<commit_before>#!/usr/bin/env python

import subprocess
import sys
from optparse import OptionParser

# Generate versions for RPM/dpkg without dashes from git describe
# make release 0 if tag matches exactly
# PKG_VERLIST = $(filter-out dirty,$(subst -, ,$(VERSION))) 0
# PKG_VERSION = $(word 1,$(PKG_VERLIST))
# PKG_RELEASE = $(word 2,$(PKG_VERLIST))

usage = "usage: %prog [field] [--sep=.]"
parser = OptionParser(usage=usage)
parser.add_option("-s", "--seperator", dest="seperator", default="-",
                          help="version seperator", metavar="SEP")
(options, args) = parser.parse_args()

# git describe return "0.1-143-ga554734"
# git_describe() returns {'release': '143', 'tag': '0.1', 'hash': 'ga554734'}
def git_describe():
    describe = "git describe --tags --always"

    try:
        p = subprocess.Popen(describe.split(),
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
                shell=True)
    except OSError as e:
        print "ERROR: running: %s" % describe
        print e
        sys.exit(1)

    version, errors = p.communicate()
    if (len(errors)):
        print(errors)
        sys.exit(1)

    version = version.strip().split('-')

    return version

# If there is no release then it is zero
def zero_release(version):
    if len(version) == 1:
        version.append("0")<commit_msg>remove split<commit_after>#!/usr/bin/env python

import subprocess
import sys
from optparse import OptionParser

# Generate versions for RPM/dpkg without dashes from git describe
# make release 0 if tag matches exactly
# PKG_VERLIST = $(filter-out dirty,$(subst -, ,$(VERSION))) 0
# PKG_VERSION = $(word 1,$(PKG_VERLIST))
# PKG_RELEASE = $(word 2,$(PKG_VERLIST))

usage = "usage: %prog [field] [--sep=.]"
parser = OptionParser(usage=usage)
parser.add_option("-s", "--seperator", dest="seperator", default="-",
                          help="version seperator", metavar="SEP")
(options, args) = parser.parse_args()

# git describe return "0.1-143-ga554734"
# git_describe() returns {'release': '143', 'tag': '0.1', 'hash': 'ga554734'}
def git_describe():
    describe = "git describe --tags --always"

    try:
        p = subprocess.Popen(describe,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
                shell=True)
    except OSError as e:
        print "ERROR: running: %s" % describe
        print e
        sys.exit(1)

    version, errors = p.communicate()
    if (len(errors)):
        print(errors)
        sys.exit(1)

    version = version.strip().split('-')

    return version

# If there is no release then it is zero
def zero_release(version):
    if len(version) == 1:
        version.append("0")
{'fraction_non_alphanumeric': 0.14706966457795798, 'fraction_numerical': 0.022115739034279394, 'mean_word_length': 2.962043795620438, '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': '3900396', 'n_tokens_mistral': 920, 'n_tokens_neox': 855, 'n_words': 234}