def process():
    data = json.load(open("./raw.json"))

    ratios = get_ratios(data)
    allkeys = get_all_keys(ratios)

    out = {}
    for benchmark in ratios:
        ic = ratios[benchmark]
        out[benchmark] = {}
        for key in allkeys:
            if key not in ic:
                out[benchmark][key] = 0
            else:
                out[benchmark][key] = ic[key]

    io.pprint(out)
Example #2
0
def process():
    data = json.load(open("./raw.json"))

    ratios = get_ratios(data)
    allkeys = get_all_keys(ratios)

    out = {}
    for benchmark in ratios:
        ic = ratios[benchmark]
        out[benchmark] = {}
        for key in allkeys:
            if key not in ic:
                out[benchmark][key] = 0
            else:
                out[benchmark][key] = ic[key]

    io.pprint(out)
Example #3
0
def test_pprint():
    out = StringIO()
    io.pprint({"foo": 1, "bar": "baz"}, file=out)
    assert '{\n  "bar": "baz",\n  "foo": 1\n}' == out.getvalue().strip()
Example #4
0
 def test_pprint(self):
     out = StringIO()
     io.pprint({"foo": 1, "bar": "baz"}, file=out)
     self._test('{\n  "bar": "baz",\n  "foo": 1\n}', out.getvalue().strip())