def group_as(tlist):

    def _right_valid(token):
        # Currently limited to DML/DDL. Maybe additional more non SQL reserved
        # keywords should appear here (see issue8).
        return not (T.DML, T.DDL) in token.ttype

    def _left_valid(token):
        return token.ttype is not T.Keyword

    _group_left_right(tlist, T.Keyword, 'AS', sql.Identifier,
                      check_right=_right_valid,
                      check_left=_left_valid)
dataset/ETHPy150Open zsong/SqlBeautifier/sqlparse3/engine/grouping.py/group_as/swapped operands of `in`