def _find_sources(sources, target, score_func):
    if isinstance(score_func, string_types):
        score_func = get_score_funcs().get(score_func, score_func)

    if not callable(score_func):
        raise ValueError('%s is not a valid score_func.' % score_func)

    scores = (score_func(sources, target) if target is not None
              else score_func(sources, 1))

    return scores
Adds a class implementation to this binding's globals() dict.
dataset/ETHPy150Open mne-tools/mne-python/mne/preprocessing/ica.py/_find_sources--crossover with--dataset/ETHPy150Open CybOXProject/python-cybox/cybox/bindings/cybox_core.py/add_external_class