code: def test_uniform_and_thresholding():
      """Test simulation metrics."""
      src = read_source_spaces(src_fname)
      vert = [src[0]["vertno"][0:1], []]
      data = np.array([[0.8, -1.0]])
      stc_true = SourceEstimate(data, vert, 0, 0.002, subject="sample")
      stc_bad = SourceEstimate(data, vert, 0, 0.002, subject="sample")
      stc_bad.vertices = [stc_bad.vertices[0]]
      with pytest.raises(ValueError, match="same number of vertices"):
          metrics._uniform_stc(stc_true, stc_bad)
  
      threshold = 0.9
      stc1, stc2 = metrics._thresholding(stc_true, stc_true, threshold)
      assert_allclose(stc1._data, np.array([[0, -1.0]]))
      assert_allclose(stc2._data, np.array([[0, -1.0]]))
      assert_allclose(threshold, metrics._check_threshold(threshold))
  
      threshold = "90"
      with pytest.raises(ValueError, match="Threshold if a str.*"):
          metrics._check_threshold(threshold)
  
file_path: mne-python/mne/simulation/metrics/tests/test_metrics.py
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose
  from scipy.linalg import norm
  from mne import SourceEstimate, read_source_spaces
  from mne.datasets import testing
  from mne.simulation import metrics
  from mne.simulation.metrics import cosine_score, f1_score, peak_position_error, precision_score, recall_score, region_localization_error, roc_auc_score, spatial_deviation_error
label_desc: Use image node_id 1 for calling a global function with example usage: test_uniform_and_thresholding() without return types