def _observed_freq_datetime_index(index: pd.DatetimeIndex) -> set:
        """Returns all observed/inferred frequencies of a pandas DatetimeIndex. The frequencies are inferred from all
        combinations of three adjacent time steps
        """
        # find unique time deltas indices from three consecutive time stamps
        _, unq_td_index = np.unique(
            np.stack([(index[1:-1] - index[:-2]), (index[2:] - index[1:-1])]),
            return_index=True,
            axis=1,
        )

        # for each unique index, take one example including the left time stamp, and one including the right
        steps = np.column_stack([index[unq_td_index + i] for i in range(3)])

        # find all unique inferred frequencies
        observed_freqs = {pd.infer_freq(step) for step in steps}
        observed_freqs.discard(None)
        return observed_freqs
Returns all observed/inferred frequencies of a pandas DatetimeIndex. The frequencies are inferred from all
        combinations of three adjacent time steps
        
darts/timeseries.py