code: def _tensorize(self, value):
      if isinstance(value, (str, bytes, type(None))):
          return value
      elif isinstance(
          value, (np.character, np.ndarray)
      ) and np.issubdtype(value.dtype, np.character):
          return value
      elif isinstance(value, np.number):
          return value
  
      default_dtype = {}
  
      if isinstance(value, np.ndarray) and np.issubdtype(
          value.dtype, np.integer
      ):
          default_dtype = {"dtype": np.int64}
      elif isinstance(value, np.ndarray) and np.issubdtype(
          value.dtype, np.floating
      ):
          default_dtype = {"dtype": np.float32}
      elif config.PIL_AVAILABLE and "PIL" in sys.modules:
          import PIL.Image
  
          if isinstance(value, PIL.Image.Image):
              return np.asarray(value, **self.np_array_kwargs)
  
      return np.asarray(
          value, **{**default_dtype, **self.np_array_kwargs}
      )
  
file_path: datasets/src/datasets/formatting/np_formatter.py
imports: import sys
  from collections.abc import Mapping
  import numpy
  import pyarrow
  from ..None import config
  from ..utils.py_utils import map_nested
  from .formatting import TensorFormatter
label_desc: Use image node_id 3 for calling the NumpyFormatter obj's underlying member method code with example usage: obj._tensorize(value) and returns: np, value, value, value, np