<commit_before># -*- coding: utf-8 -*-
#
# pyautoupdate documentation build configuration file, created by
# sphinx-quickstart on Wed May 18 10:03:49 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import re
import datetime

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))

sys.path.insert(0, os.path.abspath('../..'))

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.intersphinx',
    'sphinx.ext.todo',
    'sphinx.ext.viewcode',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = ['.rst', '.md', '.txt']

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'pyautoupdate'
author = '<NAME>'
copyright = '{0} by {1}'.format(datetime.datetime.now().year, author)


# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.

#Below version code pulled from requests module
with open(os.path.abspath('../../__init__.py'), 'r') as fd:
    version_number = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
                        fd.read(), re.MULTILINE).group(1)
if not version_number:
    raise RuntimeError('Cannot find version information')

# Get git hash without relying on the command line or on tools like gitpython
if os.path.isdir("../../.git"):
    assert os.path.isfile("../../.git/HEAD")
    with open("../../.git/HEAD",'r') as fd:
        commit_hash=fd.read()
        try: # is alreay hexadecimal
            int(commit_hash,16)
            # 40 41 42 depending on \n or \r\n
            if len(commit_hash) not in [40,41,42]:
                raise ValueError
        except ValueError: # is ref: refs/heads/*
            commit_hash=commit_hash.split()
            assert len(commit_hash)==2
            commit_hash=commit_hash[1]
            # Dereference branch pointer
            assert os.path.isfile(os.path.join("../../.git",commit_hash))
            with open(os.path.join("../../.git",commit_hash),'r') as fd2:
                commit_hash=fd2.read()
                try:
                    int(commit_hash,16)
                    # 40 41 42 depending on \n or \r\n
                    if len(commit_hash) not in [40,41,42]:
                        raise ValueError
                except ValueError:
                    # Raise more appropriate error
                    raise RuntimeError("Unable to get current commit hash")
else: # Not in git repo
    commit_hash=""
if commit_hash:
    commit_hash_short=commit_hash[:7]
else:
    commit_hash_short=""

rst_epilog='.. |commit_hash_short| replace:: {}'.format(commit_hash_short)

# The short X.Y version.
version = version_number
# The full version, including alpha/beta/rc tags.
release = version_number+"+"+commit_hash_short
<commit_msg>Replace RuntimeError with warning and continue as if no git<commit_after># -*- coding: utf-8 -*-
#
# pyautoupdate documentation build configuration file, created by
# sphinx-quickstart on Wed May 18 10:03:49 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import re
import datetime
import warnings

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))

sys.path.insert(0, os.path.abspath('../..'))

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.intersphinx',
    'sphinx.ext.todo',
    'sphinx.ext.viewcode',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = ['.rst', '.md', '.txt']

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'pyautoupdate'
author = '<NAME>'
copyright = '{0} by {1}'.format(datetime.datetime.now().year, author)


# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.

#Below version code pulled from requests module
with open(os.path.abspath('../../__init__.py'), 'r') as fd:
    version_number = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
                        fd.read(), re.MULTILINE).group(1)
if not version_number:
    raise RuntimeError('Cannot find version information')

# Get git hash without relying on the command line or on tools like gitpython
if os.path.isdir("../../.git"):
    assert os.path.isfile("../../.git/HEAD")
    with open("../../.git/HEAD",'r') as fd:
        commit_hash=fd.read()
        try: # is alreay hexadecimal
            int(commit_hash,16)
            # 40 41 42 depending on \n or \r\n
            if len(commit_hash) not in [40,41,42]:
                raise ValueError
        except ValueError: # is ref: refs/heads/*
            commit_hash=commit_hash.split()
            assert len(commit_hash)==2
            commit_hash=commit_hash[1]
            # Dereference branch pointer
            assert os.path.isfile(os.path.join("../../.git",commit_hash))
            with open(os.path.join("../../.git",commit_hash),'r') as fd2:
                commit_hash=fd2.read()
                try:
                    int(commit_hash,16)
                    # 40 41 42 depending on \n or \r\n
                    if len(commit_hash) not in [40,41,42]:
                        raise ValueError
                except ValueError:
                    # Raise more appropriate error
                    warnings.warn("Unable to get current commit hash",
                                  RuntimeWarning)
                    commit_hash=""
else: # Not in git repo
    commit_hash=""
if commit_hash:
    commit_hash_short=commit_hash[:7]
else:
    commit_hash_short=""

rst_epilog='.. |commit_hash_short| replace:: {}'.format(commit_hash_short)

# The short X.Y version.
version = version_number
# The full version, including alpha/beta/rc tags.
release = version_number+"+"+commit_hash_short

{'fraction_non_alphanumeric': 0.13121196754563894, 'fraction_numerical': 0.013691683569979716, 'mean_word_length': 2.6761416589002796, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2086600', 'n_tokens_mistral': 2392, 'n_tokens_neox': 2278, 'n_words': 774}