code: def __init__(self, obj):
      if _is_numpy_array(obj) or _is_cupy_array(obj):
          self.is_host = _is_numpy_array(obj)
          self.is_tuple = False
          self.narr = 1
          self.ndims = [obj.ndim]
          self.shapes = [obj.shape]
          self.dtype = obj.dtype
      elif isinstance(obj, collections_abc.Iterable):
          if all(map(_is_numpy_array, obj)):
              self.is_host = True
          elif all(map(_is_cupy_array, obj)):
              self.is_host = False
          else:
              raise ValueError(
                  "All message objects must be either numpy or cupy arrays."
              )
          self.is_tuple = True
          self.narr = len(obj)
          self.ndims = [x.ndim for x in obj]
          self.shapes = [x.shape for x in obj]
          dtypes = [x.dtype for x in obj]
          if not all(dtype == dtypes[0] for dtype in dtypes):
              raise TypeError("Message objects must be the same dtype")
          self.dtype = dtypes[0]
      else:
          raise TypeError(
              "Message object must be numpy/cupy array or its tuple."
          )
  
imports: import mpi4py
  import numpy
  import chainer
  import chainer.backends
  import chainer.utils
  from chainer.utils import collections_abc
  from chainermn.communicators import _communication_utility
  from chainermn.communicators._communication_utility import chunked_bcast_obj
  from chainermn.communicators import _memory_utility
  from chainermn.communicators import communicator_base
  import chainerx
label_desc: Use image node_id 1 to create a new _MessageType object from inherited base classes: object with example: obj = _MessageType(obj)