code: def is_main_proc(local=False):
      """
      Determines if the current process is the main process.
  
      Main process is responsible for logging, writing and loading checkpoints. In
      the multi GPU setting, we assign the main role to the rank 0 process. When
      training using a single GPU, there is a single process which is considered main.
  
      If local==True, then check if the current process is the main on the current node.
      """
      m = cfg.MAX_GPUS_PER_NODE if local else cfg.NUM_GPUS
      return cfg.NUM_GPUS == 1 or torch.distributed.get_rank() % m == 0
  
file_path: pycls/pycls/core/distributed.py
imports: import os
  import random
  import submitit
  import torch
  from pycls.core.config import cfg
label_desc: Use image node_id 1 for calling a global function with example usage: is_main_proc(local) and returns: unknown