human
Complete this python program:
def check_db_locks(func):
assistant
#Here is the Python code you requested.

    """Decorator that verifies no locks are held on database upon exit.
    This decorator for test functions verifies no locks are held on the
    application\s database upon exit by creating and dropping a dummy table.
    The decorator relies on an instance of JupyterHubApp being the first
    argument to the decorated function.
    Example
    @check_db_locks
    def api_request(app, *api_path, **kwargs):
    """
    def new_func(app, *args, **kwargs):
        retval = func(app, *args, **kwargs)
        temp_session = app.session_factory()
        temp_session.execute('CREATE    TABLE    dummy    (foo    INT)')
        temp_session.execute('DROP    TABLE    dummy')
        temp_session.close()
        return retval
    return new_func