code: def csd_array_morlet(
      X,
      sfreq,
      frequencies,
      t0=0,
      tmin=None,
      tmax=None,
      ch_names=None,
      n_cycles=7,
      use_fft=True,
      decim=1,
      projs=None,
      n_jobs=None,
      *,
      verbose=None,
  ):
      """Estimate cross-spectral density from an array using Morlet wavelets.
  
      Parameters
      ----------
      X : array-like, shape (n_epochs, n_channels, n_times)
          The time series data consisting of n_epochs separate observations
          of signals with n_channels time-series of length n_times.
      sfreq : float
          Sampling frequency of observations.
      frequencies : list of float
          The frequencies of interest, in Hertz.
      t0 : float
          Time of the first sample relative to the onset of the epoch, in
          seconds. Defaults to 0.
      tmin : float | None
          Minimum time instant to consider, in seconds. If ``None`` start at
          first sample.
      tmax : float | None
          Maximum time instant to consider, in seconds. If ``None`` end at last
          sample.
      ch_names : list of str | None
          A name for each time series. If ``None`` (the default), the series will
          be named 'SERIES###'.
      n_cycles : float | list of float | None
          Number of cycles to use when constructing Morlet wavelets. Fixed number
          or one per frequency. Defaults to 7.
      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).
  
          If `int`, uses tfr[..., ::decim].
          If `slice`, uses tfr[..., decim].
  
      projs : list of Projection | None
          List of projectors to store in the CSD object. Defaults to ``None``,
          which means the projectors defined in the Epochs object will be copied.
      %(n_jobs)s
      %(verbose)s
  
      Returns
      -------
      csd : instance of CrossSpectralDensity
          The computed cross-spectral density.
  
      See Also
      --------
      csd_array_fourier
      csd_array_multitaper
      csd_fourier
      csd_morlet
      csd_multitaper
      """
      X, times, tmin, tmax, _, _ = _prepare_csd_array(
          X, sfreq, t0, tmin, tmax
      )
      n_times = len(times)
  
      # Construct the appropriate Morlet wavelets
      wavelets = morlet(sfreq, frequencies, n_cycles)
  
      # Slice X to the requested time window + half the length of the longest
      # wavelet.
      wave_length = len(wavelets[np.argmin(frequencies)]) // 2
      tstart = tstop = None
      if tmin is not None:
          tstart = np.searchsorted(times, tmin)
          tstart = max(0, tstart - wave_length)
      if tmax is not None:
          tstop = np.searchsorted(times, tmax)
          tstop = min(n_times, tstop + wave_length)
      X = X[:, :, tstart:tstop]
      times = times[tstart:tstop]
  
      # After CSD computation, we slice again to the requested time window.
      csd_tstart = (
          None if tmin is None else np.searchsorted(times, tmin - 1e-10)
      )
      csd_tstop = (
          None if tmax is None else np.searchsorted(times, tmax + 1e-10)
      )
      csd_tslice = slice(csd_tstart, csd_tstop)
      times = times[csd_tslice]
  
      # Compute the CSD
      nfft = _get_nfft(wavelets, X, use_fft)
      return _execute_csd_function(
          X,
          times,
          frequencies,
          _csd_morlet,
          params=[sfreq, wavelets, nfft, csd_tslice, use_fft, decim],
          n_fft=1,
          ch_names=ch_names,
          projs=projs,
          n_jobs=n_jobs,
          verbose=verbose,
      )
  
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 11 for calling a global function with example usage: csd_array_morlet(X, sfreq, frequencies, t0, tmin, tmax, ch_names, n_cycles, use_fft, decim, projs, n_jobs) and returns: _execute_csd_function