def _check_comm(comm):
    if isinstance(comm, int):
        # If it's come from Fluidity where an MPI_Comm is just an integer.
        return _MPI.Comm.f2py(comm)
    try:
        return comm if isinstance(comm, _MPI.Comm) else comm.tompi4py()
    except __HOLE__:
        raise TypeError("MPI communicator must be of type mpi4py.MPI.Comm")
dataset/ETHPy150Open OP2/PyOP2/pyop2/mpi.py/_check_comm