<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_proxy(url, host=None):
 """ Finds proxy string for the given url and host. If host is not defined, it's extracted from the url. """

  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)