Divide integer n to m chunks
16407
def divide(n, m):
    
    avg = int(n / m)
    remain = n - m * avg
    data = list(itertools.repeat(avg, m))
    for i in range(len(data)):
        if not remain:
            break
        data[i] += 1
        remain -= 1
    return data
1185741
def chunks(self, size=32, alignment=1):
        

        if (size % alignment) != 0:
            raise Error(
                'size {} is not a multiple of alignment {}'.format(
                    size,
                    alignment))

        for segment in self:
            for chunk in segment.chunks(size, alignment):
                yield chunk
903009
def chunks(items, size):
    
    return [items[i:i+size] for i in range(0, len(items), size)]
554887
def chunks(iterable, size=1):
    """"""
    iterator = iter(iterable)

    for element in iterator:
        yield chain([element], islice(iterator, size - 1))
15589
def get_chunk(self, b, x=None, pad=True):
        '''
        

        '''

        M = np.arange(len(self.time))
        if b > 0:
            res = M[(M > self.breakpoints[b - 1] - int(pad) * self.bpad)
                    & (M <= self.breakpoints[b] + int(pad) * self.bpad)]
        else:
            res = M[M <= self.breakpoints[b] + int(pad) * self.bpad]
        if x is None:
            return res
        else:
            return x[res]
637000
def chunkreverse(integers, dtype='L'):
    
    if dtype in ('B', 8):
        return map(RBYTES.__getitem__, integers)

    fmt = '{0:0%db}' % NBITS[dtype]

    return (int(fmt.format(chunk)[::-1], 2) for chunk in integers)
1243626
def chunks(iterable, size=50):
    """"""
    batch = []
    for n in iterable:
        batch.append(n)
        if len(batch) % size == 0:
            yield batch
            batch = []
    if batch:
        yield batch
153722
def _scatter(sequence, n):
  """"""
  chunklen = int(math.ceil(float(len(sequence)) / float(n)))

  return [
    sequence[ i*chunklen : (i+1)*chunklen ] for i in range(n)
  ]
1083318
def _chunks(self, items, limit):
        
        for i in range(0, len(items), limit):
            yield items[i:i + limit]
316139
def pack(chunks, r=32):
    
    if r < 1:
        raise ValueError('pack needs r > 0')

    n = shift = 0

    for c in chunks:
        n += c << shift
        shift += r

    return n
1199292
function(n) {
        return function chunk(arg) {
          if ( Array.isArray(arg) ) {
            return arg.reduce((acc,_,i,a) => {
              return i % n === 0 ? acc.concat( [a.slice(i, i + n)] ) : acc;
            }, []);
          }
          else if ( typeof arg === 'string' ) {
            return arg.match( new RegExp('.{1,' + n + '}', 'g') ) || [];
          }
          else throw new TypeError('Incorrect type. Passed in value should be an array or string.');
        }
      }
411650
function chunk (array, size) {
  var index
  var result = []
  var arrLen = size >> 0 || 1
  if (baseExports.isArray(array)) {
    if (arrLen >= 0 && array.length > arrLen) {
      index = 0
      while (index < array.length) {
        result.push(array.slice(index, index + arrLen))
        index += arrLen
      }
    } else {
      result = array.length ? [array] : array
    }
  }
  return result
}
1279320
def chunked(l, n):
    """"""
    return [l[i:i + n] for i in range(0, len(l), n)]
1062197
def chunks(data, n):
    """"""
    for i in range(0, len(data), n):
        yield data[i:i+n]
381911
public void fromShort(short n) {
    Bits[] v = Bits.values();
    set(v[(n >>> 6) & 7], v[(n >>> 3) & 7], v[n & 7]);
  }
512392
def chunks(cls, iterable, n, fill=None):
    

    return cls(itertools.zip_longest(*[iter(iterable)] * n, fillvalue=fill))
1064558
def chunks(container, n):
    
    for i in range(0, len(container), n):
        yield container[i : i + n]