code: def get_safe_port():
      with contextlib.closing(
          socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      ) as sock:
          sock.bind(("localhost", 0))
          return sock.getsockname()[1]
  
file_path: mlflow/docs/broken_links.py
imports: import contextlib
  import socket
  import subprocess
  import sys
  import time
  import requests
  from scrapy.crawler import CrawlerProcess
  from scrapy.linkextractors import LinkExtractor
  from scrapy.spiders import CrawlSpider, Rule
label_desc: Use image node_id 1 for calling a global function with example usage: get_safe_port() and returns: sock