docs: def query(self, query, args=(), as_dict=False, suppress_warnings=True, reconnect=None):
          """
          Execute the specified query and return the tuple generator (cursor).
  
          :param query: mysql query
          :param args: additional arguments for the client.cursor
          :param as_dict: If as_dict is set to True, the returned cursor objects returns
                          query results as dictionary.
          :param suppress_warnings: If True, suppress all warnings arising from underlying query library
          """
          if reconnect is None:
              reconnect = config['database.reconnect']
  
          cursor = client.cursors.DictCursor if as_dict else client.cursors.Cursor
          cur = self._conn.cursor(cursor=cursor)
  
          logger.debug("Executing SQL:" + query[0:300])
          try:
              with warnings.catch_warnings():
                  if suppress_warnings:
                      # suppress all warnings arising from underlying SQL library
                      warnings.simplefilter("ignore")
                  cur.execute(query, args)
          except (err.InterfaceError, err.OperationalError) as e:
              if is_connection_error(e) and reconnect:
                  warnings.warn("Mysql server has gone away. Reconnecting to the server.")
                  self.connect()
                  if self._in_transaction:
                      self.cancel_transaction()
                      raise DataJointError("Connection was lost during a transaction.")
                  else:
                      logger.debug("Re-executing SQL")
                      cur = self.query(query, args=args, as_dict=as_dict, suppress_warnings=suppress_warnings, reconnect=False)
              else:
                  logger.debug("Caught InterfaceError/OperationalError.")
                  raise
          except err.ProgrammingError as e:
              if e.args[0] == server_error_codes['parse error']:
                  raise DataJointError("\n".join((
                      "Error in query:", query,
                      "Please check spelling, syntax, and existence of tables and attributes.",
                      "When restricting a relation by a condition in a string, enclose attributes in backquotes."
                  ))) from None
          return cur