code: def test_fetch_names(
      cache_kinds: list[str],
      response_spec_by_kind: Mapping[str, Mapping[str, Any]],
      expected_names: list[str],
  ) -> None:
      for kind, response_spec in response_spec_by_kind.items():
          upsert_response(
              kind=kind,
              dataset=DATASET_NAME,
              dataset_git_revision=REVISION_NAME,
              config=CONFIG_NAME_1,
              split=None,
              content=response_spec["content"],
              http_status=response_spec["http_status"],
          )
      assert (
          fetch_names(
              dataset=DATASET_NAME,
              config=CONFIG_NAME_1,
              cache_kinds=cache_kinds,
              names_field=NAMES_FIELD,
              name_field=NAME_FIELD,
          )
          == expected_names
      )
  
imports: from collections.abc import Mapping
  from datetime import datetime
  from decimal import Decimal
  from http import HTTPStatus
  from time import process_time
  from typing import Any, Optional, TypedDict
  import pytest
  from pymongo.errors import DocumentTooLarge
  from libcommon.resources import CacheMongoResource
  from libcommon.simple_cache import CachedArtifactError, CachedResponseDocument, CacheEntryDoesNotExistError, CacheReportsPage, CacheReportsWithContentPage, CacheTotalMetricDocument, InvalidCursor, InvalidLimit, delete_dataset_responses, delete_response, fetch_names, get_best_response, get_cache_reports, get_cache_reports_with_content, get_dataset_responses_without_content_for_kind, get_datasets_with_last_updated_kind, get_outdated_split_full_names_for_step, get_response, get_response_with_details, get_response_without_content, get_responses_count_by_kind_status_and_error_code, has_any_successful_response, upsert_response
  from libcommon.utils import get_datetime
  from .utils import CACHE_KIND, CONFIG_NAME_1, CONFIG_NAME_2, CONTENT_ERROR, DATASET_GIT_REVISION_A, DATASET_GIT_REVISION_B, DATASET_GIT_REVISION_C, DATASET_NAME, DATASET_NAME_A, DATASET_NAME_B, DATASET_NAME_C, REVISION_NAME
label_desc: Use image node_id 20 for calling a global function with example usage: test_fetch_names(cache_kinds, response_spec_by_kind, expected_names) without return types