def get_proxy_url(self, target_url):
    '\n        Return a proxy (type, URL) tuple associated with ``target_url`` or\n        (None, None) if no such proxy is defined.\n\n        :param str target_url:\n        :rtype: tuple[proxy_type,URL]\n        '
    proxy = (None, None)
    for (pattern, needs_match, proxy_type, proxy_url) in self._rules:
        if (pattern is not None):
            has_match = (pattern.search(target_url) is not None)
            if (has_match == needs_match):
                proxy = (proxy_type, proxy_url)
                break
        elif (proxy_url is not None):
            proxy = (proxy_type, proxy_url)
            break
    return proxy
Return a proxy (type, URL) tuple associated with ``target_url`` or
(None, None) if no such proxy is defined.

:param str target_url:
:rtype: tuple[proxy_type,URL]
def get_proxy_url(self, target_url):
    '\n        Return a proxy (type, URL) tuple associated with ``target_url`` or\n        (None, None) if no such proxy is defined.\n\n        :param str target_url:\n        :rtype: tuple[proxy_type,URL]\n        '
    proxy = (None, None)
    for (pattern, needs_match, proxy_type, proxy_url) in self._rules:
        if (pattern is not None):
            has_match = (pattern.search(target_url) is not None)
            if (has_match == needs_match):
                proxy = (proxy_type, proxy_url)
                break
        elif (proxy_url is not None):
            proxy = (proxy_type, proxy_url)
            break
    return proxy