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())),