code: def _match_dates(times, dates):
      """Creates a 0-1 dummy variable that marks every instance of dates that also occurs in times.
  
      Args:
        times: a Pandas `DatetimeIndex` for observed data.
        dates: a Pandas `DatetimeIndex` for relevant dates of a single holiday.
  
      Returns:
        regressor: a list the same length as `times`, with a 1 where there is a date
        match, and otherwise 0.
      """
      regressor = [0] * len(times)
      rounded_times = times.floor("d")
      rounded_dates = dates.floor("d")
  
      # TODO(b/195347492): Approximate to the nearest prior day
      # for greater than daily granularity.
      # TODO(b/195347492): Add _MIN_HOLIDAY_OCCURRENCES.
      date_intersection = rounded_times.intersection(
          rounded_dates
      ).unique()
      for date in date_intersection:
          date_slice = rounded_times.get_loc(date)
          regressor_slice = regressor[date_slice]
          if isinstance(regressor_slice, int):
              replacement = 1
          else:
              replacement = [1] * len(regressor[date_slice])
          regressor[date_slice] = replacement
      return regressor
  
label_desc: Use image node_id 5 for calling a global function with example usage: _match_dates(times, dates) and returns: regressor