code: def test_add_intercept_dask_dataframe():
      X = dd.from_pandas(pd.DataFrame({"A": [1, 2, 3]}), npartitions=2)
      result = add_intercept(X)
      expected = dd.from_pandas(
          pd.DataFrame(
              {"intercept": [1, 1, 1], "A": [1, 2, 3]},
              columns=["intercept", "A"],
          ),
          npartitions=2,
      )
      assert_eq(result, expected)
  
      df = dd.from_pandas(
          pd.DataFrame({"intercept": [1, 2, 3]}), npartitions=2
      )
      with pytest.raises(ValueError):
          add_intercept(df)
  
imports: import dask.array
  import dask.dataframe
  import numpy
  import numpy.linalg
  import pandas
  import pytest
  import sklearn.linear_model
  from dask.dataframe.utils import assert_eq
  from dask_glm.regularizers import Regularizer
  from sklearn.pipeline import make_pipeline
  import dask_ml.linear_model
  from dask_ml.datasets import make_classification, make_counts, make_regression
  from dask_ml.linear_model import LinearRegression, LogisticRegression, PoissonRegression
  from dask_ml.linear_model.utils import add_intercept
  from dask_ml.model_selection import GridSearchCV
label_desc: Use image node_id 12 for calling a global function with example usage: test_add_intercept_dask_dataframe() without return types