code: def test_fit_transform(params):
      """Test that 'fit_transform' and 'fit' then 'transform' yield same res."""
      shapelet_1 = ShapeletTransform(random_state=42, **params)
      shapelet_2 = ShapeletTransform(random_state=42, **params)
  
      X_fit_transform = shapelet_1.fit_transform(X, y)
      X_fit_then_transform = shapelet_2.fit(X, y).transform(X)
  
      # Test that the transformation are identical
      np.testing.assert_allclose(
          X_fit_transform, X_fit_then_transform, atol=1e-5, rtol=0.0
      )
  
      # Test that the shapelets are identical
      for shap_1, shap_2 in zip(
          shapelet_1.shapelets_, shapelet_2.shapelets_
      ):
          np.testing.assert_allclose(
              shap_1, shap_2, atol=1e-5, rtol=0.0
          )
  
      # Test that the remaining attributes are identical
      np.testing.assert_allclose(
          shapelet_1.scores_, shapelet_2.scores_, atol=1e-5, rtol=0.0
      )
      np.testing.assert_array_equal(
          shapelet_1.indices_, shapelet_2.indices_
      )
      shapelets_not_none = (shapelet_1.window_range_ is not None) and (
          shapelet_2.window_range_ is not None
      )
      if shapelets_not_none:
          np.testing.assert_array_equal(
              shapelet_1.window_range_, shapelet_2.window_range_
          )
  
file_path: pyts/pyts/transformation/tests/test_shapelet_transform.py
imports: import numpy
  import pytest
  import re
  from pyts.transformation import ShapeletTransform
  from pyts.transformation.shapelet_transform import _extract_all_shapelets, _derive_shapelet_distances, _derive_all_distances, _remove_similar_shapelets
label_desc: Use image node_id 6 for calling a global function with example usage: test_fit_transform(params) without return types