code: def test_fit_transform(params):
      """Test that fit_transform and fit then transform yield same results."""
      bop_1, bop_2 = BagOfPatterns(**params), BagOfPatterns(**params)
      arr_1 = bop_1.fit_transform(X)
      arr_2 = bop_2.fit(X).transform(X)
      assert bop_1.vocabulary_ == bop_2.vocabulary_
      if isinstance(arr_1, np.ndarray):
          np.testing.assert_array_equal(arr_1, arr_2)
      else:
          np.testing.assert_array_equal(arr_1.A, arr_2.A)
  
imports: import numpy
  import pytest
  from pyts.transformation import BagOfPatterns
label_desc: Use image node_id 2 for calling a global function with example usage: test_fit_transform(params) without return types