code: def _fit_core(self, list_series: Sequence[TimeSeries]) -> None:
      # if len(low) > 1 and len(high) > 1, then check it matches input width:
      raise_if(
          len(self.low_quantile) > 1
          and len(self.low_quantile) != list_series[0].width,
          "The number of components of input must be equal to the number"
          + " of values given for `high_quantile` or/and `low_quantile`. Found number of "
          + f"components equal to {list_series[0].width} and expected {len(self.low_quantile)}.",
      )
  
      # otherwise, make them the right length
      self.low_quantile = (
          self.low_quantile * list_series[0].width
          if len(self.low_quantile) == 1
          else self.low_quantile
      )
      self.high_quantile = (
          self.high_quantile * list_series[0].width
          if len(self.high_quantile) == 1
          else self.high_quantile
      )
  
      # concatenate everything along time axis
      np_series = np.concatenate(
          [series.all_values(copy=False) for series in list_series],
          axis=0,
      )
  
      # move sample dimension to position 1
      np_series = np.moveaxis(np_series, 2, 1)
  
      # flatten it in order to obtain an array of shape (time * samples, components)
      # where all samples of a given component are concatenated along time
      np_series = np_series.reshape(
          np_series.shape[0] * np_series.shape[1], -1
      )
  
      # Compute 2 thresholds (low, high) for each component:
      # TODO: we could make this more efficient when low_quantile or high_quantile contain a single value
      self.low_threshold = [
          np.quantile(np_series[:, i], q=lo, axis=0)
          if lo is not None
          else None
          for i, lo in enumerate(self.low_quantile)
      ]
      self.high_threshold = [
          np.quantile(np_series[:, i], q=hi, axis=0)
          if hi is not None
          else None
          for i, hi in enumerate(self.high_quantile)
      ]
  
      self.detector = ThresholdDetector(
          low_threshold=self.low_threshold,
          high_threshold=self.high_threshold,
      )
  
      return self
  
file_path: darts/darts/ad/detectors/quantile_detector.py
imports: from typing import Sequence, Union
  import numpy
  from darts.ad.detectors.detectors import FittableDetector
  from darts.ad.detectors.threshold_detector import ThresholdDetector
  from darts.logging import raise_if, raise_if_not
  from darts.timeseries import TimeSeries
label_desc: Use image node_id 2 for calling the QuantileDetector obj's underlying member method code with example usage: obj._fit_core(list_series) and returns: self