docs: def _detect(self, score_only):
          """
          Detect anomaly periods.
          :param bool score_only: if true, only anomaly scores are computed.
          """
          try:
              algorithm = self.algorithm(**self.algorithm_params)
              self.anom_scores = algorithm.run()
          except exceptions.NotEnoughDataPoints:
              algorithm = anomaly_detector_algorithms['default_detector'](self.time_series)
              self.threshold = self.threshold or ANOMALY_THRESHOLD['default_detector']
              self.anom_scores = algorithm.run()
          if not score_only:
              self._detect_anomalies()