def check_novelty(novelty, method):
    """Raise AttributeError if ``novelty`` is not valid."""
    if novelty and method == 'fit_predict':
        raise AttributeError(
            f'{method} is not available when novelty=True, use novelty=False if you want to predict on the training data'
            )
    elif not novelty and method != 'fit_predict':
        raise AttributeError(
            f'{method} is not available when novelty=False, use novelty=True if you want to predict on new unseen data'
            )
