code: def add_event_window(
      df,
      time_col,
      label_col,
      time_delta="1D",
      pre_num=1,
      post_num=1,
      events_name="",
  ):
      """For a data frame of events with a time_col and label_col
          it adds shifted events
          prior and after the given events
          For example if the event data frame includes the row
              '2019-12-25, Christmas'
          the function will produce dataframes with the events:
              '2019-12-24, Christmas' and '2019-12-26, Christmas'
          if pre_num and post_num are 1 or more.
      :param df: pd.DataFrame
          the events data frame with two columns 'time_col' and 'label_col'
      :param time_col: str
          The column with the timestamp of the events.
          This can be daily but does not have to
      :param label_col: str
          the column with labels for the events
      :param time_delta: str
          the amount of the shift for each unit specified by a string
          e.g. "1D" stands for one day delta
      :param pre_num: int
          the number of events to be added prior to the given event for each event in df
      :param post_num: int
          the number of events to be added after to the given event for each event in df
      :param events_name: str
          for each shift, we generate a new data frame
          and those data frames will be stored in a dictionary with appropriate keys.
          Each key starts with "events_name"
          and follow up with:
              "_minus_1", "_minus_2", "_plus_1", "_plus_2", ...
          depending on pre_num and post_num
      :return: dict[key: pd.Dataframe]
          A dictionary of dataframes for each needed shift.
          For example if pre_num=2 and post_num=3.
          2 + 3 = 5 data frames will be stored in the return dictionary.
      """
  
      df_dict = {}
      pd_time_delta = pd.to_timedelta(time_delta)
      for num in range(pre_num):
          df0 = pd.DataFrame()
          df0[time_col] = df[time_col] - (num + 1) * pd_time_delta
          df0[label_col] = df[label_col]
          df_dict[events_name + "_minus_" + f"{(num + 1):.0f}"] = df0
  
      for num in range(post_num):
          df0 = pd.DataFrame()
          df0[time_col] = df[time_col] + (num + 1) * pd_time_delta
          df0[label_col] = df[label_col]
          df_dict[events_name + "_plus_" + f"{(num + 1):.0f}"] = df0
  
      return df_dict
  
imports: import math
  from datetime import datetime
  from datetime import timedelta
  import numpy
  import pandas
  import pytz
  from holidays_ext import get_holidays
  from pandas.tseries.frequencies import to_offset
  from scipy.special import expit
  from greykite.common import constants
  from greykite.common.python_utils import split_offset_str
label_desc: Use image node_id 16 for calling a global function with example usage: add_event_window(df, time_col, label_col, time_delta, pre_num, post_num, events_name) and returns: df_dict