def user_summary(storages, output_dir: Path): for src, st in group_by_key(storages, key=lambda s: s.source).items(): rtype = the(get_result_type(x) for x in st) outf = output_dir / (For(src).name + '_users.html') user_summary_for(rtype=rtype, storages=st, output_path=outf)
def For(res): return the([F for F in Fors if res == F.Target])
def interactions(self): th = the(self.items) return th.points + th.comments
def the(self): return the(self.items)
def interactions(self): th = the(self.items) return th.replies + th.retweets + th.likes
def format(self): item = the(self.items) return self.FTrait.format_one(item)
def link(cls, objs): return the(o.link for _, o in objs)