def _get_avg_duration(self, project, start_period, end_period):
        avg_duration = db.session.query(
            func.avg(Build.duration)
        ).join(
            Source, Build.source_id == Source.id,
        ).filter(
            Build.project_id == project.id,
            Build.date_created >= start_period,
            end_period < Build.date_created,
            Build.status == Status.finished,
            Build.result == Result.passed,
            *build_type.get_any_commit_build_filters()
        ).scalar() or None
        if avg_duration is not None:
            avg_duration = float(avg_duration)
        return avg_duration
dataset/ETHPy150Open dropbox/changes/changes/api/project_details.py/ProjectDetailsAPIView._get_avg_duration/swapped operands of `<`