code: def get_free_tcp_port():
      tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      tcp.bind(("", 0))
      addr, port = tcp.getsockname()
      tcp.close()
      return port
  
file_path: captum/captum/insights/attr_vis/server.py
imports: import logging
  import os
  import socket
  import threading
  from time import sleep
  from typing import Optional
  from captum.log import log_usage
  from flask import Flask, jsonify, render_template, request
  from flask_compress import Compress
  from torch import Tensor
label_desc: Use image node_id 6 for calling a global function with example usage: get_free_tcp_port() and returns: port