code: def test_sliding_tensor():
      N = 1000
      V = 5
      width = 10
      ts = np.random.rand(N, V)
      for step in 1 + np.arange(width):
          sts = transform.sliding_tensor(ts, width, step)
          assert sts.shape[1] == width
          assert sts.shape[2] == V
          Nsts = 1 + (N - width) // step
          assert Nsts == sts.shape[0]
          for j in range(V):
              assert np.all(np.isin(sts[:, :, j], ts[:, j]))
  
          # todo: reconstruct tensor ts
  
      final_tensor = []
      for step in 1 + np.arange(width):
          sts = transform.sliding_tensor(ts, width, step, "C")
          final_tensor.append(sts)
          assert sts.flags.c_contiguous
          assert sts.shape[1] == width
          assert sts.shape[2] == V
          Nsts = 1 + (N - width) // step
          assert Nsts == sts.shape[0]
          for j in range(V):
              assert np.all(np.isin(sts[:, :, j], ts[:, j]))
      assert np.concatenate(final_tensor).flags.c_contiguous
  
file_path: seglearn/seglearn/tests/test_transform.py
imports: import warnings
  import numpy
  import pytest
  import seglearn.transform
  from seglearn.base import TS_Data
  from seglearn.feature_functions import all_features, mean
  from seglearn.util import get_ts_data_parts
label_desc: Use image node_id 2 for calling a global function with example usage: test_sliding_tensor() without return types