db4b9f4d50af9e83733fc301c32e85cbe6d9c812,conceptnet5/builders/json_to_solr.py,,convert_to_solr,#Any#Any#,12

Before Change



    writer = SolrEdgeWriter(out_stream)
    
    for line in in_stream:
        if not line.strip():
            continue
        info = json.loads(line.strip().decode("utf-8"))
        writer.write(info)
    writer.close()

if __name__ == "__main__":
    convert_to_solr()

After Change


    
    print("{", file=out)
    for info in read_json_stream(input_filename):
        boost = info["weight"]
        if "surfaceText" in info and info["surfaceText"] is None:
            del info["surfaceText"]

        solr_struct = {"doc": info, "boost": boost}
        solr_fragment = "\t"add": %s," % json.dumps(solr_struct)
        print(solr_fragment, file=out)
    print("\t"commit": {}", file=out)
    print("}", file=out)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: commonsense/conceptnet5
Commit Name: db4b9f4d50af9e83733fc301c32e85cbe6d9c812
Time: 2014-02-25
Author: rob@luminoso.com
File Name: conceptnet5/builders/json_to_solr.py
Class Name:
Method Name: convert_to_solr


Project Name: IndicoDataSolutions/finetune
Commit Name: 63bde2f7cf28dbf6bca6e77fe0b0a9966dc6aee6
Time: 2020-05-14
Author: benlt@hotmail.co.uk
File Name: finetune/target_models/document_labeling.py
Class Name: DocumentPipeline
Method Name: _text_to_ids


Project Name: mozilla/bugbug
Commit Name: f16992b25bb153df3ab87c5111db2a101cf68c73
Time: 2020-04-09
Author: mcastelluccio@mozilla.com
File Name: bugbug/models/testselect.py
Class Name: TestSelectModel
Method Name: train_test_split