def memoize_by_cwd(func):
    @functools.wraps(func)
    def wrapper(*args):
        cwd = os.getcwd()
        key = (cwd,) + args
        try:
            return wrapper._cache[key]
        except KeyError:
            ret = wrapper._cache[key] = func(*args)
            return ret

    wrapper._cache = {}

    return wrapper
Return a cache region plus key.
dataset/ETHPy150Open pre-commit/pre-commit/pre_commit/util.py/memoize_by_cwd--crossover with--dataset/ETHPy150Open zzzeek/sqlalchemy/examples/dogpile_caching/caching_query.py/CachingQuery._get_cache_plus_key