'Assign score to components based on statistic or metric.
Parameters
inst : instance of Raw, Epochs or Evoked
The object to reconstruct the sources from.
target : array-like | ch_name | None
Signal to which the sources shall be compared. It has to be of
the same shape as the sources. If some string is supplied, a
routine will try to find a matching channel. If None, a score
function expecting only one input-array argument must be used,
for instance, scipy.stats.skew (default).
score_func : callable | str label
Callable taking as arguments either two input arrays
(e.g. Pearson correlation) or one input
array (e. g. skewness) and returns a float. For convenience the
most common score_funcs are available via string labels:
Currently, all distance metrics from scipy.spatial and All
functions from scipy.stats taking compatible input arguments are
supported. These function have been modified to support iteration
over the rows of a 2D array.
start : int | float | None
First sample to include. If float, data will be interpreted as
time in seconds. If None, data will be used from the first sample.
stop : int | float | None
Last sample to not include. If float, data will be interpreted as
time in seconds. If None, data will be used to the last sample.
l_freq : float
Low pass frequency.
h_freq : float
High pass frequency.
reject_by_annotation : bool
If True, data annotated as bad will be omitted. Defaults to True.
.. versionadded:: 0.14.0
verbose : bool, str, int, or None
If not None, override default verbose level (see
:func:`mne.verbose` and :ref:`Logging documentation <tut_logging>`
for more). Defaults to self.verbose.
Returns
scores : ndarray
scores for each source as returned from score_func'

@verbose
def score_sources(self, inst, target=None, score_func='pearsonr', start=None, stop=None, l_freq=None, h_freq=None, reject_by_annotation=True, verbose=None):

    if isinstance(inst, BaseRaw):
        sources = self._transform_raw(inst, start, stop, reject_by_annotation)
    elif isinstance(inst, BaseEpochs):
        sources = self._transform_epochs(inst, concatenate=True)
    elif isinstance(inst, Evoked):
        sources = self._transform_evoked(inst)
    else:
        raise ValueError('Input    must    be    of    Raw,    Epochs    or    Evoked    type')
    if (target is not None):
        target = self._check_target(target, inst, start, stop, reject_by_annotation)
        if (sources.shape[(-1)] != target.shape[(-1)]):
            raise ValueError('Sources    and    target    do    not    have    the    samenumber    of    time    slices.')
        if (verbose is None):
            verbose = self.verbose
        if isinstance(inst, BaseRaw):
            (sources, target) = _band_pass_filter(self, sources, target, l_freq, h_freq, verbose)
    scores = _find_sources(sources, target, score_func)
    return scores
