<commit_before># -*- coding; utf-8 -*-
# Author: <NAME> <<EMAIL>>
# License: Affero GPLv3

import re
import logging


log = logging.getLogger(__name__)


def interest_callable(suffixes=None, prefixes=None, regexes=None):
    if suffixes is None:
        suffixes = [
            ".c",
            ".cc",
            ".cpp",
            ".css",
            ".go",
            ".h",
            ".hs",
            ".html",
            ".java",
            ".js",
            ".less",
            ".mak",
            ".php",
            ".pl",
            ".py",
            ".r",
            ".rb",
            ".sass",
            ".sh",
            ".zsh",
        ]

    fname_filters = []

    fname_filters.append(re.compile('.*(' + '|'.join(suffixes) + ')$'))

    if prefixes is not None:
        fname_filters.append(re.compile('^(' + '|'.join(prefixes) + ').*'))

    if regexes is not None:
        fname_filters.extend([re.compile(r) for r in regexes])

    def checkfile(fname):
        for f in fname_filters:
            if f.match(fname):
                return True
        log.info("Failed to match on file {}".format(fname))
        return False

    return checkfile<commit_msg>holy logging, please stop<commit_after># -*- coding; utf-8 -*-
# Author: <NAME> <<EMAIL>>
# License: Affero GPLv3

import re
import logging


log = logging.getLogger(__name__)


def interest_callable(suffixes=None, prefixes=None, regexes=None):
    if suffixes is None:
        suffixes = [
            ".c",
            ".cc",
            ".cpp",
            ".css",
            ".go",
            ".h",
            ".hs",
            ".html",
            ".java",
            ".js",
            ".less",
            ".mak",
            ".php",
            ".pl",
            ".py",
            ".r",
            ".rb",
            ".sass",
            ".sh",
            ".zsh",
        ]

    fname_filters = []

    fname_filters.append(re.compile('.*(' + '|'.join(suffixes) + ')$'))

    if prefixes is not None:
        fname_filters.append(re.compile('^(' + '|'.join(prefixes) + ').*'))

    if regexes is not None:
        fname_filters.extend([re.compile(r) for r in regexes])

    def checkfile(fname):
        for f in fname_filters:
            if f.match(fname):
                return True
        return False

    return checkfile
{'fraction_non_alphanumeric': 0.1627509611277232, 'fraction_numerical': 0.0017086715079026058, 'mean_word_length': 1.3656565656565656, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5981995', 'n_tokens_mistral': 734, 'n_tokens_neox': 707, 'n_words': 164}