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

from warnings import warn
from copy import deepcopy
import numpy as np
from scipy import linalg
from StringIO import StringIO

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

from .open import fiff_open
from .tree import dir_tree_find, copy_tree
from .constants import FIFF
from .tag import read_tag
from .proj import read_proj, write_proj
from .ctf import read_ctf_comp, write_ctf_comp
from .channels import read_bad_channels

from .write import start_block, end_block, write_string, write_dig_point, \
                   write_float, write_int, write_coord_trans, write_ch_info, \
                   write_name_list, start_file
from .. import verbose


class Info(dict):
    """ Info class to nicely represent info dicts
    """
    def __init__(self, *args, **kwargs):
        dict.__init__(self, *args, **kwargs)

    def __repr__(self):
        """Summarize info instead of printing all"""
        strs = ['<Info | %s non-empty fields']
        non_empty = 0
        for k, v in self.items():
            this_len = (len(v) if hasattr(v, '__len__') else
                       ('%s' % v if v is not None else None))
            entries = ((' | %d items' % this_len) if isinstance(this_len, int)
                       else (' | %s' % this_len if this_len else ''))
            if entries:
                non_empty += 1
            strs.append('%s : %s%s' % (k, str(type(v))[7:-2], entries))
        strs_non_empty = sorted(s for s in strs if '|' in s)
        strs_empty = sorted(s for s in strs if '|' not in s)
        st = '\n    '.join(strs_non_empty + strs_empty)
        st += '\n>'<commit_msg>COSMITS<commit_after># Authors: <NAME> <<EMAIL>>
#          <NAME> <<EMAIL>>
#
# License: BSD (3-clause)

from warnings import warn
from copy import deepcopy
import numpy as np
from scipy import linalg
from StringIO import StringIO

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

from .open import fiff_open
from .tree import dir_tree_find, copy_tree
from .constants import FIFF
from .tag import read_tag
from .proj import read_proj, write_proj
from .ctf import read_ctf_comp, write_ctf_comp
from .channels import read_bad_channels

from .write import start_block, end_block, write_string, write_dig_point, \
                   write_float, write_int, write_coord_trans, write_ch_info, \
                   write_name_list, start_file
from .. import verbose


class Info(dict):
    """ Info class to nicely represent info dicts
    """

    def __repr__(self):
        """Summarize info instead of printing all"""
        strs = ['<Info | %s non-empty fields']
        non_empty = 0
        for k, v in self.items():
            this_len = (len(v) if hasattr(v, '__len__') else
                       ('%s' % v if v is not None else None))
            entries = ((' | %d items' % this_len) if isinstance(this_len, int)
                       else (' | %s' % this_len if this_len else ''))
            if entries:
                non_empty += 1
            strs.append('%s : %s%s' % (k, str(type(v))[7:-2], entries))
        strs_non_empty = sorted(s for s in strs if '|' in s)
        strs_empty = sorted(s for s in strs if '|' not in s)
        st = '\n    '.join(strs_non_empty + strs_empty)
        st += '\n>'
{'fraction_non_alphanumeric': 0.11070998796630566, 'fraction_numerical': 0.0030084235860409147, 'mean_word_length': 2.488982161594963, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '5861835', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1057, 'n_words': 348}