code: def test_series(testCase):
      """Test the detector on series."""
      if len(testCase["df"]) == 1:
          s = pd.DataFrame(
              testCase["df"][0],
              pd.date_range(
                  start="2017-1-1",
                  periods=len(testCase["df"][0]),
                  freq="D",
              ),
          )
          model = testCase["model"](**testCase["params"])
          a_true = pd.Series(testCase["a"], index=s.index)
          if isinstance(model, _TrainableModel):
              a = model.fit_detect(s)
          else:
              a = model.detect(s)
          pd.testing.assert_series_equal(a, a_true, check_dtype=False)
  
file_path: adtk/tests/test_detectorhd.py
imports: from math import isnan
  import numpy
  import pandas
  import pytest
  from sklearn.cluster import KMeans
  from sklearn.ensemble import IsolationForest
  from sklearn.linear_model import LinearRegression
  from sklearn.neighbors import LocalOutlierFactor
  import adtk.detector
  from adtk._base import _TrainableModel
label_desc: Use image node_id 3 for calling a global function with example usage: test_series(testCase) without return types