code: def memoize(f):
      memo = {}
  
      def helper(x, y):
          y = tuple(y)
          if (
              x,
              y,
          ) not in memo:
              memo[
                  (
                      x,
                      y,
                  )
              ] = f(
                  x,
                  y,
              )
          return memo[
              (
                  x,
                  y,
              )
          ]
  
      return helper
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/types/type_tensor.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import numpy
  import sympy
  import logging
  from .type_spec import Type
  from .get_type_info import get_type_info
  from .type_mapping import promote_types, is_tensor, nptype_from_builtin, builtin_to_string, numpy_type_to_builtin_type
label_desc: Use image node_id 1 for calling a global function with example usage: memoize(f) and returns: helper, memo