code: def test_csd_get_data():
      """Test the get_data method of CrossSpectralDensity."""
      csd = _make_csd()
  
      # CSD matrix corresponding to 2 Hz.
      assert_array_equal(
          csd.get_data(frequency=2),
          [[6, 7, 8], [7, 9, 10], [8, 10, 11]],
      )
  
      # Mean CSD matrix
      assert_array_equal(
          csd.mean().get_data(),
          [[9, 10, 11], [10, 12, 13], [11, 13, 14]],
      )
  
      # Average across frequency bins, select bin
      assert_array_equal(
          csd.mean(fmin=[1, 3], fmax=[2, 4]).get_data(index=1),
          [[15, 16, 17], [16, 18, 19], [17, 19, 20]],
      )
  
      # Invalid inputs
      raises(ValueError, csd.get_data)
      raises(ValueError, csd.get_data, frequency=1, index=1)
      raises(IndexError, csd.get_data, frequency=15)
      raises(ValueError, csd.mean().get_data, frequency=1)
      raises(IndexError, csd.mean().get_data, index=15)
  
imports: import pickle
  from itertools import product
  from os import path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from pytest import raises
  import mne
  from mne.channels import equalize_channels
  from mne.proj import Projection
  from mne.time_frequency import CrossSpectralDensity, csd_array_fourier, csd_array_morlet, csd_array_multitaper, csd_fourier, csd_morlet, csd_multitaper, csd_tfr, pick_channels_csd, read_csd, tfr_morlet
  from mne.time_frequency.csd import _sym_mat_to_vector, _vector_to_sym_mat
  from mne.utils import sum_squared
label_desc: Use image node_id 7 for calling a global function with example usage: test_csd_get_data() without return types