code: def memoize_by_args(func):
      
      memory = {}
  
      @functools.wraps(func)
      def memoized(*args):
          if args not in memory.keys():
              value = func(*args)
              memory[args] = value
  
          return memory[args]
  
      return memoized
docs: Memoizes return value of a func based on args.