code: def set_test_cache_config(tmp_path_factory, monkeypatch):
      # test_hf_cache_home = tmp_path_factory.mktemp("cache")  # TODO: why a cache dir per test function does not work?
      test_hf_cache_home = tmp_path_factory.getbasetemp() / "cache"
      test_hf_evaluate_cache = test_hf_cache_home / "datasets"
      test_hf_metrics_cache = test_hf_cache_home / "metrics"
      test_hf_modules_cache = test_hf_cache_home / "modules"
      monkeypatch.setattr(
          "evaluate.config.HF_EVALUATE_CACHE",
          str(test_hf_evaluate_cache),
      )
      monkeypatch.setattr(
          "evaluate.config.HF_METRICS_CACHE", str(test_hf_metrics_cache)
      )
      monkeypatch.setattr(
          "evaluate.config.HF_MODULES_CACHE", str(test_hf_modules_cache)
      )
      test_DOWNLOADED_EVALUATE_PATH = (
          test_hf_evaluate_cache / "downloads"
      )
      monkeypatch.setattr(
          "evaluate.config.DOWNLOADED_EVALUATE_PATH",
          str(test_DOWNLOADED_EVALUATE_PATH),
      )
      test_EXTRACTED_EVALUATE_PATH = (
          test_hf_evaluate_cache / "downloads" / "extracted"
      )
      monkeypatch.setattr(
          "evaluate.config.EXTRACTED_EVALUATE_PATH",
          str(test_EXTRACTED_EVALUATE_PATH),
      )
  
imports: import csv
  import json
  import lzma
  import os
  import tarfile
  import textwrap
  import datasets
  import pyarrow
  import pyarrow.parquet
  import pytest
  from datasets import config
  from datasets.arrow_dataset import Dataset
  from datasets.features import ClassLabel, Features, Sequence, Value
label_desc: Use image node_id 1 for calling a global function with example usage: set_test_cache_config(tmp_path_factory, monkeypatch) without return types