code: def test_dict_learning_online_shapes():
      rng = np.random.RandomState(0)
      n_components = 8
  
      code, dictionary = dict_learning_online(
          X,
          n_components=n_components,
          batch_size=4,
          max_iter=10,
          method="cd",
          random_state=rng,
          return_code=True,
      )
      assert code.shape == (n_samples, n_components)
      assert dictionary.shape == (n_components, n_features)
      assert np.dot(code, dictionary).shape == X.shape
  
      dictionary = dict_learning_online(
          X,
          n_components=n_components,
          batch_size=4,
          max_iter=10,
          method="cd",
          random_state=rng,
          return_code=False,
      )
      assert dictionary.shape == (n_components, n_features)
  
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 14 for calling a global function with example usage: test_dict_learning_online_shapes() without return types