code: def test_from_numpy_dtype():
      cases = [
          (np.dtype("bool"), pa.bool_()),
          (np.dtype("int8"), pa.int8()),
          (np.dtype("int16"), pa.int16()),
          (np.dtype("int32"), pa.int32()),
          (np.dtype("int64"), pa.int64()),
          (np.dtype("uint8"), pa.uint8()),
          (np.dtype("uint16"), pa.uint16()),
          (np.dtype("uint32"), pa.uint32()),
          (np.dtype("float16"), pa.float16()),
          (np.dtype("float32"), pa.float32()),
          (np.dtype("float64"), pa.float64()),
          (np.dtype("U"), pa.string()),
          (np.dtype("S"), pa.binary()),
          (np.dtype("datetime64[s]"), pa.timestamp("s")),
          (np.dtype("datetime64[ms]"), pa.timestamp("ms")),
          (np.dtype("datetime64[us]"), pa.timestamp("us")),
          (np.dtype("datetime64[ns]"), pa.timestamp("ns")),
          (np.dtype("timedelta64[s]"), pa.duration("s")),
          (np.dtype("timedelta64[ms]"), pa.duration("ms")),
          (np.dtype("timedelta64[us]"), pa.duration("us")),
          (np.dtype("timedelta64[ns]"), pa.duration("ns")),
      ]
  
      for dt, pt in cases:
          result = pa.from_numpy_dtype(dt)
          assert result == pt
  
      # Things convertible to numpy dtypes work
      assert pa.from_numpy_dtype("U") == pa.string()
      assert pa.from_numpy_dtype(np.str_) == pa.string()
      assert pa.from_numpy_dtype("int32") == pa.int32()
      assert pa.from_numpy_dtype(bool) == pa.bool_()
  
      with pytest.raises(NotImplementedError):
          pa.from_numpy_dtype(np.dtype("O"))
  
      with pytest.raises(TypeError):
          pa.from_numpy_dtype("not_convertible_to_dtype")
  
imports: from collections import OrderedDict
  import sys
  import weakref
  import pytest
  import numpy
  import pyarrow
  import pyarrow.tests.util
  from pyarrow.vendored.version import Version
label_desc: Use image node_id 11 for calling a global function with example usage: test_from_numpy_dtype() without return types