Series from integer rank arguments.
340042
def fromints(cls, ints):
        """"""
        return cls.frombitsets(map(cls.BitSet.fromint, ints))
179574
def rankdata(inlist):
    
    n = len(inlist)
    svec, ivec = shellsort(inlist)
    sumranks = 0
    dupcount = 0
    newlist = [0] * n
    for i in range(n):
        sumranks = sumranks + i
        dupcount = dupcount + 1
        if i == n - 1 or svec[i] != svec[i + 1]:
            averank = sumranks / float(dupcount) + 1
            for j in range(i - dupcount + 1, i + 1):
                newlist[ivec[j]] = averank
            sumranks = 0
            dupcount = 0
    return newlist
346292
def _mm_rankings(n_items, data, params):
    """"""
    weights = exp_transform(params)
    wins = np.zeros(n_items, dtype=float)
    denoms = np.zeros(n_items, dtype=float)
    for ranking in data:
        sum_ = weights.take(ranking).sum()
        for i, winner in enumerate(ranking[:-1]):
            wins[winner] += 1
            val = 1.0 / sum_
            for item in ranking[i:]:
                denoms[item] += val
            sum_ -= weights[winner]
    return wins, denoms
756706
def IntGreaterThanOne(n):
    """"""
    try:
        n = int(n)
    except:
        raise ValueError("%s is not an integer" % n)
    if n <= 1:
        raise ValueError("%d is not > 1" % n)
    else:
        return n
1296634
def rank(expr, sort=None, ascending=True):
    
    return _rank_op(expr, Rank, types.int64, sort=sort, ascending=ascending)
306737
def var(series):
    
    if np.issubdtype(series.dtype, np.number):
        return series.var()
    else:
        return np.nan
990536
def _separable_series3(h, N=1, verbose=False):
    

    hx, hy, hz = [], [], []
    res = h.copy()
    for i in range(N):
        _hx, _hy, _hz, P = _splitrank3(res, verbose=verbose)
        res -= P
        hx.append(_hx)
        hy.append(_hy)
        hz.append(_hz)
    return np.array(list(zip(hx, hy, hz)))
1262983
def numberp(v):
    """"""
    return (not(isinstance(v, bool)) and
            (isinstance(v, int) or isinstance(v, float)))
378267
def _build_rhs(p, q, deriv):
    """"""

    b = [0 for _ in range(p+q+1)]
    b[deriv] = math.factorial(deriv)
    return np.array(b)
801541
def _call(self, x):
        """"""

        if abs(x.ufuncs.sum() / self.sum_value - 1) <= self.sum_rtol:
            return 0
        else:
            return np.inf
297817
def nTimes(n, f, *args, **kwargs):
    

    """
    for i in xrange(n): f(*args, **kwargs)
845583
def get_pandas_series(self):
        """"""
        return pandas.Series(self.values, self.index, name=self.name)
968974
def _K(self, R):
        """"""
        return self._ns * self._N / R / self._sin_alpha
1064383
def _values(self):
        """"""
        return [
            val for serie in self.series for val in serie.values
            if val is not None
        ]
1264657
def pow2(x: int, p: int) -> int:
    """"""
    while p > 0:
        x = x * x % q
        p -= 1
    return x
203680
def rank(self, value):
        """"""
        i = 0
        n = len(self._tree)
        rank = 0
        count = 0
        while i < n:
            cur = self._tree[i]
            if value < cur:
                i = 2 * i + 1
                continue
            elif value > cur:
                rank += self._counts[i]
                # subtract off the right tree if exists
                nexti = 2 * i + 2
                if nexti < n:
                    rank -= self._counts[nexti]
                    i = nexti
                    continue
                else:
                    return (rank, count)
            else:  # value == cur
                count = self._counts[i]
                lefti = 2 * i + 1
                if lefti < n:
                    nleft = self._counts[lefti]
                    count -= nleft
                    rank += nleft
                    righti = lefti + 1
                    if righti < n:
                        count -= self._counts[righti]
                return (rank, count)
        return (rank, count)
1373946
def _compute(self):
        """"""
        x_len = self._len
        y_len = self._order
        self._box.xmax = x_len
        self._box.ymax = y_len

        self._x_pos = [n / 2 for n in range(1, 2 * x_len, 2)]
        self._y_pos = [n / 2 for n in reversed(range(1, 2 * y_len, 2))]

        for j, serie in enumerate(self.series):
            serie.points = [(self._x_pos[i], self._y_pos[j])
                            for i in range(x_len)]