(self, when=None, dump_cache=True, load_cache=True, container=None,
                 lookup=None, dump_func=None, load_func=None)
:param dump_cache: Whether to dump data to cache.
        :param load_cache: Whether to load data from cache.
        :param container:  Data container.
        :param when:       If provided, should be a function that takes a SimulationManager and returns
                           a Boolean, or the address of the state to be cached.
        :param lookup:     A function that returns True if cache hit and False otherwise.
        :param dump_func:  If provided, should be a function that defines how Cacher should cache the
                           SimulationManager. Default to caching the active stash.
        :param load_func:  If provided, should be a function that defines how Cacher should uncache the
                           SimulationManager. Default to uncaching the stash to be stepped.
:param dump_cache: Whether to dump data to cache.
        :param load_cache: Whether to load data from cache.
        :param container:  Data container.
        :param when:       If provided, should be a function that takes a SimulationManager and returns
                           a Boolean, or the address of the state to be cached.
        :param lookup:     A function that returns True if cache hit and False otherwise.
        :param dump_func:  If provided, should be a function that defines how Cacher should cache the
                           SimulationManager. Default to caching the active stash.
        :param load_func:  If provided, should be a function that defines how Cacher should uncache the
                           SimulationManager. Default to uncaching the stash to be stepped.
: param dump_cache : Whether to dump data to cache . : param load_cache : Whether to load data from cache . : param container : Data container . : param when : If provided should be a function that takes a SimulationManager and returns a Boolean or the address of the state to be cached . : param lookup : A function that returns True if cache hit and False otherwise . : param dump_func : If provided should be a function that defines how Cacher should cache the SimulationManager . Default to caching the active stash . : param load_func : If provided should be a function that defines how Cacher should uncache the SimulationManager . Default to uncaching the stash to be stepped .
def __init__(self, when=None, dump_cache=True, load_cache=True, container=None,
                 lookup=None, dump_func=None, load_func=None):
        """
        :param dump_cache: Whether to dump data to cache.
        :param load_cache: Whether to load data from cache.
        :param container:  Data container.
        :param when:       If provided, should be a function that takes a SimulationManager and returns
                           a Boolean, or the address of the state to be cached.
        :param lookup:     A function that returns True if cache hit and False otherwise.
        :param dump_func:  If provided, should be a function that defines how Cacher should cache the
                           SimulationManager. Default to caching the active stash.
        :param load_func:  If provided, should be a function that defines how Cacher should uncache the
                           SimulationManager. Default to uncaching the stash to be stepped.
        """
        super(Cacher, self).__init__()
        self._dump_cond, _ = condition_to_lambda(when)
        self._dump_cache = dump_cache
        self._load_cache = load_cache
        self._cache_lookup = self._lookup if lookup is None else lookup
        self._dump_func = self._dump_stash if dump_func is None else dump_func
        self._load_func = self._load_stash if load_func is None else load_func

        self.container = container
        self.container_pickle_str = isinstance(container, str) and not all(c in string.printable for c in container)
def __init__ ( self , when = None , dump_cache = True , load_cache = True , container = None , lookup = None , dump_func = None , load_func = None ) : super ( Cacher , self ) . __init__ ( ) self . _dump_cond , _ = condition_to_lambda ( when ) self . _dump_cache = dump_cache self . _load_cache = load_cache self . _cache_lookup = self . _lookup if lookup is None else lookup self . _dump_func = self . _dump_stash if dump_func is None else dump_func self . _load_func = self . _load_stash if load_func is None else load_func self . container = container self . container_pickle_str = isinstance ( container , str ) and not all ( c in string . printable for c in container )