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: Converts an arg to numpy, avoiding dangerous string and unicode dtypes.
  
  Numpy pads with zeros when using string and unicode dtypes if different
  components of a tensor have different lengths.  This is bad: ignoring the
  padding is wrong for text data, and removing the padding is wrong for binary
  data.  To avoid this bug, we redo the conversion using an object dtype.
  Additionally, we convert unicode strings to (byte-)strings for
  compatibility.
  
  Args:
    value: Value to convert to a numpy array.
    dtype: (Optional.) Desired NumPy type for the returned value.
  
  Returns:
    A numpy array.
code: def _convert(value, dtype=None):
      """Converts an arg to numpy, avoiding dangerous string and unicode dtypes.
  
      Numpy pads with zeros when using string and unicode dtypes if different
      components of a tensor have different lengths.  This is bad: ignoring the
      padding is wrong for text data, and removing the padding is wrong for binary
      data.  To avoid this bug, we redo the conversion using an object dtype.
      Additionally, we convert unicode strings to (byte-)strings for
      compatibility.
  
      Args:
        value: Value to convert to a numpy array.
        dtype: (Optional.) Desired NumPy type for the returned value.
  
      Returns:
        A numpy array.
      """
      result = np.asarray(value, dtype=dtype, order="C")
      if result.dtype.char == "S" and result is not value:
          return np.asarray(value, order="C", dtype=object)
      elif result.dtype.char == "U" and result is not value:
          value = np.vectorize(lambda x: x.encode("utf8"))(value)
          return np.asarray(value, order="C", dtype=object)
      elif result.dtype.char == "U":
          return result.astype(np.bytes_)
      else:
          return result
  
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 6 for calling the FuncRegistry obj's underlying member method code with example usage: obj._convert(value, dtype) and returns: np, np, result, result