code: def testIntegers(self):
      for bits in (8, 16, 32, 64):
          s = getattr(numpy, "int%d" % bits)
          u = getattr(numpy, "uint%d" % bits)
          fs = getattr(dtype_ext, "accept_int%d" % bits)
          fu = getattr(dtype_ext, "accept_uint%d" % bits)
          self.assertEquivalent(fs(s(1)), numpy.dtype(s))
          self.assertEquivalent(fu(u(1)), numpy.dtype(u))
          # these should just use the regular Boost.Python converters
          self.assertEquivalent(fs(True), numpy.dtype(s))
          self.assertEquivalent(fu(True), numpy.dtype(u))
          self.assertEquivalent(fs(int(1)), numpy.dtype(s))
          self.assertEquivalent(fu(int(1)), numpy.dtype(u))
          self.assertEquivalent(fs(long(1)), numpy.dtype(s))
          self.assertEquivalent(fu(long(1)), numpy.dtype(u))
      for name in (
          "bool_",
          "byte",
          "ubyte",
          "short",
          "ushort",
          "intc",
          "uintc",
      ):
          t = getattr(numpy, name)
          ft = getattr(dtype_ext, "accept_%s" % name)
          self.assertEquivalent(ft(t(1)), numpy.dtype(t))
          # these should just use the regular Boost.Python converters
          self.assertEquivalent(ft(True), numpy.dtype(t))
          if name != "bool_":
              self.assertEquivalent(ft(int(1)), numpy.dtype(t))
              self.assertEquivalent(ft(long(1)), numpy.dtype(t))
  
file_path: turicreate/src/external/boost/boost_1_68_0/libs/python/test/numpy/dtype.py
imports: import dtype_ext
  import unittest
  import numpy
  import sys
label_desc: Use image node_id 2 for calling the DtypeTestCase obj's underlying member method code with example usage: obj.testIntegers() without return types