code: def has_table_query(token_list: TokenList) -> bool:
      """
      Return if a statement has a query reading from a table.
  
          >>> has_table_query(sqlparse.parse("COUNT(*)")[0])
          False
          >>> has_table_query(sqlparse.parse("SELECT * FROM table")[0])
          True
  
      Note that queries reading from constant values return false:
  
          >>> has_table_query(sqlparse.parse("SELECT * FROM (SELECT 1)")[0])
          False
  
      """
      state = InsertRLSState.SCANNING
      for token in token_list.tokens:
          # Ignore comments
          if isinstance(token, sqlparse.sql.Comment):
              continue
  
          # Recurse into child token list
          if isinstance(token, TokenList) and has_table_query(token):
              return True
  
          # Found a source keyword (FROM/JOIN)
          if imt(token, m=[(Keyword, "FROM"), (Keyword, "JOIN")]):
              state = InsertRLSState.SEEN_SOURCE
  
          # Found identifier/keyword after FROM/JOIN
          elif state == InsertRLSState.SEEN_SOURCE and (
              isinstance(token, sqlparse.sql.Identifier)
              or token.ttype == Keyword
          ):
              return True
  
          # Found nothing, leaving source
          elif (
              state == InsertRLSState.SEEN_SOURCE
              and token.ttype != Whitespace
          ):
              state = InsertRLSState.SCANNING
  
      return False
  
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 a global function with example usage: has_table_query(token_list) and returns: False, True, True