5cdaba577a38dece1d2f330e87b72616a8e5f5a9,tests/utils/test_evaluate_from_file.py,,test_load_textfiles,#,6

Before Change


    params = load_parameters()
    filename = params["DATA_ROOT_PATH"] + params["TEXT_FILES"]["val"] + params["TRG_LAN"]
    hyp = open(filename, "r")
    refs, hypo = load_textfiles([open(filename, "r")], hyp)
    assert isinstance(refs, dict)
    assert isinstance(hypo, dict)
    assert refs == hypo

After Change


    params = load_parameters()
    filename = params["DATA_ROOT_PATH"] + params["TEXT_FILES"]["val"] + params["TRG_LAN"]
    hyp = codecs.open(filename, "r", encoding="utf-8")
    refs, hypo = load_textfiles([codecs.open(filename, "r", encoding="utf-8").readlines()], hyp)
    assert isinstance(refs, dict)
    assert isinstance(hypo, dict)
    assert refs == hypo
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: lvapeab/nmt-keras
Commit Name: 5cdaba577a38dece1d2f330e87b72616a8e5f5a9
Time: 2018-10-08
Author: lvapeab@gmail.com
File Name: tests/utils/test_evaluate_from_file.py
Class Name:
Method Name: test_load_textfiles


Project Name: lvapeab/nmt-keras
Commit Name: 5cdaba577a38dece1d2f330e87b72616a8e5f5a9
Time: 2018-10-08
Author: lvapeab@gmail.com
File Name: tests/utils/test_evaluate_from_file.py
Class Name:
Method Name: test_CocoScore


Project Name: CyberZHG/keras-bert
Commit Name: 5647a8917d340d44d90b952be682678ba33d33a7
Time: 2019-01-27
Author: CyberZHG@gmail.com
File Name: setup.py
Class Name:
Method Name: