code: def _prepare_csd(
      epochs, tmin=None, tmax=None, picks=None, projs=None
  ):
      """Do some checking and preprocessing of common csd_* parameters.
  
      See the csd_* functions for documentation of the parameters.
      """
      tstep = epochs.times[1] - epochs.times[0]
      if tmin is not None and tmin < epochs.times[0] - tstep:
          raise ValueError(
              "tmin should be larger than the smallest data time "
              "point"
          )
      if tmax is not None and tmax > epochs.times[-1] + tstep:
          raise ValueError(
              "tmax should be smaller than the largest data time "
              "point"
          )
      if tmax is not None and tmin is not None:
          if tmax < tmin:
              raise ValueError("tmax must be larger than tmin")
      if epochs.baseline is None and epochs.info["highpass"] < 0.1:
          warn(
              "Epochs are not baseline corrected or enough highpass filtered. "
              "Cross-spectral density may be inaccurate."
          )
  
      picks = _picks_to_idx(
          epochs.info, picks, "data", with_ref_meg=False
      )
      epochs = epochs.copy().pick(picks)
  
      if projs is None:
          projs = epochs.info["projs"]
  
      return epochs, projs
  
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 12 for calling a global function with example usage: _prepare_csd(epochs, tmin, tmax, picks, projs) and returns: epochs,  projs