A decorator for functions of sources which memoize the results of the last _CACHE_SIZE calls,
method – method to be memoized
the decorated method
Activate/deactivate memoization temporarily
switch – True (memoization on) or False (memoization off)
cache_size – number of previous evaluation of functions to keep in memory. Default: 100