class_docstr: Zeroes all anomaly scores whose absolute value is less than the threshold.
code: def __call__(self, time_series: TimeSeries) -> TimeSeries:
      assert (
          time_series.dim == 1
      ), f"{type(self).__name__} post-rule can only be applied on single-variable time series"
      k = time_series.names[0]
      times = time_series.univariates[k].time_stamps
      scores = np.asarray(time_series.univariates[k].np_values)
      scores = np.where(np.isnan(scores), 0.0, scores)
      if self.abs_score:
          scores = np.abs(scores)
      if self.alm_threshold is None:
          logger.info(
              "No trained threshold found (either metric was None, "
              "training data had no anomalies, or no training data "
              "given). Using default histogram gap factor "
              f"{self.default_hist_gap_thres}."
          )
          alm_threshold = get_adaptive_thres(
              np.asarray(scores),
              hist_gap_thres=self.default_hist_gap_thres,
              bin_sz=self.bin_sz,
          )[1]
      else:
          alm_threshold = self.alm_threshold
      scores = np.where(scores >= alm_threshold, scores, 0.0)
      return TimeSeries({k: UnivariateTimeSeries(times, scores)})
  
imports: import bisect
  import logging
  import numpy
  from merlion.evaluate.anomaly import TSADMetric
  from merlion.post_process.base import PostRuleBase
  from merlion.utils import UnivariateTimeSeries, TimeSeries
label_desc: Use image node_id 2 for calling the AdaptiveThreshold obj's underlying member method code with example usage: obj.__call__(time_series) and returns: TimeSeries