code: def test_exception_one_label(fit_intercept, client):
      n_parts = 2
      datatype = "float32"
  
      X = np.array([(1, 2), (1, 3), (2, 1), (3, 1)], datatype)
      y = np.array([1.0, 1.0, 1.0, 1.0], datatype)
      X_df, y_df = _prep_training_data(client, X, y, n_parts)
  
      err_msg = "This solver needs samples of at least 2 classes in the data, but the data contains only one class: 1.0"
  
      from cuml.dask.linear_model import (
          LogisticRegression as cumlLBFGS_dask,
      )
  
      mg = cumlLBFGS_dask(fit_intercept=fit_intercept, verbose=6)
      with pytest.raises(RuntimeError, match=err_msg):
          mg.fit(X_df, y_df)
  
      from sklearn.linear_model import LogisticRegression
  
      lr = LogisticRegression(fit_intercept=fit_intercept)
      with pytest.raises(ValueError, match=err_msg):
          lr.fit(X, y)
  
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 16 for calling a global function with example usage: test_exception_one_label(fit_intercept, client) without return types