code: def test_cd_work_on_joblib_memmapped_data(monkeypatch):
      monkeypatch.setattr(
          sklearn.decomposition._dict_learning,
          "Parallel",
          partial(Parallel, max_nbytes=100),
      )
  
      rng = np.random.RandomState(0)
      X_train = rng.randn(10, 10)
  
      dict_learner = DictionaryLearning(
          n_components=5,
          random_state=0,
          n_jobs=2,
          fit_algorithm="cd",
          max_iter=50,
          verbose=True,
      )
  
      # This must run and complete without error.
      dict_learner.fit(X_train)
  
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 47 for calling a global function with example usage: test_cd_work_on_joblib_memmapped_data(monkeypatch) without return types