Split iterables `a` in equal parts of size `sz`
430296
def partition(a:Collection, sz:int)->List[Collection]:
    ""
    return [a[i:i+sz] for i in range(0, len(a), sz)]
696784
def partition(cls, iterable, pred):
    

    t1, t2 = itertools.tee(iterable)
    return cls(itertools.filterfalse(pred, t1), filter(pred, t2))
614646
def slice(l,num_slices=None,slice_length=None,runts=True,random=False):
	
	if random:
		import random
		random.shuffle(l)
	if not num_slices and not slice_length: return l
	if not slice_length: slice_length=int(len(l)/num_slices)
	newlist=[l[i:i+slice_length] for i in range(0, len(l), slice_length)]
	if runts: return newlist
	return [lx for lx in newlist if len(lx)==slice_length]
838649
def partition(pred, iterable):
    
    trues = []
    falses = []
    for item in iterable:
        if pred(item):
            trues.append(item)
        else:
            falses.append(item)
    return trues, falses
806055
def zs(inlist):
    
    zscores = []
    for item in inlist:
        zscores.append(z(inlist, item))
    return zscores
1003784
def _all_equal(iterable):
    """"""
    iterator = iter(iterable)
    first = next(iterator)
    return all(first == rest for rest in iterator)
295246
def split_all(reference, sep):
    
    parts = partition_all(reference, sep)
    return [p for p in parts if p not in sep]
177266
public static List<boolean[]> split(final boolean[] a, final int size) {
        if (size < 1) {
            throw new IllegalArgumentException("The parameter 'size' can not be zero or less than zero");
        }

        if (N.isNullOrEmpty(a)) {
            return new ArrayList<>();
        }

        final int len = a.length;
        final List<boolean[]> res = new ArrayList<>(len % size == 0 ? len / size : (len / size) + 1);

        for (int from = 0, toIndex = a.length; from < toIndex; from += size) {
            res.add(copyOfRange(a, from, from <= toIndex - size ? from + size : toIndex));
        }

        return res;
    }
861782
def split_input(cls, mapper_spec):
    """"""
    filelists = mapper_spec.params[cls.FILES_PARAM]
    max_values_count = mapper_spec.params.get(cls.MAX_VALUES_COUNT_PARAM, -1)
    max_values_size = mapper_spec.params.get(cls.MAX_VALUES_SIZE_PARAM, -1)
    return [cls([0] * len(files), max_values_count, max_values_size)
            for files in filelists]
985288
def integer_partition(size: int, nparts: int) -> Iterator[List[List[int]]]:
    
    for part in algorithm_u(range(size), nparts):
        yield part
84740
def trim_iterable(iterable, limit, *, split=None, prefix='', postfix=''):
    
    if split is None:
        sl = 0
        join = False
    else:
        sl = len(split)
        join = True
    result = []
    rl = 0
    for element in iterable:
        element = prefix + element + postfix
        el = len(element)
        if len(result) > 0:
            el += sl
        rl += el
        if rl <= limit:
            result.append(element)
        else:
            break
    if join:
        result = split.join(result)
    return result
923413
def _split(string, splitters):
    """"""
    part = ''
    for character in string:
        if character in splitters:
            yield part
            part = ''
        else:
            part += character
    yield part
703701
def _pairwise(iterable):
    
    a, b = itertools.tee(iterable)
    next(b, None)
    return zip(a, b)
106091
def _split_out_of_braces(s):
    
    prev = 0
    for m in re.finditer(r"{[^{}]*}|\s*,\s*", s):
        if not m.group().startswith("{"):
            part = s[prev:m.start()]
            if part:
                yield s[prev:m.start()]
            prev = m.end()
    part = s[prev:]
    if part:
        yield part
679956
def group(self, lst, n):
    
    return itertools.izip(*[itertools.islice(lst, i, None, n) for i in range(n)])
1055191
def chunks(iterable, size):
    
    it = iter(iterable)
    item = list(islice(it, size))
    while item:
        yield item
        item = list(islice(it, size))
949925
function iterableEqual(a, b) {
  if (a.length !==  b.length) return false;

  var i = 0;
  var match = true;

  for (; i < a.length; i++) {
    if (a[i] !== b[i]) {
      match = false;
      break;
    }
  }

  return match;
}