def featurize_holidays(history,
                       holidays_df):
  """Function to obtain holiday features as dummy variables to use as external 
  regressors.
   
  Parameters
  ----------
  history: pd dataframe to get holiday features for
  holidays_df: pd dataframe containing dt and holiday columns to featurize
   
  Returns
  -------
  pd dataframe of dummy variables for each holiday for the dts in history."""
  
  holidays_featurized = history[['dt']]
  unique_holidays = list(set(holidays_df['holiday']))
  
  for hday in unique_holidays:
   
    holiday_dts = holidays_df[holidays_df['holiday'] == hday] 
    holidays_featurized[hday] = [int(dt in holiday_dts['dt'].to_list())
                                 for dt in holidays_featurized['dt']]
    
  return holidays_featurized