code: def tconfig_from_mt_experiment(
      experiment: MultiTypeExperiment,
  ) -> TConfig:
      """Generate the TConfig for this transform given a multi_type_experiment.
  
      Args:
          experiment: The experiment from which to generate the config.
  
      Returns:
          The transform config to pass into the ConvertMetricNames constructor.
      """
  
      trial_index_to_type = {
          t.index: t.trial_type for t in experiment.trials.values()
      }
      return {
          "metric_name_map": experiment._metric_to_canonical_name,
          "trial_index_to_type": trial_index_to_type,
          "metric_name_to_trial_type": experiment.metric_to_trial_type,
      }
  
file_path: Ax/ax/modelbridge/transforms/convert_metric_names.py
imports: from typing import Dict, List, Optional, TYPE_CHECKING
  from ax.core.multi_type_experiment import MultiTypeExperiment
  from ax.core.observation import Observation, ObservationData
  from ax.core.search_space import SearchSpace
  from ax.modelbridge.transforms.base import Transform
  from ax.models.types import TConfig
  from ax.utils.common.docutils import copy_doc
  from ax.utils.common.typeutils import not_none
label_desc: Use image node_id 1 for calling a global function with example usage: tconfig_from_mt_experiment(experiment) and returns: dict