def get(self):
        def process_row(agg, jobstep):
            status = jobstep.status.name
            count, date_created, jobstep_id = agg.get(status, (0, None, None))
            count += 1

            # Track the oldest jobstep we've seen.
            if date_created is None or jobstep.date_created < date_created:
                date_created = jobstep.date_created
                jobstep_id = jobstep.id
            agg[status] = (count, date_created, jobstep_id)

        jobsteps = JobStep.query.filter(
            JobStep.status.in_(
                [Status.pending_allocation, Status.queued, Status.in_progress]),
        )

        by_cluster, by_project = defaultdict(dict), defaultdict(dict)
        by_global = {}
        for jobstep in jobsteps:
            process_row(by_cluster[jobstep.cluster], jobstep)
            process_row(by_project[jobstep.project.slug], jobstep)
            process_row(by_global, jobstep)

        output = {
            'jobsteps': {
                'by_cluster': by_cluster,
                'by_project': by_project,
                'global': by_global,
            },
        }
        return self.respond(output)
Encrypt the passed-in bytes.
dataset/ETHPy150Open dropbox/changes/changes/api/jobstep_aggregate_by_status.py/JobStepAggregateByStatusAPIView.get--crossover with--dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/tlslite/utils/RSAKey.py/RSAKey.encrypt