code: def _get_clusters_spatial(s, neighbors):
      """Form spatial clusters using neighbor lists.
  
      This is equivalent to _get_components with n_times = 1, with a properly
      reconfigured adjacency matrix (formed as "neighbors" list)
      """
      # s is a vector of spatial indices that are significant, like:
      #     s = np.where(x_in)[0]
      # for x_in representing a single time-instant
      r = np.ones(s.shape, bool)
      clusters = list()
      next_ind = 0 if s.size > 0 else -1
      while next_ind >= 0:
          # put first point in a cluster, adjust remaining
          t_inds = [next_ind]
          r[next_ind] = 0
          icount = 1  # count of nodes in the current cluster
          while icount <= len(t_inds):
              ind = t_inds[icount - 1]
              # look across other vertices
              buddies = _get_buddies(r, s, neighbors[s[ind]])
              t_inds.extend(buddies)
              icount += 1
          next_ind = _where_first(r)
          clusters.append(s[t_inds])
      return clusters
  
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 7 for calling a global function with example usage: _get_clusters_spatial(s, neighbors) and returns: clusters