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

Before Change


    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"]
        }

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 = []
    for query in query_list:
        search_kwargs = dict(kwargs, body=query, doc_type=doc_type,
                             size=ELASTICSEARCH_SEARCH_SIZE, index=index_name, scroll="1m")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

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: arviz-devs/arviz
Commit Name: cc5259cbd55d5cc14e7e9581210b3f5ad9cc5005
Time: 2018-06-22
Author: ari.hartikainen@aalto.fi
File Name: arviz/utils/xarray_utils.py
Class Name:
Method Name: default_varnames_coords_dims


Project Name: arviz-devs/arviz
Commit Name: cc5259cbd55d5cc14e7e9581210b3f5ad9cc5005
Time: 2018-06-22
Author: ari.hartikainen@aalto.fi
File Name: arviz/utils/xarray_utils.py
Class Name:
Method Name: pystan_varnames_coords_dims