code: def test_dask_sql_sg_logistic_regression(
      datatype, nrows, ncols, n_parts, wrap_predict
  ):
      if wrap_predict:
          cuml.set_global_output_type("input")
      else:
          cuml.set_global_output_type("cudf")
  
      X, y = make_classification(
          n_samples=nrows,
          n_features=ncols,
          n_informative=5,
          random_state=0,
      )
      X_train, X_test, y_train, y_test = train_test_split(X, y)
  
      train_df = cudf.DataFrame(
          X_train,
          dtype=datatype,
          columns=[chr(i) for i in range(ncols)],
      )
      train_df["target"] = y_train
      train_ddf = dask_cudf.from_cudf(train_df, npartitions=n_parts)
  
      c = Context()
      c.create_table("train_df", train_ddf)
  
      train_query = f"""
          CREATE MODEL model WITH (
              model_class = 'cuml.linear_model.LogisticRegression',
              wrap_predict = {wrap_predict},
              target_column = 'target'
          ) AS (
              SELECT * FROM train_df
          )
      """
  
      c.sql(train_query)
  
      skmodel = LogisticRegression().fit(X_train, y_train)
  
      test_df = cudf.DataFrame(
          X_test, dtype=datatype, columns=[chr(i) for i in range(ncols)]
      )
      test_ddf = dask_cudf.from_cudf(test_df, npartitions=n_parts)
      c.create_table("test_df", test_ddf)
  
      inference_query = """
          SELECT * FROM PREDICT(
              MODEL model,
              SELECT * FROM test_df
          )
      """
  
      preds = c.sql(inference_query).compute()
      score = cuml.metrics.accuracy_score(
          y_test, preds["target"].to_numpy()
      )
  
      assert score >= skmodel.score(X_test, y_test) - 0.022
  
file_path: cuml/python/cuml/tests/dask/test_dask_sql.py
imports: from sklearn.model_selection import train_test_split
  from sklearn.datasets import make_classification
  from sklearn.linear_model import LogisticRegression
  from cuml.internals.import_utils import has_dask_sql
  from cuml.internals.safe_imports import cpu_only_import
  import pytest
  import cuml
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 1 for calling a global function with example usage: test_dask_sql_sg_logistic_regression(datatype, nrows, ncols, n_parts, wrap_predict) without return types