@staticmethod
def rateServiceTypeInResult(discoveryResponse):
    """Gives a quality rating for a given service type in a result, higher is better.

        Several UpnP devices reply to a discovery request with multiple responses with different service type
        announcements. To find the most specific one we need to be able rate the service types against each other.
        Usually this is an internal method and just exported for convenience reasons.

        :param DiscoveryResponse discoveryResponse: the response to rate
        :return: a rating of the quality of the given service type
        :rtype: int
        """
    if discoveryResponse is None:
        return 0
    serviceType = discoveryResponse.service
    if serviceType.startswith('urn:dslforum-org:device'):
        return 11
    if serviceType.startswith('urn:dslforum-org:service'):
        return 10
    if serviceType.startswith('urn:dslforum-org:'):
        return 9
    if serviceType.startswith('urn:schemas-upnp-org:device'):
        return 8
    if serviceType.startswith('urn:schemas-upnp-org:service'):
        return 7
    if serviceType.startswith('urn:schemas-upnp-org:'):
        return 6
    if serviceType.startswith('urn:schemas-'):
        return 5
    if serviceType.startswith('urn:'):
        return 4
    if serviceType.startswith('upnp:rootdevice'):
        return 3
    if serviceType.startswith('uuid:'):
        return 2
    return 1
