code: def test_sparse_from_dense(
      fit_intercept, regularization, datatype, n_classes, client
  ):
      penalty, C, l1_ratio = regularization
  
      run_test = partial(
          test_lbfgs,
          nrows=1e5,
          ncols=20,
          n_parts=2,
          fit_intercept=fit_intercept,
          datatype=datatype,
          delayed=True,
          client=client,
          penalty=penalty,
          n_classes=n_classes,
          C=C,
          l1_ratio=l1_ratio,
          convert_to_sparse=True,
      )
  
      if datatype == np.float32:
          run_test()
      else:
          with pytest.raises(
              RuntimeError,
              match="dtypes other than float32 are currently not supported",
          ):
              run_test()
  
imports: from cuml.internals.safe_imports import gpu_only_import
  import pytest
  from cuml.dask.common import utils
  from functools import partial
  from sklearn.metrics import accuracy_score, mean_squared_error
  from sklearn.datasets import make_classification
  from sklearn.linear_model import LogisticRegression
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.testing.utils import array_equal
  from scipy.sparse import csr_matrix
label_desc: Use image node_id 14 for calling a global function with example usage: test_sparse_from_dense(fit_intercept, regularization, datatype, n_classes, client) without return types