<commit_before>"""Source file manipulation."""

import os


def parse_line_count(line):
    """Parse the information with line counts."""
    line = line.strip()
    line_count, filename = line.split(" ")
    # remove prefix that is not relevant much
    if filename.startswith("./"):
        filename = filename[len("./"):]
    return int(line_count), filename


def get_source_files(repository):
    """Find all source files in the selected repository."""
    command = ("pushd repositories/{repo} > /dev/null; " +
               "wc -l `find . -path ./venv -prune -o \( -name '*.py' -o -name '*.java' \) " +
               "-print` | head -n -1 > ../../{repo}.count; " +
               "popd > /dev/null").format(repo=repository)
    os.system(command)
    filenames = []
    line_counts = {}
    total_lines = 0
    count = 0

    with open("{repo}.count".format(repo=repository)) as fin:
        for line in fin:
            count += 1
            line_count, filename = parse_line_count(line)
            filenames.append(filename)
            line_counts[filename] = line_count
            total_lines += line_count

    return {"count": count,<commit_msg>Fixed Pylint warnings: W605 invalid escape sequence<commit_after>"""Source file manipulation."""

import os


def parse_line_count(line):
    """Parse the information with line counts."""
    line = line.strip()
    line_count, filename = line.split(" ")
    # remove prefix that is not relevant much
    if filename.startswith("./"):
        filename = filename[len("./"):]
    return int(line_count), filename


def get_source_files(repository):
    """Find all source files in the selected repository."""
    command = ("pushd repositories/{repo} > /dev/null; " +
               r"wc -l `find . -path ./venv -prune -o \( -name '*.py' -o -name '*.java' \) " +
               "-print` | head -n -1 > ../../{repo}.count; " +
               "popd > /dev/null").format(repo=repository)
    os.system(command)
    filenames = []
    line_counts = {}
    total_lines = 0
    count = 0

    with open("{repo}.count".format(repo=repository)) as fin:
        for line in fin:
            count += 1
            line_count, filename = parse_line_count(line)
            filenames.append(filename)
            line_counts[filename] = line_count
            total_lines += line_count

    return {"count": count,
{'fraction_non_alphanumeric': 0.146723044397463, 'fraction_numerical': 0.004651162790697674, 'mean_word_length': 2.3183730715287516, 'pattern_counts': {'":': 2, '<': 3, '<?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': '3840547', 'n_tokens_mistral': 716, 'n_tokens_neox': 695, 'n_words': 191}