code: def test_works_with_sparse_data(coo_container, global_random_seed):
      n_features = 20
      n_samples = 5
      n_nonzeros = int(n_features / 4)
      dense_data = make_sparse_random_data(
          coo_container,
          n_samples,
          n_features,
          n_nonzeros,
          random_state=global_random_seed,
          sparse_format=None,
      )
      sparse_data = make_sparse_random_data(
          coo_container,
          n_samples,
          n_features,
          n_nonzeros,
          random_state=global_random_seed,
          sparse_format="csr",
      )
  
      for RandomProjection in all_RandomProjection:
          rp_dense = RandomProjection(
              n_components=3, random_state=1
          ).fit(dense_data)
          rp_sparse = RandomProjection(
              n_components=3, random_state=1
          ).fit(sparse_data)
          assert_array_almost_equal(
              densify(rp_dense.components_),
              densify(rp_sparse.components_),
          )
  
imports: import functools
  import warnings
  from typing import Any, List
  import numpy
  import pytest
  import scipy.sparse
  from sklearn.exceptions import DataDimensionalityWarning, NotFittedError
  from sklearn.metrics import euclidean_distances
  from sklearn.random_projection import GaussianRandomProjection, SparseRandomProjection, _gaussian_random_matrix, _sparse_random_matrix, johnson_lindenstrauss_min_dim
  from sklearn.utils._testing import assert_allclose, assert_allclose_dense_sparse, assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from sklearn.utils.fixes import COO_CONTAINERS
label_desc: Use image node_id 20 for calling a global function with example usage: test_works_with_sparse_data(coo_container, global_random_seed) without return types