e39f75d7fd34b3da79068e2936849a16fdfced06,jarbas/core/management/commands/loaddatasets.py,Command,documents,#Command#,28
Before Change
def documents(self):
Load datasets and return a dict similar to model Document
suffixes = ("current-year", "last-year", "previous-years")
for url in map(self.get_url, suffixes) :
print("Loading " + url)
with NamedTemporaryFile() as tmp:
urlretrieve(url, filename=tmp.name)
After Change
with NamedTemporaryFile() as tmp:
urlretrieve(url, filename=tmp.name)
with lzma.open(tmp.name, mode="rt") as file_handler:
for index, row in enumerate(csv.DictReader(file_handler)):
row["source"] = suffix
row["line"] = index + 1
yield row
def selected_documents(self, start, limit):
documents = map(self.serialize, self.documents())
for count, document in enumerate(documents):
loaded = self.updated + self.created
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: okfn-brasil/serenata-de-amor
Commit Name: e39f75d7fd34b3da79068e2936849a16fdfced06
Time: 2016-09-06
Author: cuducos@gmail.com
File Name: jarbas/core/management/commands/loaddatasets.py
Class Name: Command
Method Name: documents
Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 57093f504c933132bd403add1ed75a16123f5bc2
Time: 2015-09-16
Author: skschneider@google.com
File Name: perfkitbenchmarker/vm_util.py
Class Name:
Method Name: RunParallelProcesses
Project Name: openai/baselines
Commit Name: b71152eea0470ac2629c33e0fc66a54fe494949f
Time: 2018-02-26
Author: matthiasplappert@me.com
File Name: baselines/common/vec_env/dummy_vec_env.py
Class Name: DummyVecEnv
Method Name: step_wait