code: def test_to_real_series():
      p = np.arange(20)  # highly overlapping case
      step = 2
      width = 5
      s = util.segmented_prediction_to_series(
          p, step, width, categorical_target=False
      )
      assert len(s) == (len(p) - 1) * step + width
      assert np.all(s <= max(p))
      assert np.all(s >= min(p))
  
      p = np.arange(10)
      step = 3
      width = 2
      s = util.segmented_prediction_to_series(
          p, step, width, categorical_target=False
      )
      assert len(s) == (len(p) - 1) * step + width
      assert np.all(s <= max(p))
      assert np.all(s >= min(p))
  
      p = np.arange(5)
      p = np.column_stack([p, p])
      step = 2
      width = 5
      s = util.segmented_prediction_to_series(
          p, step, width, categorical_target=False
      )
      assert len(s) == (len(p) - 1) * step + width
      assert s.shape[1] == 2
      assert np.all(s <= np.max(p))
      assert np.all(s >= np.min(p))
  
imports: import numpy
  from seglearn.datasets import load_watch
  from seglearn.base import TS_Data
  from seglearn import util
label_desc: Use image node_id 3 for calling a global function with example usage: test_to_real_series() without return types