code: def _is_aligned(datatype, offset=0):
      """Determine whether an MPI datatype is aligned."""
      if datatype.is_predefined:
          if offset == 0:
              return True
          alignment = _get_alignment(datatype)
          return offset % alignment == 0
  
      combiner = datatype.combiner
      basetype, _, info = datatype.decode()
      types, disps = [basetype], [0]
      try:
          if combiner == MPI.COMBINER_RESIZED:
              disps = [info["extent"]]
          if combiner == MPI.COMBINER_STRUCT:
              types = info["datatypes"]
              disps = info["displacements"]
          if combiner == MPI.COMBINER_HVECTOR:
              disps = [info["stride"] if info["count"] > 1 else 0]
          if combiner == MPI.COMBINER_HINDEXED:
              disps = info["displacements"]
          if combiner == MPI.COMBINER_HINDEXED_BLOCK:
              disps = info["displacements"]
          return all(
              _is_aligned(t, offset + d) for t, d in zip(types, disps)
          )
      finally:
          for _tp in types:
              if not _tp.is_predefined:
                  _tp.Free()
  
imports: from ..None import MPI
label_desc: Use image node_id 4 for calling a global function with example usage: _is_aligned(datatype, offset) and returns: unknown, all, True