code: def _setup_adjacency(adjacency, n_tests, n_times):
      if not sparse.issparse(adjacency):
          raise ValueError(
              "If adjacency matrix is given, it must be a "
              "SciPy sparse matrix."
          )
      if adjacency.shape[0] == n_tests:  # use global algorithm
          adjacency = adjacency.tocoo()
      else:  # use temporal adjacency algorithm
          got_times, mod = divmod(n_tests, adjacency.shape[0])
          if got_times != n_times or mod != 0:
              raise ValueError(
                  "adjacency (len %d) must be of the correct size, i.e. be "
                  "equal to or evenly divide the number of tests (%d).\n\n"
                  "If adjacency was computed for a source space, try using "
                  'the fwd["src"] or inv["src"] as some original source space '
                  "vertices can be excluded during forward computation"
                  % (adjacency.shape[0], n_tests)
              )
          # we claim to only use upper triangular part... not true here
          adjacency = (adjacency + adjacency.transpose()).tocsr()
          adjacency = [
              adjacency.indices[
                  adjacency.indptr[i] : adjacency.indptr[i + 1]
              ]
              for i in range(len(adjacency.indptr) - 1)
          ]
      return adjacency
  
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 19 for calling a global function with example usage: _setup_adjacency(adjacency, n_tests, n_times) and returns: adjacency