code: def create_index(prefix):
      # create index
      default_index = {
          "index_type": "IVF_FLAT",
          "params": {"nlist": 128},
          "metric_type": "L2",
      }
      col_list = get_collections(prefix)
      logger.info("\nCreate index...")
      for col_name in col_list:
          c = Collection(name=col_name)
          try:
              replicas = c.get_replicas()
              replica_number = len(replicas.groups)
              c.release()
          except Exception as e:
              replica_number = 0
              logger.info(e)
          index_name = col_name.replace(prefix, "")
          logger.info(index_name)
          logger.info(c)
          index = copy.deepcopy(default_index)
          index["index_type"] = index_name
          index["params"] = index_params_map[index_name]
          if index_name in ["BIN_FLAT", "BIN_IVF_FLAT"]:
              index["metric_type"] = "HAMMING"
          index_info_list = [x.to_dict() for x in c.indexes]
          logger.info(index_info_list)
          is_indexed = False
          for index_info in index_info_list:
              if (
                  "metric_type" in index_info.keys()
                  or "metric_type" in index_info["index_param"]
              ):
                  is_indexed = True
                  logger.info(
                      f"collection {col_name} has been indexed with {index_info}"
                  )
          if not is_indexed:
              t0 = time.time()
              c.create_index(
                  field_name="float_vector", index_params=index
              )
              logger.info(f"create index time: {time.time() - t0:.4f}")
          if replica_number > 0:
              c.load(replica_number=replica_number)
  
file_path: milvus/tests/python_client/deploy/scripts/utils.py
imports: import sys
  import copy
  import time
  from loguru import logger
  import pymilvus
  from pymilvus import FieldSchema, CollectionSchema, DataType, Collection, list_collections
label_desc: Use image node_id 6 for calling a global function with example usage: create_index(prefix) without return types