code: def test_actual_results(params, vocab_desired, arr_desired):
      """Test that the actual results are the expected ones."""
      bop = BagOfPatterns(**params)
      arr_actual = bop.fit_transform(X)
      assert bop.vocabulary_ == vocab_desired
      if isinstance(arr_actual, np.ndarray):
          np.testing.assert_array_equal(arr_actual, arr_desired)
      else:
          np.testing.assert_array_equal(arr_actual.A, arr_desired)
  
imports: import numpy
  import pytest
  from pyts.transformation import BagOfPatterns
label_desc: Use image node_id 1 for calling a global function with example usage: test_actual_results(params, vocab_desired, arr_desired) without return types