<commit_before>from __future__ import absolute_import

# dynd._lowlevel is not imported by default
from . import nd, ndt

from ._pydynd import _dynd_version_string as __libdynd_version__, \
                _dynd_python_version_string as __version__, \
                _dynd_git_sha1 as __libdynd_git_sha1__, \
                _dynd_python_git_sha1 as __git_sha1__

def fix_version(v):
    if '.' in v:
        vlst = v.lstrip('v').split('.')
        vlst = vlst[:-1] + vlst[-1].split('-')

        if len(vlst) <= 3:
            vtup = tuple(int(x) for x in vlst)
        else:
            # The first 3 numbers are always integer
            vtup = tuple(int(x) for x in vlst[:3])
            # The 4th one may not be, so trap it
            try:
                vtup = vtup + (int(vlst[3]),)
                # Zero pad the post version #, so it sorts lexicographically
                vlst[3] = 'post%02d' % int(vlst[3])
            except ValueError:
                pass
        return '.'.join(vlst), vtup
    else:
        # When a "git checkout --depth=1 ..." has been done,
        # it will look like "96da079" or "96da079-dirty"
        return v, (0, 0, 0)

__version__, __version_info__ = fix_version(__version__)
__libdynd_version__, __libdynd_version_info__ = fix_version(__libdynd_version__)

del fix_version

def test(verbosity=1, xunitfile=None, exit=False):
    """
    Runs the full DyND test suite, outputing
    the results of the tests to  sys.stdout.

    Parameters
    ----------
    verbosity : int, optional
        Value 0 prints very little, 1 prints a little bit,
        and 2 prints the test names while testing.
    xunitfile : string, optional
        If provided, writes the test results to an xunit
        style xml file. This is useful for running the tests
        in a CI server such as Jenkins.
    exit : bool, optional
        If True, the function will call sys.exit with an
        error code after the tests are finished.
    """<commit_msg>Set # of digits in post version tag to 3, to make conda dev builds happy<commit_after>from __future__ import absolute_import

# dynd._lowlevel is not imported by default
from . import nd, ndt

from ._pydynd import _dynd_version_string as __libdynd_version__, \
                _dynd_python_version_string as __version__, \
                _dynd_git_sha1 as __libdynd_git_sha1__, \
                _dynd_python_git_sha1 as __git_sha1__

def fix_version(v):
    if '.' in v:
        vlst = v.lstrip('v').split('.')
        vlst = vlst[:-1] + vlst[-1].split('-')

        if len(vlst) <= 3:
            vtup = tuple(int(x) for x in vlst)
        else:
            # The first 3 numbers are always integer
            vtup = tuple(int(x) for x in vlst[:3])
            # The 4th one may not be, so trap it
            try:
                vtup = vtup + (int(vlst[3]),)
                # Zero pad the post version #, so it sorts lexicographically
                vlst[3] = 'post%03d' % int(vlst[3])
            except ValueError:
                pass
        return '.'.join(vlst), vtup
    else:
        # When a "git checkout --depth=1 ..." has been done,
        # it will look like "96da079" or "96da079-dirty"
        return v, (0, 0, 0)

__version__, __version_info__ = fix_version(__version__)
__libdynd_version__, __libdynd_version_info__ = fix_version(__libdynd_version__)

del fix_version

def test(verbosity=1, xunitfile=None, exit=False):
    """
    Runs the full DyND test suite, outputing
    the results of the tests to  sys.stdout.

    Parameters
    ----------
    verbosity : int, optional
        Value 0 prints very little, 1 prints a little bit,
        and 2 prints the test names while testing.
    xunitfile : string, optional
        If provided, writes the test results to an xunit
        style xml file. This is useful for running the tests
        in a CI server such as Jenkins.
    exit : bool, optional
        If True, the function will call sys.exit with an
        error code after the tests are finished.
    """
{'fraction_non_alphanumeric': 0.08682709005209625, 'fraction_numerical': 0.01662118580997271, 'mean_word_length': 2.130434782608696, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6463154', 'n_tokens_mistral': 1284, 'n_tokens_neox': 1221, 'n_words': 434}