code: def test_corner_cases(self):
      td = ThresholdDetector()
      with pytest.raises(RuntimeError):
          td.score()
      with pytest.raises(RuntimeError):
          td.anomaly_indexes()
  
      time = np.arange(0, 1, 0.5)
      y = np.sin(time)
      with pytest.raises(RuntimeError):
          td.set_params(mode="dummy")
          td.fit(y, y)
      with pytest.raises(RuntimeError):
          td.set_params(pattern_threshold="1")
          td.fit(y, y)
      with pytest.raises(RuntimeError):
          td.set_params(pattern_threshold=(1, -1))
          td.fit(y, y)
      with pytest.raises(RuntimeError):
          td.set_params(
              pattern_threshold=(np.array([-1]), np.array([-1]))
          )
          td.fit(y, y)
      with pytest.raises(RuntimeError):
          td.set_params(
              pattern_threshold=(np.array([1, 1]), np.array([-1, -1]))
          )
          td.fit(y, y)
      with pytest.raises(RuntimeError):
          td.set_params(trend_threshold="1")
          td.fit(y)
      with pytest.raises(RuntimeError):
          td.set_params(trend_threshold=(1, -1))
          td.fit(y)
      with pytest.raises(RuntimeError):
          td.set_params(
              trend_threshold=(np.array([-1]), np.array([-1]))
          )
          td.fit(y)
      with pytest.raises(RuntimeError):
          td.set_params(
              trend_threshold=(np.array([1, 1]), np.array([-1, -1]))
          )
          td.fit(y)
  
file_path: BigDL/python/chronos/test/bigdl/chronos/detector/anomaly/test_th_detector.py
imports: import pytest
  import numpy
  import pandas
  from unittest import TestCase
  from bigdl.chronos.utils import LazyImport
  from bigdl.chronos.detector.anomaly import ThresholdDetector
  from ...None import op_torch
label_desc: Use image node_id 8 for calling the TestThresholdDetector obj's underlying member method code with example usage: obj.test_corner_cases() without return types