def port_ranges():
    try:
        return _linux_ranges()
    except (OSError, IOError): # not linux, try BSD
        try:
            ranges = _bsd_ranges()
            if ranges:
                return ranges
        except (OSError, IOError):
            pass

    # fallback
    return [DEFAULT_EPHEMERAL_PORT_RANGE]
Returns a list of ephemeral port ranges for current machine.
dataset/ETHPy150Open kmike/port-for/port_for/ephemeral.py/port_ranges