code: def test_base_outlier_detector_trim():
      """Tests `trim` method."""
      detect_outlier = BaseOutlierDetector()
      y = np.arange(100)
      y_trimmed_1pcnt = detect_outlier.trim(y, 1)
      # This is the default (5%)
      y_trimmed_5pcnt = detect_outlier.trim(y)
  
      # Original range.
      assert max(y) == 99
      assert min(y) == 0
  
      # 1 percent case.
      assert max(y_trimmed_1pcnt) == 98
      assert min(y_trimmed_1pcnt) == 1
  
      # 5 percent case.
      assert max(y_trimmed_5pcnt) == 96
      assert min(y_trimmed_5pcnt) == 3
  
      with pytest.raises(ValueError, match="Trim percent:"):
          detect_outlier.trim(y, -1)
  
      with pytest.raises(ValueError, match="Trim percent:"):
          detect_outlier.trim(y, 150)
  
imports: import numpy
  import pandas
  import pytest
  from greykite.common.features.outlier import EXPONENTIAL_SMOOTHING
  from greykite.common.features.outlier import MOVING_MEDIAN
  from greykite.common.features.outlier import BaseOutlierDetector
  from greykite.common.features.outlier import DetectionResult
  from greykite.common.features.outlier import DiffMethod
  from greykite.common.features.outlier import TukeyOutlierDetector
  from greykite.common.features.outlier import ZScoreOutlierDetector
  from greykite.common.viz.timeseries_annotate import plot_lines_markers
label_desc: Use image node_id 6 for calling a global function with example usage: test_base_outlier_detector_trim() without return types