code: def _to_datatype(dtype: np.dtype) -> str:
      as_str = str(dtype)
      if as_str not in _NumpyToDatatype:
          as_str = getattr(dtype, "kind")
      datatype = _NumpyToDatatype[as_str]
  
      return datatype
  
file_path: serve/ts/torch_handler/request_envelope/kservev2.py
imports: import json
  import logging
  import numpy
  from .base import BaseEnvelope
label_desc: Use image node_id 2 for calling a global function with example usage: _to_datatype(dtype) and returns: datatype