Function partitions

Partitions an array into chunks of equal size. If the last chunk is smaller than the other ones, it is returned only when include_remainder is true.