code: def run(configs: dict = None, port: int = 8866):
      """
      Run flask instance for PaddleHub-Serving
  
      Args:
           configs(dict): module info and configs
           port(int): the port of the webserver
  
      Examples:
          .. code-block:: python
  
              configs = {'lac': {'version': 1.0.0, 'category': nlp}}
              run(configs=configs, port=8866)
      """
      logger = log.get_file_logger(filename)
      if configs is not None:
          config_with_file(configs)
      else:
          logger.error("Start failed cause of missing configuration.")
          return
      my_app = create_app(init_flag=True)
      my_app.run(host="0.0.0.0", port=port, debug=False, threaded=False)
      log.logger.info("PaddleHub-Serving has been stopped.")
  
imports: import socket
  import threading
  import time
  import traceback
  from multiprocessing import Process
  from threading import Lock
  import requests
  from flask import Flask
  from flask import redirect
  from flask import request
  from flask import Response
  from paddlehub.serving.model_service.base_model_service import cv_module_info
  from paddlehub.serving.model_service.base_model_service import nlp_module_info
  from paddlehub.serving.model_service.base_model_service import v2_module_info
  from paddlehub.utils import log
  from paddlehub.utils import utils
label_desc: Use image node_id 6 for calling a global function with example usage: run(configs, port) without return types