genomepy.genome.sequences.weighted_selection

genomepy.genome.sequences.weighted_selection(list_of_tuples, n)

Selects n random elements from a list of (weight, item) tuples. Based on code snippet by Nick Johnson