def purge_expired (data_hash, interval):
    """Remove everything in the given hash if it has exceeded
    the given time interval"""
    expired = []
    for key, val in data_hash.items():
        set_time = val[0]
        if (time.time() - set_time) > interval:
            expired.append(key)
    for ex_k in expired:
        del data_hash[ex_k]
dataset/ETHPy150Open dpapathanasiou/cmdline-news/cmdlinenews.py/purge_expired/original