Skip to content

Commit

Permalink
Add query to limit how many links we sample
Browse files Browse the repository at this point in the history
  • Loading branch information
PPPI committed May 10, 2021
1 parent 141b5fb commit 616b7e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Util/sample_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,20 @@ def prompt_user_bool(prompt_msg, default=None, options_map=None):
'palantir_plottable',
'tensorflow_tensorflow', # Dev set end
]
first_n = input('How many links should we sample?')
hits = dict()
for project in projects:
hits[project] = list()
with open((location_format[:-5] + '_truth.json') % project) as f:
truth = jsonpickle.decode(f.read())
issues = random.sample(list(truth.keys()), 100)

for issue in issues:
if first_n == 'all':
first_n_actual = len(issues)
else:
first_n_actual = min(int(first_n), len(issues))

for issue in issues[:first_n_actual]:
issue_id = int(issue[1:])
wb.open(url_format % (project.replace('_', '/'), issue_id))
for other in truth[issue]:
Expand Down

0 comments on commit 616b7e3

Please sign in to comment.