class_docstr: Implementation of the Xdawn Algorithm compatible with scikit-learn.
  
  Xdawn is a spatial filtering method designed to improve the signal
  to signal + noise ratio (SSNR) of the event related responses. Xdawn was
  originally designed for P300 evoked potential by enhancing the target
  response with respect to the non-target response. This implementation is a
  generalization to any type of event related response.
  
  .. note:: _XdawnTransformer does not correct for epochs overlap. To correct
            overlaps see ``Xdawn``.
  
  Parameters
  ----------
  n_components : int (default 2)
      The number of components to decompose the signals.
  reg : float | str | None (default None)
      If not None (same as ``'empirical'``, default), allow
      regularization for covariance estimation.
      If float, shrinkage is used (0 <= shrinkage <= 1).
      For str options, ``reg`` will be passed to ``method`` to
      :func:`mne.compute_covariance`.
  signal_cov : None | Covariance | array, shape (n_channels, n_channels)
      The signal covariance used for whitening of the data.
      if None, the covariance is estimated from the epochs signal.
  method_params : dict | None
      Parameters to pass to :func:`mne.compute_covariance`.
  
      .. versionadded:: 0.16
  
  Attributes
  ----------
  classes_ : array, shape (n_classes)
      The event indices of the classes.
  filters_ : array, shape (n_channels, n_channels)
      The Xdawn components used to decompose the data for each event type.
  patterns_ : array, shape (n_channels, n_channels)
      The Xdawn patterns used to restore the signals for each event type.
docstr: Check X and y types and dimensions.
docstr_tok: ["Check","X","and","y","types","and","dimensions","."]
code: def _check_Xy(self, X, y=None):
      """Check X and y types and dimensions."""
      # Check data
      if not isinstance(X, np.ndarray) or X.ndim != 3:
          raise ValueError(
              "X must be an array of shape (n_epochs, "
              "n_channels, n_samples)."
          )
      if y is None:
          y = np.ones(len(X))
      y = np.asarray(y)
      if len(X) != len(y):
          raise ValueError("X and y must have the same length")
      return X, y
  
imports: import numpy
  from scipy import linalg
  from .._fiff.pick import _pick_data_channels, pick_info
  from ..cov import Covariance, _regularized_covariance
  from ..decoding import BaseEstimator, TransformerMixin
  from ..epochs import BaseEpochs
  from ..evoked import Evoked, EvokedArray
  from ..io import BaseRaw
  from ..utils import _check_option, logger
label_desc: Use image node_id 5 for calling the _XdawnTransformer obj's underlying member method code with example usage: obj._check_Xy(X, y) and returns: X,  y