code: def _get_result_dtype(
      to_concat: Sequence[ArrayLike], non_empties: Sequence[ArrayLike]
  ) -> tuple[bool, set[str], DtypeObj | None]:
      target_dtype = None
  
      dtypes = {obj.dtype for obj in to_concat}
      kinds = {obj.dtype.kind for obj in to_concat}
  
      any_ea = any(not isinstance(x, np.ndarray) for x in to_concat)
      if any_ea:
          # i.e. any ExtensionArrays
  
          # we ignore axis here, as internally concatting with EAs is always
          # for axis=0
          if len(dtypes) != 1:
              target_dtype = find_common_type(
                  [x.dtype for x in to_concat]
              )
              target_dtype = common_dtype_categorical_compat(
                  to_concat, target_dtype
              )
  
      elif not len(non_empties):
          # we have all empties, but may need to coerce the result dtype to
          # object if we have non-numeric type operands (numpy would otherwise
          # cast this to float)
          if len(kinds) != 1:
              if not len(kinds - {"i", "u", "f"}) or not len(
                  kinds - {"b", "i", "u"}
              ):
                  # let numpy coerce
                  pass
              else:
                  # coerce to object
                  target_dtype = np.dtype(object)
                  kinds = {"o"}
      else:
          # error: Argument 1 to "np_find_common_type" has incompatible type
          # "*Set[Union[ExtensionDtype, Any]]"; expected "dtype[Any]"
          target_dtype = np_find_common_type(*dtypes)  # type: ignore[arg-type]
  
      return any_ea, kinds, target_dtype
  
file_path: pandas/pandas/core/dtypes/concat.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, cast
  import warnings
  import numpy
  from pandas._libs import lib
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes.astype import astype_array
  from pandas.core.dtypes.cast import common_dtype_categorical_compat, find_common_type, np_find_common_type
  from pandas.core.dtypes.dtypes import CategoricalDtype
  from pandas.core.dtypes.generic import ABCCategoricalIndex, ABCSeries
label_desc: Use image node_id 3 for calling a global function with example usage: _get_result_dtype(to_concat, non_empties) and returns: any_ea,  kinds,  target_dtype