def _restore_from_cache(self, cached_data): self.all_pubkeys_by_index = toolz.itemmap( _deserialize_pair, cached_data["pubkeys_by_index"] ) for index, pubkey in self.all_pubkeys_by_index.items(): privkey = self._get_privkey_for(index) self.keys[pubkey] = privkey
def _mk_test_part(paths: Sequence[Path]) -> TestPart: paths_by_suffix = toolz.groupby(lambda path: path.suffix, paths) return TestPart(toolz.itemmap(_map_to_format_type, paths_by_suffix))