code: def return_single_query_results(
      sql: str | Iterable[str],
      return_last: bool,
      split_statements: bool,
  ):
      """
      Determine when results of single query only should be returned.
  
      For compatibility reasons, the behaviour of the DBAPIHook is somewhat confusing.
      In some cases, when multiple queries are run, the return value will be an iterable (list) of results
      -- one for each query. However, in other cases, when single query is run, the return value will be just
      the result of that single query without wrapping the results in a list.
  
      The cases when single query results are returned without wrapping them in a list are as follows:
  
      a) sql is string and ``return_last`` is True (regardless what ``split_statements`` value is)
      b) sql is string and ``split_statements`` is False
  
      In all other cases, the results are wrapped in a list, even if there is only one statement to process.
      In particular, the return value will be a list of query results in the following circumstances:
  
      a) when ``sql`` is an iterable of string statements (regardless what ``return_last`` value is)
      b) when ``sql`` is string, ``split_statements`` is True and ``return_last`` is False
  
      :param sql: sql to run (either string or list of strings)
      :param return_last: whether last statement output should only be returned
      :param split_statements: whether to split string statements.
      :return: True if the hook should return single query results
      """
      return isinstance(sql, str) and (
          return_last or not split_statements
      )
  
imports: from __future__ import annotations
  import contextlib
  import warnings
  from contextlib import closing
  from datetime import datetime
  from typing import TYPE_CHECKING, Any, Callable, Generator, Iterable, List, Mapping, Protocol, Sequence, TypeVar, cast, overload
  from urllib.parse import urlparse
  import sqlparse
  from sqlalchemy import create_engine
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.hooks.base import BaseHook
label_desc: Use image node_id 1 for calling a global function with example usage: return_single_query_results(sql, return_last, split_statements) and returns: unknown