'Init of CSP.'

def __init__(self, n_components=4, reg=None, log=None, cov_est='concat', transform_into='average_power', norm_trace=None):

    if (not isinstance(n_components, int)):
        raise ValueError('n_components    must    be    an    integer.')
    self.n_components = n_components
    if ((reg is not None) and (reg not in ['oas', 'ledoit_wolf']) and ((not isinstance(reg, (float, int))) or (not ((reg <= 1.0) and (reg >= 0.0))))):
        raise ValueError('reg    must    be    None,    "oas",    "ledoit_wolf"    or    a    float    in    between    0.    and    1.')
    self.reg = reg
    if (not ((cov_est == 'concat') or (cov_est == 'epoch'))):
        raise ValueError('unknown    covariance    estimation    method')
    self.cov_est = cov_est
    if (transform_into not in ('average_power', 'csp_space')):
        raise ValueError('transform_into    must    be    "average_power"    or    "csp_space".')
    self.transform_into = transform_into
    if (transform_into == 'average_power'):
        if ((log is not None) and (not isinstance(log, bool))):
            raise ValueError('log    must    be    a    boolean    if    transform_into    ==    "average_power".')
    elif (log is not None):
        raise ValueError('log    must    be    a    None    if    transform_into    ==    "csp_space".')
    self.log = log
    if (norm_trace is None):
        norm_trace = True
        warn('norm_trace    defaults    to    True    in    0.15,    but    will    change    to    False    in    0.16.    Set    it    explicitly    to    avoid    this    warning.', DeprecationWarning)
    if (not isinstance(norm_trace, bool)):
        raise ValueError('norm_trace    must    be    a    bool.')
    self.norm_trace = norm_trace
