code: def _align_outputs(
      all_model_outs: List[TimeSeries], target: TimeSeries
  ) -> List[Optional[TimeSeries]]:
      """
      Aligns the outputs of each model to the time series ``target``.
      """
      if all(out is None for out in all_model_outs):
          return [None for _ in all_model_outs]
      if target is None:
          time_stamps = np.unique(
              np.concatenate(
                  [
                      out.to_pd().index
                      for out in all_model_outs
                      if out is not None
                  ]
              )
          )
      else:
          t0 = min(
              min(v.index[0] for v in out.univariates)
              for out in all_model_outs
              if out is not None
          )
          tf = max(
              max(v.index[-1] for v in out.univariates)
              for out in all_model_outs
              if out is not None
          )
          time_stamps = target.to_pd()[t0:tf].index
      return [
          None if out is None else out.align(reference=time_stamps)
          for out in all_model_outs
      ]
  
imports: from abc import abstractmethod
  from collections import OrderedDict
  import copy
  import logging
  from typing import List, Optional, Union
  import numpy
  from merlion.evaluate.anomaly import TSADMetric
  from merlion.evaluate.forecast import ForecastMetric
  from merlion.utils import UnivariateTimeSeries, TimeSeries
  from merlion.utils.misc import AutodocABCMeta
label_desc: Use image node_id 1 for calling a global function with example usage: _align_outputs(all_model_outs, target) and returns: unknown, unknown