c12740b64e69e8383144d0f36a138bf033a9b074,anago/data_utils.py,,load_vocab,#Any#,146
Before Change
d = dict()
with open(filename) as f:
for idx, word in enumerate(f):
word = word.strip()
d[word] = idx
return d
After Change
print("Loading vocab...")
with open(filename) as f:
d = {w.rstrip(): i for i, w in enumerate(f)}
print("- done. {} tokens".format(len(d)))
return d
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: Hironsan/anago
Commit Name: c12740b64e69e8383144d0f36a138bf033a9b074
Time: 2017-08-01
Author: light.tree.1.13@gmail.com
File Name: anago/data_utils.py
Class Name:
Method Name: load_vocab
Project Name: quiltdata/quilt
Commit Name: b4cb0c14ebf600daa5573bc90a419eb24329eb55
Time: 2019-06-05
Author: aleksey@residentmar.io
File Name: api/python/quilt3/packages.py
Class Name: Package
Method Name: browse
Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 307156c02e1cde213cffe0daea78992b0db52f38
Time: 2015-08-03
Author: vukasin.stefanovic92@gmail.com
File Name: perfkitbenchmarker/benchmarks/cloudsuite_web_search.py
Class Name:
Method Name: Prepare