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)

After Change


        file = io.TextIOWrapper(file, encoding="utf-8")
        while True:
            batch = list(itertools.islice(file, IMPORT_BATCH_SIZE))
            if not batch:
                raise StopIteration
            yield [{"text": line.strip()} for line in batch]


class CSVParser(FileParser):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: ray-project/ray
Commit Name: 5cfa1934e4a2157d07ef534e1033a3f0e5bc1082
Time: 2020-12-18
Author: me@barakmich.com
File Name: python/ray/experimental/client/server/server.py
Class Name: RayletServicer
Method Name: WaitObject


Project Name: ray-project/ray
Commit Name: f75dfd60a3ff7ef1eabc5890e591e3d9875c39a0
Time: 2020-08-27
Author: swang@cs.berkeley.edu
File Name: python/ray/worker.py
Class Name:
Method Name: init