def get_random_item_weighted(scoreboard):
    total_scoreboard_value = sum(scoreboard.values())
item_loc = random.random() * total_scoreboard_value
current_loc = 0
for item, score in list(scoreboard.items()):
    current_loc += score
if current_loc > item_loc:
    return item
How can I get a weighted random pick from Python's Counter class?