code: def convert_events_to_features(
      df, config_events: ConfigEvents, events_df
  ):
      """
      Converts events information into binary features of the df
  
      Parameters
      ----------
          df : pd.DataFrame
              Dataframe with columns ``ds`` datestamps and ``y`` time series values
          config_events : configure.ConfigEvents
              User specified events configs
          events_df : pd.DataFrame
              containing column ``ds`` and ``event``
  
      Returns
      -------
          pd.DataFrame
              input df with columns for user_specified features
      """
  
      for event in config_events.keys():
          event_feature = pd.Series(
              0, index=range(df.shape[0]), dtype="float32"
          )
          # events_df may be None in case ID from original df is not provided in events df
          if events_df is None:
              dates = None
          else:
              dates = events_df[events_df.event == event].ds
              df.reset_index(drop=True, inplace=True)
              event_feature[df.ds.isin(dates)] = 1.0
          df[event] = event_feature
      return df
  
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 21 for calling a global function with example usage: convert_events_to_features(df, config_events, events_df) and returns: df