@app.route('/api/series/<series>/<start_timestamp>/<end_timestamp>/summaries')
def get_series_summaries(series, start_timestamp, end_timestamp):
    summaries = get_series_summaries_impl(series, start_timestamp, end_timestamp)
    # Construct the response in two passes, first sort the data points on the UUID
    # Then denormalize to arrays for each metric
    # Operation -> revision label -> uuid (for ordering) -> metrics as a bloc
    # Then do Operation -> revision label -> metrics as arrays (already sorted)
    byOperation = {}

    for summary in summaries:
        # First get everything sorted by operation, revision label (not actual revision branch/tag,sha), test id
        for stat in summary['stats']:
            if stat not in 'test':
                log.error("stat summary without test key: {}".format(stat['id']))
                continue
            operationStats = byOperation.setdefault(stat['test'], {})
            revisionStats = operationStats.setdefault(stat['label'], OrderedDict())
            revisionStats[uuid.UUID(stat['id'])] = stat
            del stat['test']
            del stat['label']

    # Now flatten the entire thing to arrays for each operation -> revision
    summaries = {}
    for operation in byOperation:
        newOperation = summaries.setdefault(operation, {})

        for revision in byOperation[operation]:
            newRevision = newOperation.setdefault(revision, {})

            for stats in byOperation[operation][revision].itervalues():
                for key, value in stats.iteritems():
                    statsArray = newRevision.setdefault(key, [])
                    if isinstance(value, basestring):
                        statsArray.append(value.split()[0])
                    else:
                        statsArray.append(value)

    # Wrapper object of facilitate adding fields later
    jsobj = { 'summaries' : summaries }

    if 'true' == request.args.get('pretty', 'True').lower():
        response = json.dumps(obj=jsobj, sort_keys=True, indent=4, separators=(',', ': '))
    else:
        response = json.dumps(obj=jsobj)
    return Response(response=response,
                    status=200,
                    mimetype= 'application/json')
dataset/ETHPy150Open datastax/cstar_perf/frontend/cstar_perf/frontend/server/controllers.py/get_series_summaries/swapped operands of `not in`