code: def test_sparse_coder_common_transformer():
      rng = np.random.RandomState(777)
      n_components, n_features = 40, 3
      init_dict = rng.rand(n_components, n_features)
  
      sc = SparseCoder(init_dict)
  
      check_transformer_data_not_an_array(sc.__class__.__name__, sc)
      check_transformer_general(sc.__class__.__name__, sc)
      check_transformer_general_memmap = partial(
          check_transformer_general, readonly_memmap=True
      )
      check_transformer_general_memmap(sc.__class__.__name__, sc)
      check_transformers_unfitted(sc.__class__.__name__, sc)
  
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 34 for calling a global function with example usage: test_sparse_coder_common_transformer() without return types