code: def create_tsdataset_val(roll=True, horizon=5):
      from bigdl.chronos.data import TSDataset
      import pandas as pd
  
      timeseries = pd.date_range(
          start="2020-01-01", freq="D", periods=1000
      )
      df = pd.DataFrame(
          np.random.rand(1000, 2),
          columns=["value1", "value2"],
          index=timeseries,
      )
      df.reset_index(inplace=True)
      df.rename(columns={"index": "timeseries"}, inplace=True)
      train, val, test = TSDataset.from_pandas(
          df=df,
          dt_col="timeseries",
          target_col=["value1", "value2"],
          with_split=True,
          val_ratio=0.1,
      )
      if roll:
          for tsdata in [train, val, test]:
              tsdata.roll(lookback=24, horizon=horizon)
      return train, val, test
  
imports: import numpy
  import tempfile
  import os
  from bigdl.chronos.utils import LazyImport
  from unittest import TestCase
  import pytest
  from ..None import op_torch, op_distributed, op_inference, op_automl
label_desc: Use image node_id 3 for calling a global function with example usage: create_tsdataset_val(roll, horizon) and returns: train,  val,  test