neulab/docprompting-conala huggingface dataset:
pkgutil.walk_packages(path=None, prefix='', onerror=None)  
Yields ModuleInfo for all modules recursively on path, or, if path is None, all accessible modules. path should be either None or a list of paths to look for modules in. prefix is a string to output on the front of every module name on output. Note that this function must import all packages (not all modules!) on the given path, in order to access the __path__ attribute to find submodules. onerror is a function which gets called with one argument (the name of the package which was being imported) if any exception occurs while trying to import a package. If no onerror function is supplied, ImportErrors are caught and ignored, while all other exceptions are propagated, terminating the search. Examples: # list all modules python can access
walk_packages()

# list all submodules of ctypes
walk_packages(ctypes.__path__, ctypes.__name__ + '.')
  Note Only works for a finder which defines an iter_modules() method. This interface is non-standard, so the module also provides implementations for importlib.machinery.FileFinder and zipimport.zipimporter.   Changed in version 3.3: Updated to be based directly on importlib rather than relying on the package internal PEP 302 import emulation.
platform.architecture(executable=sys.executable, bits='', linkage='')  
Queries the given executable (defaults to the Python interpreter binary) for various architecture information. Returns a tuple (bits, linkage) which contain information about the bit architecture and the linkage format used for the executable. Both values are returned as strings. Values that cannot be determined are returned as given by the parameter presets. If bits is given as '', the sizeof(pointer) (or sizeof(long) on Python version < 1.5.2) is used as indicator for the supported pointer size. The function relies on the system’s file command to do the actual work. This is available on most if not all Unix platforms and some non-Unix platforms and then only if the executable points to the Python interpreter. Reasonable defaults are used when the above needs are not met.  Note On Mac OS X (and perhaps other platforms), executable files may be universal files containing multiple architectures. To get at the “64-bitness” of the current interpreter, it is more reliable to query the sys.maxsize attribute: is_64bits = sys.maxsize > 2**32
platform.java_ver(release='', vendor='', vminfo=('', '', ''), osinfo=('', '', ''))  
Version interface for Jython. Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being a tuple (vm_name, vm_release, vm_vendor) and osinfo being a tuple (os_name, os_version, os_arch). Values which cannot be determined are set to the defaults given as parameters (which all default to '').
platform.libc_ver(executable=sys.executable, lib='', version='', chunksize=16384)  
Tries to determine the libc version against which the file executable (defaults to the Python interpreter) is linked. Returns a tuple of strings (lib,
version) which default to the given parameters in case the lookup fails. Note that this function has intimate knowledge of how different libc versions add symbols to the executable is probably only usable for executables compiled using gcc. The file is read and scanned in chunks of chunksize bytes.
platform.machine()  
Returns the machine type, e.g. 'i386'. An empty string is returned if the value cannot be determined.
platform.mac_ver(release='', versioninfo=('', '', ''), machine='')  
Get Mac OS version information and return it as tuple (release, versioninfo,
machine) with versioninfo being a tuple (version, dev_stage,
non_release_version). Entries which cannot be determined are set to ''. All tuple entries are strings.
platform.node()  
Returns the computer’s network name (may not be fully qualified!). An empty string is returned if the value cannot be determined.
platform.platform(aliased=0, terse=0)  
Returns a single string identifying the underlying platform with as much useful information as possible. The output is intended to be human readable rather than machine parseable. It may look different on different platforms and this is intended. If aliased is true, the function will use aliases for various platforms that report system names which differ from their common names, for example SunOS will be reported as Solaris. The system_alias() function is used to implement this. Setting terse to true causes the function to return only the absolute minimum information needed to identify the platform.  Changed in version 3.8: On macOS, the function now uses mac_ver(), if it returns a non-empty release string, to get the macOS version rather than the darwin version.
platform.processor()  
Returns the (real) processor name, e.g. 'amdk6'. An empty string is returned if the value cannot be determined. Note that many platforms do not provide this information or simply return the same value as for machine(). NetBSD does this.
platform.python_build()  
Returns a tuple (buildno, builddate) stating the Python build number and date as strings.
platform.python_implementation()  
Returns a string identifying the Python implementation. Possible return values are: ‘CPython’, ‘IronPython’, ‘Jython’, ‘PyPy’.
platform.python_version()  
Returns the Python version as string 'major.minor.patchlevel'. Note that unlike the Python sys.version, the returned value will always include the patchlevel (it defaults to 0).
platform.python_version_tuple()  
Returns the Python version as tuple (major, minor, patchlevel) of strings. Note that unlike the Python sys.version, the returned value will always include the patchlevel (it defaults to '0').
platform.release()  
Returns the system’s release, e.g. '2.2.0' or 'NT' An empty string is returned if the value cannot be determined.
platform.system()  
Returns the system/OS name, such as 'Linux', 'Darwin', 'Java', 'Windows'. An empty string is returned if the value cannot be determined.
platform.system_alias(system, release, version)  
Returns (system, release, version) aliased to common marketing names used for some systems. It also does some reordering of the information in some cases where it would otherwise cause confusion.
platform.uname()  
Fairly portable uname interface. Returns a namedtuple() containing six attributes: system, node, release, version, machine, and processor. Note that this adds a sixth attribute (processor) not present in the os.uname() result. Also, the attribute names are different for the first two attributes; os.uname() names them sysname and nodename. Entries which cannot be determined are set to ''.  Changed in version 3.3: Result changed from a tuple to a namedtuple.
platform.version()  
Returns the system’s release version, e.g. '#3 on degas'. An empty string is returned if the value cannot be determined.
platform.win32_edition()  
Returns a string representing the current Windows edition. Possible values include but are not limited to 'Enterprise', 'IoTUAP', 'ServerStandard', and 'nanoserver'.  New in version 3.8.
platform.win32_is_iot()  
Return True if the Windows edition returned by win32_edition() is recognized as an IoT edition.  New in version 3.8.
platform.win32_ver(release='', version='', csd='', ptype='')  
Get additional version information from the Windows Registry and return a tuple (release, version, csd, ptype) referring to OS release, version number, CSD level (service pack) and OS type (multi/single processor). As a hint: ptype is 'Uniprocessor Free' on single processor NT machines and 'Multiprocessor Free' on multi processor machines. The ‘Free’ refers to the OS version being free of debugging code. It could also state ‘Checked’ which means the OS version uses debugging code, i.e. code that checks arguments, ranges, etc.
plistlib.dump(value, fp, *, fmt=FMT_XML, sort_keys=True, skipkeys=False)  
Write value to a plist file. Fp should be a writable, binary file object. The fmt argument specifies the format of the plist file and can be one of the following values:  
FMT_XML: XML formatted plist file 
FMT_BINARY: Binary formatted plist file  When sort_keys is true (the default) the keys for dictionaries will be written to the plist in sorted order, otherwise they will be written in the iteration order of the dictionary. When skipkeys is false (the default) the function raises TypeError when a key of a dictionary is not a string, otherwise such keys are skipped. A TypeError will be raised if the object is of an unsupported type or a container that contains objects of unsupported types. An OverflowError will be raised for integer values that cannot be represented in (binary) plist files.  New in version 3.4.
plistlib.dumps(value, *, fmt=FMT_XML, sort_keys=True, skipkeys=False)  
Return value as a plist-formatted bytes object. See the documentation for dump() for an explanation of the keyword arguments of this function.  New in version 3.4.
plistlib.FMT_BINARY  
The binary format for plist files  New in version 3.4.
plistlib.FMT_XML  
The XML format for plist files.  New in version 3.4.
plistlib.load(fp, *, fmt=None, dict_type=dict)  
Read a plist file. fp should be a readable and binary file object. Return the unpacked root object (which usually is a dictionary). The fmt is the format of the file and the following values are valid:  
None: Autodetect the file format 
FMT_XML: XML file format 
FMT_BINARY: Binary plist format  The dict_type is the type used for dictionaries that are read from the plist file. XML data for the FMT_XML format is parsed using the Expat parser from xml.parsers.expat – see its documentation for possible exceptions on ill-formed XML. Unknown elements will simply be ignored by the plist parser. The parser for the binary format raises InvalidFileException when the file cannot be parsed.  New in version 3.4.
plistlib.loads(data, *, fmt=None, dict_type=dict)  
Load a plist from a bytes object. See load() for an explanation of the keyword arguments.  New in version 3.4.
class plistlib.UID(data)  
Wraps an int. This is used when reading or writing NSKeyedArchiver encoded data, which contains UID (see PList manual). It has one attribute, data, which can be used to retrieve the int value of the UID. data must be in the range 0 <= data < 2**64.  New in version 3.8.
exception poplib.error_proto  
Exception raised on any errors from this module (errors from socket module are not caught). The reason for the exception is passed to the constructor as a string.
class poplib.POP3(host, port=POP3_PORT[, timeout])  
This class implements the actual POP3 protocol. The connection is created when the instance is initialized. If port is omitted, the standard POP3 port (110) is used. The optional timeout parameter specifies a timeout in seconds for the connection attempt (if not specified, the global default timeout setting will be used). Raises an auditing event poplib.connect with arguments self, host, port.
All commands will raise an auditing event poplib.putline with arguments self and line, where line is the bytes about to be sent to the remote host.  Changed in version 3.9: If the timeout parameter is set to be zero, it will raise a ValueError to prevent the creation of a non-blocking socket.
POP3.apop(user, secret)  
Use the more secure APOP authentication to log into the POP3 server.
POP3.capa()  
Query the server’s capabilities as specified in RFC 2449. Returns a dictionary in the form {'name': ['param'...]}.  New in version 3.4.
POP3.dele(which)  
Flag message number which for deletion. On most servers deletions are not actually performed until QUIT (the major exception is Eudora QPOP, which deliberately violates the RFCs by doing pending deletes on any disconnect).
POP3.getwelcome()  
Returns the greeting string sent by the POP3 server.
POP3.list([which])  
Request message list, result is in the form (response, ['mesg_num octets',
...], octets). If which is set, it is the message to list.
POP3.noop()  
Do nothing. Might be used as a keep-alive.
POP3.pass_(password)  
Send password, response includes message count and mailbox size. Note: the mailbox on the server is locked until quit() is called.
POP3.quit()  
Signoff: commit changes, unlock mailbox, drop connection.
POP3.retr(which)  
Retrieve whole message number which, and set its seen flag. Result is in form (response, ['line', ...], octets).
POP3.rpop(user)  
Use RPOP authentication (similar to UNIX r-commands) to log into POP3 server.
POP3.set_debuglevel(level)  
Set the instance’s debugging level. This controls the amount of debugging output printed. The default, 0, produces no debugging output. A value of 1 produces a moderate amount of debugging output, generally a single line per request. A value of 2 or higher produces the maximum amount of debugging output, logging each line sent and received on the control connection.
POP3.stat()  
Get mailbox status. The result is a tuple of 2 integers: (message count,
mailbox size).
POP3.stls(context=None)  
Start a TLS session on the active connection as specified in RFC 2595. This is only allowed before user authentication context parameter is a ssl.SSLContext object which allows bundling SSL configuration options, certificates and private keys into a single (potentially long-lived) structure. Please read Security considerations for best practices. This method supports hostname checking via ssl.SSLContext.check_hostname and Server Name Indication (see ssl.HAS_SNI).  New in version 3.4.
POP3.top(which, howmuch)  
Retrieves the message header plus howmuch lines of the message after the header of message number which. Result is in form (response, ['line', ...],
octets). The POP3 TOP command this method uses, unlike the RETR command, doesn’t set the message’s seen flag; unfortunately, TOP is poorly specified in the RFCs and is frequently broken in off-brand servers. Test this method by hand against the POP3 servers you will use before trusting it.
POP3.uidl(which=None)  
Return message digest (unique id) list. If which is specified, result contains the unique id for that message in the form 'response mesgnum uid, otherwise result is list (response, ['mesgnum uid', ...], octets).
POP3.user(username)  
Send user command, response should indicate that a password is required.
POP3.utf8()  
Try to switch to UTF-8 mode. Returns the server response if successful, raises error_proto if not. Specified in RFC 6856.  New in version 3.5.
class poplib.POP3_SSL(host, port=POP3_SSL_PORT, keyfile=None, certfile=None, timeout=None, context=None)  
This is a subclass of POP3 that connects to the server over an SSL encrypted socket. If port is not specified, 995, the standard POP3-over-SSL port is used. timeout works as in the POP3 constructor. context is an optional ssl.SSLContext object which allows bundling SSL configuration options, certificates and private keys into a single (potentially long-lived) structure. Please read Security considerations for best practices. keyfile and certfile are a legacy alternative to context - they can point to PEM-formatted private key and certificate chain files, respectively, for the SSL connection. Raises an auditing event poplib.connect with arguments self, host, port.
All commands will raise an auditing event poplib.putline with arguments self and line, where line is the bytes about to be sent to the remote host.  Changed in version 3.2: context parameter added.   Changed in version 3.4: The class now supports hostname check with ssl.SSLContext.check_hostname and Server Name Indication (see ssl.HAS_SNI).   Deprecated since version 3.6: keyfile and certfile 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.   Changed in version 3.9: If the timeout parameter is set to be zero, it will raise a ValueError to prevent the creation of a non-blocking socket.
posix — The most common POSIX system calls This module provides access to operating system functionality that is standardized by the C Standard and the POSIX standard (a thinly disguised Unix interface). Do not import this module directly. Instead, import the module os, which provides a portable version of this interface. On Unix, the os module provides a superset of the posix interface. On non-Unix operating systems the posix module is not available, but a subset is always available through the os interface. Once os is imported, there is no performance penalty in using it instead of posix. In addition, os provides some additional functionality, such as automatically calling putenv() when an entry in os.environ is changed. Errors are reported as exceptions; the usual exceptions are given for type errors, while errors reported by the system calls raise OSError. Large File Support Several operating systems (including AIX, HP-UX, Irix and Solaris) provide support for files that are larger than 2 GiB from a C programming model where int and long are 32-bit values. This is typically accomplished by defining the relevant size and offset types as 64-bit values. Such files are sometimes referred to as large files. Large file support is enabled in Python when the size of an off_t is larger than a long and the long long is at least as large as an off_t. It may be necessary to configure and compile Python with certain compiler flags to enable this mode. For example, it is enabled by default with recent versions of Irix, but with Solaris 2.6 and 2.7 you need to do something like: CFLAGS="`getconf LFS_CFLAGS`" OPT="-g -O2 $CFLAGS" \
        ./configure
 On large-file-capable Linux systems, this might work: CFLAGS='-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64' OPT="-g -O2 $CFLAGS" \
        ./configure
 Notable Module Contents In addition to many functions described in the os module documentation, posix defines the following data item:  
posix.environ  
A dictionary representing the string environment at the time the interpreter was started. Keys and values are bytes on Unix and str on Windows. For example, environ[b'HOME'] (environ['HOME'] on Windows) is the pathname of your home directory, equivalent to getenv("HOME") in C. Modifying this dictionary does not affect the string environment passed on by execv(), popen() or system(); if you need to change the environment, pass environ to execve() or add variable assignments and export statements to the command string for system() or popen().  Changed in version 3.2: On Unix, keys and values are bytes.   Note The os module provides an alternate implementation of environ which updates the environment on modification. Note also that updating os.environ will render this dictionary obsolete. Use of the os module version of this is recommended over direct access to the posix module.
posix.environ  
A dictionary representing the string environment at the time the interpreter was started. Keys and values are bytes on Unix and str on Windows. For example, environ[b'HOME'] (environ['HOME'] on Windows) is the pathname of your home directory, equivalent to getenv("HOME") in C. Modifying this dictionary does not affect the string environment passed on by execv(), popen() or system(); if you need to change the environment, pass environ to execve() or add variable assignments and export statements to the command string for system() or popen().  Changed in version 3.2: On Unix, keys and values are bytes.   Note The os module provides an alternate implementation of environ which updates the environment on modification. Note also that updating os.environ will render this dictionary obsolete. Use of the os module version of this is recommended over direct access to the posix module.
pow(base, exp[, mod])  
Return base to the power exp; if mod is present, return base to the power exp, modulo mod (computed more efficiently than pow(base, exp) % mod). The two-argument form pow(base, exp) is equivalent to using the power operator: base**exp. The arguments must have numeric types. With mixed operand types, the coercion rules for binary arithmetic operators apply. For int operands, the result has the same type as the operands (after coercion) unless the second argument is negative; in that case, all arguments are converted to float and a float result is delivered. For example, 10**2 returns 100, but 10**-2 returns 0.01. For int operands base and exp, if mod is present, mod must also be of integer type and mod must be nonzero. If mod is present and exp is negative, base must be relatively prime to mod. In that case, pow(inv_base, -exp, mod) is returned, where inv_base is an inverse to base modulo mod. Here’s an example of computing an inverse for 38 modulo 97: >>> pow(38, -1, mod=97)
23
>>> 23 * 38 % 97 == 1
True
  Changed in version 3.8: For int operands, the three-argument form of pow now allows the second argument to be negative, permitting computation of modular inverses.   Changed in version 3.8: Allow keyword arguments. Formerly, only positional arguments were supported.
pprint.isreadable(object)  
Determine if the formatted representation of object is “readable”, or can be used to reconstruct the value using eval(). This always returns False for recursive objects. >>> pprint.isreadable(stuff)
False
pprint.isrecursive(object)  
Determine if object requires a recursive representation.
pprint.pformat(object, indent=1, width=80, depth=None, *, compact=False, sort_dicts=True)  
Return the formatted representation of object as a string. indent, width, depth, compact and sort_dicts will be passed to the PrettyPrinter constructor as formatting parameters.  Changed in version 3.4: Added the compact parameter.   Changed in version 3.8: Added the sort_dicts parameter.
pprint.pp(object, *args, sort_dicts=False, **kwargs)  
Prints the formatted representation of object followed by a newline. If sort_dicts is false (the default), dictionaries will be displayed with their keys in insertion order, otherwise the dict keys will be sorted. args and kwargs will be passed to pprint() as formatting parameters.  New in version 3.8.
pprint.pprint(object, stream=None, indent=1, width=80, depth=None, *, compact=False, sort_dicts=True)  
Prints the formatted representation of object on stream, followed by a newline. If stream is None, sys.stdout is used. This may be used in the interactive interpreter instead of the print() function for inspecting values (you can even reassign print = pprint.pprint for use within a scope). indent, width, depth, compact and sort_dicts will be passed to the PrettyPrinter constructor as formatting parameters.  Changed in version 3.4: Added the compact parameter.   Changed in version 3.8: Added the sort_dicts parameter. >>> import pprint
>>> stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'ni']
>>> stuff.insert(0, stuff)
>>> pprint.pprint(stuff)
[<Recursion on list with id=...>,
 'spam',
 'eggs',
 'lumberjack',
 'knights',
 'ni']