def http_url_exists(url):
class HEADRequest(Request):<EOL><INDENT>def get_method(self):<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT><DEDENT>try:<EOL><INDENT>response = urlopen(HEADRequest(url))<EOL>return True<EOL><DEDENT>except URLError:<EOL><INDENT>return False<EOL><DEDENT>
Returns whether the given HTTP URL 'exists' in the sense that it is returning
    an HTTP error code or not. A URL is considered to exist if it does not return
    an HTTP error code.