code: def test_random_projection_fit_transform(datatype, method):
      if has_scipy():
          from scipy.spatial.distance import pdist
      else:
          pytest.skip(
              "Skipping test_random_projection_fit_transform because "
              + "Scipy is missing"
          )
  
      eps = 0.2
  
      # dataset generation
      data, target = make_blobs(
          n_samples=800, centers=400, n_features=3000
      )
  
      # conversion to input_type
      data = data.astype(datatype)
      target = target.astype(datatype)
  
      # creation of model
      if method == "gaussian":
          model = GaussianRandomProjection(eps=eps)
      else:
          model = SparseRandomProjection(eps=eps)
  
      # fitting the model
      model.fit(data)
      # applying transformation
      transformed_data = model.transform(data)
  
      original_pdist = pdist(data)
      embedded_pdist = pdist(transformed_data)
  
      # check JL lemma
      assert np.all(
          ((1.0 - eps) * original_pdist) <= embedded_pdist
      ) and np.all(embedded_pdist <= ((1.0 + eps) * original_pdist))
  
file_path: cuml/python/cuml/tests/test_random_projection.py
imports: from cuml.common import has_scipy
  from sklearn.datasets import make_blobs
  from sklearn.random_projection import johnson_lindenstrauss_min_dim
  from cuml.random_projection import johnson_lindenstrauss_min_dim
  from cuml.random_projection import GaussianRandomProjection, SparseRandomProjection
  import pytest
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 2 for calling a global function with example usage: test_random_projection_fit_transform(datatype, method) without return types