code: def testPackUnpack(self):
      for array, typecode1 in arrayimpl.loop():
          with arrayimpl.test(self):
              if typecode1 in self.skipdtype:
                  continue
              for typecode2 in array.TypeMap:
                  if typecode2 in self.skipdtype:
                      continue
                  datatype1 = array.TypeMap[typecode1]
                  datatype2 = array.TypeMap[typecode2]
                  for count in range(10):
                      with self.subTest(
                          typecode=(typecode1, typecode2), count=count
                      ):
                          # input and output arrays
                          iarray1 = array(
                              range(count), typecode1
                          ).as_raw()
                          iarray2 = array(
                              range(count), typecode2
                          ).as_raw()
                          oarray1 = array(
                              count, typecode1, count
                          ).as_raw()
                          oarray2 = array(
                              count, typecode2, count
                          ).as_raw()
                          # temp array for packing
                          size1 = datatype1.Pack_size(
                              len(iarray1), self.COMM
                          )
                          size2 = datatype2.Pack_size(
                              len(iarray2), self.COMM
                          )
                          tmpbuf = array(
                              0, "b", size1 + size2 + 1
                          ).as_raw()
                          # pack input arrays
                          position = 0
                          position = datatype1.Pack(
                              iarray1, tmpbuf, position, self.COMM
                          )
                          position = datatype2.Pack(
                              iarray2, tmpbuf, position, self.COMM
                          )
                          # unpack output arrays
                          position = 0
                          position = datatype1.Unpack(
                              tmpbuf, position, oarray1, self.COMM
                          )
                          position = datatype2.Unpack(
                              tmpbuf, position, oarray2, self.COMM
                          )
                          # test
                          self.assertTrue(allclose(iarray1, oarray1))
                          self.assertTrue(allclose(iarray2, oarray2))
  
file_path: mpi4py/test/test_pack.py
imports: from mpi4py import MPI
  import mpiunittest
  import arrayimpl
  import os
label_desc: Use image node_id 2 for calling the BaseTestPack obj's underlying member method code with example usage: obj.testPackUnpack() without return types