def find_proxy(url, host=None):
if host is None:<EOL><INDENT>m = _URL_REGEX.match(url)<EOL>if not m:<EOL><INDENT>raise URLError(url)<EOL><DEDENT>if len(m.groups()) is <NUM_LIT:1>:<EOL><INDENT>host = m.groups()[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>raise URLError(url)<EOL><DEDENT><DEDENT>return _pacparser.find_proxy(url, host)<EOL>
Finds proxy string for the given url and host. If host is not
defined, it's extracted from the url.