neulab/docprompting-conala huggingface dataset:
signal.siginterrupt(signalnum, flag)  
Change system call restart behaviour: if flag is False, system calls will be restarted when interrupted by signal signalnum, otherwise system calls will be interrupted. Returns nothing. Availability: Unix. See the man page siginterrupt(3) for further information. Note that installing a signal handler with signal() will reset the restart behaviour to interruptible by implicitly calling siginterrupt() with a true flag value for the given signal.
signal.SIGKILL  
Kill signal. It cannot be caught, blocked, or ignored. Availability: Unix.
signal.signal(signalnum, handler)  
Set the handler for signal signalnum to the function handler. handler can be a callable Python object taking two arguments (see below), or one of the special values signal.SIG_IGN or signal.SIG_DFL. The previous signal handler will be returned (see the description of getsignal() above). (See the Unix man page signal(2) for further information.) When threads are enabled, this function can only be called from the main thread of the main interpreter; attempting to call it from other threads will cause a ValueError exception to be raised. The handler is called with two arguments: the signal number and the current stack frame (None or a frame object; for a description of frame objects, see the description in the type hierarchy or see the attribute descriptions in the inspect module). On Windows, signal() can only be called with SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM, or SIGBREAK. A ValueError will be raised in any other case. Note that not all systems define the same set of signal names; an AttributeError will be raised if a signal name is not defined as SIG* module level constant.
signal.sigpending()  
Examine the set of signals that are pending for delivery to the calling thread (i.e., the signals which have been raised while blocked). Return the set of the pending signals. Availability: Unix. See the man page sigpending(2) for further information. See also pause(), pthread_sigmask() and sigwait().  New in version 3.3.
signal.SIGPIPE  
Broken pipe: write to pipe with no readers. Default action is to ignore the signal. Availability: Unix.
signal.sigtimedwait(sigset, timeout)  
Like sigwaitinfo(), but takes an additional timeout argument specifying a timeout. If timeout is specified as 0, a poll is performed. Returns None if a timeout occurs. Availability: Unix. See the man page sigtimedwait(2) for further information. See also pause(), sigwait() and sigwaitinfo().  New in version 3.3.   Changed in version 3.5: The function is now retried with the recomputed timeout if interrupted by a signal not in sigset and the signal handler does not raise an exception (see PEP 475 for the rationale).
signal.sigwait(sigset)  
Suspend execution of the calling thread until the delivery of one of the signals specified in the signal set sigset. The function accepts the signal (removes it from the pending list of signals), and returns the signal number. Availability: Unix. See the man page sigwait(3) for further information. See also pause(), pthread_sigmask(), sigpending(), sigwaitinfo() and sigtimedwait().  New in version 3.3.
signal.sigwaitinfo(sigset)  
Suspend execution of the calling thread until the delivery of one of the signals specified in the signal set sigset. The function accepts the signal and removes it from the pending list of signals. If one of the signals in sigset is already pending for the calling thread, the function will return immediately with information about that signal. The signal handler is not called for the delivered signal. The function raises an InterruptedError if it is interrupted by a signal that is not in sigset. The return value is an object representing the data contained in the siginfo_t structure, namely: si_signo, si_code, si_errno, si_pid, si_uid, si_status, si_band. Availability: Unix. See the man page sigwaitinfo(2) for further information. See also pause(), sigwait() and sigtimedwait().  New in version 3.3.   Changed in version 3.5: The function is now retried if interrupted by a signal not in sigset and the signal handler does not raise an exception (see PEP 475 for the rationale).
signal.SIG_BLOCK  
A possible value for the how parameter to pthread_sigmask() indicating that signals are to be blocked.  New in version 3.3.
signal.SIG_DFL  
This is one of two standard signal handling options; it will simply perform the default function for the signal. For example, on most systems the default action for SIGQUIT is to dump core and exit, while the default action for SIGCHLD is to simply ignore it.
signal.SIG_IGN  
This is another standard signal handler, which will simply ignore the given signal.
signal.SIG_SETMASK  
A possible value for the how parameter to pthread_sigmask() indicating that the signal mask is to be replaced.  New in version 3.3.
signal.SIG_UNBLOCK  
A possible value for the how parameter to pthread_sigmask() indicating that signals are to be unblocked.  New in version 3.3.
signal.strsignal(signalnum)  
Return the system description of the signal signalnum, such as “Interrupt”, “Segmentation fault”, etc. Returns None if the signal is not recognized.  New in version 3.8.
signal.valid_signals()  
Return the set of valid signal numbers on this platform. This can be less than range(1, NSIG) if some signals are reserved by the system for internal use.  New in version 3.8.
site.addsitedir(sitedir, known_paths=None)  
Add a directory to sys.path and process its .pth files. Typically used in sitecustomize or usercustomize (see above).
site.ENABLE_USER_SITE  
Flag showing the status of the user site-packages directory. True means that it is enabled and was added to sys.path. False means that it was disabled by user request (with -s or PYTHONNOUSERSITE). None means it was disabled for security reasons (mismatch between user or group id and effective id) or by an administrator.
site.getsitepackages()  
Return a list containing all global site-packages directories.  New in version 3.2.
site.getuserbase()  
Return the path of the user base directory, USER_BASE. If it is not initialized yet, this function will also set it, respecting PYTHONUSERBASE.  New in version 3.2.
site.getusersitepackages()  
Return the path of the user-specific site-packages directory, USER_SITE. If it is not initialized yet, this function will also set it, respecting USER_BASE. To determine if the user-specific site-packages was added to sys.path ENABLE_USER_SITE should be used.  New in version 3.2.
site.main()  
Adds all the standard site-specific directories to the module search path. This function is called automatically when this module is imported, unless the Python interpreter was started with the -S flag.  Changed in version 3.3: This function used to be called unconditionally.
site.USER_BASE  
Path to the base directory for the user site-packages. Can be None if getuserbase() hasn’t been called yet. Default value is ~/.local for UNIX and Mac OS X non-framework builds, ~/Library/Python/X.Y for Mac framework builds, and %APPDATA%\Python for Windows. This value is used by Distutils to compute the installation directories for scripts, data files, Python modules, etc. for the user installation scheme. See also PYTHONUSERBASE.
site.USER_SITE  
Path to the user site-packages for the running Python. Can be None if getusersitepackages() hasn’t been called yet. Default value is ~/.local/lib/pythonX.Y/site-packages for UNIX and non-framework Mac OS X builds, ~/Library/Python/X.Y/lib/python/site-packages for Mac framework builds, and %APPDATA%\Python\PythonXY\site-packages on Windows. This directory is a site directory, which means that .pth files in it will be processed.
class slice(stop)  
class slice(start, stop[, step])  
Return a slice object representing the set of indices specified by range(start, stop, step). The start and step arguments default to None. Slice objects have read-only data attributes start, stop and step which merely return the argument values (or their default). They have no other explicit functionality; however they are used by Numerical Python and other third party extensions. Slice objects are also generated when extended indexing syntax is used. For example: a[start:stop:step] or a[start:stop, i]. See itertools.islice() for an alternate version that returns an iterator.
class smtpd.DebuggingServer(localaddr, remoteaddr)  
Create a new debugging server. Arguments are as per SMTPServer. Messages will be discarded, and printed on stdout.
class smtpd.MailmanProxy(localaddr, remoteaddr)  
 Deprecated since version 3.9, will be removed in version 3.11: MailmanProxy is deprecated, it depends on a Mailman module which no longer exists and therefore is already broken.  Create a new pure proxy server. Arguments are as per SMTPServer. Everything will be relayed to remoteaddr, unless local mailman configurations knows about an address, in which case it will be handled via mailman. Note that running this has a good chance to make you into an open relay, so please be careful.
class smtpd.PureProxy(localaddr, remoteaddr)  
Create a new pure proxy server. Arguments are as per SMTPServer. Everything will be relayed to remoteaddr. Note that running this has a good chance to make you into an open relay, so please be careful.
fqdn  
Holds the fully-qualified domain name of the server as returned by socket.getfqdn().
mailfrom  
Holds a string containing the address identified in the “MAIL FROM:” line from the client.
peer  
Holds the name of the client peer as returned by conn.getpeername() where conn is conn.
rcpttos  
Holds a list of strings containing the addresses identified in the “RCPT TO:” lines from the client.
received_data  
Holds a string containing all of the data sent by the client during the DATA state, up to but not including the terminating "\r\n.\r\n".
received_lines  
Holds a list of the line strings (decoded using UTF-8) received from the client. The lines have their "\r\n" line ending translated to "\n".
seen_greeting  
Holds a string containing the greeting sent by the client in its “HELO”.
smtp_state  
Holds the current state of the channel. This will be either COMMAND initially and then DATA after the client sends a “DATA” line.
channel_class  
Override this in subclasses to use a custom SMTPChannel for managing SMTP clients.
process_message(peer, mailfrom, rcpttos, data, **kwargs)  
Raise a NotImplementedError exception. Override this in subclasses to do something useful with this message. Whatever was passed in the constructor as remoteaddr will be available as the _remoteaddr attribute. peer is the remote host’s address, mailfrom is the envelope originator, rcpttos are the envelope recipients and data is a string containing the contents of the e-mail (which should be in RFC 5321 format). If the decode_data constructor keyword is set to True, the data argument will be a unicode string. If it is set to False, it will be a bytes object. kwargs is a dictionary containing additional information. It is empty if decode_data=True was given as an init argument, otherwise it contains the following keys:  
mail_options:

a list of all received parameters to the MAIL command (the elements are uppercase strings; example: ['BODY=8BITMIME', 'SMTPUTF8']).  
rcpt_options:

same as mail_options but for the RCPT command. Currently no RCPT TO options are supported, so for now this will always be an empty list.   Implementations of process_message should use the **kwargs signature to accept arbitrary keyword arguments, since future feature enhancements may add keys to the kwargs dictionary. Return None to request a normal 250 Ok response; otherwise return the desired response string in RFC 5321 format.
class smtplib.LMTP(host='', port=LMTP_PORT, local_hostname=None, source_address=None[, timeout])  
The LMTP protocol, which is very similar to ESMTP, is heavily based on the standard SMTP client. It’s common to use Unix sockets for LMTP, so our connect() method must support that as well as a regular host:port server. The optional arguments local_hostname and source_address have the same meaning as they do in the SMTP class. To specify a Unix socket, you must use an absolute path for host, starting with a ‘/’. Authentication is supported, using the regular SMTP mechanism. When using a Unix socket, LMTP generally don’t support or require any authentication, but your mileage might vary.  Changed in version 3.9: The optional timeout parameter was added.
class smtplib.SMTP(host='', port=0, local_hostname=None, [timeout, ]source_address=None)  
An SMTP instance encapsulates an SMTP connection. It has methods that support a full repertoire of SMTP and ESMTP operations. If the optional host and port parameters are given, the SMTP connect() method is called with those parameters during initialization. If specified, local_hostname is used as the FQDN of the local host in the HELO/EHLO command. Otherwise, the local hostname is found using socket.getfqdn(). If the connect() call returns anything other than a success code, an SMTPConnectError is raised. The optional timeout parameter specifies a timeout in seconds for blocking operations like the connection attempt (if not specified, the global default timeout setting will be used). If the timeout expires, socket.timeout is raised. The optional source_address parameter allows binding to some specific source address in a machine with multiple network interfaces, and/or to some specific source TCP port. It takes a 2-tuple (host, port), for the socket to bind to as its source address before connecting. If omitted (or if host or port are '' and/or 0 respectively) the OS default behavior will be used. For normal use, you should only require the initialization/connect, sendmail(), and SMTP.quit() methods. An example is included below. The SMTP class supports the with statement. When used like this, the SMTP QUIT command is issued automatically when the with statement exits. E.g.: >>> from smtplib import SMTP
>>> with SMTP("domain.org") as smtp:
...     smtp.noop()
...
(250, b'Ok')
>>>

All commands will raise an auditing event smtplib.SMTP.send with arguments self and data, where data is the bytes about to be sent to the remote host.  Changed in version 3.3: Support for the with statement was added.   Changed in version 3.3: source_address argument was added.   New in version 3.5: The SMTPUTF8 extension (RFC 6531) is now supported.   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
SMTP.auth(mechanism, authobject, *, initial_response_ok=True)  
Issue an SMTP AUTH command for the specified authentication mechanism, and handle the challenge response via authobject. mechanism specifies which authentication mechanism is to be used as argument to the AUTH command; the valid values are those listed in the auth element of esmtp_features. authobject must be a callable object taking an optional single argument: data = authobject(challenge=None) If optional keyword argument initial_response_ok is true, authobject() will be called first with no argument. It can return the RFC 4954 “initial response” ASCII str which will be encoded and sent with the AUTH command as below. If the authobject() does not support an initial response (e.g. because it requires a challenge), it should return None when called with challenge=None. If initial_response_ok is false, then authobject() will not be called first with None. If the initial response check returns None, or if initial_response_ok is false, authobject() will be called to process the server’s challenge response; the challenge argument it is passed will be a bytes. It should return ASCII str data that will be base64 encoded and sent to the server. The SMTP class provides authobjects for the CRAM-MD5, PLAIN, and LOGIN mechanisms; they are named SMTP.auth_cram_md5, SMTP.auth_plain, and SMTP.auth_login respectively. They all require that the user and password properties of the SMTP instance are set to appropriate values. User code does not normally need to call auth directly, but can instead call the login() method, which will try each of the above mechanisms in turn, in the order listed. auth is exposed to facilitate the implementation of authentication methods not (or not yet) supported directly by smtplib.  New in version 3.5.
SMTP.connect(host='localhost', port=0)  
Connect to a host on a given port. The defaults are to connect to the local host at the standard SMTP port (25). If the hostname ends with a colon (':') followed by a number, that suffix will be stripped off and the number interpreted as the port number to use. This method is automatically invoked by the constructor if a host is specified during instantiation. Returns a 2-tuple of the response code and message sent by the server in its connection response. Raises an auditing event smtplib.connect with arguments self, host, port.
SMTP.docmd(cmd, args='')  
Send a command cmd to the server. The optional argument args is simply concatenated to the command, separated by a space. This returns a 2-tuple composed of a numeric response code and the actual response line (multiline responses are joined into one long line.) In normal operation it should not be necessary to call this method explicitly. It is used to implement other methods and may be useful for testing private extensions. If the connection to the server is lost while waiting for the reply, SMTPServerDisconnected will be raised.
SMTP.ehlo(name='')  
Identify yourself to an ESMTP server using EHLO. The hostname argument defaults to the fully qualified domain name of the local host. Examine the response for ESMTP option and store them for use by has_extn(). Also sets several informational attributes: the message returned by the server is stored as the ehlo_resp attribute, does_esmtp is set to true or false depending on whether the server supports ESMTP, and esmtp_features will be a dictionary containing the names of the SMTP service extensions this server supports, and their parameters (if any). Unless you wish to use has_extn() before sending mail, it should not be necessary to call this method explicitly. It will be implicitly called by sendmail() when necessary.
SMTP.ehlo_or_helo_if_needed()  
This method calls ehlo() and/or helo() if there has been no previous EHLO or HELO command this session. It tries ESMTP EHLO first.  
SMTPHeloError


The server didn’t reply properly to the HELO greeting.
SMTP.has_extn(name)  
Return True if name is in the set of SMTP service extensions returned by the server, False otherwise. Case is ignored.
SMTP.helo(name='')  
Identify yourself to the SMTP server using HELO. The hostname argument defaults to the fully qualified domain name of the local host. The message returned by the server is stored as the helo_resp attribute of the object. In normal operation it should not be necessary to call this method explicitly. It will be implicitly called by the sendmail() when necessary.
SMTP.login(user, password, *, initial_response_ok=True)  
Log in on an SMTP server that requires authentication. The arguments are the username and the password to authenticate with. If there has been no previous EHLO or HELO command this session, this method tries ESMTP EHLO first. This method will return normally if the authentication was successful, or may raise the following exceptions:  
SMTPHeloError


The server didn’t reply properly to the HELO greeting.  
SMTPAuthenticationError


The server didn’t accept the username/password combination.  
SMTPNotSupportedError


The AUTH command is not supported by the server.  
SMTPException


No suitable authentication method was found.   Each of the authentication methods supported by smtplib are tried in turn if they are advertised as supported by the server. See auth() for a list of supported authentication methods. initial_response_ok is passed through to auth(). Optional keyword argument initial_response_ok specifies whether, for authentication methods that support it, an “initial response” as specified in RFC 4954 can be sent along with the AUTH command, rather than requiring a challenge/response.  Changed in version 3.5: SMTPNotSupportedError may be raised, and the initial_response_ok parameter was added.
SMTP.quit()  
Terminate the SMTP session and close the connection. Return the result of the SMTP QUIT command.
SMTP.sendmail(from_addr, to_addrs, msg, mail_options=(), rcpt_options=())  
Send mail. The required arguments are an RFC 822 from-address string, a list of RFC 822 to-address strings (a bare string will be treated as a list with 1 address), and a message string. The caller may pass a list of ESMTP options (such as 8bitmime) to be used in MAIL FROM commands as mail_options. ESMTP options (such as DSN commands) that should be used with all RCPT commands can be passed as rcpt_options. (If you need to use different ESMTP options to different recipients you have to use the low-level methods such as mail(), rcpt() and data() to send the message.)  Note The from_addr and to_addrs parameters are used to construct the message envelope used by the transport agents. sendmail does not modify the message headers in any way.  msg may be a string containing characters in the ASCII range, or a byte string. A string is encoded to bytes using the ascii codec, and lone \r and \n characters are converted to \r\n characters. A byte string is not modified. If there has been no previous EHLO or HELO command this session, this method tries ESMTP EHLO first. If the server does ESMTP, message size and each of the specified options will be passed to it (if the option is in the feature set the server advertises). If EHLO fails, HELO will be tried and ESMTP options suppressed. This method will return normally if the mail is accepted for at least one recipient. Otherwise it will raise an exception. That is, if this method does not raise an exception, then someone should get your mail. If this method does not raise an exception, it returns a dictionary, with one entry for each recipient that was refused. Each entry contains a tuple of the SMTP error code and the accompanying error message sent by the server. If SMTPUTF8 is included in mail_options, and the server supports it, from_addr and to_addrs may contain non-ASCII characters. This method may raise the following exceptions:  
SMTPRecipientsRefused


All recipients were refused. Nobody got the mail. The recipients attribute of the exception object is a dictionary with information about the refused recipients (like the one returned when at least one recipient was accepted).  
SMTPHeloError


The server didn’t reply properly to the HELO greeting.  
SMTPSenderRefused


The server didn’t accept the from_addr.  
SMTPDataError


The server replied with an unexpected error code (other than a refusal of a recipient).  
SMTPNotSupportedError


SMTPUTF8 was given in the mail_options but is not supported by the server.   Unless otherwise noted, the connection will be open even after an exception is raised.  Changed in version 3.2: msg may be a byte string.   Changed in version 3.5: SMTPUTF8 support added, and SMTPNotSupportedError may be raised if SMTPUTF8 is specified but the server does not support it.