This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -- the cache snippet --------------------------------------------------------- | |
from os import makedirs | |
from os.path import exists, dirname | |
from pickle import load as pload, dump as pdump | |
from re import sub | |
from time import time | |
def cache(target, args, identifier=None, cache_life=3 * 24 * 3600): | |
""" Run the target function with the given args, and store it to a pickled |