e4d313478124e00a931ec40ab25643accad88641,beancount_import/source/generic_importer_source.py,ImporterSource,prepare,#ImporterSource#,55

Before Change


            for entry in f_entries:
                hash_ = self._hash_entry(entry, frozenset(["filename","lineno"]))
                // skip the existing entries from other statements
                if hash_ in entries: continue
                // If the entry exists in the journal, skip
                if self._is_existing(journal, entry): continue
                // add importer name as sorce description to source postings
                self._add_description(entry)
                // balance amount
                self.balance_amounts(entry)
                hashed_entries[hash_] = entry
            entries = {**entries, **hashed_entries}

        results.add_pending_entries(
            [ImportResult(entry.date, [entry], None)

After Change



    def prepare(self, journal: "JournalEditor", results: SourceResults) -> None:
        results.add_account(self.account)
        entries = defaultdict(list)
        for f in self.files:
            f_entries = self.importer.extract(f)
            // collect  all entries in current statement, grouped by hash
            hashed_entries = defaultdict(list)
            for entry in f_entries:
                hash_ = self._hash_entry(entry, frozenset(["filename","lineno"]))
                hashed_entries[hash_].append(entry)
            // deduplicate across statements
            for hash_ in hashed_entries:
                // skip the existing entries from other statements. add remaining
                n = len(entries[hash_])
                entries[hash_].extend(hashed_entries[hash_][n:])

        uncleared_entries = defaultdict(list)
        for hash_ in entries:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


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


Project Name: david-abel/simple_rl
Commit Name: fdb83626b1f22ff6e7523cb3ea281847be5c69bb
Time: 2019-05-28
Author: nishanth.kumar20@gmail.com
File Name: simple_rl/agents/RMaxAgentClass.py
Class Name: RMaxAgent
Method Name: __init__


Project Name: jazzband/django-debug-toolbar
Commit Name: 8d68d307af04166e7aa4fde915b95a41560b8f19
Time: 2014-02-11
Author: davidgameswolfe@gmail.com
File Name: debug_toolbar/panels/sql/panel.py
Class Name: SQLPanel
Method Name: process_response