code: def insert_or_get(md5):
      collection = _client[DB][UNIQUE_ID_COLLECTION]
      found = collection.find_one({"md5": md5})
      if not found:
          return collection.insert_one({"md5": md5}).inserted_id
      return found["_id"]
  
file_path: milvus/tests/benchmark/milvus_benchmark/metrics/api.py
imports: import logging
  from pymongo import MongoClient
  from .models.env import Env
  from .models.hardware import Hardware
  from .models.metric import Metric
  from .models.server import Server
  from .config import DB, UNIQUE_ID_COLLECTION, DOC_COLLECTION
  from milvus_benchmark import config
label_desc: Use image node_id 1 for calling a global function with example usage: insert_or_get(md5) and returns: found, collection