code: def testMissingNumPy(self):
      from mpi4py.util import dtlib
  
      np_dtype = getattr(dtlib, "_np_dtype", None)
      if np_dtype is not None:
          delattr(dtlib, "_np_dtype")
      try:
          for t in typecodes:
              with self.subTest(typecode=t):
                  mt = MPI.Datatype.fromcode(t)
                  dt = tonumpy(mt)
                  code = mt.tocode()
                  self.assertEqual(dt, code)
                  arraytype = mt.Create_contiguous(7)
                  dt = tonumpy(arraytype)
                  arraytype.Free()
                  self.assertIsInstance(dt, tuple)
                  self.assertEqual(dt[0], code)
                  self.assertEqual(dt[1], (7,))
                  structtype = MPI.Datatype.Create_struct(
                      [1, 1],
                      [0, mt.extent],
                      [mt, mt],
                  )
                  dt = tonumpy(structtype)
                  structtype.Free()
                  self.assertIsInstance(dt, dict)
                  self.assertEqual(dt["formats"], [code] * 2)
                  self.assertEqual(dt["offsets"], [0, mt.extent])
                  self.assertEqual(dt["itemsize"], mt.extent * 2)
                  self.assertTrue(dt["aligned"])
          with self.assertRaises(RuntimeError):
              fromnumpy(None)
      finally:
          if np_dtype is not None:
              setattr(dtlib, "_np_dtype", np_dtype)
  
imports: from mpi4py import MPI
  from mpi4py.util.dtlib import from_numpy_dtype
  from mpi4py.util.dtlib import to_numpy_dtype
  import sys, os
  import itertools
label_desc: Use image node_id 25 for calling the TestUtilDTLib obj's underlying member method code with example usage: obj.testMissingNumPy() without return types