1c0cd03712f95fb5966968abc2a39313175594c6,src/fonduer/parser/preprocessors/doc_preprocessor.py,DocPreprocessor,__len__,#DocPreprocessor#,44

Before Change



    def __len__(self):
        Provide a len attribute based on max_docs and number of files in folder.
        num_docs = min(len(self.all_files), self.max_docs)
        return num_docs

    def __iter__(self):

After Change


        return [doc for doc in self.get_docs_for_path(fp)]

    def __len__(self):
        raise NotImplementedError(
            "One generec file can yield more than one Document objects, "
            "so length can not be yielded before we process all files"
        )

    def __iter__(self):
        return self.generate()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: HazyResearch/fonduer
Commit Name: 1c0cd03712f95fb5966968abc2a39313175594c6
Time: 2018-09-07
Author: jrausch@inf.ethz.ch
File Name: src/fonduer/parser/preprocessors/doc_preprocessor.py
Class Name: DocPreprocessor
Method Name: __len__


Project Name: biotite-dev/biotite
Commit Name: 2113a6adb25aa6a4ec5a01623aa7bd25b3d76691
Time: 2019-07-01
Author: patrick.kunzm@gmail.com
File Name: src/biotite/sequence/io/gff/file.py
Class Name: GFFFile
Method Name: append


Project Name: albermax/innvestigate
Commit Name: e0f6dd06cc61043662ff9beee4a4996d434e45f5
Time: 2018-02-20
Author: alber.maximilian@gmail.com
File Name: innvestigate/tools/pattern.py
Class Name: PatternComputer
Method Name: __init__


Project Name: tensorflow/cleverhans
Commit Name: 05425c36bd27b0611f0ea202aaf9d3c3934bda59
Time: 2017-12-23
Author: dongyinpeng@gmail.com
File Name: cleverhans/attacks.py
Class Name: MomentumIterativeMethod
Method Name: generate