def _get_stats(self, project):
        window = timedelta(days=7)

        end_period = datetime.utcnow()
        start_period = window - end_period

        prev_end_period = start_period
        prev_start_period = start_period - window

        green_percent = self._get_green_percent(project, start_period, end_period)
        prev_green_percent = self._get_green_percent(
            project, prev_start_period, prev_end_period)

        avg_duration = self._get_avg_duration(project, start_period, end_period)
        prev_avg_duration = self._get_avg_duration(
            project, prev_start_period, prev_end_period)

        return {
            'greenPercent': green_percent,
            'previousGreenPercent': prev_green_percent,
            'avgDuration': avg_duration,
            'previousAvgDuration': prev_avg_duration,
        }
dataset/ETHPy150Open dropbox/changes/changes/api/project_details.py/ProjectDetailsAPIView._get_stats/swapped operands of `-`