<commit_before>@ECHO OFF
REM Copyright 2015 <NAME>. All Rights Reserved.

SET DIR=%~dp0

SET VS14_VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
SET VS15_VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio 15.0\VC\vcvarsall.bat"

ECHO.
REM ============================================================================
REM Environment Validation
REM ============================================================================
REM To make life easier we just require everything before we try running.

CALL :check_git
IF %_RESULT% NEQ 0 (
  ECHO ERROR:
  ECHO git must be installed and on PATH.
  EXIT /b 1
)

CALL :check_python
IF %_RESULT% NEQ 0 (
  ECHO ERROR:
  ECHO Python 2.7 must be installed and on PATH:
  ECHO https://www.python.org/ftp/python/2.7.9/python-2.7.9.msi
  EXIT /b 1
)

CALL :check_msvc
IF %_RESULT% NEQ 0 (
  ECHO ERROR:
  ECHO Visual Studio 2015 must be installed.
  ECHO.
  ECHO The Community Edition is free and can be downloaded here:
  ECHO https://www.visualstudio.com/downloads/visual-studio-2015-downloads-vs
  ECHO.
  ECHO Once installed, launch the 'Developer Command Prompt for VS2015' and run
  ECHO this script again.
  EXIT /b 1
)
CALL %VS14_VCVARSALL% amd64

REM ============================================================================
REM Fetch Everything
REM ============================================================================
ECHO Fetching submodules and other resources...

ECHO.
ECHO ^> git submodule update --init --recursive
PUSHD %DIR%
git submodule update --init --recursive
IF %ERRORLEVEL% NEQ 0 (
  ECHO.
  ECHO ERROR: failed to initialize git submodules
  EXIT /b 1
)
POPD

ECHO.
REM ============================================================================
REM Build Premake
REM ============================================================================
ECHO Building premake...

ECHO.
ECHO ^> nmake -f Bootstrap.mak windows
PUSHD %DIR%\third_party\premake-core\
nmake -f Bootstrap.mak windows
SET _RESULT=%ERRORLEVEL%
POPD

IF %_RESULT% NEQ 0 (
  EXIT /b 1
)
EXIT /b 0


REM ============================================================================
REM Utilities
REM ============================================================================

:check_python
SETLOCAL
1>NUL 2>NUL CMD /c where python
IF %ERRORLEVEL% NEQ 0 (
  ENDLOCAL & SET _RESULT=1
  GOTO :eof
)
CMD /c python -c "import sys; sys.exit(1 if not sys.version_info[:2] == (2, 7) else 0)"
IF %ERRORLEVEL% NEQ 0 (
  ENDLOCAL & SET _RESULT=1
  GOTO :eof
)
ENDLOCAL & SET _RESULT=0
GOTO :eof

:check_git
1>NUL 2>NUL CMD /c where git
SET _RESULT=%ERRORLEVEL%
GOTO :eof

:check_msvc
SETLOCAL EnableDelayedExpansion
1>NUL 2>NUL CMD /c where devenv
IF %ERRORLEVEL% NEQ 0 (
  IF EXIST %VS15_VCVARSALL% (
    REM VS2015
    ECHO Sourcing Visual Studio settings from %VS15_VCVARSALL%...
    CALL %VS15_VCVARSALL% amd64
  ) ELSE (
    IF EXIST %VS14_VCVARSALL% (
      REM VS2015 CTP/RC
      ECHO Sourcing Visual Studio settings from %VS14_VCVARSALL%...
      CALL %VS14_VCVARSALL% amd64
    )
  )
)
1>NUL 2>NUL CMD /c where devenv
IF %ERRORLEVEL% NEQ 0 (
  REM Still no devenv!
  ENDLOCAL & SET _RESULT=1
  GOTO :eof
)
SET HAVE_TOOLS=0
IF "%VS140COMNTOOLS%" NEQ "" (
  IF EXIST "%VS140COMNTOOLS%" (
    REM VS2015 CTP/RC
    SET HAVE_TOOLS=1
  )
)
IF "%VS150COMNTOOLS%" NEQ "" (
  IF EXIST "%VS150COMNTOOLS%" (
    REM VS2015
    SET HAVE_TOOLS=1
  )
)
IF %HAVE_TOOLS% NEQ 1 (
  ENDLOCAL & SET _RESULT=1
  GOTO :eof
)
ENDLOCAL & SET _RESULT=0
GOTO :eof
<commit_msg>Python incoming at some point, cause ugh.<commit_after>@ECHO OFF
REM Copyright 2015 <NAME>. All Rights Reserved.

SET DIR=%~dp0

SET VS14_VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
SET VS15_VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio 15.0\VC\vcvarsall.bat"

ECHO.
REM ============================================================================
REM Environment Validation
REM ============================================================================
REM To make life easier we just require everything before we try running.

CALL :check_git
IF %_RESULT% NEQ 0 (
  ECHO ERROR:
  ECHO git must be installed and on PATH.
  EXIT /b 1
)

CALL :check_python
IF %_RESULT% NEQ 0 (
  ECHO ERROR:
  ECHO Python 2.7 must be installed and on PATH:
  ECHO https://www.python.org/ftp/python/2.7.9/python-2.7.9.msi
  EXIT /b 1
)

CALL :check_msvc
IF %_RESULT% NEQ 0 (
  ECHO ERROR:
  ECHO Visual Studio 2015 must be installed.
  ECHO.
  ECHO The Community Edition is free and can be downloaded here:
  ECHO https://www.visualstudio.com/downloads/visual-studio-2015-downloads-vs
  ECHO.
  ECHO Once installed, launch the 'Developer Command Prompt for VS2015' and run
  ECHO this script again.
  EXIT /b 1
)
1>NUL 2>NUL CMD /c where devenv
IF %ERRORLEVEL% NEQ 0 (
  CALL %VS14_VCVARSALL% amd64
)

REM ============================================================================
REM Fetch Everything
REM ============================================================================
ECHO Fetching submodules and other resources...

ECHO.
ECHO ^> git submodule update --init --recursive
PUSHD %DIR%
git submodule update --init --recursive
IF %ERRORLEVEL% NEQ 0 (
  ECHO.
  ECHO ERROR: failed to initialize git submodules
  EXIT /b 1
)
POPD

ECHO.
REM ============================================================================
REM Build Premake
REM ============================================================================
ECHO Building premake...

ECHO.
ECHO ^> nmake -f Bootstrap.mak windows
PUSHD %DIR%\third_party\premake-core\
nmake -f Bootstrap.mak windows
SET _RESULT=%ERRORLEVEL%
POPD

IF %_RESULT% NEQ 0 (
  EXIT /b 1
)
EXIT /b 0


REM ============================================================================
REM Utilities
REM ============================================================================

:check_python
SETLOCAL
1>NUL 2>NUL CMD /c where python
IF %ERRORLEVEL% NEQ 0 (
  ENDLOCAL & SET _RESULT=1
  GOTO :eof
)
CMD /c python -c "import sys; sys.exit(1 if not sys.version_info[:2] == (2, 7) else 0)"
IF %ERRORLEVEL% NEQ 0 (
  ENDLOCAL & SET _RESULT=1
  GOTO :eof
)
ENDLOCAL & SET _RESULT=0
GOTO :eof

:check_git
1>NUL 2>NUL CMD /c where git
SET _RESULT=%ERRORLEVEL%
GOTO :eof

:check_msvc
SETLOCAL EnableDelayedExpansion
1>NUL 2>NUL CMD /c where devenv
IF %ERRORLEVEL% NEQ 0 (
  IF EXIST %VS15_VCVARSALL% (
    REM VS2015
    ECHO Sourcing Visual Studio settings from %VS15_VCVARSALL%...
    CALL %VS15_VCVARSALL% amd64
  ) ELSE (
    IF EXIST %VS14_VCVARSALL% (
      REM VS2015 CTP/RC
      ECHO Sourcing Visual Studio settings from %VS14_VCVARSALL%...
      CALL %VS14_VCVARSALL% amd64
    )
  )
)
1>NUL 2>NUL CMD /c where devenv
IF %ERRORLEVEL% NEQ 0 (
  REM Still no devenv!
  ENDLOCAL & SET _RESULT=1
  GOTO :eof
)
SET HAVE_TOOLS=0
IF "%VS140COMNTOOLS%" NEQ "" (
  IF EXIST "%VS140COMNTOOLS%" (
    REM VS2015 CTP/RC
    SET HAVE_TOOLS=1
  )
)
IF "%VS150COMNTOOLS%" NEQ "" (
  IF EXIST "%VS150COMNTOOLS%" (
    REM VS2015
    SET HAVE_TOOLS=1
  )
)
IF %HAVE_TOOLS% NEQ 1 (
  ENDLOCAL & SET _RESULT=1
  GOTO :eof
)
ENDLOCAL & SET _RESULT=0
GOTO :eof

{'fraction_non_alphanumeric': 0.24909090909090909, 'fraction_numerical': 0.03538461538461538, 'mean_word_length': 4.30883444691908, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7607276', 'n_tokens_mistral': 2768, 'n_tokens_neox': 2375, 'n_words': 762}