code: def test_chunking_multivariate_continuous():
      # create some dummy data
      hz_series = pd.Series(
          index=pd.date_range(
              datetime.now(), periods=10_000, freq="1s"
          ),
          data=np.ones(10_000),
      ).rename("1hz_series")
  
      twohz_series = pd.Series(
          index=pd.date_range(
              datetime.now(), periods=20_000, freq="500ms"
          ),
          data=np.ones(20_000),
      ).rename("2hz_series")
      out = chunk_data(
          data=[hz_series, twohz_series],
          fs_dict={"1hz_series": 1, "2hz_series": 2},
          copy=True,
      )
  
      assert len(out) == 1
      assert len(out[0][0]) == 10_000
      assert len(out[0][1]) == 20_000
  
      # as we've returned a copy -> we should not change the original series
      out[0][0][:10] = 0
      assert all(hz_series == 1)
  
      # --------- SUB CHUNKS ------------
      # test the sub_chunk_maring and max_chunk duration
      out = chunk_data(
          data=[hz_series, twohz_series],
          fs_dict={"1hz_series": 1, "2hz_series": 2},
          copy=True,
          max_chunk_dur="1hour",
          sub_chunk_overlap="30s",
          verbose=True,
      )
  
      # 166 minutes of data -> 3*60 = 180 and is smaller than 166
      assert len(out) == 3
      # assert that, for the middle part -> the sub-chunk time-range ~= 30
      assert out[1][1].index[-1] - out[1][1].index[0] - pd.Timedelta(
          "1hour 1min"
      ) < pd.Timedelta("1second")
      # last start minus earliest stop must be ~= 2 times sub_chunk_overlap_s i.e. 1 min
      assert out[0][1].index[-1] - out[1][0].index[0] - pd.Timedelta(
          "1min"
      ) < pd.Timedelta("1sec")
  
      # --------- SUB CHUNKS ------------
      # test the sub_chunk_marging and max_chunk duration & min_chunk_duration
      # everything should remain the same
      out = chunk_data(
          data=[hz_series, twohz_series],
          fs_dict={"1hz_series": 1, "2hz_series": 2},
          copy=True,
          max_chunk_dur="3600s",
          sub_chunk_overlap="30s",
          min_chunk_dur="30s",
          verbose=True,
      )
  
      # 166 minutes of data -> 3*60 = 180 and is smaller than 166
      assert len(out) == 3
      # assert that, for the middle part -> the sub-chunk time-range ~= 30
      assert out[1][1].index[-1] - out[1][1].index[0] - pd.Timedelta(
          "1hour 1min"
      ) < pd.Timedelta("1second")
      # last start minus earliest stop must be ~= 2 times sub_chunk_overlap_s i.e. 1 min
      assert out[0][1].index[-1] - out[1][0].index[0] - pd.Timedelta(
          "1min"
      ) < pd.Timedelta("1sec")
  
file_path: tsflex/tests/test_chunking.py
imports: from datetime import datetime
  import numpy
  import pandas
  import pytest
  from tsflex.chunking import chunk_data
label_desc: Use image node_id 5 for calling a global function with example usage: test_chunking_multivariate_continuous() without return types