code: def detect_trend_anomaly_arr(y, th_arr):
      min_diff = y - th_arr[0]
      max_diff = y - th_arr[1]
      anomaly_indexes = np.logical_or(min_diff < 0, max_diff > 0)
      anomaly_scores = np.zeros_like(y)
      anomaly_scores[anomaly_indexes] = 1
      return list(set(np.where(anomaly_scores > 0)[0]))
  
imports: import math
  import numpy
  from bigdl.chronos.detector.anomaly.abstract import AnomalyDetector
  from bigdl.nano.utils.common import invalidInputError
  from abc import ABC, abstractmethod
label_desc: Use image node_id 5 for calling a global function with example usage: detect_trend_anomaly_arr(y, th_arr) and returns: list