code: def bind(f, cache: Cache, expect_cache_hit=None) -> Callable:
      """Bind the cache `cache` to the function `f` (see module docstring).
  
      Args:
        f: A function which has been decorated with `tf_memoize.memoize`.
        cache: A memoize cache created by `tf_memoize.create_memoize_cache`, or
          `None` if no caching is desired.
        expect_cache_hit: To help debugging; None => no expectation.
  
      Returns:
        The memoized function, using `cache` as the memoize cache (or the
        non-memoized function if `cache` is None).
      """
  
      @functools.wraps(f)
      def wrapper(*args, **kwargs):
          return f(
              *args,
              _private_cache_kwarg=cache,
              _expect_cache_hit=expect_cache_hit,
              **kwargs,
          )
  
      return wrapper
  
file_path: NeuralCompression/projects/torch_vct/utils/memoize.py
imports: import collections
  import functools
  from typing import Callable, Optional, Tuple, TypeVar, Union
  from torch import Tensor
label_desc: Use image node_id 4 for calling a global function with example usage: bind(f, cache, expect_cache_hit) and returns: wrapper, f