code: def start_authorization_server(host, port):
      """Function starts server to cach OAuth redirect
  
      Server has one endpoint /. If it is called with token in query
      then server is closed and this function returns that token.
  
      Parameters
      -----------
      host : str
          Host address
      port : int
          Port number
  
      Returns
      --------
      str
      """
      from flask import Flask, request, abort, Response
      from flask_cors import CORS
  
      cli = sys.modules["flask.cli"]
      cli.show_server_banner = lambda *x: None
      app = Flask(__name__)
      CORS(app)
  
      log = logging.getLogger("werkzeug")
      log.disabled = True
      app.logger.disabled = True
  
      result = {}
  
      @app.route("/", methods=["GET"])
      def main():
          token = request.args.get("token")
          if token is None:
              abort(404)
          result["token"] = token
          shutdown = request.environ.get("werkzeug.server.shutdown")
          if shutdown is None:
              raise Exception(
                  "Failed to stop the authorization server."
              )
          shutdown()
          return "<script>window.close()</script>"
  
      app.run(host=host, port=port)
      return result.get("token")
  
file_path: DALEX/python/dalex/dalex/arena/static.py
imports: import json
  import webbrowser
  import random
  import socket
  import logging
  import sys
  from .server import convert
label_desc: Use image node_id 3 for calling a global function with example usage: start_authorization_server(host, port) and returns: result, str