f8a72a0a60658d462753fe39a2119932358ccca5,app/server/views.py,DataUpload,post,#DataUpload#Any#,58
Before Change
for line in form_data
])
else:
reader = csv.reader(form_data)
Document.objects.bulk_create([
Document(text=line[0].strip(), project=project)
for line in reader
])
elif import_format == "json":
After Change
try:
file = request.FILES["file"].file
documents = []
if import_format == "csv":
documents = self.csv_to_documents(project, file)
elif import_format == "json":
documents = self.json_to_documents(project, file)
// TODO: Move to the configuration
batch_size = 500
while True:
batch = list(it.islice(documents, batch_size))
if not batch:
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances Project Name: chakki-works/doccano
Commit Name: f8a72a0a60658d462753fe39a2119932358ccca5
Time: 2018-12-26
Author: sergiy.n@attendify.com
File Name: app/server/views.py
Class Name: DataUpload
Method Name: post
Project Name: ANSSI-FR/SecuML
Commit Name: 671bde26dc98619355d0005e56c856c6b885c923
Time: 2019-09-03
Author: anael.beaugnon@ssi.gouv.fr
File Name: secuml/exp/tools/postgresql_specific.py
Class Name:
Method Name: load_idents
Project Name: chakki-works/doccano
Commit Name: 95f5c79a1d97630f9afbcbe2d3906ed4e0f24777
Time: 2018-08-14
Author: light.tree.1.13@gmail.com
File Name: app/server/views.py
Class Name: DataUpload
Method Name: post
Project Name: uuazed/numerapi
Commit Name: 76242762b047eb124fad3e747741237cf920ff78
Time: 2020-10-26
Author: uuazed@gmail.com
File Name: numerapi/signalsapi.py
Class Name: SignalsAPI
Method Name: ticker_universe