code: def is_select(self) -> bool:
      # make sure we strip comments; prevents a bug with comments in the CTE
      parsed = sqlparse.parse(self.strip_comments())
  
      for statement in parsed:
          # Check if this is a CTE
          if statement.is_group and statement[0].ttype == Keyword.CTE:
              if sqloxide_parse is not None:
                  try:
                      if not self._check_cte_is_select(
                          sqloxide_parse(
                              self.strip_comments(), dialect="ansi"
                          )
                      ):
                          return False
                  except ValueError:
                      # sqloxide was not able to parse the query, so let's continue with
                      # sqlparse
                      pass
              inner_cte = (
                  self.get_inner_cte_expression(statement.tokens) or []
              )
              # Check if the inner CTE is a not a SELECT
              if any(token.ttype == DDL for token in inner_cte) or any(
                  token.ttype == DML and token.normalized != "SELECT"
                  for token in inner_cte
              ):
                  return False
  
          if statement.get_type() == "SELECT":
              continue
  
          if statement.get_type() != "UNKNOWN":
              return False
  
          # for `UNKNOWN`, check all DDL/DML explicitly: only `SELECT` DML is allowed,
          # and no DDL is allowed
          if any(token.ttype == DDL for token in statement) or any(
              token.ttype == DML and token.normalized != "SELECT"
              for token in statement
          ):
              return False
  
          # return false on `EXPLAIN`, `SET`, `SHOW`, etc.
          if statement[0].ttype == Keyword:
              return False
  
          if not any(
              token.ttype == DML and token.normalized == "SELECT"
              for token in statement
          ):
              return False
  
      return True
  
imports: import logging
  import re
  from collections.abc import Iterator
  from dataclasses import dataclass
  from typing import Any, cast, Optional
  from urllib import parse
  import sqlparse
  from sqlalchemy import and_
  from sqlparse import keywords
  from sqlparse.lexer import Lexer
  from sqlparse.sql import Identifier, IdentifierList, Parenthesis, remove_quotes, Token, TokenList, Where
  from sqlparse.tokens import Comment, CTE, DDL, DML, Keyword, Name, Punctuation, String, Whitespace, Wildcard
  from sqlparse.utils import imt
  from superset.exceptions import QueryClauseValidationException
  from superset.utils.backports import StrEnum
label_desc: Use image node_id 6 for calling the ParsedQuery obj's underlying member method code with example usage: obj.is_select() and returns: True, False, False, False, False, False, False