`single_index  = random.choice(range(len(idlist)))` seems a little easier to parse, but I might (ironically) be misunderstanding the intent with this line.