code: def get_metrics_pipeline_class(reference_type, reference):
      _metrics_pipeline_register = {
          "self": SelfReferenceMetricsPipeline,
          "external": ExternalReferenceMetricsPipeline,
          "self_split": ExternalReferenceMetricsPipeline,
          "rolling": RollingReferenceMetricsPipeline,
          "expanding": ExpandingReferenceMetricsPipeline,
      }
  
      if reference_type not in _metrics_pipeline_register:
          raise ValueError(
              f"reference_type should be in {_metrics_pipeline_register.keys()!s}'."
          )
      if (
          reference_type in ["external", "self_split"]
          and not isinstance(reference, dict)
          and reference is not None
      ):
          raise TypeError(
              "reference should be a dict of histogrammar histograms."
          )
  
      return _metrics_pipeline_register[reference_type]
  
imports: from __future__ import annotations
  from popmon.alerting import AlertsSummary, DynamicBounds, StaticBounds, TrafficLightAlerts, traffic_light_summary
  from popmon.analysis.apply_func import ApplyFunc
  from popmon.analysis.comparison.hist_comparer import ExpandingHistComparer, PreviousHistComparer, ReferenceHistComparer, RollingHistComparer
  from popmon.analysis.functions import rolling_lr_zscore
  from popmon.analysis.profiling import HistProfiler
  from popmon.analysis.profiling.pull_calculator import ExpandingPullCalculator, ReferencePullCalculator, RefMedianMadPullCalculator, RollingPullCalculator
  from popmon.base import Module, Pipeline
  from popmon.config import Settings
  from popmon.hist.hist_splitter import HistSplitter
  from .timing import Timing
label_desc: Use image node_id 1 for calling a global function with example usage: get_metrics_pipeline_class(reference_type, reference) and returns: _metrics_pipeline_register