7450bce543a9ac268b6bc5e97b557c9596823aed,beancount_import/source/generic_importer_source.py,ImporterSource,prepare,#ImporterSource#,57

Before Change


    def prepare(self, journal: "JournalEditor", results: SourceResults) -> None:
        results.add_account(self.account)
        
        entries = defaultdict(list) //type: Dict[Hashable,List[Directive]]
        for f in self.files:
            f_entries = self.importer.extract(f, existing_entries=journal.entries)
            // collect  all entries in current statement, grouped by hash

After Change


            // deduplicate across statements
            for key_ in hashed_entries:
                // skip the existing entries from other statements. add remaining
                if not key_ in entries:
                    n = 0
                else:
                    n = len(entries[key_])
                entries.setdefault(key_, []).extend(hashed_entries[key_][n:])

        get_pending_and_invalid_entries(
            raw_entries=list(itertools.chain.from_iterable(entries.values())),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: jbms/beancount-import
Commit Name: 7450bce543a9ac268b6bc5e97b557c9596823aed
Time: 2020-08-07
Author: dumbpyx@gmail.com
File Name: beancount_import/source/generic_importer_source.py
Class Name: ImporterSource
Method Name: prepare


Project Name: snorkel-team/snorkel
Commit Name: d7bcbade517750cc4fdb7642415e4cf05ae584e8
Time: 2016-07-03
Author: ajratner@gmail.com
File Name: tutorial/utils.py
Class Name:
Method Name: collect_pubtator_annotations


Project Name: oddt/oddt
Commit Name: 82b4498b10fb0a3dc3fdfea7262880978f590530
Time: 2018-05-17
Author: maciek@wojcikowski.pl
File Name: rdkit_fixer.py
Class Name:
Method Name: PreparePDBMol