code: def _where_first_fallback(x):
      # this is equivalent to np.where(r)[0] for these purposes, but it's
      # a little bit faster. Unfortunately there's no way to tell numpy
      # just to find the first instance (to save checking every one):
      next_ind = int(np.argmax(x))
      if next_ind == 0:
          next_ind = -1
      return next_ind
  
imports: import numpy
  from scipy import ndimage, sparse
  from scipy.sparse.csgraph import connected_components
  from scipy.stats import f
  from scipy.stats import t
  from ..fixes import has_numba, jit
  from ..parallel import parallel_func
  from ..source_estimate import MixedSourceEstimate, SourceEstimate, VolSourceEstimate
  from ..source_space import SourceSpaces
  from ..utils import ProgressBar, _check_option, _pl, _validate_type, check_random_state, logger, split_list, verbose, warn
  from .parametric import f_oneway, ttest_1samp_no_p
label_desc: Use image node_id 3 for calling a global function with example usage: _where_first_fallback(x) and returns: next_ind