def port_ranges():
    """
    Returns a list of ephemeral port ranges for current machine.
    """
    try:
        return _linux_ranges()
    except (OSError, IOError): # not linux, try BSD
        try:
            ranges = _bsd_ranges()
            if ranges:
                return ranges
        except (__HOLE__, IOError):
            pass

    # fallback
    return [DEFAULT_EPHEMERAL_PORT_RANGE]
dataset/ETHPy150Open kmike/port-for/port_for/ephemeral.py/port_ranges