code: def verify_load_balance(c_name, host, port=19530):
      """
      verify load balance is available after scale
      """
      connections.connect("default", host=host, port=port)
      # verify load balance
      utility_w = ApiUtilityWrapper()
      collection_w = ApiCollectionWrapper()
      collection_w.init_collection(c_name)
      ms = MilvusSys()
      res, _ = utility_w.get_query_segment_info(collection_w.name)
      log.debug(res)
      segment_distribution = cf.get_segment_distribution(res)
      all_querynodes = [node["identifier"] for node in ms.query_nodes]
      assert len(all_querynodes) > 1
      all_querynodes = sorted(
          all_querynodes,
          key=lambda x: len(segment_distribution[x]["sealed"])
          if x in segment_distribution
          else 0,
          reverse=True,
      )
      log.debug(all_querynodes)
      src_node_id = all_querynodes[0]
      des_node_ids = all_querynodes[1:]
      sealed_segment_ids = segment_distribution[src_node_id]["sealed"]
      # load balance
      utility_w.load_balance(
          collection_w.name,
          src_node_id,
          des_node_ids,
          sealed_segment_ids,
      )
      # get segments distribution after load balance
      res, _ = utility_w.get_query_segment_info(collection_w.name)
      log.debug(res)
      segment_distribution = cf.get_segment_distribution(res)
      sealed_segment_ids_after_load_banalce = segment_distribution[
          src_node_id
      ]["sealed"]
      # assert src node has no sealed segments
      assert sealed_segment_ids_after_load_banalce == []
      des_sealed_segment_ids = []
      for des_node_id in des_node_ids:
          des_sealed_segment_ids += segment_distribution[des_node_id][
              "sealed"
          ]
      # assert sealed_segment_ids is subset of des_sealed_segment_ids
      assert set(sealed_segment_ids).issubset(des_sealed_segment_ids)
  
imports: import random
  import threading
  import time
  import pytest
  from base.collection_wrapper import ApiCollectionWrapper
  from base.utility_wrapper import ApiUtilityWrapper
  from common.common_type import CaseLabel, CheckTasks
  from common.milvus_sys import MilvusSys
  from customize.milvus_operator import MilvusOperator
  from common import common_func
  from common import common_type
  from scale import constants, scale_common
  from pymilvus import Index, connections, MilvusException
  from utils.util_log import test_log
  from utils.util_k8s import wait_pods_ready, read_pod_log
  from utils.util_pymilvus import get_latest_tag
  from utils.wrapper import counter
label_desc: Use image node_id 1 for calling a global function with example usage: verify_load_balance(c_name, host, port) without return types