code: def get_dataobj(img):
      """Return data object for nibabel image
  
      Parameters
      ----------
      img : ``SpatialImage`` instance
          Instance of nibabel ``SpatialImage`` class
  
      Returns
      -------
      dataobj : object
          ``ArrayProxy`` or ndarray object containing data for `img`
      """
      try:
          return img.dataobj
      except AttributeError:
          return img._data
  
imports: import nibabel
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: get_dataobj(img) and returns: img, img