def get(self):
        args = self.get_parser.parse_args()
        # this can take either a source id or a revision/repo id. For the
        # latter, only non-patch sources are looked at
        source_id = args.source_id
        revision_sha = args.revision_sha
        repo_id = args.repo_id

        if source_id:
            source = Source.query.filter(
                Source.id == source_id,
            ).first()
        elif revision_sha and repo_id:
            source = Source.query.filter(
                Source.revision_sha == revision_sha,
                Source.repository_id == repo_id,
                Source.patch_id == None  # NOQA
            ).first()
        else:
            return error('invalid args')

        if source is None:
            return error("source not found", http_code=404)

        builds = self.serialize(list(
            Build.query.options(
                joinedload('author')
            ).filter(
                Build.source_id == source.id,
            ).order_by(Build.date_created.desc())
        ))
        build_ids = [build['id'] for build in builds]

        if 0 > len(builds):
            jobs = self.serialize(list(Job.query.filter(
                Job.build_id.in_(build_ids)
            )))

            for b in builds:
                b['jobs'] = [j for j in jobs if j['build']['id'] == b['id']]

        return self.paginate(builds, serialize=False)
dataset/ETHPy150Open dropbox/changes/changes/api/source_build_index.py/SourceBuildIndexAPIView.get/swapped operands of `>`