neulab/docprompting-conala huggingface dataset:
class mailbox.mbox(path, factory=None, create=True)  
A subclass of Mailbox for mailboxes in mbox format. Parameter factory is a callable object that accepts a file-like message representation (which behaves as if opened in binary mode) and returns a custom representation. If factory is None, mboxMessage is used as the default message representation. If create is True, the mailbox is created if it does not exist. The mbox format is the classic format for storing mail on Unix systems. All messages in an mbox mailbox are stored in a single file with the beginning of each message indicated by a line whose first five characters are “From “. Several variations of the mbox format exist to address perceived shortcomings in the original. In the interest of compatibility, mbox implements the original format, which is sometimes referred to as mboxo. This means that the Content-Length header, if present, is ignored and that any occurrences of “From ” at the beginning of a line in a message body are transformed to “>From ” when storing the message, although occurrences of “>From ” are not transformed to “From ” when reading the message. Some Mailbox methods implemented by mbox deserve special remarks:  
get_file(key)  
Using the file after calling flush() or close() on the mbox instance may yield unpredictable results or raise an exception. 
  
lock()  
unlock()  
Three locking mechanisms are used—dot locking and, if available, the flock() and lockf() system calls.
get_file(key)  
Using the file after calling flush() or close() on the mbox instance may yield unpredictable results or raise an exception.
class mailbox.mboxMessage(message=None)  
A message with mbox-specific behaviors. Parameter message has the same meaning as with the Message constructor. Messages in an mbox mailbox are stored together in a single file. The sender’s envelope address and the time of delivery are typically stored in a line beginning with “From ” that is used to indicate the start of a message, though there is considerable variation in the exact format of this data among mbox implementations. Flags that indicate the state of the message, such as whether it has been read or marked as important, are typically stored in Status and X-Status headers. Conventional flags for mbox messages are as follows:   
Flag Meaning Explanation   
R Read Read  
O Old Previously detected by MUA  
D Deleted Marked for subsequent deletion  
F Flagged Marked as important  
A Answered Replied to   The “R” and “O” flags are stored in the Status header, and the “D”, “F”, and “A” flags are stored in the X-Status header. The flags and headers typically appear in the order mentioned. mboxMessage instances offer the following methods:  
get_from()  
Return a string representing the “From ” line that marks the start of the message in an mbox mailbox. The leading “From ” and the trailing newline are excluded. 
  
set_from(from_, time_=None)  
Set the “From ” line to from_, which should be specified without a leading “From ” or trailing newline. For convenience, time_ may be specified and will be formatted appropriately and appended to from_. If time_ is specified, it should be a time.struct_time instance, a tuple suitable for passing to time.strftime(), or True (to use time.gmtime()). 
  
get_flags()  
Return a string specifying the flags that are currently set. If the message complies with the conventional format, the result is the concatenation in the following order of zero or one occurrence of each of 'R', 'O', 'D', 'F', and 'A'. 
  
set_flags(flags)  
Set the flags specified by flags and unset all others. Parameter flags should be the concatenation in any order of zero or more occurrences of each of 'R', 'O', 'D', 'F', and 'A'. 
  
add_flag(flag)  
Set the flag(s) specified by flag without changing other flags. To add more than one flag at a time, flag may be a string of more than one character. 
  
remove_flag(flag)  
Unset the flag(s) specified by flag without changing other flags. To remove more than one flag at a time, flag maybe a string of more than one character.
add_flag(flag)  
Set the flag(s) specified by flag without changing other flags. To add more than one flag at a time, flag may be a string of more than one character.
get_flags()  
Return a string specifying the flags that are currently set. If the message complies with the conventional format, the result is the concatenation in the following order of zero or one occurrence of each of 'R', 'O', 'D', 'F', and 'A'.
get_from()  
Return a string representing the “From ” line that marks the start of the message in an mbox mailbox. The leading “From ” and the trailing newline are excluded.
remove_flag(flag)  
Unset the flag(s) specified by flag without changing other flags. To remove more than one flag at a time, flag maybe a string of more than one character.
set_flags(flags)  
Set the flags specified by flags and unset all others. Parameter flags should be the concatenation in any order of zero or more occurrences of each of 'R', 'O', 'D', 'F', and 'A'.
set_from(from_, time_=None)  
Set the “From ” line to from_, which should be specified without a leading “From ” or trailing newline. For convenience, time_ may be specified and will be formatted appropriately and appended to from_. If time_ is specified, it should be a time.struct_time instance, a tuple suitable for passing to time.strftime(), or True (to use time.gmtime()).
class mailbox.Message(message=None)  
A subclass of the email.message module’s Message. Subclasses of mailbox.Message add mailbox-format-specific state and behavior. If message is omitted, the new instance is created in a default, empty state. If message is an email.message.Message instance, its contents are copied; furthermore, any format-specific information is converted insofar as possible if message is a Message instance. If message is a string, a byte string, or a file, it should contain an RFC 2822-compliant message, which is read and parsed. Files should be open in binary mode, but text mode files are accepted for backward compatibility. The format-specific state and behaviors offered by subclasses vary, but in general it is only the properties that are not specific to a particular mailbox that are supported (although presumably the properties are specific to a particular mailbox format). For example, file offsets for single-file mailbox formats and file names for directory-based mailbox formats are not retained, because they are only applicable to the original mailbox. But state such as whether a message has been read by the user or marked as important is retained, because it applies to the message itself. There is no requirement that Message instances be used to represent messages retrieved using Mailbox instances. In some situations, the time and memory required to generate Message representations might not be acceptable. For such situations, Mailbox instances also offer string and file-like representations, and a custom message factory may be specified when a Mailbox instance is initialized.
class mailbox.MH(path, factory=None, create=True)  
A subclass of Mailbox for mailboxes in MH format. Parameter factory is a callable object that accepts a file-like message representation (which behaves as if opened in binary mode) and returns a custom representation. If factory is None, MHMessage is used as the default message representation. If create is True, the mailbox is created if it does not exist. MH is a directory-based mailbox format invented for the MH Message Handling System, a mail user agent. Each message in an MH mailbox resides in its own file. An MH mailbox may contain other MH mailboxes (called folders) in addition to messages. Folders may be nested indefinitely. MH mailboxes also support sequences, which are named lists used to logically group messages without moving them to sub-folders. Sequences are defined in a file called .mh_sequences in each folder. The MH class manipulates MH mailboxes, but it does not attempt to emulate all of mh’s behaviors. In particular, it does not modify and is not affected by the context or .mh_profile files that are used by mh to store its state and configuration. MH instances have all of the methods of Mailbox in addition to the following:  
list_folders()  
Return a list of the names of all folders. 
  
get_folder(folder)  
Return an MH instance representing the folder whose name is folder. A NoSuchMailboxError exception is raised if the folder does not exist. 
  
add_folder(folder)  
Create a folder whose name is folder and return an MH instance representing it. 
  
remove_folder(folder)  
Delete the folder whose name is folder. If the folder contains any messages, a NotEmptyError exception will be raised and the folder will not be deleted. 
  
get_sequences()  
Return a dictionary of sequence names mapped to key lists. If there are no sequences, the empty dictionary is returned. 
  
set_sequences(sequences)  
Re-define the sequences that exist in the mailbox based upon sequences, a dictionary of names mapped to key lists, like returned by get_sequences(). 
  
pack()  
Rename messages in the mailbox as necessary to eliminate gaps in numbering. Entries in the sequences list are updated correspondingly.  Note Already-issued keys are invalidated by this operation and should not be subsequently used.  
 Some Mailbox methods implemented by MH deserve special remarks:  
remove(key)  
__delitem__(key)  
discard(key)  
These methods immediately delete the message. The MH convention of marking a message for deletion by prepending a comma to its name is not used. 
  
lock()  
unlock()  
Three locking mechanisms are used—dot locking and, if available, the flock() and lockf() system calls. For MH mailboxes, locking the mailbox means locking the .mh_sequences file and, only for the duration of any operations that affect them, locking individual message files. 
  
get_file(key)  
Depending upon the host platform, it may not be possible to remove the underlying message while the returned file remains open. 
  
flush()  
All changes to MH mailboxes are immediately applied, so this method does nothing. 
  
close()  
MH instances do not keep any open files, so this method is equivalent to unlock().
add_folder(folder)  
Create a folder whose name is folder and return an MH instance representing it.
close()  
MH instances do not keep any open files, so this method is equivalent to unlock().
remove(key)  
__delitem__(key)  
discard(key)  
These methods immediately delete the message. The MH convention of marking a message for deletion by prepending a comma to its name is not used.
flush()  
All changes to MH mailboxes are immediately applied, so this method does nothing.
get_file(key)  
Depending upon the host platform, it may not be possible to remove the underlying message while the returned file remains open.
get_folder(folder)  
Return an MH instance representing the folder whose name is folder. A NoSuchMailboxError exception is raised if the folder does not exist.
get_sequences()  
Return a dictionary of sequence names mapped to key lists. If there are no sequences, the empty dictionary is returned.
lock()  
unlock()  
Three locking mechanisms are used—dot locking and, if available, the flock() and lockf() system calls. For MH mailboxes, locking the mailbox means locking the .mh_sequences file and, only for the duration of any operations that affect them, locking individual message files.
pack()  
Rename messages in the mailbox as necessary to eliminate gaps in numbering. Entries in the sequences list are updated correspondingly.  Note Already-issued keys are invalidated by this operation and should not be subsequently used.
set_sequences(sequences)  
Re-define the sequences that exist in the mailbox based upon sequences, a dictionary of names mapped to key lists, like returned by get_sequences().
class mailbox.MHMessage(message=None)  
A message with MH-specific behaviors. Parameter message has the same meaning as with the Message constructor. MH messages do not support marks or flags in the traditional sense, but they do support sequences, which are logical groupings of arbitrary messages. Some mail reading programs (although not the standard mh and nmh) use sequences in much the same way flags are used with other formats, as follows:   
Sequence Explanation   
unseen Not read, but previously detected by MUA  
replied Replied to  
flagged Marked as important   MHMessage instances offer the following methods:  
get_sequences()  
Return a list of the names of sequences that include this message. 
  
set_sequences(sequences)  
Set the list of sequences that include this message. 
  
add_sequence(sequence)  
Add sequence to the list of sequences that include this message. 
  
remove_sequence(sequence)  
Remove sequence from the list of sequences that include this message.
class mailbox.MMDF(path, factory=None, create=True)  
A subclass of Mailbox for mailboxes in MMDF format. Parameter factory is a callable object that accepts a file-like message representation (which behaves as if opened in binary mode) and returns a custom representation. If factory is None, MMDFMessage is used as the default message representation. If create is True, the mailbox is created if it does not exist. MMDF is a single-file mailbox format invented for the Multichannel Memorandum Distribution Facility, a mail transfer agent. Each message is in the same form as an mbox message but is bracketed before and after by lines containing four Control-A ('\001') characters. As with the mbox format, the beginning of each message is indicated by a line whose first five characters are “From “, but additional occurrences of “From ” are not transformed to “>From ” when storing messages because the extra message separator lines prevent mistaking such occurrences for the starts of subsequent messages. Some Mailbox methods implemented by MMDF deserve special remarks:  
get_file(key)  
Using the file after calling flush() or close() on the MMDF instance may yield unpredictable results or raise an exception. 
  
lock()  
unlock()  
Three locking mechanisms are used—dot locking and, if available, the flock() and lockf() system calls.
get_file(key)  
Using the file after calling flush() or close() on the MMDF instance may yield unpredictable results or raise an exception.
class mailbox.MMDFMessage(message=None)  
A message with MMDF-specific behaviors. Parameter message has the same meaning as with the Message constructor. As with message in an mbox mailbox, MMDF messages are stored with the sender’s address and the delivery date in an initial line beginning with “From “. Likewise, flags that indicate the state of the message are typically stored in Status and X-Status headers. Conventional flags for MMDF messages are identical to those of mbox message and are as follows:   
Flag Meaning Explanation   
R Read Read  
O Old Previously detected by MUA  
D Deleted Marked for subsequent deletion  
F Flagged Marked as important  
A Answered Replied to   The “R” and “O” flags are stored in the Status header, and the “D”, “F”, and “A” flags are stored in the X-Status header. The flags and headers typically appear in the order mentioned. MMDFMessage instances offer the following methods, which are identical to those offered by mboxMessage:  
get_from()  
Return a string representing the “From ” line that marks the start of the message in an mbox mailbox. The leading “From ” and the trailing newline are excluded. 
  
set_from(from_, time_=None)  
Set the “From ” line to from_, which should be specified without a leading “From ” or trailing newline. For convenience, time_ may be specified and will be formatted appropriately and appended to from_. If time_ is specified, it should be a time.struct_time instance, a tuple suitable for passing to time.strftime(), or True (to use time.gmtime()). 
  
get_flags()  
Return a string specifying the flags that are currently set. If the message complies with the conventional format, the result is the concatenation in the following order of zero or one occurrence of each of 'R', 'O', 'D', 'F', and 'A'. 
  
set_flags(flags)  
Set the flags specified by flags and unset all others. Parameter flags should be the concatenation in any order of zero or more occurrences of each of 'R', 'O', 'D', 'F', and 'A'. 
  
add_flag(flag)  
Set the flag(s) specified by flag without changing other flags. To add more than one flag at a time, flag may be a string of more than one character. 
  
remove_flag(flag)  
Unset the flag(s) specified by flag without changing other flags. To remove more than one flag at a time, flag maybe a string of more than one character.
exception mailbox.NoSuchMailboxError  
Raised when a mailbox is expected but is not found, such as when instantiating a Mailbox subclass with a path that does not exist (and with the create parameter set to False), or when opening a folder that does not exist.
exception mailbox.NotEmptyError  
Raised when a mailbox is not empty but is expected to be, such as when deleting a folder that contains messages.
mailcap.findmatch(caps, MIMEtype, key='view', filename='/dev/null', plist=[])  
Return a 2-tuple; the first element is a string containing the command line to be executed (which can be passed to os.system()), and the second element is the mailcap entry for a given MIME type. If no matching MIME type can be found, (None, None) is returned. key is the name of the field desired, which represents the type of activity to be performed; the default value is ‘view’, since in the most common case you simply want to view the body of the MIME-typed data. Other possible values might be ‘compose’ and ‘edit’, if you wanted to create a new body of the given MIME type or alter the existing body data. See RFC 1524 for a complete list of these fields. filename is the filename to be substituted for %s in the command line; the default value is '/dev/null' which is almost certainly not what you want, so usually you’ll override it by specifying a filename. plist can be a list containing named parameters; the default value is simply an empty list. Each entry in the list must be a string containing the parameter name, an equals sign ('='), and the parameter’s value. Mailcap entries can contain named parameters like %{foo}, which will be replaced by the value of the parameter named ‘foo’. For example, if the command line showpartial
%{id} %{number} %{total} was in a mailcap file, and plist was set to ['id=1', 'number=2', 'total=3'], the resulting command line would be 'showpartial 1 2 3'. In a mailcap file, the “test” field can optionally be specified to test some external condition (such as the machine architecture, or the window system in use) to determine whether or not the mailcap line applies. findmatch() will automatically check such conditions and skip the entry if the check fails.
mailcap.getcaps()  
Returns a dictionary mapping MIME types to a list of mailcap file entries. This dictionary must be passed to the findmatch() function. An entry is stored as a list of dictionaries, but it shouldn’t be necessary to know the details of this representation. The information is derived from all of the mailcap files found on the system. Settings in the user’s mailcap file $HOME/.mailcap will override settings in the system mailcap files /etc/mailcap, /usr/etc/mailcap, and /usr/local/etc/mailcap.
map(function, iterable, ...)  
Return an iterator that applies function to every item of iterable, yielding the results. If additional iterable arguments are passed, function must take that many arguments and is applied to the items from all iterables in parallel. With multiple iterables, the iterator stops when the shortest iterable is exhausted. For cases where the function inputs are already arranged into argument tuples, see itertools.starmap().
marshal.dump(value, file[, version])  
Write the value on the open file. The value must be a supported type. The file must be a writeable binary file. If the value has (or contains an object that has) an unsupported type, a ValueError exception is raised — but garbage data will also be written to the file. The object will not be properly read back by load(). The version argument indicates the data format that dump should use (see below).
marshal.dumps(value[, version])  
Return the bytes object that would be written to a file by dump(value, file). The value must be a supported type. Raise a ValueError exception if value has (or contains an object that has) an unsupported type. The version argument indicates the data format that dumps should use (see below).
marshal.load(file)  
Read one value from the open file and return it. If no valid value is read (e.g. because the data has a different Python version’s incompatible marshal format), raise EOFError, ValueError or TypeError. The file must be a readable binary file.  Note If an object containing an unsupported type was marshalled with dump(), load() will substitute None for the unmarshallable type.
marshal.loads(bytes)  
Convert the bytes-like object to a value. If no valid value is found, raise EOFError, ValueError or TypeError. Extra bytes in the input are ignored.
marshal.version  
Indicates the format that the module uses. Version 0 is the historical format, version 1 shares interned strings and version 2 uses a binary format for floating point numbers. Version 3 adds support for object instancing and recursion. The current version is 4.
math.acos(x)  
Return the arc cosine of x, in radians. The result is between 0 and pi.
math.asin(x)  
Return the arc sine of x, in radians. The result is between -pi/2 and pi/2.
math.atan(x)  
Return the arc tangent of x, in radians. The result is between -pi/2 and pi/2.
math.atan2(y, x)  
Return atan(y / x), in radians. The result is between -pi and pi. The vector in the plane from the origin to point (x, y) makes this angle with the positive X axis. The point of atan2() is that the signs of both inputs are known to it, so it can compute the correct quadrant for the angle. For example, atan(1) and atan2(1, 1) are both pi/4, but atan2(-1,
-1) is -3*pi/4.
math.atanh(x)  
Return the inverse hyperbolic tangent of x.
math.ceil(x)  
Return the ceiling of x, the smallest integer greater than or equal to x. If x is not a float, delegates to x.__ceil__(), which should return an Integral value.
math.comb(n, k)  
Return the number of ways to choose k items from n items without repetition and without order. Evaluates to n! / (k! * (n - k)!) when k <= n and evaluates to zero when k > n. Also called the binomial coefficient because it is equivalent to the coefficient of k-th term in polynomial expansion of the expression (1 + x) ** n. Raises TypeError if either of the arguments are not integers. Raises ValueError if either of the arguments are negative.  New in version 3.8.
math.copysign(x, y)  
Return a float with the magnitude (absolute value) of x but the sign of y. On platforms that support signed zeros, copysign(1.0, -0.0) returns -1.0.
math.dist(p, q)  
Return the Euclidean distance between two points p and q, each given as a sequence (or iterable) of coordinates. The two points must have the same dimension. Roughly equivalent to: sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))
  New in version 3.8.
math.e  
The mathematical constant e = 2.718281…, to available precision.
math.erf(x)  
Return the error function at x. The erf() function can be used to compute traditional statistical functions such as the cumulative standard normal distribution: def phi(x):
    'Cumulative distribution function for the standard normal distribution'
    return (1.0 + erf(x / sqrt(2.0))) / 2.0
  New in version 3.2.
math.erfc(x)  
Return the complementary error function at x. The complementary error function is defined as 1.0 - erf(x). It is used for large values of x where a subtraction from one would cause a loss of significance.  New in version 3.2.
math.exp(x)  
Return e raised to the power x, where e = 2.718281… is the base of natural logarithms. This is usually more accurate than math.e ** x or pow(math.e, x).