code: def _boolean_index_to_array(idx):
      if idx.ndim > 1:
          raise IndexError("invalid index shape")
      return np.where(idx)[0]
  
imports: import numpy
  from ._sputils import isintlike
label_desc: Use image node_id 7 for calling a global function with example usage: _boolean_index_to_array(idx) and returns: np