code: def test_csp_twoclass_symmetry():
      """Test that CSP is symmetric when swapping classes."""
      x, y = deterministic_toy_data(["class_a", "class_b"])
      csp = CSP(
          norm_trace=False, transform_into="average_power", log=True
      )
      log_power = csp.fit_transform(x, y)
      log_power_ratio_ab = log_power[0] - log_power[1]
  
      x, y = deterministic_toy_data(["class_b", "class_a"])
      csp = CSP(
          norm_trace=False, transform_into="average_power", log=True
      )
      log_power = csp.fit_transform(x, y)
      log_power_ratio_ba = log_power[0] - log_power[1]
  
      assert_array_almost_equal(log_power_ratio_ab, log_power_ratio_ba)
  
file_path: mne-python/mne/decoding/tests/test_csp.py
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_equal
  from mne import Epochs, io, pick_types, read_events
  from mne.decoding.csp import CSP, SPoC, _ajd_pham
label_desc: Use image node_id 8 for calling a global function with example usage: test_csp_twoclass_symmetry() without return types