<commit_before>import codecs
import os
import re
import setuptools


def findVersion(*filePaths):
    # Credits: https://packaging.python.org/single_source_version.
    here = os.path.abspath(os.path.dirname(__file__))
    with codecs.open(os.path.join(here, *filePaths), 'r', 'utf8') as f:
        versionFile = f.read()

    versionMatch = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]',
                             versionFile, re.M)
    if versionMatch:
        return versionMatch.group(1)

    raise RuntimeError("Unable to find the version string.")


setuptools.setup(
    name='revl',
    version=findVersion('revl.py'),
    description="Helps to benchmark code for Autodesk Maya",
    keywords='Autodesk Maya API benchmark test',
    license='MIT',
    url='https://github.com/christophercrouzet/revl',
    author="<NAME>",<commit_msg>Extract a `read` function from `findVersion`<commit_after>import io
import os
import re
import setuptools


def read(*names, **kwargs):
    # Credits: https://packaging.python.org/single_source_version.
    here = os.path.dirname(__file__)
    encoding = kwargs.get('encoding', 'utf8')
    with io.open(os.path.join(here, *names), encoding=encoding) as fp:
        return fp.read()


def findVersion(*filePaths):
    # Credits: https://packaging.python.org/single_source_version.
    versionFile = read(*filePaths)
    versionMatch = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
                             versionFile, re.M)
    if versionMatch:
        return versionMatch.group(1)

    raise RuntimeError("Unable to find the version string.")


setuptools.setup(
    name='revl',
    version=findVersion('revl.py'),
    description="Helps to benchmark code for Autodesk Maya",
    keywords='Autodesk Maya API benchmark test',
    license='MIT',
    url='https://github.com/christophercrouzet/revl',
    author="<NAME>uzet",
{'fraction_non_alphanumeric': 0.14589989350372737, 'fraction_numerical': 0.002129925452609159, 'mean_word_length': 3.484486873508353, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 5, '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': '3532494', 'n_tokens_mistral': 603, 'n_tokens_neox': 582, 'n_words': 125}