code: def get_rank():
      """Helper function that returns torch.distributed.get_rank() if DDP has been initialized otherwise it returns 0."""
  
      if is_global_rank_zero():
          return 0
      else:
          return torch.distributed.get_rank()
  
label_desc: Use image node_id 2 for calling a global function with example usage: get_rank() and returns: int, torch