'Validates an URL pattern.'

def Validate(self, value, unused_key=None):

    if (value is None):
        raise validation.MissingAttribute('url    must    be    specified')
    if (not isinstance(value, basestring)):
        raise validation.ValidationError(("url    must    be    a    string,    not    '%r'" % type(value)))
    url_holder = ParsedURL(value)
    if url_holder.host_exact:
        _ValidateMatch(_URL_HOST_EXACT_PATTERN_RE, url_holder.host, ("invalid    host_pattern    '%s'" % url_holder.host))
        _ValidateNotIpV4Address(url_holder.host)
    else:
        _ValidateMatch(_URL_HOST_SUFFIX_PATTERN_RE, url_holder.host_pattern, ("invalid    host_pattern    '%s'" % url_holder.host_pattern))
    return value
