def _downloads_for_num_days(self, num_days):
logger.debug("<STR_LIT>", num_days)<EOL>dates = self.cache_dates<EOL>logger.debug("<STR_LIT>", len(dates))<EOL>if len(dates) > num_days:<EOL><INDENT>dates = dates[(-<NUM_LIT:1> * num_days):]<EOL><DEDENT>logger.debug("<STR_LIT>", len(dates))<EOL>dl_sum = <NUM_LIT:0><EOL>for cache_date in dates:<EOL><INDENT>data = self._cache_get(cache_date)<EOL>dl_sum += sum(data['<STR_LIT>'].values())<EOL><DEDENT>logger.debug("<STR_LIT>", dl_sum)<EOL>return dl_sum, len(dates)<EOL>
Given a number of days of historical data to look at (starting with
today and working backwards), return the total number of downloads
for that time range, and the number of days of data we had (in cases
where we had less data than requested).

:param num_days: number of days of data to look at
:type num_days: int
:return: 2-tuple of (download total, number of days of data)
:rtype: tuple