コード例 #1
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)
コード例 #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)
コード例 #3
0
ファイル: io_test.py プロジェクト: 50417/DeepFuzzSL
def test_pprint():
    out = StringIO()
    io.pprint({"foo": 1, "bar": "baz"}, file=out)
    assert '{\n  "bar": "baz",\n  "foo": 1\n}' == out.getvalue().strip()
コード例 #4
0
ファイル: test_io.py プロジェクト: ChrisCummins/phd
 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())