code: def start_server(
      _viz,
      blocking: bool = False,
      debug: bool = False,
      _port: Optional[int] = None,
      bind_all: bool = False,
  ):
      global visualizer
      visualizer = _viz
  
      global port
      if port is None:
          os.environ[
              "WERKZEUG_RUN_MAIN"
          ] = "true"  # hides starting message
          if not debug:
              log = logging.getLogger("werkzeug")
              log.disabled = True
              app.logger.disabled = True
  
          port = _port or get_free_tcp_port()
          # Start in a new thread to not block notebook execution
          t = threading.Thread(
              target=run_app,
              kwargs={"debug": debug, "bind_all": bind_all},
          )
          t.start()
          sleep(0.01)  # add a short delay to allow server to start up
          if blocking:
              t.join()
  
      print(
          f"\nFetch data and view Captum Insights at http://localhost:{port}/\n"
      )
      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 8 for calling a global function with example usage: start_server(_viz, blocking, debug, _port, bind_all) and returns: port