def test_constrain_landmarks():
    breaking_bad = mio.import_builtin_asset('breakingbad.jpg').as_masked()
    breaking_bad = breaking_bad.crop_to_landmarks(boundary=20)
    breaking_bad = breaking_bad.resize([50, 50])
    breaking_bad.constrain_mask_to_landmarks()
    hog_b = hog(breaking_bad, mode='sparse')
    x = np.where(hog_b.landmarks['PTS'].lms.points[:, 0] > hog_b.shape[1] - 1)
    y = np.where(hog_b.landmarks['PTS'].lms.points[:, 0] > 1 - hog_b.shape[0])
    assert_allclose(len(x[0]) + len(y[0]), 12)
    hog_b = hog(breaking_bad, mode='sparse')
    hog_b.constrain_landmarks_to_bounds()
    x = np.where(hog_b.landmarks['PTS'].lms.points[:, 0] > hog_b.shape[1] - 1)
    y = np.where(hog_b.landmarks['PTS'].lms.points[:, 0] > hog_b.shape[0] - 1)
    assert_allclose(len(x[0]) + len(y[0]), 0)
dataset/ETHPy150Open menpo/menpo/menpo/feature/test/test_features.py/test_constrain_landmarks/swapped operands of `-`