code: def check_script(upgrade, conn, dry_run=True, debug=True):
      
      conn = WrappedConnection(conn, debug=debug)
      try:
          upgrade(conn)
      except Exception:
          conn.rollback()
          raise
      else:
          if dry_run:
              conn.rollback()
          else:
              conn.commit()
docs: An utility to debug upgrade scripts written in Python
  
      :param upgrade: upgrade procedure
      :param conn: a DB API 2 connection
      :param dry_run: if True, do not change the database
      :param debug: if True, print the queries which are executed