neulab/docprompting-conala huggingface dataset:
static_order()  
Returns an iterable of nodes in a topological order. Using this method does not require to call TopologicalSorter.prepare() or TopologicalSorter.done(). This method is equivalent to: def static_order(self):
    self.prepare()
    while self.is_active():
        node_group = self.get_ready()
        yield from node_group
        self.done(*node_group)
 The particular order that is returned may depend on the specific order in which the items were inserted in the graph. For example: >>> ts = TopologicalSorter()
>>> ts.add(3, 2, 1)
>>> ts.add(1, 0)
>>> print([*ts.static_order()])
[2, 0, 1, 3]

>>> ts2 = TopologicalSorter()
>>> ts2.add(1, 0)
>>> ts2.add(3, 2, 1)
>>> print([*ts2.static_order()])
[0, 2, 1, 3]
 This is due to the fact that “0” and “2” are in the same level in the graph (they would have been returned in the same call to get_ready()) and the order between them is determined by the order of insertion. If any cycle is detected, CycleError will be raised.
grp — The group database This module provides access to the Unix group database. It is available on all Unix versions. Group database entries are reported as a tuple-like object, whose attributes correspond to the members of the group structure (Attribute field below, see <pwd.h>):   
Index Attribute Meaning   
0 gr_name the name of the group  
1 gr_passwd the (encrypted) group password; often empty  
2 gr_gid the numerical group ID  
3 gr_mem all the group member’s user names   The gid is an integer, name and password are strings, and the member list is a list of strings. (Note that most users are not explicitly listed as members of the group they are in according to the password database. Check both databases to get complete membership information. Also note that a gr_name that starts with a + or - is likely to be a YP/NIS reference and may not be accessible via getgrnam() or getgrgid().) It defines the following items:  
grp.getgrgid(gid)  
Return the group database entry for the given numeric group ID. KeyError is raised if the entry asked for cannot be found.  Deprecated since version 3.6: Since Python 3.6 the support of non-integer arguments like floats or strings in getgrgid() is deprecated.  
  
grp.getgrnam(name)  
Return the group database entry for the given group name. KeyError is raised if the entry asked for cannot be found. 
  
grp.getgrall()  
Return a list of all available group entries, in arbitrary order. 
  See also  
Module pwd


An interface to the user database, similar to this.  
Module spwd


An interface to the shadow password database, similar to this.
grp.getgrall()  
Return a list of all available group entries, in arbitrary order.
grp.getgrgid(gid)  
Return the group database entry for the given numeric group ID. KeyError is raised if the entry asked for cannot be found.  Deprecated since version 3.6: Since Python 3.6 the support of non-integer arguments like floats or strings in getgrgid() is deprecated.
grp.getgrnam(name)  
Return the group database entry for the given group name. KeyError is raised if the entry asked for cannot be found.
exception gzip.BadGzipFile  
An exception raised for invalid gzip files. It inherits OSError. EOFError and zlib.error can also be raised for invalid gzip files.  New in version 3.8.
gzip.compress(data, compresslevel=9, *, mtime=None)  
Compress the data, returning a bytes object containing the compressed data. compresslevel and mtime have the same meaning as in the GzipFile constructor above.  New in version 3.2.   Changed in version 3.8: Added the mtime parameter for reproducible output.
gzip.decompress(data)  
Decompress the data, returning a bytes object containing the uncompressed data.  New in version 3.2.
mtime  
When decompressing, the value of the last modification time field in the most recently read header may be read from this attribute, as an integer. The initial value before reading any headers is None. All gzip compressed streams are required to contain this timestamp field. Some programs, such as gunzip, make use of the timestamp. The format is the same as the return value of time.time() and the st_mtime attribute of the object returned by os.stat().
peek(n)  
Read n uncompressed bytes without advancing the file position. At most one single read on the compressed stream is done to satisfy the call. The number of bytes returned may be more or less than requested.  Note While calling peek() does not change the file position of the GzipFile, it may change the position of the underlying file object (e.g. if the GzipFile was constructed with the fileobj parameter).   New in version 3.2.
gzip.open(filename, mode='rb', compresslevel=9, encoding=None, errors=None, newline=None)  
Open a gzip-compressed file in binary or text mode, returning a file object. The filename argument can be an actual filename (a str or bytes object), or an existing file object to read from or write to. The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x' or 'xb' for binary mode, or 'rt', 'at', 'wt', or 'xt' for text mode. The default is 'rb'. The compresslevel argument is an integer from 0 to 9, as for the GzipFile constructor. For binary mode, this function is equivalent to the GzipFile constructor: GzipFile(filename, mode, compresslevel). In this case, the encoding, errors and newline arguments must not be provided. For text mode, a GzipFile object is created, and wrapped in an io.TextIOWrapper instance with the specified encoding, error handling behavior, and line ending(s).  Changed in version 3.3: Added support for filename being a file object, support for text mode, and the encoding, errors and newline arguments.   Changed in version 3.4: Added support for the 'x', 'xb' and 'xt' modes.   Changed in version 3.6: Accepts a path-like object.
hasattr(object, name)  
The arguments are an object and a string. The result is True if the string is the name of one of the object’s attributes, False if not. (This is implemented by calling getattr(object, name) and seeing whether it raises an AttributeError or not.)
hash(object)  
Return the hash value of the object (if it has one). Hash values are integers. They are used to quickly compare dictionary keys during a dictionary lookup. Numeric values that compare equal have the same hash value (even if they are of different types, as is the case for 1 and 1.0).  Note For objects with custom __hash__() methods, note that hash() truncates the return value based on the bit width of the host machine. See __hash__() for details.
hashlib.algorithms_available  
A set containing the names of the hash algorithms that are available in the running Python interpreter. These names will be recognized when passed to new(). algorithms_guaranteed will always be a subset. The same algorithm may appear multiple times in this set under different names (thanks to OpenSSL).  New in version 3.2.
hashlib.algorithms_guaranteed  
A set containing the names of the hash algorithms guaranteed to be supported by this module on all platforms. Note that ‘md5’ is in this list despite some upstream vendors offering an odd “FIPS compliant” Python build that excludes it.  New in version 3.2.
hashlib.blake2b(data=b'', *, digest_size=64, key=b'', salt=b'', person=b'', fanout=1, depth=1, leaf_size=0, node_offset=0, node_depth=0, inner_size=0, last_node=False, usedforsecurity=True)
hashlib.blake2s(data=b'', *, digest_size=32, key=b'', salt=b'', person=b'', fanout=1, depth=1, leaf_size=0, node_offset=0, node_depth=0, inner_size=0, last_node=False, usedforsecurity=True)
hash.copy()  
Return a copy (“clone”) of the hash object. This can be used to efficiently compute the digests of data sharing a common initial substring.
hash.digest()  
Return the digest of the data passed to the update() method so far. This is a bytes object of size digest_size which may contain bytes in the whole range from 0 to 255.
hash.hexdigest()  
Like digest() except the digest is returned as a string object of double length, containing only hexadecimal digits. This may be used to exchange the value safely in email or other non-binary environments.
hash.name  
The canonical name of this hash, always lowercase and always suitable as a parameter to new() to create another hash of this type.  Changed in version 3.4: The name attribute has been present in CPython since its inception, but until Python 3.4 was not formally specified, so may not exist on some platforms.
hash.update(data)  
Update the hash object with the bytes-like object. Repeated calls are equivalent to a single call with the concatenation of all the arguments: m.update(a); m.update(b) is equivalent to m.update(a+b).  Changed in version 3.1: The Python GIL is released to allow other threads to run while hash updates on data larger than 2047 bytes is taking place when using hash algorithms supplied by OpenSSL.
hashlib.new(name, [data, ]*, usedforsecurity=True)  
Is a generic constructor that takes the string name of the desired algorithm as its first parameter. It also exists to allow access to the above listed hashes as well as any other algorithms that your OpenSSL library may offer. The named constructors are much faster than new() and should be preferred.
hashlib.pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None)  
The function provides PKCS#5 password-based key derivation function 2. It uses HMAC as pseudorandom function. The string hash_name is the desired name of the hash digest algorithm for HMAC, e.g. ‘sha1’ or ‘sha256’. password and salt are interpreted as buffers of bytes. Applications and libraries should limit password to a sensible length (e.g. 1024). salt should be about 16 or more bytes from a proper source, e.g. os.urandom(). The number of iterations should be chosen based on the hash algorithm and computing power. As of 2013, at least 100,000 iterations of SHA-256 are suggested. dklen is the length of the derived key. If dklen is None then the digest size of the hash algorithm hash_name is used, e.g. 64 for SHA-512. >>> import hashlib
>>> dk = hashlib.pbkdf2_hmac('sha256', b'password', b'salt', 100000)
>>> dk.hex()
'0394a2ede332c9a13eb82e9b24631604c31df978b4e2f0fbd2c549944f9d79a5'
  New in version 3.4.   Note A fast implementation of pbkdf2_hmac is available with OpenSSL. The Python implementation uses an inline version of hmac. It is about three times slower and doesn’t release the GIL.
hashlib.scrypt(password, *, salt, n, r, p, maxmem=0, dklen=64)  
The function provides scrypt password-based key derivation function as defined in RFC 7914. password and salt must be bytes-like objects. Applications and libraries should limit password to a sensible length (e.g. 1024). salt should be about 16 or more bytes from a proper source, e.g. os.urandom(). n is the CPU/Memory cost factor, r the block size, p parallelization factor and maxmem limits memory (OpenSSL 1.1.0 defaults to 32 MiB). dklen is the length of the derived key. Availability: OpenSSL 1.1+.  New in version 3.6.
shake.digest(length)  
Return the digest of the data passed to the update() method so far. This is a bytes object of size length which may contain bytes in the whole range from 0 to 255.
shake.hexdigest(length)  
Like digest() except the digest is returned as a string object of double length, containing only hexadecimal digits. This may be used to exchange the value safely in email or other non-binary environments.
heapq.heapify(x)  
Transform list x into a heap, in-place, in linear time.
heapq.heappop(heap)  
Pop and return the smallest item from the heap, maintaining the heap invariant. If the heap is empty, IndexError is raised. To access the smallest item without popping it, use heap[0].
heapq.heappush(heap, item)  
Push the value item onto the heap, maintaining the heap invariant.
heapq.heappushpop(heap, item)  
Push item on the heap, then pop and return the smallest item from the heap. The combined action runs more efficiently than heappush() followed by a separate call to heappop().
heapq.heapreplace(heap, item)  
Pop and return the smallest item from the heap, and also push the new item. The heap size doesn’t change. If the heap is empty, IndexError is raised. This one step operation is more efficient than a heappop() followed by heappush() and can be more appropriate when using a fixed-size heap. The pop/push combination always returns an element from the heap and replaces it with item. The value returned may be larger than the item added. If that isn’t desired, consider using heappushpop() instead. Its push/pop combination returns the smaller of the two values, leaving the larger value on the heap.
heapq.merge(*iterables, key=None, reverse=False)  
Merge multiple sorted inputs into a single sorted output (for example, merge timestamped entries from multiple log files). Returns an iterator over the sorted values. Similar to sorted(itertools.chain(*iterables)) but returns an iterable, does not pull the data into memory all at once, and assumes that each of the input streams is already sorted (smallest to largest). Has two optional arguments which must be specified as keyword arguments. key specifies a key function of one argument that is used to extract a comparison key from each input element. The default value is None (compare the elements directly). reverse is a boolean value. If set to True, then the input elements are merged as if each comparison were reversed. To achieve behavior similar to sorted(itertools.chain(*iterables), reverse=True), all iterables must be sorted from largest to smallest.  Changed in version 3.5: Added the optional key and reverse parameters.
heapq.nlargest(n, iterable, key=None)  
Return a list with the n largest elements from the dataset defined by iterable. key, if provided, specifies a function of one argument that is used to extract a comparison key from each element in iterable (for example, key=str.lower). Equivalent to: sorted(iterable, key=key,
reverse=True)[:n].
heapq.nsmallest(n, iterable, key=None)  
Return a list with the n smallest elements from the dataset defined by iterable. key, if provided, specifies a function of one argument that is used to extract a comparison key from each element in iterable (for example, key=str.lower). Equivalent to: sorted(iterable, key=key)[:n].
help([object])  
Invoke the built-in help system. (This function is intended for interactive use.) If no argument is given, the interactive help system starts on the interpreter console. If the argument is a string, then the string is looked up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on the console. If the argument is any other kind of object, a help page on the object is generated. Note that if a slash(/) appears in the parameter list of a function, when invoking help(), it means that the parameters prior to the slash are positional-only. For more info, see the FAQ entry on positional-only parameters. This function is added to the built-in namespace by the site module.  Changed in version 3.4: Changes to pydoc and inspect mean that the reported signatures for callables are now more comprehensive and consistent.
hex(x)  
Convert an integer number to a lowercase hexadecimal string prefixed with “0x”. If x is not a Python int object, it has to define an __index__() method that returns an integer. Some examples: >>> hex(255)
'0xff'
>>> hex(-42)
'-0x2a'
 If you want to convert an integer number to an uppercase or lower hexadecimal string with prefix or not, you can use either of the following ways: >>> '%#x' % 255, '%x' % 255, '%X' % 255
('0xff', 'ff', 'FF')
>>> format(255, '#x'), format(255, 'x'), format(255, 'X')
('0xff', 'ff', 'FF')
>>> f'{255:#x}', f'{255:x}', f'{255:X}'
('0xff', 'ff', 'FF')
 See also format() for more information. See also int() for converting a hexadecimal string to an integer using a base of 16.  Note To obtain a hexadecimal string representation for a float, use the float.hex() method.
hmac.compare_digest(a, b)  
Return a == b. This function uses an approach designed to prevent timing analysis by avoiding content-based short circuiting behaviour, making it appropriate for cryptography. a and b must both be of the same type: either str (ASCII only, as e.g. returned by HMAC.hexdigest()), or a bytes-like object.  Note If a and b are of different lengths, or if an error occurs, a timing attack could theoretically reveal information about the types and lengths of a and b—but not their values.   New in version 3.3.   Changed in version 3.9: The function uses OpenSSL’s CRYPTO_memcmp() internally when available.
hmac.digest(key, msg, digest)  
Return digest of msg for given secret key and digest. The function is equivalent to HMAC(key, msg, digest).digest(), but uses an optimized C or inline implementation, which is faster for messages that fit into memory. The parameters key, msg, and digest have the same meaning as in new(). CPython implementation detail, the optimized C implementation is only used when digest is a string and name of a digest algorithm, which is supported by OpenSSL.  New in version 3.7.
HMAC.block_size  
The internal block size of the hash algorithm in bytes.  New in version 3.4.
HMAC.copy()  
Return a copy (“clone”) of the hmac object. This can be used to efficiently compute the digests of strings that share a common initial substring.
HMAC.digest()  
Return the digest of the bytes passed to the update() method so far. This bytes object will be the same length as the digest_size of the digest given to the constructor. It may contain non-ASCII bytes, including NUL bytes.  Warning When comparing the output of digest() to an externally-supplied digest during a verification routine, it is recommended to use the compare_digest() function instead of the == operator to reduce the vulnerability to timing attacks.
HMAC.digest_size  
The size of the resulting HMAC digest in bytes.
HMAC.hexdigest()  
Like digest() except the digest is returned as a string twice the length containing only hexadecimal digits. This may be used to exchange the value safely in email or other non-binary environments.  Warning When comparing the output of hexdigest() to an externally-supplied digest during a verification routine, it is recommended to use the compare_digest() function instead of the == operator to reduce the vulnerability to timing attacks.
HMAC.name  
The canonical name of this HMAC, always lowercase, e.g. hmac-md5.  New in version 3.4.
HMAC.update(msg)  
Update the hmac object with msg. Repeated calls are equivalent to a single call with the concatenation of all the arguments: m.update(a); m.update(b) is equivalent to m.update(a + b).  Changed in version 3.4: Parameter msg can be of any type supported by hashlib.
hmac.new(key, msg=None, digestmod='')  
Return a new hmac object. key is a bytes or bytearray object giving the secret key. If msg is present, the method call update(msg) is made. digestmod is the digest name, digest constructor or module for the HMAC object to use. It may be any name suitable to hashlib.new(). Despite its argument position, it is required.  Changed in version 3.4: Parameter key can be a bytes or bytearray object. Parameter msg can be of any type supported by hashlib. Parameter digestmod can be the name of a hash algorithm.   Deprecated since version 3.4, removed in version 3.8: MD5 as implicit default digest for digestmod is deprecated. The digestmod parameter is now required. Pass it as a keyword argument to avoid awkwardness when you do not have an initial msg.
html — HyperText Markup Language support Source code: Lib/html/__init__.py This module defines utilities to manipulate HTML.  
html.escape(s, quote=True)  
Convert the characters &, < and > in string s to HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML. If the optional flag quote is true, the characters (") and (') are also translated; this helps for inclusion in an HTML attribute value delimited by quotes, as in <a href="...">.  New in version 3.2.  
  
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.  
 Submodules in the html package are:  
html.parser – HTML/XHTML parser with lenient parsing mode 
html.entities – HTML entity definitions
html.entities — Definitions of HTML general entities Source code: Lib/html/entities.py This module defines four dictionaries, html5, name2codepoint, codepoint2name, and entitydefs.  
html.entities.html5  
A dictionary that maps HTML5 named character references 1 to the equivalent Unicode character(s), e.g. html5['gt;'] == '>'. Note that the trailing semicolon is included in the name (e.g. 'gt;'), however some of the names are accepted by the standard even without the semicolon: in this case the name is present with and without the ';'. See also html.unescape().  New in version 3.3.  
  
html.entities.entitydefs  
A dictionary mapping XHTML 1.0 entity definitions to their replacement text in ISO Latin-1. 
  
html.entities.name2codepoint  
A dictionary that maps HTML entity names to the Unicode code points. 
  
html.entities.codepoint2name  
A dictionary that maps Unicode code points to HTML entity names. 
 Footnotes  
1  
See https://www.w3.org/TR/html5/syntax.html#named-character-references
html.entities.codepoint2name  
A dictionary that maps Unicode code points to HTML entity names.
html.entities.entitydefs  
A dictionary mapping XHTML 1.0 entity definitions to their replacement text in ISO Latin-1.
html.entities.html5  
A dictionary that maps HTML5 named character references 1 to the equivalent Unicode character(s), e.g. html5['gt;'] == '>'. Note that the trailing semicolon is included in the name (e.g. 'gt;'), however some of the names are accepted by the standard even without the semicolon: in this case the name is present with and without the ';'. See also html.unescape().  New in version 3.3.
html.entities.name2codepoint  
A dictionary that maps HTML entity names to the Unicode code points.
html.escape(s, quote=True)  
Convert the characters &, < and > in string s to HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML. If the optional flag quote is true, the characters (") and (') are also translated; this helps for inclusion in an HTML attribute value delimited by quotes, as in <a href="...">.  New in version 3.2.
class html.parser.HTMLParser(*, convert_charrefs=True)  
Create a parser instance able to parse invalid markup. If convert_charrefs is True (the default), all character references (except the ones in script/style elements) are automatically converted to the corresponding Unicode characters. An HTMLParser instance is fed HTML data and calls handler methods when start tags, end tags, text, comments, and other markup elements are encountered. The user should subclass HTMLParser and override its methods to implement the desired behavior. This parser does not check that end tags match start tags or call the end-tag handler for elements which are closed implicitly by closing an outer element.  Changed in version 3.4: convert_charrefs keyword argument added.   Changed in version 3.5: The default value for argument convert_charrefs is now True.
HTMLParser.close()  
Force processing of all buffered data as if it were followed by an end-of-file mark. This method may be redefined by a derived class to define additional processing at the end of the input, but the redefined version should always call the HTMLParser base class method close().
HTMLParser.feed(data)  
Feed some text to the parser. It is processed insofar as it consists of complete elements; incomplete data is buffered until more data is fed or close() is called. data must be str.
HTMLParser.get_starttag_text()  
Return the text of the most recently opened start tag. This should not normally be needed for structured processing, but may be useful in dealing with HTML “as deployed” or for re-generating input with minimal changes (whitespace between attributes can be preserved, etc.).