docstr: Detect anomaly periods.
  :param bool score_only: if true, only anomaly scores are computed.
docstr_tok: ["Detect","anomaly","periods",".",":","param","bool","score_only",":","if","true",",","only","anomaly","scores","are","computed","."]
code: 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()
  
file_path: luminol/src/luminol/anomaly_detector.py
imports: from luminol import exceptions, utils
  from luminol.algorithms.anomaly_detector_algorithms.all import anomaly_detector_algorithms
  from luminol.modules.anomaly import Anomaly
  from luminol.modules.time_series import TimeSeries
  from luminol.constants import ANOMALY_DETECTOR_ALGORITHM, ANOMALY_THRESHOLD, ANOMALY_DETECTOR_REFINE_ALGORITHM, DEFAULT_SCORE_PERCENT_THRESHOLD
label_desc: Use image node_id 4 for calling the AnomalyDetector obj's underlying member method code with example usage: obj._detect(score_only) without return types