code: def test_permutation_cluster_signs(threshold, kind):
      """Test cluster signs."""
      # difference between two conditions for 3 subjects x 2 vertices x 2 times
      X = np.array(
          [
              [[-10, 5], [-2, -7]],
              [[-4, 5], [-8, -0]],
              [[-6, 3], [-4, -2]],
          ],
          float,
      )
      want_signs = np.sign(np.mean(X, axis=0))
      n_permutations = 1
      if kind == "1samp":
          func = permutation_cluster_1samp_test
          stat_fun = ttest_1samp_no_p
          use_X = X
      else:
          assert kind == "ind"
          func = permutation_cluster_test
          stat_fun = ttest_ind_no_p
          use_X = [X, np.random.RandomState(0).randn(*X.shape) * 0.1]
      tobs, clu, clu_pvalues, _ = func(
          use_X,
          n_permutations=n_permutations,
          threshold=threshold,
          tail=0,
          stat_fun=stat_fun,
          out_type="mask",
      )
      clu_signs = np.zeros(X.shape[1:])
      used = np.zeros(X.shape[1:])
      assert len(clu) == len(clu_pvalues)
      for c, p in zip(clu, clu_pvalues):
          assert not used[c].any()
          assert len(np.unique(np.sign(tobs[c]))) == 1
          clu_signs[c] = np.sign(tobs[c])[0]
          used[c] = True
      assert used.all()
      assert clu_signs.all()
      assert_array_equal(np.sign(tobs), want_signs)
      assert_array_equal(clu_signs, want_signs)
  
imports: import os
  from functools import partial
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from scipy import linalg, sparse, stats
  from mne import MixedSourceEstimate, SourceEstimate, SourceSpaces, VolSourceEstimate
  from mne.stats import combine_adjacency, ttest_ind_no_p
  from mne.stats.cluster_level import f_oneway, permutation_cluster_1samp_test, permutation_cluster_test, spatio_temporal_cluster_1samp_test, spatio_temporal_cluster_test, summarize_clusters_stc, ttest_1samp_no_p
  from mne.utils import _record_warnings, catch_logging
label_desc: Use image node_id 9 for calling a global function with example usage: test_permutation_cluster_signs(threshold, kind) without return types