def _contains_datetime_timedeltas(array):
    """Check if an input array contains datetime.timedelta objects."""
    array = np.atleast_1d(array)
    return isinstance(array[0], timedelta)
Check if an input array contains datetime.timedelta objects.
xarray/coding/cftimeindex.py