code: 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)
docs: Finds proxy string for the given url and host. If host is not
    defined, it's extracted from the url.