<commit_before>"""
This module contains general functions for folder stepping.
"""

import os.path

from .exceptions import Error


def util_get_file_paths(folder, extension=None):
    '''
    Gets the paths of the files with the requested extension as a list.

    Parameters
    ----------
    folder : str
        Folder where the function will look in, recursively.
    extension : str
        The extension of the files to look for.

    Returns
    -------
    list
        Paths of each file.

    '''
    if extension is None:
        raise Error("Must provide a file extension to look for")

    paths = []

    for root, _, files in os.walk(folder):
        for file in files:
            fullpath = os.path.join(root, file)
            ext = os.path.splitext(fullpath)[-1].lower()
            if ext == extension:
                paths.append(fullpath)

    return paths<commit_msg>made sure lowercase is not important<commit_after>"""
This module contains general functions for folder stepping.
"""

import os.path

from .exceptions import Error


def util_get_file_paths(folder, extension=None):
    '''
    Gets the paths of the files with the requested extension as a list.

    Parameters
    ----------
    folder : str
        Folder where the function will look in, recursively.
    extension : str
        The extension of the files to look for.

    Returns
    -------
    list
        Paths of each file.

    '''
    if extension is None:
        raise Error("Must provide a file extension to look for")

    paths = []

    for root, _, files in os.walk(folder):
        for file in files:
            fullpath = os.path.join(root, file)
            ext = os.path.splitext(fullpath)[-1].lower()
            if ext == extension.lower():
                paths.append(fullpath)

    return paths
{'fraction_non_alphanumeric': 0.09521188772702256, 'fraction_numerical': 0.001100715465052284, 'mean_word_length': 2.0554621848739494, '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': '7236444', 'n_tokens_mistral': 493, 'n_tokens_neox': 474, 'n_words': 188}