def print_statistics(responses):
    responses_by_status = defaultdict(list)
    for response in responses:
        responses_by_status[str(response.status_code)].append(response.elapsed.total_seconds())

    for status_code, responses in responses_by_status.iteritems():
        count = len(responses)
        elapsed_time = sum(responses) / count
        print "%d requests returned %s status code with average elapsed time: %.2f s" % (count, status_code, elapsed_time)
dataset/ETHPy150Open UFAL-DSG/cloud-asr/benchmarks/benchmark_batch_recognition.py/print_statistics/original