83d80c5a19326a516b4ab54339c27f8cac349693,data_utils/lazy_loader.py,,make_lazy,#Any#Any#Any#,24

Before Change


    if not torch.distributed._initialized or torch.distributed.get_rank() == 0:
        with open(datapath, "w") as f:
            f.write("".join(strs))
        str_ends = list(accumulate(map(len, strs)))
        pkl.dump(str_ends, open(lenpath, "wb"))
    else:
        while not os.path.exists(lenpath):

After Change


    lenpath = os.path.join(lazypath, data_type+".len.pkl")
    if not torch.distributed._initialized or torch.distributed.get_rank() == 0:
        with open(datapath, "wb") as f:
            str_ends = []
            str_cnt = 0
            for s in strs:
                f.write(s.encode("utf-8"))
                str_cnt += len(s)
                str_ends.append(str_cnt)
        pkl.dump(str_ends, open(lenpath, "wb"))
    else:
        while not os.path.exists(lenpath):
            time.sleep(1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: NVIDIA/sentiment-discovery
Commit Name: 83d80c5a19326a516b4ab54339c27f8cac349693
Time: 2018-06-14
Author: raulpuric@berkeley.edu
File Name: data_utils/lazy_loader.py
Class Name:
Method Name: make_lazy


Project Name: pantsbuild/pants
Commit Name: 3b9451ca512dcd204328c8547cdc3a1a986d8b6a
Time: 2015-02-23
Author: stuhood@gmail.com
File Name: src/python/pants/backend/jvm/tasks/ivy_resolve.py
Class Name: IvyResolve
Method Name: execute


Project Name: snipsco/snips-nlu
Commit Name: f782e70c53068bd68ae048957aa1e29ec46b405a
Time: 2018-05-02
Author: adrien.ball@snips.net
File Name: snips_nlu/intent_parser/deterministic_intent_parser.py
Class Name:
Method Name: _get_joined_entity_utterances


Project Name: danforthcenter/plantcv
Commit Name: e628b2e6c566b9dd70d8eab50c00df23bb0cecea
Time: 2020-08-17
Author: noahfahlgren@gmail.com
File Name: plantcv/parallel/multiprocess.py
Class Name:
Method Name: multiprocess