code: def detect_all(y, yhat, th, dist_measure):
      anomaly_scores = np.zeros_like(y)
      anomaly_indexes = []
      for i, (y_i, yhat_i) in enumerate(zip(y, yhat)):
          if dist_measure.abs_dist(y_i, yhat_i) > th:
              anomaly_indexes.append(i)
              anomaly_scores[i] = 1
      return anomaly_indexes, anomaly_scores
  
imports: import math
  import numpy
  from zoo.chronos.detector.anomaly.abstract import AnomalyDetector
  from abc import ABC, abstractmethod
label_desc: Use image node_id 2 for calling a global function with example usage: detect_all(y, yhat, th, dist_measure) and returns: anomaly_indexes,  anomaly_scores