<commit_before>#!/bin/sh
#
# ------------------------------------------------------
#  PyCharm Startup Script for Unix
# ------------------------------------------------------
#

# ---------------------------------------------------------------------
#   Before you run PyCharm specify the location of the
#   JDK 1.6 installation directory which will be used for running it.

JDK="$PYCHARM_JDK"
if [ -z "$JDK" ]; then
  [ `uname -s` = "Darwin" ] && OS_TYPE="MAC" || OS_TYPE="NOT_MAC"
  JDK="$JDK_HOME"
  # if JDK_HOME not defined and JAVA_HOME looks correct (tools.jar isn't included in Mac OS X Java bundle)
  if [ -z "$JDK" ] && ([ "$OS_TYPE" = "MAC" -a -x "$JAVA_HOME/bin/java" ] || [ -f "$JAVA_HOME/lib/tools.jar" ]); then
    JDK="$JAVA_HOME"
  fi

  if [ -z "$JDK" ]; then
    # try to get the JDK path from java binary path
    JAVA_BIN_PATH=`which java`
    if [ -n "$JAVA_BIN_PATH" ]; then
      if [ "$OS_TYPE" = "MAC" ]; then
        JAVA_LOCATION=`readlink "$JAVA_BIN_PATH" | xargs dirname | xargs dirname | xargs dirname`
        if [ -x "$JAVA_LOCATION/CurrentJDK/Home/bin/java" ]; then
          JDK="$JAVA_LOCATION/CurrentJDK/Home"
        fi
      else
        JAVA_LOCATION=`readlink -f "$JAVA_BIN_PATH"`
        case "$JAVA_LOCATION" in
          */jre/bin/java)
            JAVA_LOCATION=`echo "$JAVA_LOCATION" | xargs dirname | xargs dirname | xargs dirname` ;;
          *)
            JAVA_LOCATION=`echo "$JAVA_LOCATION" | xargs dirname | xargs dirname` ;;
        esac
        if [ -x "$JAVA_LOCATION/bin/java" ]; then
          JDK="$JAVA_LOCATION"
        fi
      fi
    fi
  fi

  if [ -z "$JDK" ]; then
    echo ERROR: cannot start PyCharm.
    echo No JDK found. Please validate either PYCHARM_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.
    echo
    echo Press Enter to continue.
    read IGNORE
    exit 1
  fi
fi

VERSION_LOG='/tmp/java.version.log'
$JDK/bin/java -version 2> $VERSION_LOG
grep 'OpenJDK' $VERSION_LOG
OPEN_JDK=$?
grep '64-Bit' $VERSION_LOG
BITS=$?
rm $VERSION_LOG
if [ $OPEN_JDK -eq 0 ]; then
  echo WARNING: You are launching IDE using OpenJDK Java runtime.
  echo
  echo          THIS IS STRICTLY UNSUPPORTED DUE TO KNOWN PERFORMANCE AND GRAPHICS PROBLEMS!
  echo
  echo NOTE:    If you have both Sun JDK and OpenJDK installed
  echo          please validate either PYCHARM_JDK, JDK_HOME, or JAVA_HOME environment variable points to valid Sun JDK installation.
  echo<commit_msg>IDEA-74625 (secure temp file creation in a startup scripts)<commit_after>#!/bin/sh
#
# ------------------------------------------------------
#  PyCharm Startup Script for Unix
# ------------------------------------------------------
#

# ---------------------------------------------------------------------
#   Before you run PyCharm specify the location of the
#   JDK 1.6 installation directory which will be used for running it.

JDK="$PYCHARM_JDK"
if [ -z "$JDK" ]; then
  [ `uname -s` = "Darwin" ] && OS_TYPE="MAC" || OS_TYPE="NOT_MAC"
  JDK="$JDK_HOME"
  # if JDK_HOME not defined and JAVA_HOME looks correct (tools.jar isn't included in Mac OS X Java bundle)
  if [ -z "$JDK" ] && ([ "$OS_TYPE" = "MAC" -a -x "$JAVA_HOME/bin/java" ] || [ -f "$JAVA_HOME/lib/tools.jar" ]); then
    JDK="$JAVA_HOME"
  fi

  if [ -z "$JDK" ]; then
    # try to get the JDK path from java binary path
    JAVA_BIN_PATH=`which java`
    if [ -n "$JAVA_BIN_PATH" ]; then
      if [ "$OS_TYPE" = "MAC" ]; then
        JAVA_LOCATION=`readlink "$JAVA_BIN_PATH" | xargs dirname | xargs dirname | xargs dirname`
        if [ -x "$JAVA_LOCATION/CurrentJDK/Home/bin/java" ]; then
          JDK="$JAVA_LOCATION/CurrentJDK/Home"
        fi
      else
        JAVA_LOCATION=`readlink -f "$JAVA_BIN_PATH"`
        case "$JAVA_LOCATION" in
          */jre/bin/java)
            JAVA_LOCATION=`echo "$JAVA_LOCATION" | xargs dirname | xargs dirname | xargs dirname` ;;
          *)
            JAVA_LOCATION=`echo "$JAVA_LOCATION" | xargs dirname | xargs dirname` ;;
        esac
        if [ -x "$JAVA_LOCATION/bin/java" ]; then
          JDK="$JAVA_LOCATION"
        fi
      fi
    fi
  fi

  if [ -z "$JDK" ]; then
    echo ERROR: cannot start PyCharm.
    echo No JDK found. Please validate either PYCHARM_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.
    echo
    echo Press Enter to continue.
    read IGNORE
    exit 1
  fi
fi

VERSION_LOG=`mktemp -t java.version.log.XXXX`
$JDK/bin/java -version 2> $VERSION_LOG
grep 'OpenJDK' $VERSION_LOG
OPEN_JDK=$?
grep '64-Bit' $VERSION_LOG
BITS=$?
rm $VERSION_LOG
if [ $OPEN_JDK -eq 0 ]; then
  echo WARNING: You are launching IDE using OpenJDK Java runtime.
  echo
  echo          THIS IS STRICTLY UNSUPPORTED DUE TO KNOWN PERFORMANCE AND GRAPHICS PROBLEMS!
  echo
  echo NOTE:    If you have both Sun JDK and OpenJDK installed
  echo          please validate either PYCHARM_JDK, JDK_HOME, or JAVA_HOME environment variable points to valid Sun JDK installation.
  echo
{'fraction_non_alphanumeric': 0.17233787029623698, 'fraction_numerical': 0.0038030424339471577, 'mean_word_length': 2.1787531806615776, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5735913', 'n_tokens_mistral': 1805, 'n_tokens_neox': 1653, 'n_words': 507}