Check if any of the given URLs has a matching host.

        :param urls: an iterable containing URLs
        :returns: True if any host has a listed match
        :raises InvalidURLError: if there are any invalid URLs in
        the sequence
518108
def any_match(self, urls):
        
        return any(urlparse(u).hostname in self for u in urls)
227907
def local_check (self):
        
        if not self.host:
            self.set_result(_("Host is empty"), valid=False)
            return
        super(TelnetUrl, self).local_check()
1124652
def is_same_host(self, url):
        
        # TODO: Add optional support for socket.gethostbyname checking.
        return (url.startswith('/') or
                get_host(url) == (self.scheme, self.host, self.port))
1256901
def validate_host_parameters(self, host_list, remote_user):
        '''
        
        '''
        if host_list is None:
            host_list = self.host_list

        if remote_user is None:
            remote_user = self.remote_user

        if host_list is None or remote_user is None:
            print "Host list [%s], remote user [%s] are required" % \
                  (host_list, remote_user)
            return (None, None)

        return (host_list, remote_user)
56954
def is_url(str_):
    
    return any([
        str_.startswith('http://'),
        str_.startswith('https://'),
        str_.startswith('www.'),
        '.org/' in str_,
        '.com/' in str_,
    ])
1079461
def _hosts_by_success(self, hosts=[]):
        
        hosts = hosts if hosts else self.hosts
        return sorted(hosts, key=lambda h: self._host_errors[h])
418504
def url_match?(request_url)
      case base_url
      when String
        base_url == request_url
      when Regexp
        base_url === request_url
      when nil
        true
      else
        false
      end
    end
251671
def has_host_match(log_data, hosts):
    
    hostname = getattr(log_data, 'host', None)
    if hostname and hostname not in host_cache:
        for host_pattern in hosts:
            if host_pattern.search(hostname) is not None:
                host_cache.add(hostname)
                return True
        else:
            return False
    return True
54982
def _IsValidUrl(self, url):
    
    parsed_url = urlparse.urlparse(url)
    return parsed_url.scheme in self._SUPPORTED_URL_SCHEMES
35944
def find_proxy(url, host=None):
  
  if host is None:
    m = _URL_REGEX.match(url)
    if not m:
      raise URLError(url)
    if len(m.groups()) is 1:
      host = m.groups()[0]
    else:
      raise URLError(url)
  return _pacparser.find_proxy(url, host)
469499
def url_host(url: str) -> str:
    
    from urllib.parse import urlparse
    res = urlparse(url)
    return res.netloc.split(':')[0] if res.netloc else ''
27474
def validate_urls(urls, allowed_response_codes=None):
    

    for url in urls:
        validate_url(url, allowed_response_codes=allowed_response_codes)
    return True
1354562
def match_host (host, domainlist):
    """"""
    if not host:
        return False
    for domain in domainlist:
        if domain.startswith('.'):
            if host.endswith(domain):
                return True
        elif host == domain:
            return True
    return False
453352
def is_valid_url(url):
    
    regex = re.compile(
            r'^(?:http|ftp)s?://' # http:// or https://
            r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #domain...
            #r'localhost|' #localhost...
            r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
            r'(?::\d+)?' # optional port
            r'(?:/?|[/?]\S+)$', re.IGNORECASE)
    return bool(regex.match(url))
35264
def wrap_iterable(cls, url_or_urls):
    
    try:
      return [cls.wrap(url_or_urls)]
    except ValueError:
      pass
    if isinstance(url_or_urls, Iterable):
      return [cls.wrap(url) for url in url_or_urls]
    raise ValueError('url_or_urls must be string/Link or iterable of strings/Links')
154505
def _hostname_matches(self, hostname, entry):
        
        for h in entry.hostnames:
            if (
                h == hostname
                or h.startswith("|1|")
                and not hostname.startswith("|1|")
                and constant_time_bytes_eq(self.hash_host(hostname, h), h)
            ):
                return True
        return False
1014869
def is_same_host(self, url):
        
        if url.startswith('/'):
            return True

        # TODO: Add optional support for socket.gethostbyname checking.
        scheme, host, port = get_host(url)

        host = _ipv6_host(host).lower()

        # Use explicit default port for comparison when none is given
        if self.port and not port:
            port = port_by_scheme.get(scheme)
        elif not self.port and port == port_by_scheme.get(scheme):
            port = None

        return (scheme, host, port) == (self.scheme, self.host, self.port)