code: def _blocks_and_name(obj):
      if hasattr(obj, "chunks"):
          nblocks = len(obj.chunks[0])
          name = obj.name
  
      elif hasattr(obj, "npartitions"):
          # dataframe, bag
          nblocks = obj.npartitions
          if hasattr(obj, "_name"):
              # dataframe
              name = obj._name
          else:
              # bag
              name = obj.name
  
      return nblocks, name
  
file_path: dask-ml/dask_ml/_partial.py
imports: from __future__ import absolute_import, division, print_function
  import logging
  import os
  import dask
  import numpy
  import sklearn.utils
  from dask.delayed import Delayed
  from dask.highlevelgraph import HighLevelGraph
  from toolz import partial
  from ._compat import DASK_2022_01_0
label_desc: Use image node_id 3 for calling a global function with example usage: _blocks_and_name(obj) and returns: nblocks,  name