code: def set_engine_env_variables(
      test_configuration: MetricFlowTestConfiguration,
  ) -> None:
      """Set connection env variables dynamically for the engine being used.
  
      Requires MF_TEST_ENGINE_CREDENTIALS env variable to be set with creds for all engines.
      """
      if test_configuration.credential_set.engine_url is None:
          if "MF_SQL_ENGINE_URL" in os.environ:
              del os.environ["MF_SQL_ENGINE_URL"]
      else:
          os.environ[
              "MF_SQL_ENGINE_URL"
          ] = test_configuration.credential_set.engine_url
  
      if test_configuration.credential_set.engine_password is None:
          if "MF_SQL_ENGINE_PASSWORD" in os.environ:
              del os.environ["MF_SQL_ENGINE_PASSWORD"]
      else:
          os.environ[
              "MF_SQL_ENGINE_PASSWORD"
          ] = test_configuration.credential_set.engine_password
  
file_path: metricflow/metricflow/test/generate_snapshots.py
imports: from __future__ import annotations
  import logging
  import os
  from dataclasses import dataclass
  from typing import Callable, Optional, Sequence
  from dbt_semantic_interfaces.enum_extension import assert_values_exhausted
  from dbt_semantic_interfaces.implementations.base import FrozenBaseModel
  from metricflow.protocols.sql_client import SqlEngine
  from metricflow.test.fixtures.setup_fixtures import SQL_ENGINE_SNAPSHOT_MARKER_NAME
label_desc: Use image node_id 2 for calling a global function with example usage: set_engine_env_variables(test_configuration) without return types