code: def test_cached_artifact_error() -> None:
      dataset = "dataset"
      config = "config"
      split = "split"
      kind = "cache_kind"
      error_code = "ErrorCode"
      error_message = "error message"
      cause_exception = "CauseException"
      cause_message = "cause message"
      cause_traceback = ["traceback1", "traceback2"]
      details = {
          "error": error_message,
          "cause_exception": cause_exception,
          "cause_message": cause_message,
          "cause_traceback": cause_traceback,
      }
      content = {"error": error_message}
      job_runner_version = 1
      dataset_git_revision = REVISION_NAME
      progress = 1.0
      upsert_response(
          kind=kind,
          dataset=dataset,
          config=config,
          split=split,
          content=content,
          http_status=HTTPStatus.INTERNAL_SERVER_ERROR,
          error_code=error_code,
          details=details,
          job_runner_version=job_runner_version,
          dataset_git_revision=dataset_git_revision,
          progress=progress,
      )
      response = get_response_with_details(
          kind=kind, dataset=dataset, config=config, split=split
      )
      error = CachedArtifactError(
          message="Previous step error",
          kind=kind,
          dataset=dataset,
          config=config,
          split=split,
          cache_entry_with_details=response,
      )
  
      assert error.cache_entry_with_details["content"] == content
      assert (
          error.cache_entry_with_details["http_status"]
          == HTTPStatus.INTERNAL_SERVER_ERROR
      )
      assert error.cache_entry_with_details["error_code"] == error_code
      assert error.enhanced_details == {
          "error": error_message,
          "cause_exception": cause_exception,
          "cause_message": cause_message,
          "cause_traceback": cause_traceback,
          "copied_from_artifact": {
              "kind": kind,
              "dataset": dataset,
              "config": config,
              "split": split,
          },
      }
  
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 19 for calling a global function with example usage: test_cached_artifact_error() without return types