<commit_before>import sys
import os
import re

MYDIR=os.path.dirname(sys.argv[0])
if '' == MYDIR:
    MYDIR='.'

#################################
# Get info from configure.ac    #
# file                          #
#################################

configureAcFile = open (MYDIR + '/configure.ac', 'rb')
AC_INIT_LINE=configureAcFile.readline ()
while (not AC_INIT_LINE.startswith ('AC_INIT')) and ('' != AC_INIT_LINE):
    AC_INIT_LINE=configureAcFile.readline ()
if '' == AC_INIT_LINE:
    ARPrint ('Unable to read from configure.ac file !')
    sys.exit (1)

AC_ARGS=re.findall(r'\[[^]]*\]', AC_INIT_LINE)
LIB_NAME=AC_ARGS[0].replace ('[', '').replace (']', '')
LIB_MODULE=LIB_NAME.replace ('lib', '')
LIB_VERSION=AC_ARGS[1].replace ('[', '').replace (']', '')

#################################
# Generic infos about the lib   #
#################################

# Directories
SRC_DIR      = MYDIR + '/../Sources/'
INC_DIR      = MYDIR + '/../Includes/' + LIB_NAME + '/'
BUILD_DIR    = MYDIR + '/'
JNI_C_DIR    = MYDIR + '/../JNI/c/'
JNI_JAVA_DIR = MYDIR + '/../JNI/java/'

# Java/JNI package
JAVA_PACKAGE='com.parrot.arsdk.' + LIB_MODULE.lower ()

# Generated file disclaimer
GENERATED_FILE_DISCLAIMER='/*\n * GENERATED FILE\n *  Do not modify this file, it will be erased during the next configure run\n */\n'

#################################
# Internal functions            #
#################################

def ARPrint (msg, noNewLine=0):
    sys.stdout.write (msg)
    if 0 == noNewLine:
        sys.stdout.write ('\n')
    else:
        sys.stdout.write (' ')

def ARCapitalize (arstr):
    return arstr[0].upper () + arstr[1:]

def ARStringIsInteger (arstr):<commit_msg>Fixed a potential issue with the prebuild script<commit_after>import sys
import os
import re

MYDIR=os.path.dirname(sys.argv[0])
if '' == MYDIR:
    MYDIR='.'

#################################
# Get info from configure.ac    #
# file                          #
#################################

configureAcFile = open (MYDIR + '/configure.ac', 'rb')
AC_INIT_LINE=configureAcFile.readline ()
while (not AC_INIT_LINE.startswith ('AC_INIT')) and ('' != AC_INIT_LINE):
    AC_INIT_LINE=configureAcFile.readline ()
if '' == AC_INIT_LINE:
    ARPrint ('Unable to read from configure.ac file !')
    sys.exit (1)

AC_ARGS=re.findall(r'\[[^]]*\]', AC_INIT_LINE)
LIB_NAME=AC_ARGS[0].replace ('[', '').replace (']', '')
LIB_MODULE=LIB_NAME.replace ('lib', '')
LIB_VERSION=AC_ARGS[1].replace ('[', '').replace (']', '')

#################################
# Generic infos about the lib   #
#################################

# Directories
SRC_DIR      = MYDIR + '/../Sources/'
INC_DIR      = MYDIR + '/../Includes/' + LIB_NAME + '/'
BUILD_DIR    = MYDIR + '/'
JNI_C_DIR    = MYDIR + '/../JNI/c/'
JNI_JAVA_DIR = MYDIR + '/../JNI/java/'

# Create dir if neededif not os.path.exists (SRC_DIR):
if not os.path.exists (SRC_DIR):
    os.makedirs (SRC_DIR)
if not os.path.exists (INC_DIR):
    os.makedirs (INC_DIR)
if not os.path.exists (JNI_C_DIR):
    os.makedirs (JNI_C_DIR)
if not os.path.exists (JNI_JAVA_DIR):
    os.makedirs (JNI_JAVA_DIR)

# Java/JNI package
JAVA_PACKAGE='com.parrot.arsdk.' + LIB_MODULE.lower ()

# Generated file disclaimer
GENERATED_FILE_DISCLAIMER='/*\n * GENERATED FILE\n *  Do not modify this file, it will be erased during the next configure run\n */\n'

#################################
# Internal functions            #
#################################

def ARPrint (msg, noNewLine=0):
    sys.stdout.write (msg)
    if 0 == noNewLine:
        sys.stdout.write ('\n')
    else:
        sys.stdout.write (' ')

def ARCapitalize (arstr):
    return arstr[0].upper () + arstr[1:]

def ARStringIsInteger (arstr):
{'fraction_non_alphanumeric': 0.25679676985195155, 'fraction_numerical': 0.004306864064602961, 'mean_word_length': 3.7580025608194623, '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': '5191279', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1243, 'n_words': 271}