code: def opensearch(
      elasticsearch_config: dict,
  ) -> Generator[OpenSearch, None, None]:
      client = OpenSearch(**elasticsearch_config)
      yield client
  
      for index_info in client.cat.indices(
          index="ar.*,rg.*", format="json"
      ):
          client.indices.delete(index=index_info["index"])
  
imports: import contextlib
  import uuid
  from typing import TYPE_CHECKING, Dict, Generator
  import pytest
  import pytest_asyncio
  from argilla.server import telemetry
  from argilla.server.constants import API_KEY_HEADER_NAME, DEFAULT_API_KEY
  from argilla.server.daos.backend import GenericElasticEngineBackend
  from argilla.server.daos.datasets import DatasetsDAO
  from argilla.server.daos.records import DatasetRecordsDAO
  from argilla.server.database import get_async_db
  from argilla.server.models import User, UserRole, Workspace
  from argilla.server.search_engine import SearchEngine, get_search_engine
  from argilla.server.settings import settings
  from argilla.server.telemetry import TelemetryClient
  from httpx import AsyncClient
  from opensearchpy import OpenSearch
  from tests.database import TestSession
  from tests.factories import AnnotatorFactory, OwnerFactory, UserFactory
label_desc: Use image node_id 2 for calling a global function with example usage: opensearch(elasticsearch_config) without return types