code: def _find_free_port():
      try:
          s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
          s.bind(("", 0))
          s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
          return s.getsockname()[1]
      finally:
          s.close()
  
file_path: consistency_models/cm/dist_util.py
imports: import io
  import os
  import socket
  import blobfile
  from mpi4py import MPI
  import torch
  import torch.distributed
label_desc: Use image node_id 5 for calling a global function with example usage: _find_free_port() and returns: s