49d41416e440926f0a9a8243b4d77f6f5468efe9,app/server/utils.py,JsonHandler,parse,#JsonHandler#Any#,242
Before Change
def parse(self, file):
for i, line in enumerate(file, start=1):
try:
j = json.loads(line)
j["meta"] = json.dumps(j.get("meta", {}))
yield j
except json.decoder.JSONDecodeError:
raise FileParseException(line_num=i, line=line)
def render(self):
After Change
batch = list(itertools.islice(file, IMPORT_BATCH_SIZE))
if not batch:
raise StopIteration
yield [{"text": line.strip()} for line in batch]
class CSVParser(FileParser):
Uploads csv file.
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances
Project Name: chakki-works/doccano
Commit Name: 49d41416e440926f0a9a8243b4d77f6f5468efe9
Time: 2019-03-12
Author: light.tree.1.13@gmail.com
File Name: app/server/utils.py
Class Name: JsonHandler
Method Name: parse
Project Name: tensorflow/datasets
Commit Name: 52ba3c53fdeb5806b3626b873eefabf8c065d9d4
Time: 2019-05-21
Author: adarob@google.com
File Name: tensorflow_datasets/text/squad.py
Class Name: Squad
Method Name: _generate_examples
Project Name: HazyResearch/fonduer
Commit Name: 9f77853cb41262368b956859dbd8e98800ec374d
Time: 2018-12-18
Author: SenWu@users.noreply.github.com
File Name: src/fonduer/parser/preprocessors/text_doc_preprocessor.py
Class Name: TextDocPreprocessor
Method Name: _parse_file
Project Name: shibing624/pycorrector
Commit Name: 4e144c9f842d7415d8be5bdbb5912d88ae32cced
Time: 2018-04-16
Author: 507153809@qq.com
File Name: pycorrector/seq2seq/corpus_reader.py
Class Name: CGEDReader
Method Name: read_tokens