'Selects the requested data for each date.
Parameters
zero_qtr_data : pd.DataFrame
The \'time zero\' data for each calendar date per sid.
zeroth_quarter_idx : pd.Index
An index of calendar dates, sid, and normalized quarters, for only
the rows that have a next or previous earnings estimate.
stacked_last_per_qtr : pd.DataFrame
The latest estimate known with the dates, normalized quarter, and
sid as the index.
num_announcements : int
The number of annoucements out the user requested relative to
each date in the calendar dates.
dates : pd.DatetimeIndex
The calendar dates for which estimates data is requested.
Returns
requested_qtr_data : pd.DataFrame
The DataFrame with the latest values for the requested quarter
for all columns; `dates` are the index and columns are a MultiIndex
with sids at the top level and the dataset columns on the bottom.'

def get_requested_quarter_data(self, zero_qtr_data, zeroth_quarter_idx, stacked_last_per_qtr, num_announcements, dates):

    zero_qtr_data_idx = zero_qtr_data.index
    requested_qtr_idx = pd.MultiIndex.from_arrays([zero_qtr_data_idx.get_level_values(0), zero_qtr_data_idx.get_level_values(1), self.get_shifted_qtrs(zeroth_quarter_idx.get_level_values(NORMALIZED_QUARTERS), num_announcements)], names=[zero_qtr_data_idx.names[0], zero_qtr_data_idx.names[1], SHIFTED_NORMALIZED_QTRS])
    requested_qtr_data = stacked_last_per_qtr.loc[requested_qtr_idx]
    requested_qtr_data = requested_qtr_data.reset_index(SHIFTED_NORMALIZED_QTRS)
    (requested_qtr_data[FISCAL_YEAR_FIELD_NAME], requested_qtr_data[FISCAL_QUARTER_FIELD_NAME]) = split_normalized_quarters(requested_qtr_data[SHIFTED_NORMALIZED_QTRS])
    return requested_qtr_data.unstack(SID_FIELD_NAME).reindex(dates)
