

@staticmethod
def _Downsample(lst, target_size):
    if (target_size == 0):
        return
    elif ((len(lst) < 3) or (len(lst) <= target_size)):
        for n in lst:
            (yield n)
    else:
        skip = (len(lst) / target_size)
        lst = sorted(lst)
        for (i, n) in enumerate(lst[0:(- 2)]):
            if ((i % skip) == 0):
                (yield n)
        (yield lst[(- 1)])

dataset/ETHPy150Open steveniemitz/scales/scales/varz.py VarzAggregator._Downsample/original