code: def only_first_process(local_rank):
      if local_rank not in [-1, 0]:
          # noinspection PyUnresolvedReferences
          torch.distributed.barrier()
  
      try:
          yield
      finally:
          if local_rank == 0:
              # noinspection PyUnresolvedReferences
              torch.distributed.barrier()
  
label_desc: Use image node_id 1 for calling a global function with example usage: only_first_process(local_rank) without return types