human
Complete the below
def _concat_datetime(to_concat, axis=0, typs=None):

    ''''provide concatenation of an datetimelike array of arrays each of which is a
    single M8[ns], datetimet64[ns, tz] or m8[ns] dtype
    Parameters
    to_concat : array of arrays
    axis : axis to provide concatenation
    typs : set of to_concat dtypes
    Returns
    a single array, preserving the combined dtypes'
    '''
assistant
#Here is the Python program you requested.
    def convert_to_pydatetime(x, axis):
        if (x.dtype.kind == _NS_DTYPE.kind):
            if (getattr(x, 'tz', None) is not None):
                x = x.asobject.values
            else:
                shape = x.shape
                x = tslib.ints_to_pydatetime(x.view(np.int64).ravel(), box=True)
                x = x.reshape(shape)
        elif (x.dtype == _TD_DTYPE):
            shape = x.shape
            x = tslib.ints_to_pytimedelta(x.view(np.int64).ravel(), box=True)
            x = x.reshape(shape)
        if (axis == 1):
            x = np.atleast_2d(x)
        return x
    if (typs is None):
        typs = get_dtype_kinds(to_concat)
    if (len(typs) == 1):
        _contains_datetime = any((typ.startswith('datetime') for typ in typs))
        _contains_period = any((typ.startswith('period') for typ in typs))
        if _contains_datetime:
            if ('datetime' in typs):
                new_values = np.concatenate([x.view(np.int64) for x in to_concat], axis=axis)
                return new_values.view(_NS_DTYPE)
            else:
                return _concat_datetimetz(to_concat)
        elif ('timedelta' in typs):
            new_values = np.concatenate([x.view(np.int64) for x in to_concat], axis=axis)
            return new_values.view(_TD_DTYPE)
        elif _contains_period:
            raise NotImplementedError
    to_concat = [convert_to_pydatetime(x, axis) for x in to_concat]
    return np.concatenate(to_concat, axis=axis)