neulab/docprompting-conala huggingface dataset:
class ssl.SSLSocket(socket.socket)  
SSL sockets provide the following methods of Socket Objects:  accept() bind() close() connect() detach() fileno() 
getpeername(), getsockname()
 
getsockopt(), setsockopt()
 
gettimeout(), settimeout(), setblocking()
 listen() makefile() 
recv(), recv_into() (but passing a non-zero flags argument is not allowed) 
send(), sendall() (with the same limitation) 
sendfile() (but os.sendfile will be used for plain-text sockets only, else send() will be used) shutdown()  However, since the SSL (and TLS) protocol has its own framing atop of TCP, the SSL sockets abstraction can, in certain respects, diverge from the specification of normal, OS-level sockets. See especially the notes on non-blocking sockets. Instances of SSLSocket must be created using the SSLContext.wrap_socket() method.  Changed in version 3.5: The sendfile() method was added.   Changed in version 3.5: The shutdown() does not reset the socket timeout each time bytes are received or sent. The socket timeout is now to maximum total duration of the shutdown.   Deprecated since version 3.6: It is deprecated to create a SSLSocket instance directly, use SSLContext.wrap_socket() to wrap a socket.   Changed in version 3.7: SSLSocket instances must to created with wrap_socket(). In earlier versions, it was possible to create instances directly. This was never documented or officially supported.
SSLSocket.cipher()  
Returns a three-value tuple containing the name of the cipher being used, the version of the SSL protocol that defines its use, and the number of secret bits being used. If no connection has been established, returns None.
SSLSocket.compression()  
Return the compression algorithm being used as a string, or None if the connection isn’t compressed. If the higher-level protocol supports its own compression mechanism, you can use OP_NO_COMPRESSION to disable SSL-level compression.  New in version 3.3.
SSLSocket.context  
The SSLContext object this SSL socket is tied to. If the SSL socket was created using the deprecated wrap_socket() function (rather than SSLContext.wrap_socket()), this is a custom context object created for this SSL socket.  New in version 3.2.
SSLSocket.do_handshake()  
Perform the SSL setup handshake.  Changed in version 3.4: The handshake method also performs match_hostname() when the check_hostname attribute of the socket’s context is true.   Changed in version 3.5: The socket timeout is no more reset each time bytes are received or sent. The socket timeout is now to maximum total duration of the handshake.   Changed in version 3.7: Hostname or IP address is matched by OpenSSL during handshake. The function match_hostname() is no longer used. In case OpenSSL refuses a hostname or IP address, the handshake is aborted early and a TLS alert message is send to the peer.
SSLSocket.getpeercert(binary_form=False)  
If there is no certificate for the peer on the other end of the connection, return None. If the SSL handshake hasn’t been done yet, raise ValueError. If the binary_form parameter is False, and a certificate was received from the peer, this method returns a dict instance. If the certificate was not validated, the dict is empty. If the certificate was validated, it returns a dict with several keys, amongst them subject (the principal for which the certificate was issued) and issuer (the principal issuing the certificate). If a certificate contains an instance of the Subject Alternative Name extension (see RFC 3280), there will also be a subjectAltName key in the dictionary. The subject and issuer fields are tuples containing the sequence of relative distinguished names (RDNs) given in the certificate’s data structure for the respective fields, and each RDN is a sequence of name-value pairs. Here is a real-world example: {'issuer': ((('countryName', 'IL'),),
            (('organizationName', 'StartCom Ltd.'),),
            (('organizationalUnitName',
              'Secure Digital Certificate Signing'),),
            (('commonName',
              'StartCom Class 2 Primary Intermediate Server CA'),)),
 'notAfter': 'Nov 22 08:15:19 2013 GMT',
 'notBefore': 'Nov 21 03:09:52 2011 GMT',
 'serialNumber': '95F0',
 'subject': ((('description', '571208-SLe257oHY9fVQ07Z'),),
             (('countryName', 'US'),),
             (('stateOrProvinceName', 'California'),),
             (('localityName', 'San Francisco'),),
             (('organizationName', 'Electronic Frontier Foundation, Inc.'),),
             (('commonName', '*.eff.org'),),
             (('emailAddress', 'hostmaster@eff.org'),)),
 'subjectAltName': (('DNS', '*.eff.org'), ('DNS', 'eff.org')),
 'version': 3}
  Note To validate a certificate for a particular service, you can use the match_hostname() function.  If the binary_form parameter is True, and a certificate was provided, this method returns the DER-encoded form of the entire certificate as a sequence of bytes, or None if the peer did not provide a certificate. Whether the peer provides a certificate depends on the SSL socket’s role:  for a client SSL socket, the server will always provide a certificate, regardless of whether validation was required; for a server SSL socket, the client will only provide a certificate when requested by the server; therefore getpeercert() will return None if you used CERT_NONE (rather than CERT_OPTIONAL or CERT_REQUIRED).   Changed in version 3.2: The returned dictionary includes additional items such as issuer and notBefore.   Changed in version 3.4: ValueError is raised when the handshake isn’t done. The returned dictionary includes additional X509v3 extension items such as crlDistributionPoints, caIssuers and OCSP URIs.   Changed in version 3.9: IPv6 address strings no longer have a trailing new line.
SSLSocket.get_channel_binding(cb_type="tls-unique")  
Get channel binding data for current connection, as a bytes object. Returns None if not connected or the handshake has not been completed. The cb_type parameter allow selection of the desired channel binding type. Valid channel binding types are listed in the CHANNEL_BINDING_TYPES list. Currently only the ‘tls-unique’ channel binding, defined by RFC 5929, is supported. ValueError will be raised if an unsupported channel binding type is requested.  New in version 3.3.
SSLSocket.pending()  
Returns the number of already decrypted bytes available for read, pending on the connection.
SSLSocket.read(len=1024, buffer=None)  
Read up to len bytes of data from the SSL socket and return the result as a bytes instance. If buffer is specified, then read into the buffer instead, and return the number of bytes read. Raise SSLWantReadError or SSLWantWriteError if the socket is non-blocking and the read would block. As at any time a re-negotiation is possible, a call to read() can also cause write operations.  Changed in version 3.5: The socket timeout is no more reset each time bytes are received or sent. The socket timeout is now to maximum total duration to read up to len bytes.   Deprecated since version 3.6: Use recv() instead of read().
SSLSocket.selected_alpn_protocol()  
Return the protocol that was selected during the TLS handshake. If SSLContext.set_alpn_protocols() was not called, if the other party does not support ALPN, if this socket does not support any of the client’s proposed protocols, or if the handshake has not happened yet, None is returned.  New in version 3.5.
SSLSocket.selected_npn_protocol()  
Return the higher-level protocol that was selected during the TLS/SSL handshake. If SSLContext.set_npn_protocols() was not called, or if the other party does not support NPN, or if the handshake has not yet happened, this will return None.  New in version 3.3.
SSLSocket.server_hostname  
Hostname of the server: str type, or None for server-side socket or if the hostname was not specified in the constructor.  New in version 3.2.   Changed in version 3.7: The attribute is now always ASCII text. When server_hostname is an internationalized domain name (IDN), this attribute now stores the A-label form ("xn--pythn-mua.org"), rather than the U-label form ("pythön.org").
SSLSocket.server_side  
A boolean which is True for server-side sockets and False for client-side sockets.  New in version 3.2.
SSLSocket.session  
The SSLSession for this SSL connection. The session is available for client and server side sockets after the TLS handshake has been performed. For client sockets the session can be set before do_handshake() has been called to reuse a session.  New in version 3.6.
SSLSocket.shared_ciphers()  
Return the list of ciphers shared by the client during the handshake. Each entry of the returned list is a three-value tuple containing the name of the cipher, the version of the SSL protocol that defines its use, and the number of secret bits the cipher uses. shared_ciphers() returns None if no connection has been established or the socket is a client socket.  New in version 3.5.
SSLSocket.unwrap()  
Performs the SSL shutdown handshake, which removes the TLS layer from the underlying socket, and returns the underlying socket object. This can be used to go from encrypted operation over a connection to unencrypted. The returned socket should always be used for further communication with the other side of the connection, rather than the original socket.
SSLSocket.verify_client_post_handshake()  
Requests post-handshake authentication (PHA) from a TLS 1.3 client. PHA can only be initiated for a TLS 1.3 connection from a server-side socket, after the initial TLS handshake and with PHA enabled on both sides, see SSLContext.post_handshake_auth. The method does not perform a cert exchange immediately. The server-side sends a CertificateRequest during the next write event and expects the client to respond with a certificate on the next read event. If any precondition isn’t met (e.g. not TLS 1.3, PHA not enabled), an SSLError is raised.  Note Only available with OpenSSL 1.1.1 and TLS 1.3 enabled. Without TLS 1.3 support, the method raises NotImplementedError.   New in version 3.8.
SSLSocket.version()  
Return the actual SSL protocol version negotiated by the connection as a string, or None is no secure connection is established. As of this writing, possible return values include "SSLv2", "SSLv3", "TLSv1", "TLSv1.1" and "TLSv1.2". Recent OpenSSL versions may define more return values.  New in version 3.5.
SSLSocket.write(buf)  
Write buf to the SSL socket and return the number of bytes written. The buf argument must be an object supporting the buffer interface. Raise SSLWantReadError or SSLWantWriteError if the socket is non-blocking and the write would block. As at any time a re-negotiation is possible, a call to write() can also cause read operations.  Changed in version 3.5: The socket timeout is no more reset each time bytes are received or sent. The socket timeout is now to maximum total duration to write buf.   Deprecated since version 3.6: Use send() instead of write().
exception ssl.SSLSyscallError  
A subclass of SSLError raised when a system error was encountered while trying to fulfill an operation on a SSL socket. Unfortunately, there is no easy way to inspect the original errno number.  New in version 3.3.
exception ssl.SSLWantReadError  
A subclass of SSLError raised by a non-blocking SSL socket when trying to read or write data, but more data needs to be received on the underlying TCP transport before the request can be fulfilled.  New in version 3.3.
exception ssl.SSLWantWriteError  
A subclass of SSLError raised by a non-blocking SSL socket when trying to read or write data, but more data needs to be sent on the underlying TCP transport before the request can be fulfilled.  New in version 3.3.
exception ssl.SSLZeroReturnError  
A subclass of SSLError raised when trying to read or write and the SSL connection has been closed cleanly. Note that this doesn’t mean that the underlying transport (read TCP) has been closed.  New in version 3.3.
class ssl.TLSVersion  
enum.IntEnum collection of SSL and TLS versions for SSLContext.maximum_version and SSLContext.minimum_version.  New in version 3.7.
TLSVersion.MAXIMUM_SUPPORTED  
The minimum or maximum supported SSL or TLS version. These are magic constants. Their values don’t reflect the lowest and highest available TLS/SSL versions.
TLSVersion.TLSv1_3  
SSL 3.0 to TLS 1.3.
class ssl.VerifyFlags  
enum.IntFlag collection of VERIFY_* constants.  New in version 3.6.
class ssl.VerifyMode  
enum.IntEnum collection of CERT_* constants.  New in version 3.6.
ssl.VERIFY_CRL_CHECK_CHAIN  
Possible value for SSLContext.verify_flags. In this mode, CRLs of all certificates in the peer cert chain are checked.  New in version 3.4.
ssl.VERIFY_CRL_CHECK_LEAF  
Possible value for SSLContext.verify_flags. In this mode, only the peer cert is checked but none of the intermediate CA certificates. The mode requires a valid CRL that is signed by the peer cert’s issuer (its direct ancestor CA). If no proper CRL has been loaded with SSLContext.load_verify_locations, validation will fail.  New in version 3.4.
ssl.VERIFY_DEFAULT  
Possible value for SSLContext.verify_flags. In this mode, certificate revocation lists (CRLs) are not checked. By default OpenSSL does neither require nor verify CRLs.  New in version 3.4.
ssl.VERIFY_X509_STRICT  
Possible value for SSLContext.verify_flags to disable workarounds for broken X.509 certificates.  New in version 3.4.
ssl.VERIFY_X509_TRUSTED_FIRST  
Possible value for SSLContext.verify_flags. It instructs OpenSSL to prefer trusted certificates when building the trust chain to validate a certificate. This flag is enabled by default.  New in version 3.4.4.
ssl.wrap_socket(sock, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, ssl_version=PROTOCOL_TLS, ca_certs=None, do_handshake_on_connect=True, suppress_ragged_eofs=True, ciphers=None)  
Takes an instance sock of socket.socket, and returns an instance of ssl.SSLSocket, a subtype of socket.socket, which wraps the underlying socket in an SSL context. sock must be a SOCK_STREAM socket; other socket types are unsupported. Internally, function creates a SSLContext with protocol ssl_version and SSLContext.options set to cert_reqs. If parameters keyfile, certfile, ca_certs or ciphers are set, then the values are passed to SSLContext.load_cert_chain(), SSLContext.load_verify_locations(), and SSLContext.set_ciphers(). The arguments server_side, do_handshake_on_connect, and suppress_ragged_eofs have the same meaning as SSLContext.wrap_socket().  Deprecated since version 3.7: Since Python 3.2 and 2.7.9, it is recommended to use the SSLContext.wrap_socket() instead of wrap_socket(). The top-level function is limited and creates an insecure client socket without server name indication or hostname matching.
stat.filemode(mode)  
Convert a file’s mode to a string of the form ‘-rwxrwxrwx’.  New in version 3.3.   Changed in version 3.4: The function supports S_IFDOOR, S_IFPORT and S_IFWHT.
stat.FILE_ATTRIBUTE_ARCHIVE  
stat.FILE_ATTRIBUTE_COMPRESSED  
stat.FILE_ATTRIBUTE_DEVICE  
stat.FILE_ATTRIBUTE_DIRECTORY  
stat.FILE_ATTRIBUTE_ENCRYPTED  
stat.FILE_ATTRIBUTE_HIDDEN  
stat.FILE_ATTRIBUTE_INTEGRITY_STREAM  
stat.FILE_ATTRIBUTE_NORMAL  
stat.FILE_ATTRIBUTE_NOT_CONTENT_INDEXED  
stat.FILE_ATTRIBUTE_NO_SCRUB_DATA  
stat.FILE_ATTRIBUTE_OFFLINE  
stat.FILE_ATTRIBUTE_READONLY  
stat.FILE_ATTRIBUTE_REPARSE_POINT  
stat.FILE_ATTRIBUTE_SPARSE_FILE  
stat.FILE_ATTRIBUTE_SYSTEM  
stat.FILE_ATTRIBUTE_TEMPORARY  
stat.FILE_ATTRIBUTE_VIRTUAL  
 New in version 3.5.
stat.IO_REPARSE_TAG_SYMLINK  
stat.IO_REPARSE_TAG_MOUNT_POINT  
stat.IO_REPARSE_TAG_APPEXECLINK  
 New in version 3.8.
stat.ST_CTIME  
The “ctime” as reported by the operating system. On some systems (like Unix) is the time of the last metadata change, and, on others (like Windows), is the creation time (see platform documentation for details).
stat.ST_SIZE  
Size in bytes of a plain file; amount of data waiting on some special files.
stat.S_ENFMT  
System V file locking enforcement. This flag is shared with S_ISGID: file/record locking is enforced on files that do not have the group execution bit (S_IXGRP) set.
stat.S_IEXEC  
Unix V7 synonym for S_IXUSR.
stat.S_IFDOOR  
Door.  New in version 3.4.
stat.S_IFMT(mode)  
Return the portion of the file’s mode that describes the file type (used by the S_IS*() functions above).
stat.S_IFPORT  
Event port.  New in version 3.4.
stat.S_IFWHT  
Whiteout.  New in version 3.4.
stat.S_IMODE(mode)  
Return the portion of the file’s mode that can be set by os.chmod()—that is, the file’s permission bits, plus the sticky bit, set-group-id, and set-user-id bits (on systems that support them).
stat.S_IREAD  
Unix V7 synonym for S_IRUSR.
stat.S_IRWXO  
Mask for permissions for others (not in group).
stat.S_ISBLK(mode)  
Return non-zero if the mode is from a block special device file.
stat.S_ISCHR(mode)  
Return non-zero if the mode is from a character special device file.
stat.S_ISDIR(mode)  
Return non-zero if the mode is from a directory.
stat.S_ISDOOR(mode)  
Return non-zero if the mode is from a door.  New in version 3.4.
stat.S_ISFIFO(mode)  
Return non-zero if the mode is from a FIFO (named pipe).
stat.S_ISGID  
Set-group-ID bit. This bit has several special uses. For a directory it indicates that BSD semantics is to be used for that directory: files created there inherit their group ID from the directory, not from the effective group ID of the creating process, and directories created there will also get the S_ISGID bit set. For a file that does not have the group execution bit (S_IXGRP) set, the set-group-ID bit indicates mandatory file/record locking (see also S_ENFMT).
stat.S_ISLNK(mode)  
Return non-zero if the mode is from a symbolic link.
stat.S_ISPORT(mode)  
Return non-zero if the mode is from an event port.  New in version 3.4.
stat.S_ISREG(mode)  
Return non-zero if the mode is from a regular file.
stat.S_ISSOCK(mode)  
Return non-zero if the mode is from a socket.
stat.S_ISVTX  
Sticky bit. When this bit is set on a directory it means that a file in that directory can be renamed or deleted only by the owner of the file, by the owner of the directory, or by a privileged process.
stat.S_ISWHT(mode)  
Return non-zero if the mode is from a whiteout.  New in version 3.4.
stat.S_IWRITE  
Unix V7 synonym for S_IWUSR.
stat.UF_COMPRESSED  
The file is stored compressed (Mac OS X 10.6+).
stat.UF_HIDDEN  
The file should not be displayed in a GUI (Mac OS X 10.5+).
stat.UF_OPAQUE  
The directory is opaque when viewed through a union stack.
@staticmethod  
Transform a method into a static method. A static method does not receive an implicit first argument. To declare a static method, use this idiom: class C:
    @staticmethod
    def f(arg1, arg2, ...): ...
 The @staticmethod form is a function decorator – see Function definitions for details. A static method can be called either on the class (such as C.f()) or on an instance (such as C().f()). Static methods in Python are similar to those found in Java or C++. Also see classmethod() for a variant that is useful for creating alternate class constructors. Like all decorators, it is also possible to call staticmethod as a regular function and do something with its result. This is needed in some cases where you need a reference to a function from a class body and you want to avoid the automatic transformation to instance method. For these cases, use this idiom: class C:
    builtin_open = staticmethod(open)
 For more information on static methods, see The standard type hierarchy.
statistics.fmean(data)  
Convert data to floats and compute the arithmetic mean. This runs faster than the mean() function and it always returns a float. The data may be a sequence or iterable. If the input dataset is empty, raises a StatisticsError. >>> fmean([3.5, 4.0, 5.25])
4.25
  New in version 3.8.
statistics.geometric_mean(data)  
Convert data to floats and compute the geometric mean. The geometric mean indicates the central tendency or typical value of the data using the product of the values (as opposed to the arithmetic mean which uses their sum). Raises a StatisticsError if the input dataset is empty, if it contains a zero, or if it contains a negative value. The data may be a sequence or iterable. No special efforts are made to achieve exact results. (However, this may change in the future.) >>> round(geometric_mean([54, 24, 36]), 1)
36.0
  New in version 3.8.
statistics.harmonic_mean(data)  
Return the harmonic mean of data, a sequence or iterable of real-valued numbers. The harmonic mean, sometimes called the subcontrary mean, is the reciprocal of the arithmetic mean() of the reciprocals of the data. For example, the harmonic mean of three values a, b and c will be equivalent to 3/(1/a + 1/b + 1/c). If one of the values is zero, the result will be zero. The harmonic mean is a type of average, a measure of the central location of the data. It is often appropriate when averaging rates or ratios, for example speeds. Suppose a car travels 10 km at 40 km/hr, then another 10 km at 60 km/hr. What is the average speed? >>> harmonic_mean([40, 60])
48.0
 Suppose an investor purchases an equal value of shares in each of three companies, with P/E (price/earning) ratios of 2.5, 3 and 10. What is the average P/E ratio for the investor’s portfolio? >>> harmonic_mean([2.5, 3, 10])  # For an equal investment portfolio.
3.6
 StatisticsError is raised if data is empty, or any element is less than zero. The current algorithm has an early-out when it encounters a zero in the input. This means that the subsequent inputs are not tested for validity. (This behavior may change in the future.)  New in version 3.6.
statistics.mean(data)  
Return the sample arithmetic mean of data which can be a sequence or iterable. The arithmetic mean is the sum of the data divided by the number of data points. It is commonly called “the average”, although it is only one of many different mathematical averages. It is a measure of the central location of the data. If data is empty, StatisticsError will be raised. Some examples of use: >>> mean([1, 2, 3, 4, 4])
2.8
>>> mean([-1.0, 2.5, 3.25, 5.75])
2.625

>>> from fractions import Fraction as F
>>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])
Fraction(13, 21)

>>> from decimal import Decimal as D
>>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")])
Decimal('0.5625')
  Note The mean is strongly affected by outliers and is not a robust estimator for central location: the mean is not necessarily a typical example of the data points. For more robust measures of central location, see median() and mode(). The sample mean gives an unbiased estimate of the true population mean, so that when taken on average over all the possible samples, mean(sample) converges on the true mean of the entire population. If data represents the entire population rather than a sample, then mean(data) is equivalent to calculating the true population mean μ.
statistics.median(data)  
Return the median (middle value) of numeric data, using the common “mean of middle two” method. If data is empty, StatisticsError is raised. data can be a sequence or iterable. The median is a robust measure of central location and is less affected by the presence of outliers. When the number of data points is odd, the middle data point is returned: >>> median([1, 3, 5])
3
 When the number of data points is even, the median is interpolated by taking the average of the two middle values: >>> median([1, 3, 5, 7])
4.0
 This is suited for when your data is discrete, and you don’t mind that the median may not be an actual data point. If the data is ordinal (supports order operations) but not numeric (doesn’t support addition), consider using median_low() or median_high() instead.