def _slice_set(X, dates):
    """
    Returns a copy of the original data, sliced based on the specified dates
    :param X: dataset with a MultiIndex consisting of date as pd.DatetimeIndex and category
    :param dates: list of dates for filtering
    :return: subset of X (copy)
    """
    new_samples = X.copy().loc[dates]
    new_samples.index = new_samples.index.remove_unused_levels()
    return new_samples