code: def memoize_single_argument(f):
      
      class memodict(dict):
  
          def __missing__(self, key):
              ret = self[key] = f(key)
              return ret
      return memodict().__getitem__
docs: Memoization decorator for a function taking a single argument