code: def split_considering_timestamp(
      df, n_lags, n_forecasts, inputs_overbleed, threshold_time_stamp
  ):
      """Splits timeseries into train and validation sets according to given threshold_time_stamp.
  
      Parameters
      ----------
          df : pd.DataFrame
              data with column ``ds``, ``y``, and ``ID``
          n_lags : int
              identical to NeuralProphet
          n_forecasts : int
              identical to NeuralProphet
          inputs_overbleed : bool
              Whether to allow last training targets to be first validation inputs (never targets)
          threshold_time_stamp : str
              time stamp boundary that defines splitting of data
  
      Returns
      -------
          pd.DataFrame, dict
              training data
          pd.DataFrame, dict
              validation data
      """
      df_train = pd.DataFrame()
      df_val = pd.DataFrame()
      for df_name, df_i in df.groupby("ID"):
          if df[df["ID"] == df_name]["ds"].max() < threshold_time_stamp:
              df_train = pd.concat(
                  (df_train, df_i.copy(deep=True)), ignore_index=True
              )
          elif (
              df[df["ID"] == df_name]["ds"].min() > threshold_time_stamp
          ):
              df_val = pd.concat(
                  (df_val, df_i.copy(deep=True)), ignore_index=True
              )
          else:
              df_aux = df_i.copy(deep=True)
              n_train = len(df_aux[df_aux["ds"] < threshold_time_stamp])
              split_idx_train = n_train + n_lags + n_forecasts - 1
              split_idx_val = (
                  split_idx_train - n_lags
                  if inputs_overbleed
                  else split_idx_train
              )
              df_train = pd.concat(
                  (df_train, df_aux.iloc[:split_idx_train]),
                  ignore_index=True,
              )
              df_val = pd.concat(
                  (df_val, df_aux.iloc[split_idx_val:]),
                  ignore_index=True,
              )
      return df_train, df_val
  
imports: from __future__ import annotations
  import logging
  import math
  from collections import OrderedDict
  from dataclasses import dataclass
  from typing import TYPE_CHECKING, List, Optional, Tuple
  import numpy
  import pandas
label_desc: Use image node_id 18 for calling a global function with example usage: split_considering_timestamp(df, n_lags, n_forecasts, inputs_overbleed, threshold_time_stamp) and returns: df_train,  df_val