code: def test_dtype(simple_dtype):
      from sys import byteorder
  
      e = "<" if byteorder == "little" else ">"
  
      assert [x.replace(" ", "") for x in m.print_dtypes()] == [
          simple_dtype_fmt(),
          packed_dtype_fmt(),
          f"[('a',{simple_dtype_fmt()}),('b',{packed_dtype_fmt()})]",
          partial_dtype_fmt(),
          partial_nested_fmt(),
          "[('a','S3'),('b','S3')]",
          (
              "{{'names':['a','b','c','d'],"
              + "'formats':[('S4',(3,)),('"
              + e
              + "i4',(2,)),('u1',(3,)),('"
              + e
              + "f4',(4,2))],"
              + "'offsets':[0,12,20,24],'itemsize':56}}"
          ).format(e=e),
          "[('e1','" + e + "i8'),('e2','u1')]",
          "[('x','i1'),('y','" + e + "u8')]",
          "[('cflt','" + e + "c8'),('cdbl','" + e + "c16')]",
      ]
  
      d1 = np.dtype(
          {
              "names": ["a", "b"],
              "formats": ["int32", "float64"],
              "offsets": [1, 10],
              "itemsize": 20,
          }
      )
      d2 = np.dtype([("a", "i4"), ("b", "f4")])
      assert m.test_dtype_ctors() == [
          np.dtype("int32"),
          np.dtype("float64"),
          np.dtype("bool"),
          d1,
          d1,
          np.dtype("uint32"),
          d2,
          np.dtype("d"),
      ]
  
      assert m.test_dtype_methods() == [
          np.dtype("int32"),
          simple_dtype,
          False,
          True,
          np.dtype("int32").itemsize,
          simple_dtype.itemsize,
      ]
  
      assert m.trailing_padding_dtype() == m.buffer_to_dtype(
          np.zeros(1, m.trailing_padding_dtype())
      )
  
      expected_chars = "bhilqBHILQefdgFDG?MmO"
      assert m.test_dtype_kind() == list("iiiiiuuuuuffffcccbMmO")
      assert m.test_dtype_char_() == list(expected_chars)
      assert m.test_dtype_num() == [
          np.dtype(ch).num for ch in expected_chars
      ]
      assert m.test_dtype_byteorder() == [
          np.dtype(ch).byteorder for ch in expected_chars
      ]
      assert m.test_dtype_alignment() == [
          np.dtype(ch).alignment for ch in expected_chars
      ]
      assert m.test_dtype_flags() == [
          chr(np.dtype(ch).flags) for ch in expected_chars
      ]
  
imports: import re
  import pytest
  import env
  from pybind11_tests import numpy_dtypes
label_desc: Use image node_id 11 for calling a global function with example usage: test_dtype(simple_dtype) without return types