def test_digitize(X, bins, arr_desired):
    """Test that the actual results are the expected ones."""
    X = np.asarray(X)
    bins = np.asarray(bins)
    arr_actual = _digitize(X, bins)
    np.testing.assert_allclose(arr_actual, arr_desired, atol=1e-5, rtol=0.)
Test that the actual results are the expected ones.
pyts/approximation/tests/test_mcb.py