2a6a32e3ec6be921eef5d4bb4d905a9f22a309c0,inference.py,,inference,#,169

Before Change


        index = None

    if index is None and include_blacklisted:
        try:
            index = answers_rate.index(0)
            score = 0
        except:
            index = 0
            score = -1

    if index is None:
        index = 0
        score = -1

After Change


    answers = replace_in_answers(answers, "answers")
    answers_score = score_answers(answers, "answers")

    best_index, best_score = get_best_score(answers_score, include_blacklisted)

    return {"answers": answers, "scores": answers_score, "best_index": best_index, "best_score": best_score}
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: daniel-kukiela/nmt-chatbot
Commit Name: 2a6a32e3ec6be921eef5d4bb4d905a9f22a309c0
Time: 2017-12-03
Author: daniel@kukiela.pl
File Name: inference.py
Class Name:
Method Name: inference


Project Name: autonomio/talos
Commit Name: a5cf5911849412e56788324fddb989eec0d56978
Time: 2019-03-11
Author: mailme@mikkokotila.com
File Name: talos/commands/kerasmodel.py
Class Name: KerasModel
Method Name: _create_input_model


Project Name: tensorflow/cleverhans
Commit Name: 68fe96add85bd842df23569dde490e1694d256fe
Time: 2019-06-21
Author: siarheisiniak@yahoo.com
File Name: cleverhans/model_zoo/deep_k_nearest_neighbors/dknn.py
Class Name: DkNNModel
Method Name: find_train_knns