(self)
Returns the type of a statement.

        The returned value is a string holding an upper-cased reprint of
        the first DML or DDL keyword. If the first token in this group
        isn't a DML or DDL keyword "UNKNOWN" is returned.
Returns the type of a statement.
Returns the type of a statement .
def get_type(self):
        """Returns the type of a statement.

        The returned value is a string holding an upper-cased reprint of
        the first DML or DDL keyword. If the first token in this group
        isn't a DML or DDL keyword "UNKNOWN" is returned.
        """
        first_token = self.token_first()
        if first_token is None:
            # An "empty" statement that either has not tokens at all
            # or only whitespace tokens.
            return 'UNKNOWN'
        elif first_token.ttype in (T.Keyword.DML, T.Keyword.DDL):
            return first_token.value.upper()
        else:
            return 'UNKNOWN'
def get_type ( self ) : first_token = self . token_first ( ) if first_token is None : # An "empty" statement that either has not tokens at all # or only whitespace tokens. return 'UNKNOWN' elif first_token . ttype in ( T . Keyword . DML , T . Keyword . DDL ) : return first_token . value . upper ( ) else : return 'UNKNOWN'