<commit_before># Authors: <NAME> <<EMAIL>>
#          <NAME> <<EMAIL>>
#          <NAME> <<EMAIL>>
#
# License: BSD (3-clause)

from copy import deepcopy
import inspect
import warnings
from inspect import getargspec, isfunction

import os
import logging
logger = logging.getLogger('mne')

import numpy as np
from scipy import stats
from scipy.spatial import distance
from scipy import linalg

from .ecg import qrs_detector
from .eog import _find_eog_events

from ..cov import compute_whitener
from .. import Covariance
from mne.fiff import pick_types, pick_channels
from mne.fiff.write import write_float_matrix, write_string, write_int, \
                         write_name_list, start_block, end_block
from mne.fiff.tree import dir_tree_find
from mne.fiff.open import fiff_open
from mne.fiff.tag import read_tag
from mne.fiff.constants import Bunch, FIFF
from ..viz import plot_ica_panel
from .. import verbose
from mne.fiff.write import start_file, end_file


def _make_xy_sfunc(func, ndim_output=False):
    """Helper Function"""
    if ndim_output:
        sfunc = lambda x, y: np.array([func(a, y.ravel()) for a in x])[:, 0]
    else:
        sfunc = lambda x, y: np.array([func(a, y.ravel()) for a in x])
    sfunc.__name__ = '.'.join(['score_func', func.__module__, func.__name__])
    sfunc.__doc__ = func.__doc__
    return sfunc

# makes score funcs attr accessible for users
score_funcs = Bunch()

xy_arg_dist_funcs = [(n, f) for n, f in vars(distance).items() if isfunction(f)
                     and not n.startswith('_')]

xy_arg_stats_funcs = [(n, f) for n, f in vars(stats).items() if isfunction(f)<commit_msg>CLEANUP -- removing absolute imports for debuggging.<commit_after># Authors: <NAME> <<EMAIL>>
#          <NAME> <<EMAIL>>
#          <NAME> <<EMAIL>>
#
# License: BSD (3-clause)

from copy import deepcopy
import inspect
import warnings
from inspect import getargspec, isfunction

import os
import logging
logger = logging.getLogger('mne')

import numpy as np
from scipy import stats
from scipy.spatial import distance
from scipy import linalg

from .ecg import qrs_detector
from .eog import _find_eog_events

from ..cov import compute_whitener
from .. import Covariance
from ..fiff import pick_types, pick_channels
from ..fiff.write import write_float_matrix, write_string, write_int, \
                         write_name_list, start_block, end_block
from ..fiff.tree import dir_tree_find
from ..fiff.open import fiff_open
from ..fiff.tag import read_tag
from ..fiff.constants import Bunch, FIFF
from ..viz import plot_ica_panel
from .. import verbose
from ..fiff.write import start_file, end_file


def _make_xy_sfunc(func, ndim_output=False):
    """Helper Function"""
    if ndim_output:
        sfunc = lambda x, y: np.array([func(a, y.ravel()) for a in x])[:, 0]
    else:
        sfunc = lambda x, y: np.array([func(a, y.ravel()) for a in x])
    sfunc.__name__ = '.'.join(['score_func', func.__module__, func.__name__])
    sfunc.__doc__ = func.__doc__
    return sfunc

# makes score funcs attr accessible for users
score_funcs = Bunch()

xy_arg_dist_funcs = [(n, f) for n, f in vars(distance).items() if isfunction(f)
                     and not n.startswith('_')]

xy_arg_stats_funcs = [(n, f) for n, f in vars(stats).items() if isfunction(f)
{'fraction_non_alphanumeric': 0.10721900700578739, 'fraction_numerical': 0.0012183978068839476, 'mean_word_length': 3.671408250355619, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1844644', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1095, 'n_words': 350}