code: def db_exec_with_cursor(self, cursor, sql: str, *args) -> int:
          
          sql = self.localize_sql(sql)
          try:
              debug_sql(sql, args)
              cursor.execute(sql, args)
              return cursor.rowcount
          except:  # nopep8
              log.exception("db_exec_with_cursor: SQL was: " + sql)
              raise
docs: Executes SQL on a supplied cursor, with "?" placeholders,
          substituting in the arguments. Returns number of rows affected.