8000 Adds a --household argument to exact match ckecking by eedrummer · Pull Request #33 · mitre/linkage-agent-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adds a --household argument to exact match ckecking #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions dcctools/exact_matches.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@
description="Tool for counting the number of exact matches (exactly identical hashes) \
for one project across sites."
)
parser.add_argument(
group = parser.add_mutually_exclusive_group()
group.add_argument(
"-p",
"--project",
default="name-sex-dob-zip",
help="Select a project to review exact matches across sites. \
Default: name-sex-dob-zip",
Default: name-sex-dob-zip \
Does not work with the household flag",
)
group.add_argument(
"--household",
help="Review exact household matches. \
Does not work with the project flag",
)
args = parser.parse_args()

Expand All @@ -22,13 +29,21 @@
# python3 dcctools/exact_matches.py --> use path "./config.json"
c = Configuration("config.json")

project = args.project

print(f"COUNTING EXACT MATCHES FOR {project}")
project = None
if args.household is not None:
project = args.household
print(f"COUNTING EXACT MATCHES FOR households {project}")
else:
project = args.project
print(f"COUNTING EXACT MATCHES FOR {project}")

clks = {}
for system in c.systems:
raw_clks = c.get_clks_raw(system, project)
raw_clks = None
if args.household is not None:
raw_clks = c.get_household_clks_raw(system, project)
else:
raw_clks = c.get_clks_raw(system, project)
clk_json = json.loads(raw_clks)
clks[system] = set(clk_json["clks"])
print(f"Size of {system}: {len(clks[system])}")
Expand Down
0