code: def data_split(df, start, end, target_date_col="date"):
      """
      split the dataset into training or testing using date
      :param data: (df) pandas dataframe, start, end
      :return: (df) pandas dataframe
      """
      data = df[
          (df[target_date_col] >= start) & (df[target_date_col] < end)
      ]
      data = data.sort_values(
          [target_date_col, "tic"], ignore_index=True
      )
      data.index = data[target_date_col].factorize()[0]
      return data
  
imports: from __future__ import annotations
  import datetime
  from multiprocessing.sharedctypes import Value
  import numpy
  import pandas
  from stockstats import StockDataFrame
  from finrl import config
  from finrl.meta.preprocessor.yahoodownloader import YahooDownloader
label_desc: Use image node_id 2 for calling a global function with example usage: data_split(df, start, end, target_date_col) and returns: data