code: def setUp(self):
      if self.multi_in_values:
          self.n_input = 2
      else:
          self.n_input = 1
  
      in_values_expect = []
      for _ in range(self.n_input):
          in_value = []
          for _ in range(5):
              H, W = np.random.randint(8, 16, size=2)
              in_value.append(np.random.randint(0, 256, size=(3, H, W)))
          in_values_expect.append(in_value)
      self.in_values_expect = tuple(in_values_expect)
  
      if self.multi_out_values:
  
          def func(*in_values):
              n_sample = len(in_values[0])
              return (
                  [
                      np.random.uniform(size=(10, 4))
                      for _ in range(n_sample)
                  ],
                  [np.random.uniform(size=10) for _ in range(n_sample)],
                  [np.random.uniform(size=10) for _ in range(n_sample)],
              )
  
          self.n_output = 3
      else:
  
          def func(*in_values):
              n_sample = len(in_values[0])
              return [
                  np.random.uniform(size=(48, 64))
                  for _ in range(n_sample)
              ]
  
          self.n_output = 1
      self.func = func
  
      if self.with_rest_values:
          strs = ["a", "bc", "def", "ghij", "klmno"]
          nums = [0, 1, 2, 3, 4]
          arrays = [np.random.uniform(size=10) for _ in range(5)]
          self.rest_values_expect = (strs, nums, arrays)
          self.n_rest = 3
  
          self.dataset = chainer.datasets.TupleDataset(
              *(self.in_values_expect + self.rest_values_expect)
          )
      else:
          self.rest_values_expect = ()
          self.n_rest = 0
  
          self.dataset = list(zip(*self.in_values_expect))
  
      self.iterator = SerialIterator(
          self.dataset, 2, repeat=False, shuffle=False
      )
  
      if self.with_hook:
  
          def hook(in_values, out_values, rest_values):
              n_sample = len(in_values[0])
  
              self.assertEqual(len(in_values), self.n_input)
              for in_vals in in_values:
                  self.assertEqual(len(in_vals), n_sample)
  
              self.assertEqual(len(out_values), self.n_output)
              for out_vals in out_values:
                  self.assertEqual(len(out_vals), n_sample)
  
              self.assertEqual(len(rest_values), self.n_rest)
              for rest_vals in rest_values:
                  self.assertEqual(len(rest_vals), n_sample)
  
          self.hook = hook
      else:
          self.hook = None
  
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 1 for calling the TestApplyToIterator obj's underlying member method code with example usage: obj.setUp() and returns: unknown,  unknown,  unknown, unknown