code: def create_multi_node_optimizer(
      actual_optimizer,
      communicator,
      double_buffering=False,
      zero_fill=True,
  ):
      """Create a multi node optimizer from a Chainer optimizer.
  
      Args:
          actual_optimizer: Chainer optimizer
              (e.g., ``chainer.optimizers.Adam``).
          communicator: ChainerMN communicator.
          double_buffering: If ``True``, all-reduce and other
               processing (such as forward and backward) are
               overlapped using double buffering.
               There are cases where accuracy is affected because
               the gradients of the previous iteration are used
               for update. This flag is supported by
               ``PureNcclCommunicator`` only.
          zero_fill: A knob to control whether to fill gradients of initialized
               and unused Link (which is None internally) with zero-valued array,
               because the all gradients must be an array among processes for
               performing all-reduce, which might be an array or None after
               backward computation. Gradients of uninitialized Link are skipped.
               If it is False, gradients of unused Link are just skipped.
      Returns:
          The multi node optimizer based on ``actual_optimizer``.
      """
      if double_buffering:
          from chainermn.communicators.pure_nccl_communicator import (
              PureNcclCommunicator,
          )
  
          if not isinstance(communicator, PureNcclCommunicator):
              raise ValueError(
                  "This communicator does not support double buffering."
              )
          return _DoubleBufferingOptimizer(
              actual_optimizer, communicator, zero_fill
          )
      return _MultiNodeOptimizer(
          actual_optimizer, communicator, zero_fill
      )
  
imports: import chainer
  import copy
label_desc: Use image node_id 1 for calling a global function with example usage: create_multi_node_optimizer(actual_optimizer, communicator, double_buffering, zero_fill) and returns: _MultiNodeOptimizer, _DoubleBufferingOptimizer