docstr: Get MySQL connection ID that will be used to cancel all other running
  queries in the same connection.
  
  :param cursor: Cursor instance in which the query will be executed
  :param query: Query instance
  :return: MySQL Connection ID
docstr_tok: ["Get","MySQL","connection","ID","that","will","be","used","to","cancel","all","other","running","queries","in","the","same","connection",".",":","param","cursor",":","Cursor","instance","in","which","the","query","will","be","executed",":","param","query",":","Query","instance",":","return",":","MySQL","Connection","ID"]
code: def get_cancel_query_id(
      cls, cursor: Any, query: Query
  ) -> Optional[str]:
      """
      Get MySQL connection ID that will be used to cancel all other running
      queries in the same connection.
  
      :param cursor: Cursor instance in which the query will be executed
      :param query: Query instance
      :return: MySQL Connection ID
      """
      cursor.execute("SELECT CONNECTION_ID()")
      row = cursor.fetchone()
      return row[0]
  
imports: import contextlib
  import re
  from datetime import datetime
  from decimal import Decimal
  from re import Pattern
  from typing import Any, Callable, Optional
  from urllib import parse
  from flask_babel import gettext
  from sqlalchemy import types
  from sqlalchemy.dialects.mysql import BIT, DECIMAL, DOUBLE, FLOAT, INTEGER, LONGTEXT, MEDIUMINT, MEDIUMTEXT, TINYINT, TINYTEXT
  from sqlalchemy.engine.url import URL
  from superset.constants import TimeGrain
  from superset.db_engine_specs.base import BaseEngineSpec, BasicParametersMixin
  from superset.errors import SupersetErrorType
  from superset.models.sql_lab import Query
  from superset.utils.core import GenericDataType
label_desc: Use image node_id 7 for calling the MySQLEngineSpec obj's underlying member method code with example usage: obj.get_cancel_query_id(cls, cursor, query) and returns: row