code: def get_communication_backend(comm, communication_backend="auto"):
      if communication_backend not in ["mpi", "nccl", "auto"]:
          raise ValueError(
              "MultiNodeBatchNormalization does not support "
              "{}.".format(communication_backend)
          )
      from chainermn.communicators.pure_nccl_communicator import (
          PureNcclCommunicator,
      )
  
      if communication_backend != "auto":
          if "nccl" == communication_backend:
              if not isinstance(comm, PureNcclCommunicator):
                  raise ValueError(
                      "{} is not supported in "
                      "MultiNodeBatchNormalization when using "
                      "{}.".format(communication_backend, type(comm))
                  )
          selected_communication_backend = communication_backend
      else:
          if isinstance(comm, PureNcclCommunicator):
              selected_communication_backend = "nccl"
          else:
              selected_communication_backend = "mpi"
      return selected_communication_backend
  
file_path: chainer/chainermn/functions/batch_normalization.py
imports: import chainer
  from chainer.backends import cuda
  from chainer.functions.normalization import batch_normalization
  import chainer.utils
label_desc: Use image node_id 1 for calling a global function with example usage: get_communication_backend(comm, communication_backend) and returns: selected_communication_backend