code: def get_local_rank() -> int:
      """
      Returns:
          The rank of the current process within the local (per-machine) process group.
      """
      if not dist.is_available():
          return 0
      if not dist.is_initialized():
          return 0
      assert _LOCAL_PROCESS_GROUP is not None
      return dist.get_rank(group=_LOCAL_PROCESS_GROUP)
  
imports: import functools
  import logging
  import pickle
  import numpy
  import torch
  import torch.distributed
label_desc: Use image node_id 5 for calling a global function with example usage: get_local_rank() and returns: dist, int, int