n can be getter(number of times) n可以是方法, 参数1是第几次分块
327908
function splitArray(arr, n) {
  var r = [];

  if (isFunction(n)) {
    var getChunkLength = n;
    var times = 1;
    var i = 0;

    while (i < arr.length) {
      var _n = getChunkLength(times);

      var end = i + _n;
      r.push(arr.slice(i, end));
      i = end;
      times++;
    }
  } else {
    var _i = 0;

    while (_i < arr.length) {
      var _end = _i + n;

      r.push(arr.slice(_i, _end));
      _i = _end;
    }
  }

  return r;
}
820104
function groupByThreeArguments(keySelector, inner, third) {
                            var keyComparator = void 0,
                                elementSelector = void 0,
                                resultSelector = void 0;
                            if (isKeyComparator(third)) {
                                keyComparator = third;
                            } else {
                                resultSelector = third;
                            }
                            if (__getParameterCount(inner) === 2) {
                                resultSelector = inner;
                            } else {
                                elementSelector = inner;
                            }
                            if (!keyComparator) {
                                keyComparator = __defaultEqualityCompareFn;
                            }
                            if (!elementSelector) {
                                elementSelector = function elementSelector(elem) {
                                    return elem;
                                };
                            }
                            return groupBy(keySelector, elementSelector, resultSelector, keyComparator);
                        }
1201263
def one(self):
        ''' 
        '''
        count = -1
        for count, result in enumerate(self):
            if count > 0:
                raise BadResultException('Too many results for .one()')
        if count == -1:
            raise BadResultException('Too few results for .one()')
        return result
384891
def nvalues(self):
        """"""
        if self._nvalues is None:
            self._nvalues = 0
            for val in self.values:
                if type(val) == type(int):
                    self._nvalues += val
                else:
                    self._nvalues = -1
                    break

        return self._nvalues
555676
function(n){
    var fetch = n - this.stash.length;
    while (fetch-- > 0) this.stash.push(this.advance());
    return this.stash[--n];
  }
1342671
function(g, x, y, z, w) {
		var n = g[0] * x + g[1] * y;
		if(z){
			n += g[2] * z;
			if(w){
				n += g[3] * w;
			}
		}
		return n;
	}
45588
def each
      if block_given?
        num_geometries.times do |n|
          yield get_geometry_n(n)
        end
        self
      else
        num_geometries.times.collect { |n|
          get_geometry_n(n)
        }.to_enum
      end
    end
965673
def _maybe_repeat(self, x):
    
    if isinstance(x, list):
      assert len(x) == self.n
      return x
    else:
      return [x] * self.n
505121
function(T, C, n, k) {
        var i;
        for (i = 0; i < k; i++) { C[i] = 0; }
        for (i = 0; i < n; i++) { C[T[i]]++; }
    }
1130900
def first(self, n=1):
        
        res = self.obj[0:n]
        if len(res) is 1:
            res = res[0]
        return self._wrap(res)
453219
def taking(n):
    """"""

    if n < 0:
        raise ValueError("Cannot take fewer than zero ({}) items".format(n))

    def taking_transducer(reducer):
        return Taking(reducer, n)

    return taking_transducer
238900
function (str, n) {
      n = window.parseInt(n, 10);
      return new Array(n + 1).join(str);
    }
877454
def limit(self, n):
    
    data = self._data
    self._data = (next(data) for _ in xrange(int(round(n))))
    return self
1292573
private long getFrequentItemsets(PrintStream out, List<ItemSet> list) {
        long n = 0;
        if (root.children != null) {
            for (int i = 0; i < root.children.length; i++) {
                Node child = root.children[i];
                if (child != null && child.support >= minSupport) {
                    int[] itemset = {child.id};
                    n += getFrequentItemsets(out, list, itemset, i, child);
                }
            }
        }
        
        return n;
    }
181418
def Take(self: Iterable, n):
    

    for i, e in enumerate(self):
        if i == n:
            break
        yield e
351094
def take(self, n):
        
        if n <= 0:
            return self._transform(transformations.take_t(0))
        else:
            return self._transform(transformations.take_t(n))
902667
function repeat( str, n ) {
	var rpt;
	var cnt;
	if ( !isString( str ) ) {
		throw new TypeError( 'invalid input argument. First argument must be a string. Value: `' + str + '`.' );
	}
	if ( !isNonNegativeInteger( n ) ) {
		throw new TypeError( 'invalid input argument. Second argument must be a nonnegative integer. Value: `' + n + '`.' );
	}
	if ( str.length === 0 || n === 0 ) {
		return '';
	}
	// Check that output string will not exceed the maximum string length:
	if ( str.length * n > MAX_SAFE_INTEGER ) {
		throw new RangeError( 'invalid input argument. Output string length exceeds maximum allowed string length.' );
	}
	rpt = '';
	cnt = n;
	for( ; ; ) {
		// If the count is odd, append the current concatenated string:
		if ( (cnt&1) === 1 ) {
			rpt += str;
		}
		// Right-shift the bits:
		cnt >>>= 1;
		if ( cnt === 0 ) {
			break;
		}
		// Double the string:
		str += str;
	}
	return rpt;
}