cgitb.enable()

cgitb.enable(display=1, logdir=None, context=5, format="html") This function causes the cgitb module to take over the interpreter’s default handling for exceptions by setting the value of sys.excepthook. The optional argument display defaults to 1 and can be set to 0 to suppress sending the traceback to the browser. If the argument logdir is present, the traceback reports are written to files. The value of logdir should be a directory where these files will be placed. The optional argument c

email.headerregistry.ContentTypeHeader

class email.headerregistry.ContentTypeHeader A ParameterizedMIMEHeader class that handles the Content-Type header. content_type The content type string, in the form maintype/subtype. maintype subtype

ssl.SSLContext.load_default_certs()

SSLContext.load_default_certs(purpose=Purpose.SERVER_AUTH) Load a set of default “certification authority” (CA) certificates from default locations. On Windows it loads CA certs from the CA and ROOT system stores. On other systems it calls SSLContext.set_default_verify_paths(). In the future the method may load CA certificates from other locations, too. The purpose flag specifies what kind of CA certificates are loaded. The default settings Purpose.SERVER_AUTH loads certificates, that are fl

mailbox.Mailbox.lock()

lock() Acquire an exclusive advisory lock on the mailbox so that other processes know not to modify it. An ExternalClashError is raised if the lock is not available. The particular locking mechanisms used depend upon the mailbox format. You should always lock the mailbox before making any modifications to its contents.

threading.Semaphore

class threading.Semaphore(value=1) This class implements semaphore objects. A semaphore manages a counter representing the number of release() calls minus the number of acquire() calls, plus an initial value. The acquire() method blocks if necessary until it can return without making the counter negative. If not given, value defaults to 1. The optional argument gives the initial value for the internal counter; it defaults to 1. If the value given is less than 0, ValueError is raised. Change

asyncio.BaseProtocol.connection_made()

BaseProtocol.connection_made(transport) Called when a connection is made. The transport argument is the transport representing the connection. You are responsible for storing it somewhere (e.g. as an attribute) if you need to.

asyncio.BaseTransport.get_extra_info()

get_extra_info(name, default=None) Return optional transport information. name is a string representing the piece of transport-specific information to get, default is the value to return if the information doesn’t exist. This method allows transport implementations to easily expose channel-specific information. socket: 'peername': the remote address to which the socket is connected, result of socket.socket.getpeername() (None on error) 'socket': socket.socket instance 'sockname': the socke

os.setgroups()

os.setgroups(groups) Set the list of supplemental group ids associated with the current process to groups. groups must be a sequence, and each element must be an integer identifying a group. This operation is typically available only to the superuser. Availability: Unix. Note On Mac OS X, the length of groups may not exceed the system-defined maximum number of effective group ids, typically 16. See the documentation for getgroups() for cases where it may not return the same group list set b

asyncio.Future.cancel()

cancel() Cancel the future and schedule callbacks. If the future is already done or cancelled, return False. Otherwise, change the future’s state to cancelled, schedule the callbacks and return True.

collections.namedtuple()

collections.namedtuple(typename, field_names, verbose=False, rename=False) Returns a new tuple subclass named typename. The new subclass is used to create tuple-like objects that have fields accessible by attribute lookup as well as being indexable and iterable. Instances of the subclass also have a helpful docstring (with typename and field_names) and a helpful __repr__() method which lists the tuple contents in a name=value format. The field_names are a single string with each fieldname se