ssl.SSLContext.check_hostname

SSLContext.check_hostname Whether to match the peer cert’s hostname with match_hostname() in SSLSocket.do_handshake(). The context’s verify_mode must be set to CERT_OPTIONAL or CERT_REQUIRED, and you must pass server_hostname to wrap_socket() in order to match the hostname. Example: import socket, ssl context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) context.verify_mode = ssl.CERT_REQUIRED context.check_hostname = True context.load_default_certs() s = socket.socket(socket.AF_INET, socket.SOCK_S

os.getgroups()

os.getgroups() Return list of supplemental group ids associated with the current process. Availability: Unix. Note On Mac OS X, getgroups() behavior differs somewhat from other Unix platforms. If the Python interpreter was built with a deployment target of 10.5 or earlier, getgroups() returns the list of effective group ids associated with the current user process; this list is limited to a system-defined number of entries, typically 16, and may be modified by calls to setgroups() if suitab

email.headerregistry.Address

class email.headerregistry.Address(display_name='', username='', domain='', addr_spec=None) The class used to represent an email address. The general form of an address is: [display_name] <username@domain> or: username@domain where each part must conform to specific syntax rules spelled out in RFC 5322. As a convenience addr_spec can be specified instead of username and domain, in which case username and domain will be parsed from the addr_spec. An addr_spec must be a properly RFC qu

base64.a85encode()

base64.a85encode(b, *, foldspaces=False, wrapcol=0, pad=False, adobe=False) Encode the bytes-like object b using Ascii85 and return the encoded bytes. foldspaces is an optional flag that uses the special short sequence ‘y’ instead of 4 consecutive spaces (ASCII 0x20) as supported by ‘btoa’. This feature is not supported by the “standard” Ascii85 encoding. wrapcol controls whether the output should have newline (b'\n') characters added to it. If this is non-zero, each output line will be at m

email.message.EmailMessage.add_alternative()

add_alternative(*args, content_manager=None, **kw) If the message is a multipart/alternative, create a new message object, pass all of the arguments to its set_content() method, and attach() it to the multipart. If the message is a non-multipart or multipart/related, call make_alternative() and then proceed as above. If the message is any other type of multipart, raise a TypeError. If content_manager is not specified, use the content_manager specified by the current policy.

logging.handlers.SysLogHandler.encodePriority()

encodePriority(facility, priority) Encodes the facility and priority into an integer. You can pass in strings or integers - if strings are passed, internal mapping dictionaries are used to convert them to integers. The symbolic LOG_ values are defined in SysLogHandler and mirror the values defined in the sys/syslog.h header file. Priorities Name (string) Symbolic value alert LOG_ALERT crit or critical LOG_CRIT debug LOG_DEBUG emerg or panic LOG_EMERG err or error LOG_ERR info LOG_INFO

codecs.IncrementalDecoder.getstate()

getstate() Return the current state of the decoder. This must be a tuple with two items, the first must be the buffer containing the still undecoded input. The second must be an integer and can be additional state info. (The implementation should make sure that 0 is the most common additional state info.) If this additional state info is 0 it must be possible to set the decoder to the state which has no input buffered and 0 as the additional state info, so that feeding the previously buffere

types.MappingProxyType.items()

items() Return a new view of the underlying mapping’s items ((key, value) pairs).

dis.Bytecode.dis()

dis() Return a formatted view of the bytecode operations (the same as printed by dis.dis(), but returned as a multi-line string).

bz2.BZ2File

class bz2.BZ2File(filename, mode='r', buffering=None, compresslevel=9) Open a bzip2-compressed file in binary mode. If filename is a str or bytes object, open the named file directly. Otherwise, filename should be a file object, which will be used to read or write the compressed data. The mode argument can be either 'r' for reading (default), 'w' for overwriting, 'x' for exclusive creation, or 'a' for appending. These can equivalently be given as 'rb', 'wb', 'xb' and 'ab' respectively. If fi