<commit_before>#!/bin/bash

##HELP
# For more information on a specific command, type -help command-name.
#
#   jmx              [-jmx]
#   jmxport          [-jmxport <num>] - DEFAULT is 1088
#   debug            [-debug]
#   debugsuspend     [-debugsuspend]
#   debugport        [-debugport <num>] - DEFAULT is 8000
#   start            [-start [<console port>]] - DEFAULT port is 2400
#   stop             [-stop]
#   status           [-status]
#   console          [-console]
#   agentpath        [-agentpath:<path to lib>]
##

platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
   platform='linux'
elif [[ "$unamestr" == 'Darwin' ]]; then
   platform='osx'
fi

if [[ $platform == 'linux' ]]; then
   fullpath=`readlink -f $0`

   if [[ -z ${JAVA_HOME} ]]; then
      # Find the actual location of the Java launcher:
      java_launcher=`command -v java`
      java_launcher=`readlink -f "${java_launcher}"`

      # Compute the Java home from the location of the Java launcher:
      export JAVA_HOME="${java_launcher%/bin/java}"
    fi
elif [[ $platform == 'osx' ]]; then
   TARGET_FILE=$0
   cd `dirname "$TARGET_FILE"`
   TARGET_FILE=`basename $TARGET_FILE`

   # Iterate down a (possible) chain of symlinks
   while [ -L "$TARGET_FILE" ]
   do
       TARGET_FILE=`readlink "$TARGET_FILE"`
       cd `dirname "$TARGET_FILE"`
       TARGET_FILE=`basename "$TARGET_FILE"`
   done

   # Compute the canonicalized name by finding the physical path
   # for the directory we're in and appending the target file.
   PHYS_DIR=`pwd -P`
   RESULT=$PHYS_DIR/$TARGET_FILE
   fullpath=$RESULT

   [[ -z ${JAVA_HOME} ]] && [[ -x "/usr/libexec/java_home" ]] && export JAVA_HOME=`/usr/libexec/java_home -v 1.7`;

fi

[[ -z ${JAVA_HOME} ]] && echo "Need to set JAVA_HOME environment variable" && exit -1;
[[ ! -x ${JAVA_HOME}/bin/java ]] && echo "Cannot find an executable \
JVM at path ${JAVA_HOME}/bin/java check your JAVA_HOME" && exit -1;

if [ -z ${ODL_BASEDIR} ]; then
    basedir=`dirname "${fullpath}"`
else
    basedir=${ODL_BASEDIR}
fi

if [ -z ${ODL_DATADIR} ]; then
    datadir=`dirname "${fullpath}"`
else
    datadir=${ODL_DATADIR}
fi

if [ -z ${TMP} ]; then
    pidfile="/tmp/opendaylight.PID"
else
    pidfile="${TMP}/opendaylight.PID"
fi
debug=0
debugsuspend=0
debugport=8000
debugportread=""
startdaemon=0
daemonport=2400
daemonportread=""
jmxport=1088
jmxportread=""
startjmx=0
stopdaemon=0
statusdaemon=0
consolestart=1
dohelp=0
jvmMaxMemory="-Xmx1G"
extraJVMOpts=""
agentPath=""
unknown_option=0
helper=""
while true ; do
    case "$1" in
        -debug) debug=1; shift ;;
        -help) dohelp=1; shift;  helper=$1; break ;;
        -jmx) startjmx=1; shift ;;
        -debugsuspend) debugsuspend=1; shift ;;
        -debugport) shift; debugportread="$1"; if [[ "${debugportread}" =~ ^[0-9]+$ ]] ; then debugport=${debugportread}; shift; else echo "-debugport expects a number but was not found"; exit -1; fi;;
        -jmxport) shift; jmxportread="$1"; if [[ "${jmxportread}" =~ ^[0-9]+$ ]] ; then jmxport=${jmxportread}; shift; else echo "-jmxport expects a number but was not found"; exit -1; fi;;
        -start) startdaemon=1; shift; daemonportread="$1"; if [[ "${daemonportread}" =~ ^[0-9]+$ ]] ; then daemonport=${daemonportread}; shift; fi;;
        -stop) stopdaemon=1; shift ;;
        -status) statusdaemon=1; shift ;;
        -console) shift ;;
        -Xmx*) jvmMaxMemory="$1"; shift;;
        -D*) extraJVMOpts="${extraJVMOpts} $1"; shift;;
        -X*) extraJVMOpts="${extraJVMOpts} $1"; shift;;
        -agentpath:*) agentPath="$1"; shift;;
        "") break ;;
        *) echo "Unknown option $1"; unknown_option=1; break ;;
    esac
done
<commit_msg>added an option to pass JVM params (like -verbose:gc) to run.sh<commit_after>#!/bin/bash

##HELP
# For more information on a specific command, type -help command-name.
#
#   jmx              [-jmx]
#   jmxport          [-jmxport <num>] - DEFAULT is 1088
#   debug            [-debug]
#   debugsuspend     [-debugsuspend]
#   debugport        [-debugport <num>] - DEFAULT is 8000
#   start            [-start [<console port>]] - DEFAULT port is 2400
#   stop             [-stop]
#   status           [-status]
#   console          [-console]
#   agentpath        [-agentpath:<path to lib>]
##

platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
   platform='linux'
elif [[ "$unamestr" == 'Darwin' ]]; then
   platform='osx'
fi

if [[ $platform == 'linux' ]]; then
   fullpath=`readlink -f $0`

   if [[ -z ${JAVA_HOME} ]]; then
      # Find the actual location of the Java launcher:
      java_launcher=`command -v java`
      java_launcher=`readlink -f "${java_launcher}"`

      # Compute the Java home from the location of the Java launcher:
      export JAVA_HOME="${java_launcher%/bin/java}"
    fi
elif [[ $platform == 'osx' ]]; then
   TARGET_FILE=$0
   cd `dirname "$TARGET_FILE"`
   TARGET_FILE=`basename $TARGET_FILE`

   # Iterate down a (possible) chain of symlinks
   while [ -L "$TARGET_FILE" ]
   do
       TARGET_FILE=`readlink "$TARGET_FILE"`
       cd `dirname "$TARGET_FILE"`
       TARGET_FILE=`basename "$TARGET_FILE"`
   done

   # Compute the canonicalized name by finding the physical path
   # for the directory we're in and appending the target file.
   PHYS_DIR=`pwd -P`
   RESULT=$PHYS_DIR/$TARGET_FILE
   fullpath=$RESULT

   [[ -z ${JAVA_HOME} ]] && [[ -x "/usr/libexec/java_home" ]] && export JAVA_HOME=`/usr/libexec/java_home -v 1.7`;

fi

[[ -z ${JAVA_HOME} ]] && echo "Need to set JAVA_HOME environment variable" && exit -1;
[[ ! -x ${JAVA_HOME}/bin/java ]] && echo "Cannot find an executable \
JVM at path ${JAVA_HOME}/bin/java check your JAVA_HOME" && exit -1;

if [ -z ${ODL_BASEDIR} ]; then
    basedir=`dirname "${fullpath}"`
else
    basedir=${ODL_BASEDIR}
fi

if [ -z ${ODL_DATADIR} ]; then
    datadir=`dirname "${fullpath}"`
else
    datadir=${ODL_DATADIR}
fi

if [ -z ${TMP} ]; then
    pidfile="/tmp/opendaylight.PID"
else
    pidfile="${TMP}/opendaylight.PID"
fi
debug=0
debugsuspend=0
debugport=8000
debugportread=""
startdaemon=0
daemonport=2400
daemonportread=""
jmxport=1088
jmxportread=""
startjmx=0
stopdaemon=0
statusdaemon=0
consolestart=1
dohelp=0
jvmMaxMemory="-Xmx1G"
extraJVMOpts=""
agentPath=""
unknown_option=0
helper=""
while true ; do
    case "$1" in
        -debug) debug=1; shift ;;
        -help) dohelp=1; shift;  helper=$1; break ;;
        -jmx) startjmx=1; shift ;;
        -debugsuspend) debugsuspend=1; shift ;;
        -debugport) shift; debugportread="$1"; if [[ "${debugportread}" =~ ^[0-9]+$ ]] ; then debugport=${debugportread}; shift; else echo "-debugport expects a number but was not found"; exit -1; fi;;
        -jmxport) shift; jmxportread="$1"; if [[ "${jmxportread}" =~ ^[0-9]+$ ]] ; then jmxport=${jmxportread}; shift; else echo "-jmxport expects a number but was not found"; exit -1; fi;;
        -start) startdaemon=1; shift; daemonportread="$1"; if [[ "${daemonportread}" =~ ^[0-9]+$ ]] ; then daemonport=${daemonportread}; shift; fi;;
        -stop) stopdaemon=1; shift ;;
        -status) statusdaemon=1; shift ;;
        -console) shift ;;
        -Xmx*) jvmMaxMemory="$1"; shift;;
        -D*) extraJVMOpts="${extraJVMOpts} $1"; shift;;
        -X*) extraJVMOpts="${extraJVMOpts} $1"; shift;;
        -J*) extraJVMOpts="${extraJVMOpts} -$(echo "$1" | cut -d'J' -f2)"; shift;;
        -agentpath:*) agentPath="$1"; shift;;
        "") break ;;
        *) echo "Unknown option $1"; unknown_option=1; break ;;
    esac
done

{'fraction_non_alphanumeric': 0.16540655259318213, 'fraction_numerical': 0.01777424061546624, 'mean_word_length': 3.1474147414741473, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4440994', 'n_tokens_mistral': 2758, 'n_tokens_neox': 2633, 'n_words': 698}