#!/usr/bin/env python3 import importlib.util import json SPEC = importlib.util.spec_from_file_location( "qe", "/root/troupe-standup/wizard-work/ledger/queue-extract.py") qm = importlib.util.module_from_spec(SPEC) SPEC.loader.exec_module(qm) mine, _, _ = qm.extract() from collections import Counter c = Counter((it["id"], it["line"]) for it in mine) dups = {k: v for k, v in c.items() if v > 1} print("duplicate (id,line) keys:", len(dups)) for k, v in sorted(dups.items())[:40]: # show the two items matches = [it for it in mine if (it["id"], it["line"]) == k] print(" %s x%d:" % (k, v)) for it in matches: print(" ", it["kind"], it["role"], "end=%d lines=%d by=%d det=%r status=%r" % (it["end_line"], it["lines"], it["bytes"], it["role_detail"], it["status"]))