code: def add_intercept(X):  # noqa: F811
      if X.ndim != 2:
          raise ValueError(
              "'X' should have 2 dimensions, not {}".format(X.ndim)
          )
  
      if len(X.chunks[1]) > 1:
          msg = (
              "Chunking is only allowed on the first axis. "
              "Use 'array.rechunk({1: array.shape[1]})' to "
              "rechunk to a single block along the second axis."
          )
          raise ValueError(msg)
  
      chunks = (X.chunks[0], ((X.chunks[1][0] + 1),))
      return X.map_blocks(_add_intercept, dtype=X.dtype, chunks=chunks)
  
file_path: dask-ml/dask_ml/linear_model/utils.py
imports: import dask.array
  import dask.dataframe
  import numpy
  from multipledispatch import dispatch
label_desc: Use image node_id 7 for calling a global function with example usage: add_intercept(X) and returns: X