code: def _csd_morlet(
      data, sfreq, wavelets, nfft, tslice=None, use_fft=True, decim=1
  ):
      """Compute cross spectral density (CSD) using the given Morlet wavelets.
  
      Computes the CSD for a single epoch of data.
  
      Parameters
      ----------
      data : ndarray, shape (n_channels, n_times)
          The time series data consisting of n_channels time-series of length
          n_times.
      sfreq : float
          The sampling frequency of the data in Hertz.
      wavelets : list of ndarray
          The Morlet wavelets for which to compute the CSD's. These have been
          created by the `mne.time_frequency.tfr.morlet` function.
      nfft : int
          The number of FFT points.
      tslice : slice | None
          The desired time samples to compute the CSD over. If None, defaults to
          including all time samples.
      use_fft : bool
          Whether to use FFT-based convolution to compute the wavelet transform.
          Defaults to True.
      decim : int | slice
          To reduce memory usage, decimation factor during time-frequency
          decomposition. Defaults to 1 (no decimation).
          Only used in 'cwt_morlet' mode.
  
          If `int`, uses tfr[..., ::decim].
          If `slice`, uses tfr[..., decim].
  
      Returns
      -------
      csd : ndarray, shape ((n_channels**2 + n_channels) / 2 , n_wavelets)
          For each wavelet, the upper triangle of the cross spectral density
          matrix.
  
      See Also
      --------
      _vector_to_sym_mat : For converting the CSD to a full matrix.
      """
      # Compute PSD
      psds = _cwt_array(
          data,
          wavelets,
          nfft,
          mode="same",
          use_fft=use_fft,
          decim=decim,
      )
  
      if tslice is not None:
          tstart = (
              None if tslice.start is None else tslice.start // decim
          )
          tstop = None if tslice.stop is None else tslice.stop // decim
          tstep = None if tslice.step is None else tslice.step // decim
          tslice = slice(tstart, tstop, tstep)
          psds = psds[:, :, tslice]
  
      psds_conj = np.conj(psds)
  
      # Compute the spectral density between all pairs of series
      n_channels = data.shape[0]
      csds = np.vstack(
          [
              np.mean(psds[[i]] * psds_conj[i:], axis=2)
              for i in range(n_channels)
          ]
      )
  
      # Scaling by sampling frequency for compatibility with Matlab
      csds /= sfreq
      return csds
  
imports: import copy
  import numbers
  import numpy
  from scipy.fft import rfftfreq
  from .._fiff.pick import _picks_to_idx, pick_channels
  from ..parallel import parallel_func
  from ..time_frequency.multitaper import _compute_mt_params, _csd_from_mt, _mt_spectra, _psd_from_mt_adaptive
  from ..utils import ProgressBar, _check_fname, _import_h5io_funcs, _validate_type, copy_function_doc_to_method_doc, logger, verbose, warn
  from ..viz.misc import plot_csd
  from .tfr import EpochsTFR, _cwt_array, _get_nfft, morlet
label_desc: Use image node_id 17 for calling a global function with example usage: _csd_morlet(data, sfreq, wavelets, nfft, tslice, use_fft, decim) and returns: csds