code: def _sparsify_and_convert(data, input_type, sparsity_ratio=0.3):
      """Randomly set values to 0 and produce a sparse array."""
      if not has_scipy():
          raise RuntimeError("Scipy is required")
      import scipy
  
      random_loc = np.random.choice(
          data.size, int(data.size * sparsity_ratio), replace=False
      )
      data.ravel()[random_loc] = 0
      if input_type == "csr":
          return scipy.sparse.csr_matrix(data)
      elif input_type == "csc":
          return scipy.sparse.csc_matrix(data)
      else:
          TypeError("Wrong sparse input type {}".format(input_type))
  
imports: from cuml.internals.import_utils import has_scipy
  from cuml.internals.safe_imports import gpu_only_import_from
  from cuml.internals import input_utils
  from urllib.request import urlretrieve
  import sklearn.model_selection
  from sklearn.datasets import load_svmlight_file, fetch_covtype
  import cuml.datasets
  from cuml.internals.safe_imports import cpu_only_import
  import os
  import functools
  import gzip
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 19 for calling a global function with example usage: _sparsify_and_convert(data, input_type, sparsity_ratio) and returns: scipy, scipy