code: def __init__(self, actual_iterator, communicator):
      if not hasattr(actual_iterator, "order_sampler"):
          raise ValueError("actual_iterator must have order_sampler")
      else:
          super(_SynchronizedIterator, self).__setattr__(
              "actual_iterator", actual_iterator
          )
  
      # Synchronize random seed.
      self.communicator = communicator
      if self.communicator.rank == 0:
          seed = numpy.random.randint(0, 2**32 - 1)
      else:
          seed = None
      seed = self.communicator.bcast_obj(seed, root=0)
  
      # Random number generator for iterator.
      rng = numpy.random.RandomState(seed)
      self.actual_iterator.order_sampler = (
          chainer.iterators.ShuffleOrderSampler(rng)
      )
      self.actual_iterator.reset()
  
file_path: chainer/chainermn/iterators/synchronized_iterator.py
imports: import chainer
  import numpy
label_desc: Use image node_id 1 to create a new _SynchronizedIterator object from inherited base classes: chainer.dataset.iterator with example: obj = _SynchronizedIterator(actual_iterator, communicator)