def highest_priority(source):
    max_prio = 0
    pools = list(source)
    for pool in pools:
        name = pool.name
        if not name:
            continue
        if Pools.get_priority(name)>max_prio:
            max_prio = Pools.get_priority(name)

    for pool in pools:
        name = pool.name
        if not name:
            continue
        if Pools.get_priority(name)>=max_prio:
            yield pool
Filters pools by highest priority
dataset/ETHPy150Open c00w/bitHopper/bitHopper/Logic/ServerLogic.py/highest_priority