code: def load_experiment(
      experiment_name: str,
      config: Optional[SQAConfig] = None,
      reduced_state: bool = False,
      load_trials_in_batches_of_size: Optional[int] = None,
      skip_runners_and_metrics: bool = False,
  ) -> Experiment:
      """Load experiment by name.
  
      Args:
          experiment_name: Name of the expeirment to load.
          config: `SQAConfig`, from which to retrieve the decoder. Optional,
              defaults to base `SQAConfig`.
          reduced_state: Whether to load experiment with a slightly reduced state
              (without abandoned arms on experiment and withoug model state,
              search space, and optimization config on generator runs).
          skip_runners_and_metrics: If True skip loading runners, and do only a
              minimal load of metrics. This option is intended to enable loading of
              experiments that require custom runners or metrics, without depending
              on a registry. Note that even though the intention is to skip loading
              of metrics, this option converts the loaded metrics into a base
              metric avoiding conversion related to custom properties of the metric.
      """
      config = config or SQAConfig()
      decoder = Decoder(config=config)
      return _load_experiment(
          experiment_name=experiment_name,
          decoder=decoder,
          reduced_state=reduced_state,
          load_trials_in_batches_of_size=load_trials_in_batches_of_size,
          skip_runners_and_metrics=skip_runners_and_metrics,
      )
  
imports: from math import ceil
  from typing import Any, cast, Dict, List, Optional, Type
  from ax.core.experiment import Experiment
  from ax.core.generator_run import GeneratorRun
  from ax.core.metric import Metric
  from ax.core.trial import Trial
  from ax.exceptions.core import ExperimentNotFoundError, ObjectNotFoundError
  from ax.modelbridge.generation_strategy import GenerationStrategy
  from ax.storage.sqa_store.db import session_scope
  from ax.storage.sqa_store.decoder import Decoder
  from ax.storage.sqa_store.reduced_state import get_query_options_to_defer_immutable_duplicates, get_query_options_to_defer_large_model_cols
  from ax.storage.sqa_store.sqa_classes import SQAExperiment, SQAGenerationStrategy, SQAGeneratorRun, SQATrial
  from ax.storage.sqa_store.sqa_config import SQAConfig
  from ax.utils.common.constants import Keys
  from ax.utils.common.typeutils import checked_cast, not_none
  from sqlalchemy.orm import defaultload, lazyload, noload
  from sqlalchemy.orm.exc import DetachedInstanceError
label_desc: Use image node_id 1 for calling a global function with example usage: load_experiment(experiment_name, config, reduced_state, load_trials_in_batches_of_size, skip_runners_and_metrics) and returns: _load_experiment