code: def get_proc_info():
      """Helper function to get the rank from the
      environment when `mpirun` is used to run this python program.
  
      Please note that for mpi(openmpi) installation the rank is retrieved from the
      environment using OMPI_COMM_WORLD_RANK. For mpich it is
      retrieved from the environment using PMI_RANK.
  
      Returns:
      --------
      integer :
          Rank of the current process.
      """
      env_variables = dict(os.environ)
      # mpich
      if "PMI_RANK" in env_variables:
          return int(env_variables["PMI_RANK"])
      # openmpi
      elif "OMPI_COMM_WORLD_RANK" in env_variables:
          return int(env_variables["OMPI_COMM_WORLD_RANK"])
      else:
          return 0
  
file_path: dgl/tools/distpartitioning/parmetis_preprocess.py
imports: import argparse
  import logging
  import os
  import platform
  from pathlib import Path
  import array_readwriter
  import constants
  import numpy
  import pyarrow
  import pyarrow.csv
  from utils import generate_read_list, generate_roundrobin_read_list, get_idranges, get_node_types, read_json
label_desc: Use image node_id 1 for calling a global function with example usage: get_proc_info() and returns: int, int, int