code: def _inference_tip_cached(func, instance, args, kwargs, _cache={}):
      
      node = args[0]
      try:
          return iter(_cache[func, node])
      except KeyError:
          result = func(*args, **kwargs)
          # Need to keep an iterator around
          original, copy = itertools.tee(result)
          _cache[func, node] = list(copy)
          return original
docs: Cache decorator used for inference tips