code: def np_to_pa_dtype(dtype):
      """Util to convert numpy dtype to PyArrow dtype."""
      # special case when dtype is np.datetime64
      if dtype.kind == "M":
          time_unit, _ = np.datetime_data(dtype)
          if time_unit in ("s", "ms", "us", "ns"):
              # return a pa.Timestamp of the appropriate unit
              return pa.timestamp(time_unit)
          # default is int64_t UNIX ms
          return pa.date64()
      elif dtype.kind == "m":
          time_unit, _ = np.datetime_data(dtype)
          if time_unit in ("s", "ms", "us", "ns"):
              # return a pa.Duration of the appropriate unit
              return pa.duration(time_unit)
          # default fallback unit is ns
          return pa.duration("ns")
      return _np_pa_dtypes[cudf.dtype(dtype).type]
  
imports: import datetime
  from collections import namedtuple
  from decimal import Decimal
  import cupy
  import numpy
  import pandas
  import pyarrow
  from pandas.core.dtypes.common import infer_dtype_from_object
  import cudf
  from cudf._typing import DtypeObj
  from cudf.api.types import is_bool, is_float, is_integer
label_desc: Use image node_id 1 for calling a global function with example usage: np_to_pa_dtype(dtype) and returns: _np_pa_dtypes, pa, pa, pa, pa