class_docstr: A helper class to keep track of registered py functions.
  
  FuncRegistry keeps a map from unique tokens (string) to python
  functions, which takes numpy arrays and outputs numpy arrays.
class_docstr_tok: ["A","helper","class","to","keep","track","of","registered","py","functions",".","FuncRegistry","keeps","a","map","from","unique","tokens","(","string",")","to","python","functions",",","which","takes","numpy","arrays","and","outputs","numpy","arrays","."]
docstr: Calls the registered function for `token` with args.
  
  Args:
    token: A key into this `FuncRegistry` identifying which function to call.
    device: Name of the device on which outputs of `token`'s corresponding
      operation should be placed. Used iff the function registered for `token`
      is an EagerPyFunc.
    args: The arguments to pass to the function registered for `token`.
  
  Returns:
    The output of the function registered for `token`.
  
  Raises:
    ValueError: if no function is registered for `token`.
code: def __call__(self, token, device, args):
      """Calls the registered function for `token` with args.
  
      Args:
        token: A key into this `FuncRegistry` identifying which function to call.
        device: Name of the device on which outputs of `token`'s corresponding
          operation should be placed. Used iff the function registered for `token`
          is an EagerPyFunc.
        args: The arguments to pass to the function registered for `token`.
  
      Returns:
        The output of the function registered for `token`.
  
      Raises:
        ValueError: if no function is registered for `token`.
      """
      func = self.get(token, None)
      if func is None:
          raise ValueError(
              f"Could not find callback with key={token} in the "
              "registry."
          )
      if isinstance(func, EagerFunc):
          # NB: Different invocations of the same py_func will share the same
          # token, and the entries they stash in the tape_cache will collide.
          # In practice, when executing a graph, this should only happen if
          # the py_func is in a while_loop whose iterations are run in parallel
          # or if the graph is being driven by concurrent session.run() calls.
          #
          # TODO(akshayka): Key the tape cache in a thread-safe way.
          return func(device, token, args)
      else:
          ret = func(*args)
          # Strings seem to lead to a memory leak here if they're not wrapped in a
          # list.
          if isinstance(ret, bytes):
              ret = [ret]
          # Ensures that we return either a single numpy array or a list of numpy
          # arrays.
          if isinstance(ret, (tuple, list)):
              return [self._convert(x) for x in ret]
          else:
              return self._convert(ret)
  
imports: import functools
  import threading
  import traceback
  import weakref
  import numpy
  from tensorflow.python.autograph.impl import api
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import backprop_util
  from tensorflow.python.eager import context
  from tensorflow.python.eager import record
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import func_graph
  from tensorflow.python.framework import function
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import type_spec
  from tensorflow.python.lib.core import _pywrap_py_func
  from tensorflow.python.ops import autograph_ops
  from tensorflow.python.ops import gen_script_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.util import compat
  from tensorflow.python.util import deprecation
  from tensorflow.python.util import dispatch
  from tensorflow.python.util import nest
  from tensorflow.python.util import tf_inspect
  from tensorflow.python.util import variable_utils
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 7 for calling the FuncRegistry obj's underlying member method code with example usage: obj.__call__(token, device, args) and returns: func, unknown, self