neulab/docprompting-conala huggingface dataset:
HTMLParser.handle_charref(name)  
This method is called to process decimal and hexadecimal numeric character references of the form &#NNN; and &#xNNN;. For example, the decimal equivalent for &gt; is &#62;, whereas the hexadecimal is &#x3E;; in this case the method will receive '62' or 'x3E'. This method is never called if convert_charrefs is True.
HTMLParser.handle_comment(data)  
This method is called when a comment is encountered (e.g. <!--comment-->). For example, the comment <!-- comment --> will cause this method to be called with the argument ' comment '. The content of Internet Explorer conditional comments (condcoms) will also be sent to this method, so, for <!--[if IE 9]>IE9-specific content<![endif]-->, this method will receive '[if IE 9]>IE9-specific content<![endif]'.
HTMLParser.handle_data(data)  
This method is called to process arbitrary data (e.g. text nodes and the content of <script>...</script> and <style>...</style>).
HTMLParser.handle_decl(decl)  
This method is called to handle an HTML doctype declaration (e.g. <!DOCTYPE html>). The decl parameter will be the entire contents of the declaration inside the <!...> markup (e.g. 'DOCTYPE html').
HTMLParser.handle_endtag(tag)  
This method is called to handle the end tag of an element (e.g. </div>). The tag argument is the name of the tag converted to lower case.
HTMLParser.handle_entityref(name)  
This method is called to process a named character reference of the form &name; (e.g. &gt;), where name is a general entity reference (e.g. 'gt'). This method is never called if convert_charrefs is True.
HTMLParser.handle_pi(data)  
Method called when a processing instruction is encountered. The data parameter will contain the entire processing instruction. For example, for the processing instruction <?proc color='red'>, this method would be called as handle_pi("proc color='red'"). It is intended to be overridden by a derived class; the base class implementation does nothing.  Note The HTMLParser class uses the SGML syntactic rules for processing instructions. An XHTML processing instruction using the trailing '?' will cause the '?' to be included in data.
HTMLParser.handle_startendtag(tag, attrs)  
Similar to handle_starttag(), but called when the parser encounters an XHTML-style empty tag (<img ... />). This method may be overridden by subclasses which require this particular lexical information; the default implementation simply calls handle_starttag() and handle_endtag().
HTMLParser.handle_starttag(tag, attrs)  
This method is called to handle the start of a tag (e.g. <div id="main">). The tag argument is the name of the tag converted to lower case. The attrs argument is a list of (name, value) pairs containing the attributes found inside the tag’s <> brackets. The name will be translated to lower case, and quotes in the value have been removed, and character and entity references have been replaced. For instance, for the tag <A HREF="https://www.cwi.nl/">, this method would be called as handle_starttag('a', [('href', 'https://www.cwi.nl/')]). All entity references from html.entities are replaced in the attribute values.
HTMLParser.reset()  
Reset the instance. Loses all unprocessed data. This is called implicitly at instantiation time.
HTMLParser.unknown_decl(data)  
This method is called when an unrecognized declaration is read by the parser. The data parameter will be the entire contents of the declaration inside the <![...]> markup. It is sometimes useful to be overridden by a derived class. The base class implementation does nothing.
html.unescape(s)  
Convert all named and numeric character references (e.g. &gt;, &#62;, &#x3e;) in the string s to the corresponding Unicode characters. This function uses the rules defined by the HTML 5 standard for both valid and invalid character references, and the list of
HTML 5 named character references.  New in version 3.4.
exception http.client.BadStatusLine  
A subclass of HTTPException. Raised if a server responds with a HTTP status code that we don’t understand.
exception http.client.CannotSendHeader  
A subclass of ImproperConnectionState.
exception http.client.CannotSendRequest  
A subclass of ImproperConnectionState.
class http.client.HTTPConnection(host, port=None, [timeout, ]source_address=None, blocksize=8192)  
An HTTPConnection instance represents one transaction with an HTTP server. It should be instantiated passing it a host and optional port number. If no port number is passed, the port is extracted from the host string if it has the form host:port, else the default HTTP port (80) is used. If the optional timeout parameter is given, blocking operations (like connection attempts) will timeout after that many seconds (if it is not given, the global default timeout setting is used). The optional source_address parameter may be a tuple of a (host, port) to use as the source address the HTTP connection is made from. The optional blocksize parameter sets the buffer size in bytes for sending a file-like message body. For example, the following calls all create instances that connect to the server at the same host and port: >>> h1 = http.client.HTTPConnection('www.python.org')
>>> h2 = http.client.HTTPConnection('www.python.org:80')
>>> h3 = http.client.HTTPConnection('www.python.org', 80)
>>> h4 = http.client.HTTPConnection('www.python.org', 80, timeout=10)
  Changed in version 3.2: source_address was added.   Changed in version 3.4: The strict parameter was removed. HTTP 0.9-style “Simple Responses” are not longer supported.   Changed in version 3.7: blocksize parameter was added.
HTTPConnection.blocksize  
Buffer size in bytes for sending a file-like message body.  New in version 3.7.
HTTPConnection.connect()  
Connect to the server specified when the object was created. By default, this is called automatically when making a request if the client does not already have a connection.
HTTPConnection.endheaders(message_body=None, *, encode_chunked=False)  
Send a blank line to the server, signalling the end of the headers. The optional message_body argument can be used to pass a message body associated with the request. If encode_chunked is True, the result of each iteration of message_body will be chunk-encoded as specified in RFC 7230, Section 3.3.1. How the data is encoded is dependent on the type of message_body. If message_body implements the buffer interface the encoding will result in a single chunk. If message_body is a collections.abc.Iterable, each iteration of message_body will result in a chunk. If message_body is a file object, each call to .read() will result in a chunk. The method automatically signals the end of the chunk-encoded data immediately after message_body.  Note Due to the chunked encoding specification, empty chunks yielded by an iterator body will be ignored by the chunk-encoder. This is to avoid premature termination of the read of the request by the target server due to malformed encoding.   New in version 3.6: Chunked encoding support. The encode_chunked parameter was added.
HTTPConnection.getresponse()  
Should be called after a request is sent to get the response from the server. Returns an HTTPResponse instance.  Note Note that you must have read the whole response before you can send a new request to the server.   Changed in version 3.5: If a ConnectionError or subclass is raised, the HTTPConnection object will be ready to reconnect when a new request is sent.
HTTPConnection.putheader(header, argument[, ...])  
Send an RFC 822-style header to the server. It sends a line to the server consisting of the header, a colon and a space, and the first argument. If more arguments are given, continuation lines are sent, each consisting of a tab and an argument.
HTTPConnection.putrequest(method, url, skip_host=False, skip_accept_encoding=False)  
This should be the first call after the connection to the server has been made. It sends a line to the server consisting of the method string, the url string, and the HTTP version (HTTP/1.1). To disable automatic sending of Host: or Accept-Encoding: headers (for example to accept additional content encodings), specify skip_host or skip_accept_encoding with non-False values.
HTTPConnection.request(method, url, body=None, headers={}, *, encode_chunked=False)  
This will send a request to the server using the HTTP request method method and the selector url. If body is specified, the specified data is sent after the headers are finished. It may be a str, a bytes-like object, an open file object, or an iterable of bytes. If body is a string, it is encoded as ISO-8859-1, the default for HTTP. If it is a bytes-like object, the bytes are sent as is. If it is a file object, the contents of the file is sent; this file object should support at least the read() method. If the file object is an instance of io.TextIOBase, the data returned by the read() method will be encoded as ISO-8859-1, otherwise the data returned by read() is sent as is. If body is an iterable, the elements of the iterable are sent as is until the iterable is exhausted. The headers argument should be a mapping of extra HTTP headers to send with the request. If headers contains neither Content-Length nor Transfer-Encoding, but there is a request body, one of those header fields will be added automatically. If body is None, the Content-Length header is set to 0 for methods that expect a body (PUT, POST, and PATCH). If body is a string or a bytes-like object that is not also a file, the Content-Length header is set to its length. Any other type of body (files and iterables in general) will be chunk-encoded, and the Transfer-Encoding header will automatically be set instead of Content-Length. The encode_chunked argument is only relevant if Transfer-Encoding is specified in headers. If encode_chunked is False, the HTTPConnection object assumes that all encoding is handled by the calling code. If it is True, the body will be chunk-encoded.  Note Chunked transfer encoding has been added to the HTTP protocol version 1.1. Unless the HTTP server is known to handle HTTP 1.1, the caller must either specify the Content-Length, or must pass a str or bytes-like object that is not also a file as the body representation.   New in version 3.2: body can now be an iterable.   Changed in version 3.6: If neither Content-Length nor Transfer-Encoding are set in headers, file and iterable body objects are now chunk-encoded. The encode_chunked argument was added. No attempt is made to determine the Content-Length for file objects.
HTTPConnection.send(data)  
Send data to the server. This should be used directly only after the endheaders() method has been called and before getresponse() is called.
HTTPConnection.set_debuglevel(level)  
Set the debugging level. The default debug level is 0, meaning no debugging output is printed. Any value greater than 0 will cause all currently defined debug output to be printed to stdout. The debuglevel is passed to any new HTTPResponse objects that are created.  New in version 3.1.
HTTPConnection.set_tunnel(host, port=None, headers=None)  
Set the host and the port for HTTP Connect Tunnelling. This allows running the connection through a proxy server. The host and port arguments specify the endpoint of the tunneled connection (i.e. the address included in the CONNECT request, not the address of the proxy server). The headers argument should be a mapping of extra HTTP headers to send with the CONNECT request. For example, to tunnel through a HTTPS proxy server running locally on port 8080, we would pass the address of the proxy to the HTTPSConnection constructor, and the address of the host that we eventually want to reach to the set_tunnel() method: >>> import http.client
>>> conn = http.client.HTTPSConnection("localhost", 8080)
>>> conn.set_tunnel("www.python.org")
>>> conn.request("HEAD","/index.html")
  New in version 3.2.
exception http.client.HTTPException  
The base class of the other exceptions in this module. It is a subclass of Exception.
class http.client.HTTPResponse(sock, debuglevel=0, method=None, url=None)  
Class whose instances are returned upon successful connection. Not instantiated directly by user.  Changed in version 3.4: The strict parameter was removed. HTTP 0.9 style “Simple Responses” are no longer supported.
HTTPResponse.debuglevel  
A debugging hook. If debuglevel is greater than zero, messages will be printed to stdout as the response is read and parsed.
HTTPResponse.getheader(name, default=None)  
Return the value of the header name, or default if there is no header matching name. If there is more than one header with the name name, return all of the values joined by ‘, ‘. If ‘default’ is any iterable other than a single string, its elements are similarly returned joined by commas.
HTTPResponse.getheaders()  
Return a list of (header, value) tuples.
HTTPResponse.getstatus()  
 Deprecated since version 3.9: Deprecated in favor of status.
HTTPResponse.geturl()  
 Deprecated since version 3.9: Deprecated in favor of url.
HTTPResponse.headers  
Headers of the response in the form of an email.message.EmailMessage instance.
HTTPResponse.info()  
 Deprecated since version 3.9: Deprecated in favor of headers.
HTTPResponse.msg  
A http.client.HTTPMessage instance containing the response headers. http.client.HTTPMessage is a subclass of email.message.Message.
HTTPResponse.read([amt])  
Reads and returns the response body, or up to the next amt bytes.
HTTPResponse.readinto(b)  
Reads up to the next len(b) bytes of the response body into the buffer b. Returns the number of bytes read.  New in version 3.3.
HTTPResponse.url  
URL of the resource retrieved, commonly used to determine if a redirect was followed.
HTTPResponse.version  
HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1.
class http.client.HTTPSConnection(host, port=None, key_file=None, cert_file=None, [timeout, ]source_address=None, *, context=None, check_hostname=None, blocksize=8192)  
A subclass of HTTPConnection that uses SSL for communication with secure servers. Default port is 443. If context is specified, it must be a ssl.SSLContext instance describing the various SSL options. Please read Security considerations for more information on best practices.  Changed in version 3.2: source_address, context and check_hostname were added.   Changed in version 3.2: This class now supports HTTPS virtual hosts if possible (that is, if ssl.HAS_SNI is true).   Changed in version 3.4: The strict parameter was removed. HTTP 0.9-style “Simple Responses” are no longer supported.   Changed in version 3.4.3: This class now performs all the necessary certificate and hostname checks by default. To revert to the previous, unverified, behavior ssl._create_unverified_context() can be passed to the context parameter.   Changed in version 3.8: This class now enables TLS 1.3 ssl.SSLContext.post_handshake_auth for the default context or when cert_file is passed with a custom context.   Deprecated since version 3.6: key_file and cert_file are deprecated in favor of context. Please use ssl.SSLContext.load_cert_chain() instead, or let ssl.create_default_context() select the system’s trusted CA certificates for you. The check_hostname parameter is also deprecated; the ssl.SSLContext.check_hostname attribute of context should be used instead.
http.client.HTTPS_PORT  
The default port for the HTTPS protocol (always 443).
http.client.HTTP_PORT  
The default port for the HTTP protocol (always 80).
exception http.client.InvalidURL  
A subclass of HTTPException, raised if a port is given and is either non-numeric or empty.
exception http.client.LineTooLong  
A subclass of HTTPException. Raised if an excessively long line is received in the HTTP protocol from the server.
http.client.parse_headers(fp)  
Parse the headers from a file pointer fp representing a HTTP request/response. The file has to be a BufferedIOBase reader (i.e. not text) and must provide a valid RFC 2822 style header. This function returns an instance of http.client.HTTPMessage that holds the header fields, but no payload (the same as HTTPResponse.msg and http.server.BaseHTTPRequestHandler.headers). After returning, the file pointer fp is ready to read the HTTP body.  Note parse_headers() does not parse the start-line of a HTTP message; it only parses the Name: value lines. The file has to be ready to read these field lines, so the first line should already be consumed before calling the function.
exception http.client.RemoteDisconnected  
A subclass of ConnectionResetError and BadStatusLine. Raised by HTTPConnection.getresponse() when the attempt to read the response results in no data read from the connection, indicating that the remote end has closed the connection.  New in version 3.5: Previously, BadStatusLine('') was raised.
exception http.client.ResponseNotReady  
A subclass of ImproperConnectionState.
http.client.responses  
This dictionary maps the HTTP 1.1 status codes to the W3C names. Example: http.client.responses[http.client.NOT_FOUND] is 'Not Found'.
exception http.client.UnknownTransferEncoding  
A subclass of HTTPException.
class http.cookiejar.Cookie  
This class represents Netscape, RFC 2109 and RFC 2965 cookies. It is not expected that users of http.cookiejar construct their own Cookie instances. Instead, if necessary, call make_cookies() on a CookieJar instance.
Cookie.comment_url  
URL linking to a comment from the server explaining the function of this cookie, or None.
Cookie.domain_initial_dot  
True if the domain explicitly specified by the server began with a dot ('.').
Cookie.expires  
Integer expiry date in seconds since epoch, or None. See also the is_expired() method.
Cookie.get_nonstandard_attr(name, default=None)  
If cookie has the named cookie-attribute, return its value. Otherwise, return default.
Cookie.has_nonstandard_attr(name)  
Return True if cookie has the named cookie-attribute.
Cookie.is_expired(now=None)  
True if cookie has passed the time at which the server requested it should expire. If now is given (in seconds since the epoch), return whether the cookie has expired at the specified time.
Cookie.path  
Cookie path (a string, eg. '/acme/rocket_launchers').
Cookie.port  
String representing a port or a set of ports (eg. ‘80’, or ‘80,8080’), or None.
Cookie.port_specified  
True if a port or set of ports was explicitly specified by the server (in the Set-Cookie / Set-Cookie2 header).
Cookie.rfc2109  
True if this cookie was received as an RFC 2109 cookie (ie. the cookie arrived in a Set-Cookie header, and the value of the Version cookie-attribute in that header was 1). This attribute is provided because http.cookiejar may ‘downgrade’ RFC 2109 cookies to Netscape cookies, in which case version is 0.
Cookie.set_nonstandard_attr(name, value)  
Set the value of the named cookie-attribute.
Cookie.version  
Integer or None. Netscape cookies have version 0. RFC 2965 and RFC 2109 cookies have a version cookie-attribute of 1. However, note that http.cookiejar may ‘downgrade’ RFC 2109 cookies to Netscape cookies, in which case version is 0.
class http.cookiejar.CookieJar(policy=None)  
policy is an object implementing the CookiePolicy interface. The CookieJar class stores HTTP cookies. It extracts cookies from HTTP requests, and returns them in HTTP responses. CookieJar instances automatically expire contained cookies when necessary. Subclasses are also responsible for storing and retrieving cookies from a file or database.
CookieJar.add_cookie_header(request)  
Add correct Cookie header to request. If policy allows (ie. the rfc2965 and hide_cookie2 attributes of the CookieJar’s CookiePolicy instance are true and false respectively), the Cookie2 header is also added when appropriate. The request object (usually a urllib.request.Request instance) must support the methods get_full_url(), get_host(), get_type(), unverifiable(), has_header(), get_header(), header_items(), add_unredirected_header() and origin_req_host attribute as documented by urllib.request.  Changed in version 3.3: request object needs origin_req_host attribute. Dependency on a deprecated method get_origin_req_host() has been removed.
CookieJar.clear([domain[, path[, name]]])  
Clear some cookies. If invoked without arguments, clear all cookies. If given a single argument, only cookies belonging to that domain will be removed. If given two arguments, cookies belonging to the specified domain and URL path are removed. If given three arguments, then the cookie with the specified domain, path and name is removed. Raises KeyError if no matching cookie exists.
CookieJar.clear_session_cookies()  
Discard all session cookies. Discards all contained cookies that have a true discard attribute (usually because they had either no max-age or expires cookie-attribute, or an explicit discard cookie-attribute). For interactive browsers, the end of a session usually corresponds to closing the browser window. Note that the save() method won’t save session cookies anyway, unless you ask otherwise by passing a true ignore_discard argument.
CookieJar.extract_cookies(response, request)  
Extract cookies from HTTP response and store them in the CookieJar, where allowed by policy. The CookieJar will look for allowable Set-Cookie and Set-Cookie2 headers in the response argument, and store cookies as appropriate (subject to the CookiePolicy.set_ok() method’s approval). The response object (usually the result of a call to urllib.request.urlopen(), or similar) should support an info() method, which returns an email.message.Message instance. The request object (usually a urllib.request.Request instance) must support the methods get_full_url(), get_host(), unverifiable(), and origin_req_host attribute, as documented by urllib.request. The request is used to set default values for cookie-attributes as well as for checking that the cookie is allowed to be set.  Changed in version 3.3: request object needs origin_req_host attribute. Dependency on a deprecated method get_origin_req_host() has been removed.
CookieJar.make_cookies(response, request)  
Return sequence of Cookie objects extracted from response object. See the documentation for extract_cookies() for the interfaces required of the response and request arguments.
CookieJar.set_cookie(cookie)  
Set a Cookie, without checking with policy to see whether or not it should be set.
CookieJar.set_cookie_if_ok(cookie, request)  
Set a Cookie if policy says it’s OK to do so.
CookieJar.set_policy(policy)  
Set the CookiePolicy instance to be used.
class http.cookiejar.CookiePolicy  
This class is responsible for deciding whether each cookie should be accepted from / returned to the server.
CookiePolicy.domain_return_ok(domain, request)  
Return False if cookies should not be returned, given cookie domain. This method is an optimization. It removes the need for checking every cookie with a particular domain (which might involve reading many files). Returning true from domain_return_ok() and path_return_ok() leaves all the work to return_ok(). If domain_return_ok() returns true for the cookie domain, path_return_ok() is called for the cookie path. Otherwise, path_return_ok() and return_ok() are never called for that cookie domain. If path_return_ok() returns true, return_ok() is called with the Cookie object itself for a full check. Otherwise, return_ok() is never called for that cookie path. Note that domain_return_ok() is called for every cookie domain, not just for the request domain. For example, the function might be called with both ".example.com" and "www.example.com" if the request domain is "www.example.com". The same goes for path_return_ok(). The request argument is as documented for return_ok().
CookiePolicy.hide_cookie2  
Don’t add Cookie2 header to requests (the presence of this header indicates to the server that we understand RFC 2965 cookies).
CookiePolicy.path_return_ok(path, request)  
Return False if cookies should not be returned, given cookie path. See the documentation for domain_return_ok().
CookiePolicy.return_ok(cookie, request)  
Return boolean value indicating whether cookie should be returned to server. cookie is a Cookie instance. request is an object implementing the interface defined by the documentation for CookieJar.add_cookie_header().