code: def test_execute_with_cursor_in_parallel(mocker: MockerFixture):
      """Test that `execute_with_cursor` fetches query ID from the cursor"""
      from superset.db_engine_specs.trino import TrinoEngineSpec
  
      query_id = "myQueryId"
  
      mock_cursor = mocker.MagicMock()
      mock_cursor.query_id = None
  
      mock_query = mocker.MagicMock()
  
      def _mock_execute(*args, **kwargs):
          mock_cursor.query_id = query_id
  
      mock_cursor.execute.side_effect = _mock_execute
  
      TrinoEngineSpec.execute_with_cursor(
          cursor=mock_cursor,
          sql="SELECT 1 FROM foo",
          query=mock_query,
      )
  
      mock_query.set_extra_json_key.assert_called_once_with(
          key=QUERY_CANCEL_KEY, value=query_id
      )
  
imports: import copy
  import json
  from datetime import datetime
  from typing import Any, Optional
  from unittest.mock import Mock, patch
  import pandas
  import pytest
  from pytest_mock import MockerFixture
  from sqlalchemy import types
  from trino.sqlalchemy import datatype
  import superset.config
  from superset.constants import QUERY_CANCEL_KEY, QUERY_EARLY_CANCEL_KEY, USER_AGENT
  from superset.superset_typing import ResultSetColumnType, SQLAColumnType
  from superset.utils.core import GenericDataType
  from tests.unit_tests.db_engine_specs.utils import assert_column_spec, assert_convert_dttm
  from tests.unit_tests.fixtures.common import dttm
label_desc: Use image node_id 17 for calling a global function with example usage: test_execute_with_cursor_in_parallel(mocker) without return types