def to_ranges(lst):
    for a, b in itertools.groupby(enumerate(lst), lambda t: t[1] - t[0]):
        b = list(b)
        yield b[0][1], b[-1][1]
Updates traffic type of a physical network
dataset/ETHPy150Open kmike/port-for/port_for/utils.py/to_ranges--crossover with--dataset/ETHPy150Open jasonhancock/cloudstack-python-client/CloudStack/Client.py/Client.updateTrafficType