code: def memoize(function):
      
      cache = {}
      @functools.wraps(function)
      def _memoize(*args):
          if args in cache:
              return cache[args]
          result = function(*args)
          cache[args] = result
          return result
      return function
docs: A very simple memoize decorator to optimize pure-ish functions
  
      Don't use this unless you've examined the code and see the
      potential risks.