6140cbd632d9e5c835cb6feaf3f7f7420facbe47,datastore/elastic_search/query.py,,get_dictionary_records,#Any#Any#Any#Any#Any#,88

Before Change


    search_results = _run_es_search(connection, **kwargs)

    // Parse hits
    results_dictionary = {}
    results = search_results["hits"]["hits"]
    for result in results:
        results_dictionary.setdefault(result["_source"]["value"], {})
        results_dictionary[result["_source"]["value"]][result["_source"]["language_script"]] = {
            "_id": result["_id"],
            "value": result["_source"]["variants"]
        }

    return results_dictionary


def dictionary_unique_words(connection, index_name, doc_type, entity_name, **kwargs):

After Change



    query_list = []
    if word_list is not None:
        word_list_chunks = [word_list[i:i + 500] for i in xrange(0, len(word_list), 500)]
        for chunk in word_list_chunks:
            updated_query = copy.deepcopy(data)
            updated_query["query"]["bool"]["must"].append({
                "terms": {
                    "value.keyword": chunk
                }
            })
            query_list.append(updated_query)
    else:
        query_list.append(data)

    results = []
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: hellohaptik/chatbot_ner
Commit Name: 6140cbd632d9e5c835cb6feaf3f7f7420facbe47
Time: 2019-01-13
Author: jatin.parekh@haptik.co
File Name: datastore/elastic_search/query.py
Class Name:
Method Name: get_dictionary_records


Project Name: eth-cscs/reframe
Commit Name: ba058676b504f7456f6e4015e9697b179f791336
Time: 2018-03-08
Author: samuel.omlin@cscs.ch
File Name: reframe/frontend/statistics.py
Class Name: TestStats
Method Name: __init__


Project Name: arnomoonens/yarll
Commit Name: 8f2980e1747617c309a61be2882fa7674782492e
Time: 2017-03-31
Author: x-006@hotmail.com
File Name: knowledge_transfer.py
Class Name: KnowledgeTransferLearner
Method Name: __init__