code: def CachedFunctionByID(func):
      def decorated(*args, **kwargs):
          id_args = tuple(id(a) for a in args)
          id_kwargs = (
              (k, id(kwargs[k])) for k in sorted(kwargs.keys())
          )
          key = (func, id_args, id_kwargs)
          if key not in cache:
              cache[key] = func(*args, **kwargs)
          return cache[key]
  
      return decorated
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import datetime
  import os
  import re
  from functools import partial
  import numpy
  import tensorflow
  from scipy import ndimage
  from six import string_types
label_desc: Use image node_id 10 for calling a global function with example usage: CachedFunctionByID(func) and returns: decorated, cache