code: 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]
docs: Returns a list of ephemeral port ranges for current machine.