code: def test_nan():
      s = pd.Series(
          [1, 1, 0, 0, 0, np.nan, 1, 1, np.nan, np.nan, 0, 1],
          index=pd.date_range(start="2017-1-1", periods=12, freq="D"),
      )
      anomaly_list = to_events(s)
      anomaly_list_true = [
          (
              Timestamp("2017-01-01 00:00:00"),
              Timestamp("2017-01-02 23:59:59.999999999"),
          ),
          (
              Timestamp("2017-01-07 00:00:00"),
              Timestamp("2017-01-08 23:59:59.999999999"),
          ),
          (
              Timestamp("2017-01-12 00:00:00"),
              Timestamp("2017-01-12 23:59:59.999999999"),
          ),
      ]
      assert anomaly_list == anomaly_list_true
  
file_path: adtk/tests/test_label_list_convert.py
imports: import numpy
  import pandas
  from pandas import Timestamp
  from adtk.data import to_events, to_labels
label_desc: Use image node_id 7 for calling a global function with example usage: test_nan() without return types