code: def _concat_datetime(to_concat, axis: AxisInt = 0):
      """
      provide concatenation of an datetimelike array of arrays each of which is a
      single M8[ns], datetime64[ns, tz] or m8[ns] dtype
  
      Parameters
      ----------
      to_concat : array of arrays
      axis : axis to provide concatenation
  
      Returns
      -------
      a single array, preserving the combined dtypes
      """
      from pandas.core.construction import (
          ensure_wrapped_if_datetimelike,
      )
  
      to_concat = [ensure_wrapped_if_datetimelike(x) for x in to_concat]
  
      single_dtype = len({x.dtype for x in to_concat}) == 1
  
      # multiple types, need to coerce to object
      if not single_dtype:
          # ensure_wrapped_if_datetimelike ensures that astype(object) wraps
          #  in Timestamp/Timedelta
          return _concatenate_2d(
              [x.astype(object) for x in to_concat], axis=axis
          )
  
      result = type(to_concat[0])._concat_same_type(
          to_concat, axis=axis
      )
      return result
  
file_path: catboost/contrib/python/pandas/py3/pandas/core/dtypes/concat.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
  import numpy
  from pandas._typing import AxisInt
  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.common import is_dtype_equal
  from pandas.core.dtypes.dtypes import DatetimeTZDtype, ExtensionDtype
  from pandas.core.dtypes.generic import ABCCategoricalIndex, ABCExtensionArray, ABCSeries
label_desc: Use image node_id 4 for calling a global function with example usage: _concat_datetime(to_concat, axis) and returns: result, _concatenate_2d