def main():
    t0 = time.time()
    now = time.time()
    fses = list(fsegen(ref=now, N_per_cat=5*10**4, max_timecount=9))
    shuffle(fses)
    nbr_fses = len(fses)
    n = 8
    rules = {
        "years": n,
        "months": n,
        "weeks": n,
        "days": n,
        "hours": n,
        "recent": n
        }
    sduration = time.time() - t0
    log.info("Setup duration: %.3f s", sduration)
    log.info("Profiling...")
    pr = cProfile.Profile()
    pr.enable()
    a, r = TimeFilter(rules, now).filter(fses)
    pr.disable()
    s = StringIO.StringIO()
    ps = pstats.Stats(pr, stream=s).sort_stats('time')
    ps.print_stats(20)
    print s.getvalue()
dataset/ETHPy150Open jgehrcke/timegaps/utils/profile_filter_func.py/main/original