code: def test_sweep_config_cache(
      self, hydra_restore_singletons: Any, path: str, monkeypatch: Any
  ) -> None:
      setup_globals()
  
      # pseudorandom resolvers with/without value caching
      pseudorandom_values = iter(["1st", "2nd", "3rd", "4th"])
      OmegaConf.register_new_resolver(
          "cached",
          lambda: next(pseudorandom_values),
          use_cache=True,
          replace=True,
      )
      OmegaConf.register_new_resolver(
          "uncached",
          lambda: next(pseudorandom_values),
          use_cache=False,
          replace=True,
      )
  
      monkeypatch.setenv("TEST_ENV", "test_env")
  
      config_loader = ConfigLoaderImpl(
          config_search_path=create_config_search_path(path)
      )
      master_cfg = config_loader.load_configuration(
          config_name="config.yaml",
          overrides=[
              "+time=${now:%H-%M-%S}",
              "+test_env=${oc.env:TEST_ENV}",
              "+test_cached=${cached:}",
              "+test_uncached=${uncached:}",
          ],
          run_mode=RunMode.RUN,
      )
  
      # trigger resolution by type assertion
      assert type(master_cfg.time) == str
      assert type(master_cfg.test_env) == str
      assert type(master_cfg.test_cached) == str  # "1st"
      assert type(master_cfg.test_uncached) == str  # "2nd"
  
      master_cfg_cache = OmegaConf.get_cache(master_cfg)
      assert "now" in master_cfg_cache.keys()
      # oc.env is not cached as of OmegaConf 2.1
      assert "oc.env" not in master_cfg_cache.keys()
      assert master_cfg.test_env == "test_env"
      assert "cached" in master_cfg_cache.keys()
      assert master_cfg.test_cached == "1st"  # use cached value
      assert "uncached" not in master_cfg_cache.keys()
      assert master_cfg.test_uncached == "3rd"  # use `next` value
  
      sweep_cfg = config_loader.load_sweep_config(
          master_config=master_cfg,
          sweep_overrides=[
              "+time=${now:%H-%M-%S}",
              "+test_env=${oc.env:TEST_ENV}",
              "+test_cached=${cached:}",
              "+test_uncached=${uncached:}",
          ],
      )
  
      sweep_cfg_cache = OmegaConf.get_cache(sweep_cfg)
      assert len(sweep_cfg_cache.keys()) == 2  # "now", and "cached"
      assert "now" in sweep_cfg_cache.keys()
      assert "oc.env" not in sweep_cfg_cache.keys()
      assert "cached" in sweep_cfg_cache.keys()
      assert "uncached" not in sweep_cfg_cache.keys()
      assert sweep_cfg_cache["now"] == master_cfg_cache["now"]
      assert sweep_cfg_cache["cached"] == master_cfg_cache["cached"]
      monkeypatch.setenv("TEST_ENV", "test_env2")
      assert sweep_cfg.test_env == "test_env2"
      assert master_cfg.test_cached == "1st"  # use cached value
      assert master_cfg.test_uncached == "4th"
  
imports: import re
  from dataclasses import dataclass, field
  from textwrap import dedent
  from typing import Any, List
  from omegaconf import MISSING, OmegaConf, ValidationError, open_dict
  from pytest import mark, param, raises, warns
  from hydra import version
  from hydra._internal.config_loader_impl import ConfigLoaderImpl
  from hydra._internal.utils import create_config_search_path
  from hydra.core.config_store import ConfigStore, ConfigStoreWithProvider
  from hydra.core.override_parser.overrides_parser import OverridesParser
  from hydra.core.utils import env_override, setup_globals
  from hydra.errors import ConfigCompositionException, HydraException, MissingConfigException
  from hydra.test_utils.test_utils import chdir_hydra_root
  from hydra.types import RunMode
  from tests.instantiate import UserGroup
label_desc: Use image node_id 17 for calling the TestConfigLoader obj's underlying member method code with example usage: obj.test_sweep_config_cache(hydra_restore_singletons, path, monkeypatch) without return types