def extract_interesting_date_ranges(returns):
returns_dupe = returns.copy()<EOL>returns_dupe.index = returns_dupe.index.map(pd.Timestamp)<EOL>ranges = OrderedDict()<EOL>for name, (start, end) in PERIODS.items():<EOL><INDENT>try:<EOL><INDENT>period = returns_dupe.loc[start:end]<EOL>if len(period) == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>ranges[name] = period<EOL><DEDENT>except BaseException:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>return ranges<EOL>
Extracts returns based on interesting events. See
gen_date_range_interesting.

Parameters
----------
returns : pd.Series
    Daily returns of the strategy, noncumulative.
     - See full explanation in tears.create_full_tear_sheet.

Returns
-------
ranges : OrderedDict
    Date ranges, with returns, of all valid events.