code: def test_csd_pickle(tmp_path):
      """Test pickling and unpickling a CrossSpectralDensity."""
      csd = _make_csd()
      tempdir = str(tmp_path)
      fname = op.join(tempdir, "csd.dat")
      with open(fname, "wb") as f:
          pickle.dump(csd, f)
      with open(fname, "rb") as f:
          csd2 = pickle.load(f)  # nosec B301
      assert_array_equal(csd._data, csd2._data)
      assert csd.tmin == csd2.tmin
      assert csd.tmax == csd2.tmax
      assert csd.ch_names == csd2.ch_names
      assert csd.frequencies == csd2.frequencies
      assert csd._is_sum == csd2._is_sum
  
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 9 for calling a global function with example usage: test_csd_pickle(tmp_path) without return types