code: def add_custom_calendar_timedelta(input, timedelta, freq):
      """
      Add timedelta to 'input' taking into consideration custom frequency, which
      is used to deal with custom calendars, such as a trading calendar
  
      Parameters
      ----------
      input : pd.DatetimeIndex or pd.Timestamp
      timedelta : pd.Timedelta
      freq : pd.DataOffset (CustomBusinessDay, Day or BusinessDay)
  
      Returns
      -------
      pd.DatetimeIndex or pd.Timestamp
          input + timedelta
      """
      if not isinstance(freq, (Day, BusinessDay, CustomBusinessDay)):
          raise ValueError(
              "freq must be Day, BDay or CustomBusinessDay"
          )
      days = timedelta.components.days
      offset = timedelta - pd.Timedelta(days=days)
      return input + freq * days + offset
  
imports: import pandas
  import numpy
  import re
  import warnings
  from IPython.display import display
  from pandas.tseries.offsets import CustomBusinessDay, Day, BusinessDay
  from scipy.stats import mode
label_desc: Use image node_id 16 for calling a global function with example usage: add_custom_calendar_timedelta(input, timedelta, freq) and returns: unknown