Yield an infinite series of linearly decaying values.
559928
def decaying(start, stop, decay):
    """"""

    curr = float(start)
    while True:
        yield max(curr, stop)
        curr -= (decay)
410275
def linearRegressionAnalysis(series):
    
    n = safeLen(series)
    sumI = sum([i for i, v in enumerate(series) if v is not None])
    sumV = sum([v for i, v in enumerate(series) if v is not None])
    sumII = sum([i * i for i, v in enumerate(series) if v is not None])
    sumIV = sum([i * v for i, v in enumerate(series) if v is not None])
    denominator = float(n * sumII - sumI * sumI)
    if denominator == 0:
        return None
    else:
        factor = (n * sumIV - sumI * sumV) / denominator / series.step
        offset = sumII * sumV - sumIV * sumI
        offset = offset / denominator - factor * series.start
        return factor, offset
449171
def items(self, limit=0):
        """"""
        i = ItemIterator(self.iterator)
        i.limit = limit
        return i
1185839
def lows(self, *args):
		
		for t in ifilter(lambda e: e[2] == 'L', self.extrema(*args)):
			yield t
150550
def series(self):
        ''''''
        data = self.values()
        if len(data):
            for c in range(self.count()):
                yield data[:, c]
        else:
            raise StopIteration
946644
def _secondary_values(self):
        """"""
        return [
            val[1] for serie in self.secondary_series for val in
            (serie.interpolated if self.interpolate else serie.points)
            if val[1] is not None and (not self.logarithmic or val[1] > 0)
        ]
161225
def get_lr(lr, epoch, steps, factor):
    """"""
    for s in steps:
        if epoch >= s:
            lr *= factor
    return lr
671263
def collapse_equal_values(values, counts):
    
    assert len(values) == len(counts)
    previousValue = values[0]
    previousCount = 0

    for value, count in zip(values, counts):
        if value != previousValue:
            yield (previousValue, previousCount)
            previousCount = 0
            previousValue = value
        previousCount += count

    yield (previousValue, previousCount)
229982
def divisors(n):
  """"""
  for i in range(1, int(math.sqrt(n) + 1)):
    if n % i == 0:
      yield i
      if i*i != n:
        yield n / i
297817
def nTimes(n, f, *args, **kwargs):
    

    """
    for i in xrange(n): f(*args, **kwargs)
227111
def non_increasing(values):
    """"""
    return all(x >= y for x, y in zip(values, values[1:]))
617914
def slicing(args, length):
    """"""
    if isinstance(args, tuple):
        for arg in args:
            yield from slicing_singlevalue(arg, length)
    else:
        yield from slicing_singlevalue(args, length)
251286
def searchlast(self,n=10):
        """"""            
        solutions = deque([], n)
        for solution in self:
            solutions.append(solution)
        return solutions
770333
def annealing_linear(start:Number, end:Number, pct:float)->Number:
    ""
    return start + pct * (end-start)
692652
def _secondary_values(self):
        """"""
        return [
            val for serie in self.secondary_series for val in serie.values
            if val is not None
        ]
700850
def intersperse(iterable, element):
    """"""
    iterable = iter(iterable)
    yield next(iterable)
    while True:
        next_from_iterable = next(iterable)
        yield element
        yield next_from_iterable
222663
def iteritems(self):
        """"""
        for key in self:
            vals = self._container[key.lower()]
            for val in vals[1:]:
                yield vals[0], val