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