parameters: (func, cache, num_args)
return_statement: return wraps(func)(wrapper)
docstring: Wrap a function so that results for any argument tuple are stored in
      'cache'. Note that the args to the function must be usable as dictionary
      keys.
  
      Only the first num_args are considered when creating the key.
docstring_summary: Wrap a function so that results for any argument tuple are stored in
      'cache'. Note that the args to the function must be usable as dictionary
      keys.
docstring_tokens: Wrap a function so that results for any argument tuple are stored in cache . Note that the args to the function must be usable as dictionary keys .
function: def memoize(func, cache, num_args):
      """
      Wrap a function so that results for any argument tuple are stored in
      'cache'. Note that the args to the function must be usable as dictionary
      keys.
  
      Only the first num_args are considered when creating the key.
      """
      def wrapper(*args):
          mem_args = args[:num_args]
          if mem_args in cache:
              return cache[mem_args]
          result = func(*args)
          cache[mem_args] = result
          return result
      return wraps(func)(wrapper)
function_tokens: def memoize ( func , cache , num_args ) : def wrapper ( * args ) : mem_args = args [ : num_args ] if mem_args in cache : return cache [ mem_args ] result = func ( * args ) cache [ mem_args ] = result return result return wraps ( func ) ( wrapper )