24d3656c6c4b3c6806954487720d53af775a1150,set_expansion_demo/ui/main.py,,get_phrases,#Any#,30

Before Change


        print("sending a get_vocab request")
        sock.sendall(bytes("get_vocab" + "\n", "utf-8"))
        // Receive data from the server and shut down
        data = b""
        while True:
            packet = sock.recv(4096)
            if not packet:
                break
            data += packet
        received = pickle.loads(data)
        all_phrases.extend(received)
        print("vocab len = " + str(len(all_phrases)))
        // print("Received: {}".format(received))

    finally:

After Change


    // all_phrases.extend(x for x in received if len(x) < max_phrase_length)
    all_phrases=received
    for p in all_phrases:
        if len(p) < max_phrase_length:
            all_phrases_dict[p] = p
            all_cut_phrases_dict[p] = p
        else:
            all_phrases_dict[p] = p[:max_phrase_length] + "..."
            all_cut_phrases_dict[p[:max_phrase_length] + "..."] = p
    print("done. vocab count = " + str(len(all_phrases)))
    // pp = pprint.PrettyPrinter()
    // pp.pprint(all_phrases_dict)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: NervanaSystems/nlp-architect
Commit Name: 24d3656c6c4b3c6806954487720d53af775a1150
Time: 2018-06-07
Author: shira.guskin@intel.com
File Name: set_expansion_demo/ui/main.py
Class Name:
Method Name: get_phrases


Project Name: OpenNMT/OpenNMT-py
Commit Name: 0b2fd0f6ac45feda4eb2ccd92cc7b15b279a448a
Time: 2017-08-10
Author: benzurdopeters@gmail.com
File Name: onmt/Models.py
Class Name: Embeddings
Method Name: __init__


Project Name: OpenMined/PySyft
Commit Name: 5efaf25f5499c7065f1c37bfd4288159714406d8
Time: 2020-08-12
Author: vova@promail.spb.ru
File Name: src/syft/lib/torch/uppercase_tensor.py
Class Name: TorchTensorWrapper
Method Name: _data_object2proto