<commit_before># encoding: utf-8

"""
.. codeauthor:: <NAME> <<EMAIL>>
"""

from __future__ import absolute_import, unicode_literals

import re

from ._base import VarNameSanitizer


class ElasticsearchIndexNameSanitizer(VarNameSanitizer):

    __RE_INVALID_INDEX_NAME = re.compile("[" + re.escape('\\/*?"<>|,"') + "\s]+")
    __RE_INVALID_INDEX_NAME_HEAD = re.compile("^[_]+")

    @property
    def reserved_keywords(self):
        return []

    @property
    def _invalid_var_name_head_re(self):
        return self.__RE_INVALID_INDEX_NAME_HEAD

    @property
    def _invalid_var_name_re(self):
        return self.__RE_INVALID_INDEX_NAME
<commit_msg>Change to avoid "DeprecationWarning: invalid escape sequence"<commit_after># encoding: utf-8

"""
.. codeauthor:: <NAME> <<EMAIL>>
"""

from __future__ import absolute_import, unicode_literals

import re

from ._base import VarNameSanitizer


class ElasticsearchIndexNameSanitizer(VarNameSanitizer):

    __RE_INVALID_INDEX_NAME = re.compile("[" + re.escape('\\/*?"<>|,"') + r"\s]+")
    __RE_INVALID_INDEX_NAME_HEAD = re.compile("^[_]+")

    @property
    def reserved_keywords(self):
        return []

    @property
    def _invalid_var_name_head_re(self):
        return self.__RE_INVALID_INDEX_NAME_HEAD

    @property
    def _invalid_var_name_re(self):
        return self.__RE_INVALID_INDEX_NAME

{'fraction_non_alphanumeric': 0.12417340191036003, 'fraction_numerical': 0.0014695077149155032, 'mean_word_length': 4.258687258687258, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4725748', 'n_tokens_mistral': 458, 'n_tokens_neox': 445, 'n_words': 84}