code: def test_input(input_type, sparse_format, dtype, convert_format):
      rand_func = (
          cupyx.scipy.sparse if input_type == "cupy" else scipy_sparse
      )
  
      X = rand_func.random(
          100, 100, format=sparse_format, density=0.5, dtype=dtype
      )
  
      if convert_format or sparse_format == "csr":
          X_m = SparseCumlArray(X, convert_format=convert_format)
  
          assert X.shape == X_m.shape
          assert X.nnz == X_m.nnz
          assert X.dtype == X_m.dtype
  
          # Just a sanity check
          assert isinstance(X_m.indptr, CumlArray)
          assert isinstance(X_m.indices, CumlArray)
          assert isinstance(X_m.data, CumlArray)
  
          assert X_m.indptr.dtype == cp.int32
          assert X_m.indices.dtype == cp.int32
          assert X_m.data.dtype == dtype
  
      elif not convert_format:
          with pytest.raises(ValueError):
              SparseCumlArray(X, convert_format=convert_format)
  
file_path: cuml/python/cuml/tests/test_array_sparse.py
imports: from cuml.internals.safe_imports import gpu_only_import
  import pytest
  from cuml.internals.array import CumlArray
  from cuml.internals.array_sparse import SparseCumlArray
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 1 for calling a global function with example usage: test_input(input_type, sparse_format, dtype, convert_format) without return types