The optional flag parameter has the same interpretation as the flag parameter of dbm.open()
portage.util.path module
portage.util.socks5 module