code: def _aff_is_diag(aff):
      """Utility function returning True if affine is nearly diagonal"""
      rzs_aff = aff[:3, :3]
      return np.allclose(rzs_aff, np.diag(np.diag(rzs_aff)))
  
file_path: nibabel/nibabel/funcs.py
imports: import numpy
  from .loadsave import load
  from .orientations import OrientationError, io_orientation
label_desc: Use image node_id 5 for calling a global function with example usage: _aff_is_diag(aff) and returns: np