def test_smoten_sparse_input(data, sparse_format):
    """Check that we handle sparse input in SMOTEN even if it is not efficient.

    Non-regression test for:
    https://github.com/scikit-learn-contrib/imbalanced-learn/issues/971
    """
    X, y = data
    X = OneHotEncoder().fit_transform(X).toarray()
    X = _convert_container(X, sparse_format)

    with pytest.warns(DataConversionWarning, match="is not really efficient"):
        X_res, y_res = SMOTEN(random_state=0).fit_resample(X, y)

    assert X_res.format == X.format
    assert X_res.shape[0] == len(y_res)
Check that we handle sparse input in SMOTEN even if it is not efficient.

    Non-regression test for:
    https://github.com/scikit-learn-contrib/imbalanced-learn/issues/971
    
imblearn/over_sampling/_smote/tests/test_smoten.py