code: def connect(request):
      host = request.config.getoption("--host")
      service_name = request.config.getoption("--service")
      port = request.config.getoption("--port")
      http_port = request.config.getoption("--http_port")
      handler = request.config.getoption("--handler")
      if handler == "HTTP":
          port = http_port
      try:
          milvus = get_milvus(host=host, port=port, handler=handler)
          # reset_build_index_threshold(milvus)
      except Exception as e:
          logging.getLogger().error(str(e))
          pytest.exit(
              "Milvus server can not connected, exit pytest ..."
          )
  
      def fin():
          try:
              milvus.close()
              pass
          except Exception as e:
              logging.getLogger().info(str(e))
  
      request.addfinalizer(fin)
      return milvus
  
imports: import logging
  import pytest
  import functools
  import socket
  import common.common_type
  import common.common_func
  from utils.util_log import test_log
  from common.common_func import param_info
  from check.param_check import ip_check, number_check
  from config.log_config import log_config
  from utils.util_pymilvus import get_milvus, gen_unique_str, gen_default_fields, gen_binary_default_fields
  from pymilvus.orm.types import CONSISTENCY_STRONG
label_desc: Use image node_id 44 for calling a global function with example usage: connect(request) and returns: milvus