<commit_before>'''
Regular expressions for matching special case types that don't directly map via 
standard operators.
'''

import re
from location import _not_prefixed_impl, _not_followed_impl

'''
This matches any integer based number that has a ##,###,### format with a possible '+-' 
prepended. Numbers without comma separators are not matched.
'''
_contains_comma_sep_numerical_impl = (
    # Can start with or without a '-+'
    r"(?:[-+]?"
    # Can have 1 to 3 numbers
    r"[0-9]{1,3}"
    # Then must have sets of 3 numbers separated by commas
    r"(?:,[0-9]{3})+"
    # That can optionally end with a '.' and number
    r"(?:\.[0-9]*)?)")

contains_comma_sep_numerical_regex = re.compile(_contains_comma_sep_numerical_impl)

'''
Like containsCommaSepNumerical but also doesn't allow for 
trailing or following characters other than whitespace
'''
_comma_sep_numerical_impl = (
    r"(?:"+_not_prefixed_impl+
    _contains_comma_sep_numerical_impl+
    _not_followed_impl+r")")

comma_sep_numerical_regex = re.compile(_comma_sep_numerical_impl)

'''
Matches for integer or float types that end in a percentage sign
'''
_percent_numerical_impl = (
    r"(?:\A[ ]*?)"
    r"([-+]?"
    r"[0-9]+"
    r"(?:\.[0-9]*)?)"
    r"(?:%+)"
    r"(?:[ ]*$)"
    )


percent_numerical_regex = re.compile(_percent_numerical_impl)

'''
Matches for integer or float types that end in a - or + sign
'''
_estimate_numerical_impl = (
    r"(?:\A[ ]*?)"
    r"([-+]?"
    r"[0-9]+"
    r"(?:\.[0-9]*)?)"
    r"(?:[-+]+)"
    r"(?:[ ]*$)"
    )
print _percent_numerical_impl
estimate_numerical_regex = re.compile(_estimate_numerical_impl)

<commit_msg>removed unnecessary print statement<commit_after>'''
Regular expressions for matching special case types that don't directly map via 
standard operators.
'''

import re
from location import _not_prefixed_impl, _not_followed_impl

'''
This matches any integer based number that has a ##,###,### format with a possible '+-' 
prepended. Numbers without comma separators are not matched.
'''
_contains_comma_sep_numerical_impl = (
    # Can start with or without a '-+'
    r"(?:[-+]?"
    # Can have 1 to 3 numbers
    r"[0-9]{1,3}"
    # Then must have sets of 3 numbers separated by commas
    r"(?:,[0-9]{3})+"
    # That can optionally end with a '.' and number
    r"(?:\.[0-9]*)?)")

contains_comma_sep_numerical_regex = re.compile(_contains_comma_sep_numerical_impl)

'''
Like containsCommaSepNumerical but also doesn't allow for 
trailing or following characters other than whitespace
'''
_comma_sep_numerical_impl = (
    r"(?:"+_not_prefixed_impl+
    _contains_comma_sep_numerical_impl+
    _not_followed_impl+r")")

comma_sep_numerical_regex = re.compile(_comma_sep_numerical_impl)

'''
Matches for integer or float types that end in a percentage sign
'''
_percent_numerical_impl = (
    r"(?:\A[ ]*?)"
    r"([-+]?"
    r"[0-9]+"
    r"(?:\.[0-9]*)?)"
    r"(?:%+)"
    r"(?:[ ]*$)"
    )

percent_numerical_regex = re.compile(_percent_numerical_impl)

'''
Matches for integer or float types that end in a - or + sign
'''
_estimate_numerical_impl = (
    r"(?:\A[ ]*?)"
    r"([-+]?"
    r"[0-9]+"
    r"(?:\.[0-9]*)?)"
    r"(?:[-+]+)"
    r"(?:[ ]*$)"
    )

estimate_numerical_regex = re.compile(_estimate_numerical_impl)


{'fraction_non_alphanumeric': 0.16341463414634147, 'fraction_numerical': 0.012195121951219513, 'mean_word_length': 4.047692307692308, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7368902', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1177, 'n_words': 289}