code: def _first_element_bool(idx, max_dim=2):
      """Returns True if first element of the incompatible
      array type is boolean.
      """
      if max_dim < 1:
          return None
      try:
          first = idx[0] if len(idx) > 0 else None
      except TypeError:
          return None
      if isinstance(first, _bool_scalar_types):
          return True
      return _first_element_bool(first, max_dim - 1)
  
imports: import cupy
  from cupy import _core
  from cupyx.scipy.sparse._base import isspmatrix
  from cupyx.scipy.sparse._base import spmatrix
  from cupy.cuda import device
  from cupy.cuda import runtime
  import numpy
label_desc: Use image node_id 11 for calling a global function with example usage: _first_element_bool(idx, max_dim) and returns: _first_element_bool, None, True, None