code: def indices_to_bool_mask(indices, size):
      """Convert indices to a boolean (integer) mask.
  
      >>> list(indices_to_bool_mask(np.array([2, 3]), 4))
      [False, False, True, True]
  
      >>> list(indices_to_bool_mask([2, 3], 4))
      [False, False, True, True]
  
      >>> indices_to_bool_mask(np.array([5]), 2)
      Traceback (most recent call last):
      ...
      IndexError: index 5 is out of bounds ...
      """
      mask = np.zeros(size, dtype=bool)
      mask[indices] = 1
      return mask
  
file_path: eli5/eli5/utils.py
imports: import numpy
  from scipy import sparse
label_desc: Use image node_id 6 for calling a global function with example usage: indices_to_bool_mask(indices, size) and returns: mask