my hands shake and my chest contract a little when I review apis with intent to use. this is from python standard docs: from imaplib import IMAP4 >>> with IMAP4("[1]domain.org") as M: ... M.noop() ... References 1. http://domain.org/