<commit_before>#!/bin/bash

# determine OS and other useful information
if [[ $OSTYPE = darwin* ]]; then
    OS="OSX"
    CPUS=`sysctl -n hw.ncpu`
    FREEMEM="$(( $(vm_stat | awk '/free/ {gsub(/\./, "", $3); print $3}') * 4096 / 1048576))"
else
    OS="LINUX"
    CPUS=`grep vendor_id /proc/cpuinfo | wc -l`
    FREEMEM=`grep -i memfree /proc/meminfo | sed -e 's/MemFree:[ ]*//' | sed -e 's/ kB//'`
    n=$((FREEMEM / 1024))
    FREEMEM=$n
fi
FREEMEM=$((FREEMEM/2))

# figure out where decaf dependencies are
# assume /usr/local/decaf
#
# but maybe user is working within the git working set
# so see if the dependencies are in the current directory
DECAF='/usr/local/decaf'
if [ -d "java" ]; then
    DECAF=$PWD
    MODULES=$PWD
fi
if [ -d "bower_components/decaf" ]; then
    DECAF="$PWD/bower_components/decaf"
    MODULES=`ls -1 $PWD/bower_components/*/java/*.jar | tr "\\n" ":"`
fi
if [ -d "modules" ]; then
    LOCAL_MODULES=`find modules -name "*.jar"` | tr "\\n" ":"
    if [ "${#LOCAL_MODULES}" -gt 0 ]; then
        MODULES="$LOCAL_MODULES:$MODULES"
    fi
fi
if [ -d "/usr/local/decaf/modules" ]; then
    LOCAL_MODULES=`find /usr/local/decaf/modules -name "*.jar"` | tr "\\n" ":"
    if [ "${#LOCAL_MODULES}" -gt 0 ]; then
        MODULES="$LOCAL_MODULES:$MODULES"
    fi
fi

# On Linux, MySQL JDBC driver needs to be manually loaded
if [[ $OSTYPE == "linux-gnu" ]]; then
    MODULES="/usr/share/java/mysql-connector-java.jar:$MODULES"
fi

# set up class path for java/rhino
CP="."

#if [ ! -z "$MODULES" ]; then
#echo 1
#    CP="$CP:$MODULES/*/java/*.jar"
#fi
#
#if [ -d "modules" ]; then
#echo 2
#    CP="$CP:modules/*/java/*.jar"
#fi

if [ -d "java" ]; then
    DECAF_JAVA=`ls -1 java/*.jar | tr "\\n" ":"` # | sed 's!\:$!!'
    DECAF_JAVA=${DECAF_JAVA%:}
    CP="$CP:$DECAF_JAVA"
    if [ "$RHINO" = "true" ]; then
        DECAF_JAVA=`ls -1 java/rhino/*.jar | tr "\\n" ":"`
        CP="$CP:$DECAF_JAVA"
    else
        DECAF_JAVA=`ls -1 java/nashorn/*.jar | tr "\\n" ":"`
        CP="$CP:$DECAF_JAVA"<commit_msg>fix classpath for modules<commit_after>#!/bin/bash

# determine OS and other useful information
if [[ $OSTYPE = darwin* ]]; then
    OS="OSX"
    CPUS=`sysctl -n hw.ncpu`
    FREEMEM="$(( $(vm_stat | awk '/free/ {gsub(/\./, "", $3); print $3}') * 4096 / 1048576))"
else
    OS="LINUX"
    CPUS=`grep vendor_id /proc/cpuinfo | wc -l`
    FREEMEM=`grep -i memfree /proc/meminfo | sed -e 's/MemFree:[ ]*//' | sed -e 's/ kB//'`
    n=$((FREEMEM / 1024))
    FREEMEM=$n
fi
FREEMEM=$((FREEMEM/2))

# figure out where decaf dependencies are
# assume /usr/local/decaf
#
# but maybe user is working within the git working set
# so see if the dependencies are in the current directory
DECAF='/usr/local/decaf'
if [ -d "java" ]; then
    DECAF=$PWD
    MODULES=$PWD
fi
if [ -d "bower_components/decaf" ]; then
    DECAF="$PWD/bower_components/decaf"
    MODULES=`ls -1 $PWD/bower_components/*/java/*.jar | tr "\\n" ":"`
fi
if [ -d "modules" ]; then
    LOCAL_MODULES=`find modules -name "*.jar"` | tr "\\n" ":"
    if [ "${#LOCAL_MODULES}" -gt 0 ]; then
        MODULES="$LOCAL_MODULES:$MODULES"
    fi
fi
if [ -d "/usr/local/decaf/modules" ]; then
    LOCAL_MODULES=`find /usr/local/decaf/modules -name "*.jar"` | tr "\\n" ":"
    if [ "${#LOCAL_MODULES}" -gt 0 ]; then
        MODULES="$LOCAL_MODULES:$MODULES"
    fi
fi

# On Linux, MySQL JDBC driver needs to be manually loaded
if [[ $OSTYPE == "linux-gnu" ]]; then
    MODULES="/usr/share/java/mysql-connector-java.jar:$MODULES"
fi

# set up class path for java/rhino
CP="."

if [ ! -z "$MODULES" ]; then
    CP="$CP:$MODULES/*/java/*.jar"
fi
#
#if [ -d "modules" ]; then
#    CP="$CP:modules/*/java/*.jar"
#fi

if [ -d "java" ]; then
    DECAF_JAVA=`ls -1 java/*.jar | tr "\\n" ":"` # | sed 's!\:$!!'
    DECAF_JAVA=${DECAF_JAVA%:}
    CP="$CP:$DECAF_JAVA"
    if [ "$RHINO" = "true" ]; then
        DECAF_JAVA=`ls -1 java/rhino/*.jar | tr "\\n" ":"`
        CP="$CP:$DECAF_JAVA"
    else
        DECAF_JAVA=`ls -1 java/nashorn/*.jar | tr "\\n" ":"`
        CP="$CP:$DECAF_JAVA"
{'fraction_non_alphanumeric': 0.20651369356032567, 'fraction_numerical': 0.01233654083395016, 'mean_word_length': 2.8831417624521074, 'pattern_counts': {'":': 12, '<': 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': '1413764', 'n_tokens_mistral': 1720, 'n_tokens_neox': 1667, 'n_words': 398}