code: def test_imap(self):
      self.assertEqual(
          list(self.pool.imap(sqr, range(10))),
          list(map(sqr, list(range(10)))),
      )
      self.assertEqual(
          list(self.pool.imap(sqr, (i for i in range(10)))),
          list(map(sqr, list(range(10)))),
      )
      self.assertEqual(
          list(self.pool.imap(sqr, list(range(10)))),
          list(map(sqr, list(range(10)))),
      )
  
      it = self.pool.imap(sqr, range(10))
      for i in range(10):
          self.assertEqual(next(it), i * i)
      self.assertRaises(StopIteration, next, it)
      it = self.pool.imap(sqr, list(range(10)))
      for i in range(10):
          self.assertEqual(next(it), i * i)
      self.assertRaises(StopIteration, next, it)
  
      it = self.pool.imap(sqr, range(100), chunksize=20)
      for i in range(100):
          self.assertEqual(next(it), i * i)
      self.assertRaises(StopIteration, next, it)
      it = self.pool.imap(sqr, list(range(100)), chunksize=20)
      for i in range(100):
          self.assertEqual(next(it), i * i)
      self.assertRaises(StopIteration, next, it)
  
imports: from mpi4py import MPI
  import mpi4py.util.pool
  import concurrent.futures
  import itertools
  import functools
  import warnings
  import unittest
  import time
  import sys
  import os
label_desc: Use image node_id 6 for calling the BaseTestPool obj's underlying member method code with example usage: obj.test_imap() without return types