code: def __init__(self, windowSize, positiveThreshold, negativeThreshold):
      if negativeThreshold > positiveThreshold:
          raise Exception("Invalid thresholds")
  
      super(TrendEventWindow, self).__init__(windowSize)
      self.__positiveThreshold = positiveThreshold
      self.__negativeThreshold = negativeThreshold
  
imports: from pyalgotrade import technical
  from pyalgotrade.utils import collections
  from pyalgotrade.utils import dt
  import numpy
  from scipy import stats
label_desc: Use image node_id 1 to create a new TrendEventWindow object from inherited base classes: SlopeEventWindow with example: obj = TrendEventWindow(windowSize, positiveThreshold, negativeThreshold)