code: def _setup_free_port(local_rank):
      port_file = "/tmp/free_port"
  
      if local_rank == 0:
          port = _find_free_port()
          with open(port_file, "w") as h:
              h.write(str(port))
          return port
      else:
          counter = 10
          while counter > 0:
              counter -= 1
              time.sleep(1)
              if not Path(port_file).exists():
                  continue
              with open(port_file, "r") as h:
                  port = h.readline()
                  return int(port)
  
          raise RuntimeError(
              f"Failed to fetch free port on local rank {local_rank}"
          )
  
imports: import functools
  import os
  import shutil
  import sys
  import tempfile
  import time
  from pathlib import Path
  import pytest
  import torch
  import torch.distributed
  import ignite.distributed
label_desc: Use image node_id 11 for calling a global function with example usage: _setup_free_port(local_rank) and returns: port, int