pyclbr.readmodule_ex()

pyclbr.readmodule_ex(module, path=None) Like readmodule(), but the returned dictionary, in addition to mapping class names to class descriptor objects, also maps top-level function names to function descriptor objects. Moreover, if the module being read is a package, the key '__path__' in the returned dictionary has as its value a list which contains the package search path.

xml.sax.xmlreader.InputSource.setEncoding()

InputSource.setEncoding(encoding) Sets the character encoding of this InputSource. The encoding must be a string acceptable for an XML encoding declaration (see section 4.3.3 of the XML recommendation). The encoding attribute of the InputSource is ignored if the InputSource also contains a character stream.

urllib.request.HTTPPasswordMgrWithPriorAuth.add_password()

HTTPPasswordMgrWithPriorAuth.add_password(realm, uri, user, passwd, is_authenticated=False) realm, uri, user, passwd are as for HTTPPasswordMgr.add_password(). is_authenticated sets the initial value of the is_authenticated flag for the given URI or list of URIs. If is_authenticated is specified as True, realm is ignored.

re.regex.search()

regex.search(string[, pos[, endpos]]) Scan through string looking for the first location where this regular expression produces a match, and return a corresponding match object. Return None if no position in the string matches the pattern; note that this is different from finding a zero-length match at some point in the string. The optional second parameter pos gives an index in the string where the search is to start; it defaults to 0. This is not completely equivalent to slicing the string

cgi.test()

cgi.test() Robust test CGI script, usable as main program. Writes minimal HTTP headers and formats all information provided to the script in HTML form.

smtplib.SMTPException

exception smtplib.SMTPException Subclass of OSError that is the base exception class for all the other exceptions provided by this module. Changed in version 3.4: SMTPException became subclass of OSError

unittest.mock.Mock.reset_mock()

reset_mock() The reset_mock method resets all the call attributes on a mock object: >>> mock = Mock(return_value=None) >>> mock('hello') >>> mock.called True >>> mock.reset_mock() >>> mock.called False This can be useful where you want to make a series of assertions that reuse the same object. Note that reset_mock() doesn’t clear the return value, side_effect or any child attributes you have set using normal assignment. Child mocks and the return

asyncio.create_subprocess_exec()

coroutine asyncio.create_subprocess_exec(*args, stdin=None, stdout=None, stderr=None, loop=None, limit=None, **kwds) Create a subprocess. The limit parameter sets the buffer limit passed to the StreamReader. See AbstractEventLoop.subprocess_exec() for other parameters. Return a Process instance. This function is a coroutine.

winreg.SetValue()

winreg.SetValue(key, sub_key, type, value) Associates a value with a specified key. key is an already open key, or one of the predefined HKEY_* constants. sub_key is a string that names the subkey with which the value is associated. type is an integer that specifies the type of the data. Currently this must be REG_SZ, meaning only strings are supported. Use the SetValueEx() function for support for other data types. value is a string that specifies the new value. If the key specified by the

asyncio.Task.get_stack()

get_stack(*, limit=None) Return the list of stack frames for this task’s coroutine. If the coroutine is not done, this returns the stack where it is suspended. If the coroutine has completed successfully or was cancelled, this returns an empty list. If the coroutine was terminated by an exception, this returns the list of traceback frames. The frames are always ordered from oldest to newest. The optional limit gives the maximum number of frames to return; by default all available frames are