def test_attributes_shape(params, X, y, fewer_shapelets, attr_expected):
    """Test the attributes of a ShapaletTransform instance."""
    shapelet = ShapeletTransform(**params)
    shapelet.fit(X, y)

    # Check 'window_range_'
    window_sizes_auto = (isinstance(shapelet.window_sizes, str) and
                         shapelet.window_sizes == 'auto')
    if window_sizes_auto:
        assert isinstance(shapelet.window_range_, tuple)
        assert (0 < shapelet.window_range_[0]
                <= shapelet.window_range_[1] <= 8)
    else:
        assert shapelet.window_range_ is None

    # Check other attributes
    n_shapelets_actual = len(shapelet.shapelets_)
    if fewer_shapelets:
        assert n_shapelets_actual < attr_expected['n_shapelets']
        assert shapelet.indices_.shape[0] < attr_expected['indices_shape'][0]
        assert shapelet.scores_.size < attr_expected['scores_size']
    else:
        assert n_shapelets_actual == attr_expected['n_shapelets']
        assert shapelet.indices_.shape == attr_expected['indices_shape']
        assert shapelet.scores_.size == attr_expected['scores_size']
Test the attributes of a ShapaletTransform instance.
pyts/transformation/tests/test_shapelet_transform.py