code: def test_simulate_sparse_stc_single_hemi(_get_fwd_labels):
      """Test generation of sparse source estimate."""
      fwd, labels = _get_fwd_labels
      labels_single_hemi = labels[
          1:
      ]  # keep only labels in one hemisphere
  
      n_times = 10
      tmin = 0
      tstep = 1e-3
      times = np.arange(n_times, dtype=np.float64) * tstep + tmin
  
      stc_1 = simulate_sparse_stc(
          fwd["src"],
          len(labels_single_hemi),
          times,
          labels=labels_single_hemi,
          random_state=0,
      )
  
      assert stc_1.data.shape[0] == len(labels_single_hemi)
      assert stc_1.data.shape[1] == n_times
  
      # make sure we get the same result when using the same seed
      stc_2 = simulate_sparse_stc(
          fwd["src"],
          len(labels_single_hemi),
          times,
          labels=labels_single_hemi,
          random_state=0,
      )
  
      assert_array_equal(stc_1.lh_vertno, stc_2.lh_vertno)
      assert_array_equal(stc_1.rh_vertno, stc_2.rh_vertno)
  
file_path: mne-python/mne/simulation/tests/test_source.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_equal
  from mne import convert_forward_solution, pick_types_forward, read_forward_solution, read_label
  from mne.datasets import testing
  from mne.label import Label
  from mne.simulation import SourceSimulator, simulate_sparse_stc, simulate_stc
label_desc: Use image node_id 6 for calling a global function with example usage: test_simulate_sparse_stc_single_hemi(_get_fwd_labels) without return types