code: def stability_metrics(
      hists,
      settings: Settings,
      reference=None,
  ):
      """Create a data stability monitoring datastore for given dict of input histograms.
  
      :param dict hists: input histograms to be profiled and monitored over time.
      :param popmon.config.Settings settings: popmon configuration object
      :param reference: histograms used as reference. default is None
      :return: dict with results of metrics pipeline
      """
  
      if not isinstance(hists, dict):
          raise TypeError(
              "hists should be a dict of histogrammar histograms."
          )
  
      if (
          isinstance(settings.time_axis, str)
          and len(settings.time_axis) == 0
      ):
          settings._set_time_axis_hists(hists)
  
      kwargs = {}
      if (
          settings.reference_type in ["external", "self_split"]
          and "ref_hists_key" not in kwargs
      ):
          kwargs["ref_hists_key"] = "ref_hists"
  
      pipeline = create_metrics_pipeline(
          settings=settings,
          reference=reference,
          hists_key="hists",
          **kwargs,
      )
  
      datastore = {"hists": hists}
      if settings.reference_type in ["external", "self_split"]:
          datastore["ref_hists"] = reference
  
      return pipeline.transform(datastore)
  
imports: from __future__ import annotations
  import logging
  from histogrammar.dfinterface.make_histograms import get_bin_specs, make_histograms
  from popmon.config import Settings
  from popmon.pipeline.metrics_pipelines import create_metrics_pipeline
label_desc: Use image node_id 1 for calling a global function with example usage: stability_metrics(hists, settings, reference) and returns: pipeline