networkx.utils.random_sequence.
weighted_choice
Return a single element from a weighted sample.
The input is a dictionary of items with weights as values.