code: def _first_block(dask_object):
      """Extract the first block / partition from a dask object"""
      if isinstance(dask_object, da.Array):
          if dask_object.ndim > 1 and dask_object.numblocks[-1] != 1:
              raise NotImplementedError(
                  "IID estimators require that the array "
                  "blocked only along the first axis. "
                  "Rechunk your array before fitting."
              )
          shape = (dask_object.chunks[0][0],)
          if dask_object.ndim > 1:
              shape = shape + (dask_object.chunks[1][0],)
  
          return da.from_delayed(
              dask_object.to_delayed().flatten()[0],
              shape,
              dask_object.dtype,
          )
  
      if isinstance(dask_object, dd._Frame):
          return dask_object.get_partition(0)
  
      else:
          return dask_object
  
imports: import logging
  import warnings
  import dask.array
  import dask.dataframe
  import dask.delayed
  import numpy
  import sklearn.base
  import sklearn.metrics
  from sklearn.utils.validation import check_is_fitted
  from dask_ml.utils import _timer
  from ._partial import fit
  from ._utils import copy_learned_attributes
  from .metrics import check_scoring, get_scorer
label_desc: Use image node_id 1 for calling a global function with example usage: _first_block(dask_object) and returns: da, dask_object, dask_object