code: def _check_apply_to_iterator(self, comm=None):
      values = apply_to_iterator(
          self.func,
          self.iterator,
          n_input=self.n_input,
          hook=self.hook,
          comm=comm,
      )
  
      if comm is not None and not comm.rank == 0:
          self.assertEqual(values, None)
          return
  
      in_values, out_values, rest_values = values
  
      self.assertEqual(len(in_values), self.n_input)
      for in_vals, in_vals_expect in zip_longest(
          in_values, self.in_values_expect
      ):
          for in_val, in_val_expect in zip_longest(
              in_vals, in_vals_expect
          ):
              np.testing.assert_equal(in_val, in_val_expect)
  
      self.assertEqual(len(out_values), self.n_output)
      for out_vals in out_values:
          self.assertEqual(len(list(out_vals)), len(self.dataset))
  
      self.assertEqual(len(rest_values), self.n_rest)
      for rest_vals, rest_vals_expect in zip_longest(
          rest_values, self.rest_values_expect
      ):
          for rest_val, rest_val_expect in zip_longest(
              rest_vals, rest_vals_expect
          ):
              if isinstance(rest_val_expect, np.ndarray):
                  np.testing.assert_equal(rest_val, rest_val_expect)
              else:
                  self.assertEqual(rest_val, rest_val_expect)
  
file_path: chainercv/tests/utils_tests/iterator_tests/test_apply_to_iterator.py
imports: import numpy
  from six.moves import zip_longest
  import unittest
  import chainer
  from chainer.iterators import SerialIterator
  from chainer import testing
  from chainermn import create_communicator
  from chainercv.utils import apply_to_iterator
  from chainercv.utils.testing import attr
label_desc: Use image node_id 2 for calling the TestApplyToIterator obj's underlying member method code with example usage: obj._check_apply_to_iterator(comm) without return types