code: def test_inverse_mixed(all_src_types_inv_evoked):
      """Test creating and applying an inverse to mixed source spaces."""
      stcs = dict()
      invs, evoked = all_src_types_inv_evoked
      for kind, klass in [
          ("surface", mne.VectorSourceEstimate),
          ("volume", mne.VolVectorSourceEstimate),
          ("mixed", mne.MixedVectorSourceEstimate),
      ]:
          assert invs[kind]["src"].kind == kind
          with pytest.warns(RuntimeWarning, match="has been reduced"):
              stc = apply_inverse(evoked, invs[kind])
          assert isinstance(stc, klass._scalar_class)
          with pytest.warns(RuntimeWarning, match="has been reduced"):
              stc_vec = apply_inverse(
                  evoked, invs[kind], pick_ori="vector"
              )
          stcs[kind] = stc_vec
          assert isinstance(stc_vec, klass)
          assert_allclose(stc.data, stc_vec.magnitude().data, atol=1e-2)
      # Check class equivalences, need to force the mixed to have the same
      # data as the other two
      surf_src = invs["surface"]["src"]
      stcs["mixed"].data = np.concatenate(
          [stcs["surface"].data, stcs["volume"].data], axis=0
      )
      for kind in ("surface", "volume"):
          assert_allclose(
              getattr(stcs["mixed"], kind)().data, stcs[kind].data
          )
          assert_allclose(
              getattr(stcs["mixed"].magnitude(), kind)().data,
              stcs[kind].magnitude().data,
          )
          assert_allclose(
              getattr(stcs["mixed"], kind)().magnitude().data,
              stcs[kind].magnitude().data,
          )
      assert not np.allclose(stcs["surface"].data[0], 0.0, atol=1e-2)
      assert_allclose(
          stcs["mixed"].surface().project("normal", surf_src)[0].data,
          stcs["surface"].project("normal", surf_src)[0].data,
      )
  
imports: import copy
  import re
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_array_less, assert_equal
  from scipy import sparse
  import mne
  from mne import Covariance, EvokedArray, SourceEstimate, combine_evoked, compute_raw_covariance, convert_forward_solution, make_ad_hoc_cov, make_forward_solution, make_sphere_model, pick_channels_forward, pick_types, pick_types_forward, read_cov, read_evokeds, read_forward_solution
  from mne.datasets import testing
  from mne.epochs import Epochs, EpochsArray, make_fixed_length_epochs
  from mne.event import read_events
  from mne.forward import apply_forward, is_fixed_orient, restrict_forward_to_stc
  from mne.io import read_info, read_raw_fif
  from mne.label import label_sign_flip, read_label
  from mne.minimum_norm import INVERSE_METHODS, apply_inverse, apply_inverse_cov, apply_inverse_epochs, apply_inverse_raw, apply_inverse_tfr_epochs, compute_rank_inverse, make_inverse_operator, prepare_inverse_operator, read_inverse_operator, write_inverse_operator
  from mne.source_estimate import VolSourceEstimate, read_source_estimate
  from mne.source_space._source_space import _get_src_nn
  from mne.surface import _normal_orth
  from mne.time_frequency import EpochsTFR
  from mne.utils import _record_warnings, catch_logging
label_desc: Use image node_id 34 for calling a global function with example usage: test_inverse_mixed(all_src_types_inv_evoked) without return types