@contextmanager
    def temporary_connection(self):
        must_close = self.connection is None
        cursor = self.cursor()
        try:
            yield cursor
        finally:
            cursor.close()
            if must_close:
                self.close()
Context manager that ensures that a connection is established, and
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/backends/__init__.py/BaseDatabaseWrapper.temporary_connection