code: def generate_train_and_test_data(
      prediction_length: int = 1,
      freq: str = "H",
      start_time: pd.Timestamp = "2020-01-05 15:37",
      use_known_covariates: bool = False,
      use_past_covariates: bool = False,
      use_static_features_continuous: bool = False,
      use_static_features_categorical: bool = False,
  ) -> Tuple[TimeSeriesDataFrame, TimeSeriesDataFrame]:
      min_length = prediction_length * 6
      length_per_item = {
          item_id: np.random.randint(min_length, min_length + 10)
          for item_id in ITEM_IDS
      }
      df_per_item = []
      for idx, (item_id, length) in enumerate(length_per_item.items()):
          start = pd.Timestamp(start_time) + (
              idx + 1
          ) * pd.tseries.frequencies.to_offset(freq)
          timestamps = pd.date_range(
              start=start, periods=length, freq=freq
          )
          index = pd.MultiIndex.from_product(
              [(item_id,), timestamps], names=[ITEMID, TIMESTAMP]
          )
          columns = {TARGET_COLUMN: np.random.normal(size=length)}
          if use_known_covariates:
              columns["known_A"] = np.random.randint(0, 10, size=length)
              columns["known_B"] = np.random.normal(size=length)
          if use_past_covariates:
              columns["past_A"] = np.random.randint(0, 10, size=length)
              columns["past_B"] = np.random.normal(size=length)
              columns["past_C"] = np.random.normal(size=length)
          df_per_item.append(pd.DataFrame(columns, index=index))
  
      df = TimeSeriesDataFrame(pd.concat(df_per_item))
  
      if (
          use_static_features_categorical
          or use_static_features_continuous
      ):
          static_columns = {}
          if use_static_features_categorical:
              static_columns["static_A"] = np.random.choice(
                  ["foo", "bar", "bazz"], size=len(ITEM_IDS)
              )
          if use_static_features_continuous:
              static_columns["static_B"] = np.random.normal(
                  size=len(ITEM_IDS)
              )
          static_df = pd.DataFrame(static_columns, index=ITEM_IDS)
          df.static_features = static_df
  
      train_data = df.slice_by_timestep(None, -prediction_length)
      test_data = df
      return train_data, test_data
  
file_path: autogluon/timeseries/tests/smoketests/test_all_models.py
imports: from typing import Tuple
  import numpy
  import pandas
  import pytest
  from pkg_resources import parse_version
  from autogluon.timeseries import TimeSeriesPredictor
  from autogluon.timeseries.dataset.ts_dataframe import ITEMID, TIMESTAMP, TimeSeriesDataFrame
  from autogluon.timeseries.utils.datetime.seasonality import DEFAULT_SEASONALITIES
label_desc: Use image node_id 1 for calling a global function with example usage: generate_train_and_test_data(prediction_length, freq, start_time, use_known_covariates, use_past_covariates, use_static_features_continuous, use_static_features_categorical) and returns: train_data,  test_data