code: def test_dict_learning_online_partial_fit():
      n_components = 12
      rng = np.random.RandomState(0)
      V = rng.randn(n_components, n_features)  # random init
      V /= np.sum(V**2, axis=1)[:, np.newaxis]
      dict1 = MiniBatchDictionaryLearning(
          n_components,
          max_iter=10,
          batch_size=1,
          alpha=1,
          shuffle=False,
          dict_init=V,
          max_no_improvement=None,
          tol=0.0,
          random_state=0,
      ).fit(X)
      dict2 = MiniBatchDictionaryLearning(
          n_components, alpha=1, dict_init=V, random_state=0
      )
      for i in range(10):
          for sample in X:
              dict2.partial_fit(sample[np.newaxis, :])
  
      assert not np.all(
          sparse_encode(X, dict1.components_, alpha=1) == 0
      )
      assert_array_almost_equal(
          dict1.components_, dict2.components_, decimal=2
      )
  
      # partial_fit should ignore max_iter (#17433)
      assert dict1.n_steps_ == dict2.n_steps_ == 100
  
imports: import itertools
  import warnings
  from functools import partial
  import numpy
  import pytest
  import sklearn
  from sklearn.base import clone
  from sklearn.decomposition import DictionaryLearning, MiniBatchDictionaryLearning, SparseCoder, dict_learning, dict_learning_online, sparse_encode
  from sklearn.decomposition._dict_learning import _update_dict
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.utils import check_array
  from sklearn.utils._testing import TempMemmap, assert_allclose, assert_array_almost_equal, assert_array_equal, ignore_warnings
  from sklearn.utils.estimator_checks import check_transformer_data_not_an_array, check_transformer_general, check_transformers_unfitted
  from sklearn.utils.parallel import Parallel
label_desc: Use image node_id 24 for calling a global function with example usage: test_dict_learning_online_partial_fit() without return types