code: def _check_dtypes_are_same(msgtypes):
      dtypes = [msgtype.dtype for msgtype in msgtypes]
      if any(dtypes[0] != dtype for dtype in dtypes):
          raise TypeError("all dtypes must be the same")
  
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 2 for calling a global function with example usage: _check_dtypes_are_same(msgtypes) without return types