code: def use_astromodels_memoization(switch, cache_size=_CACHE_SIZE):
      
  
      global _WITH_MEMOIZATION
      global _CACHE_SIZE
  
      old_status = bool(_WITH_MEMOIZATION)
      old_cache_size = int(_CACHE_SIZE)
  
      _WITH_MEMOIZATION = bool(switch)
      _CACHE_SIZE = int(cache_size)
  
      yield
  
      _WITH_MEMOIZATION = old_status
      _CACHE_SIZE = old_cache_size
docs: Activate/deactivate memoization temporarily
  
      :param switch: True (memoization on) or False (memoization off)
      :param cache_size: number of previous evaluation of functions to keep in memory. Default: 100
      :return: