code: def patch_id_generators_helper(
      start_value: int,
  ) -> Generator[None, None, None]:
      """Replace ID generators in IdGeneratorRegistry with one that has the given start value."""
      # Create patch context managers for all ID generators in the registry with introspection magic.
      patch_context_managers = [
          patch.object(
              IdGeneratorRegistry, "_class_name_to_id_generator", {}
          ),
          patch.object(
              IdGeneratorRegistry, "DEFAULT_START_VALUE", start_value
          ),
          patch.object(PrefixIdGenerator, "_prefix_to_next_value", {}),
          patch.object(
              PrefixIdGenerator, "DEFAULT_START_VALUE", start_value
          ),
      ]
  
      # Enter the patch context for the patches above.
      with ExitStack() as stack:
          for patch_context_manager in patch_context_managers:
              stack.enter_context(patch_context_manager)  # type: ignore
          # This will un-patch when done with the test.
          yield None
  
file_path: metricflow/metricflow/test/fixtures/id_fixtures.py
imports: from __future__ import annotations
  from contextlib import ExitStack, contextmanager
  from typing import Generator
  from unittest.mock import patch
  import pytest
  from metricflow.dag.id_generation import IdGeneratorRegistry
  from metricflow.dag.prefix_id import PrefixIdGenerator
label_desc: Use image node_id 2 for calling a global function with example usage: patch_id_generators_helper(start_value) without return types