code: def _convert_bool2index(sample_mask):
      """Convert boolean to index."""
      check_boolean = [
          type(i) is bool or type(i) is np.bool_ for i in sample_mask
      ]
      if all(check_boolean):
          sample_mask = np.where(sample_mask)[0]
      return sample_mask
  
file_path: nilearn/nilearn/_utils/param_validation.py
imports: import numbers
  import warnings
  import numpy
  from sklearn.feature_selection import SelectPercentile, f_classif, f_regression
  from .niimg import _get_data
label_desc: Use image node_id 6 for calling a global function with example usage: _convert_bool2index(sample_mask) and returns: sample_mask