def transient_internet():
 time_out = TransientResource(IOError, errno=errno.ETIMEDOUT)
 socket_peer_reset = TransientResource(socket.error, errno=errno.ECONNRESET)
 ioerror_peer_reset = TransientResource(IOError, errno=errno.ECONNRESET)
 return contextlib.nested(time_out, socket_peer_reset, ioerror_peer_reset)

def transient_internet ( ) : time_out = TransientResource ( IOError , errno = errno . ETIMEDOUT ) socket_peer_reset = TransientResource ( socket . error , errno = errno . ECONNRESET ) ioerror_peer_reset = TransientResource ( IOError , errno = errno . ECONNRESET ) return contextlib . nested ( time_out , socket_peer_reset , ioerror_peer_reset )
return a context manager that raises resourcedenied when various issues with the internet connection manifest themselves as exceptions .