<commit_before>@REM Try locating all Python versions via Python Launcher.
@SET pythonloc=python.exe

@rem Check if Python launcher is installed.
@set ERRORLEVEL=0
@where /q py.exe
@IF ERRORLEVEL 1 GOTO nopylauncher

:pylist
@set pythontotal=0
@set pythoncount=0
@set goodpython=0
@cls

@rem Count supported python installations
@setlocal ENABLEDELAYEDEXPANSION
@FOR /F "USEBACKQ tokens=1 skip=1" %%a IN (`py -0 2^>nul`) do @(
@set pythoninstance=%%a
@IF !pythoninstance^:^~1^,-3! EQU 2.7 set goodpython=1
@IF !pythoninstance^:^~1^,-3! GEQ 3.5 set goodpython=1
@IF !goodpython!==1 set /a pythontotal+=1
)
@endlocal&set pythontotal=%pythontotal%
@IF %pythontotal%==0 echo WARNING: No suitable Python installation found by Python launcher. Note that Python 2.7 or Python 3.5 and newer is required.
@IF %pythontotal%==0 echo.
@IF %pythontotal%==0 GOTO nopylauncher

@rem Select Python installation to use
@IF %enablemeson%==0 echo Select python installation. Note that experimental /enablemeson command-line argument is not set. We won't attempt to build Mesa3D if you pick any Python 3.x installation: & echo.
@IF %enablemeson%==1 echo Select python installation. Note that experimental /enablemeson command-line argument is set. We will attempt to build Mesa3D regardless of Python installation selected: & echo.
@setlocal ENABLEDELAYEDEXPANSION
@FOR /F "USEBACKQ tokens=1 skip=1" %%a IN (`py -0 2^>nul`) do @(
@set pythoninstance=%%a
@IF !pythoninstance^:^~1^,-3! EQU 2.7 set goodpython=1
@IF !pythoninstance^:^~1^,-3! GEQ 3.5 set goodpython=1
@IF !goodpython!==1 set /a pythoncount+=1
@IF !goodpython!==1 echo !pythoncount!. Python !pythoninstance:~1,1!.!pythoninstance:~3,-3! !pythoninstance:~-2! bit
)
@endlocal
@echo.
@set /p pyselect=Select Python version by entering its index from the table above:
@echo.
@IF %pyselect% LEQ 0 echo Invalid entry.
@IF %pyselect% LEQ 0 pause
@IF %pyselect% LEQ 0 GOTO pylist
@IF %pyselect% GTR %pythontotal% echo Invalid entry.
@IF %pyselect% GTR %pythontotal% pause
@IF %pyselect% GTR %pythontotal% GOTO pylist

@rem Locate selected Python installation
@setlocal ENABLEDELAYEDEXPANSION
@FOR /F "USEBACKQ tokens=1 skip=1" %%a IN (`py -0 2^>nul`) do @(
@set pythoninstance=%%a
@IF !pythoninstance^:^~1^,-3! EQU 2.7 set goodpython=1
@IF !pythoninstance^:^~1^,-3! GEQ 3.5 set goodpython=1
@IF !goodpython!==1 set /a pythoncount+=1
@IF !pythoncount!==%pyselect% set selectedpython=%%a<commit_msg>Small simplification in Python launcher interface menu. No functional change.<commit_after>@REM Try locating all Python versions via Python Launcher.
@SET pythonloc=python.exe

@rem Check if Python launcher is installed.
@set ERRORLEVEL=0
@where /q py.exe
@IF ERRORLEVEL 1 GOTO nopylauncher

:pylist
@set pythontotal=0
@set pythoncount=0
@set goodpython=0
@cls

@rem Count supported python installations
@setlocal ENABLEDELAYEDEXPANSION
@FOR /F "USEBACKQ tokens=1 skip=1" %%a IN (`py -0 2^>nul`) do @(
@set pythoninstance=%%a
@IF !pythoninstance^:^~1^,-3! EQU 2.7 set goodpython=1
@IF !pythoninstance^:^~1^,-3! GEQ 3.5 set goodpython=1
@IF !goodpython!==1 set /a pythontotal+=1
)
@endlocal&set pythontotal=%pythontotal%
@IF %pythontotal%==0 echo WARNING: No suitable Python installation found by Python launcher. Note that Python 2.7 or Python 3.5 and newer is required.
@IF %pythontotal%==0 echo.
@IF %pythontotal%==0 GOTO nopylauncher

@rem Select Python installation to use
@IF %enablemeson%==0 echo Select python installation. Note that experimental /enablemeson command-line argument is not set. We won't attempt to build Mesa3D if you pick any Python 3.x installation: & echo.
@IF %enablemeson%==1 echo Select python installation. Note that experimental /enablemeson command-line argument is set. We will attempt to build Mesa3D regardless of Python installation selected: & echo.
@setlocal ENABLEDELAYEDEXPANSION
@FOR /F "USEBACKQ tokens=1 skip=1" %%a IN (`py -0 2^>nul`) do @(
@set pythoninstance=%%a
@IF !pythoninstance^:^~1^,-3! EQU 2.7 set goodpython=1
@IF !pythoninstance^:^~1^,-3! GEQ 3.5 set goodpython=1
@IF !goodpython!==1 set /a pythoncount+=1
@IF !goodpython!==1 echo !pythoncount!. Python !pythoninstance:~1,-3! !pythoninstance:~-2! bit
)
@endlocal
@echo.
@set /p pyselect=Select Python version by entering its index from the table above:
@echo.
@IF %pyselect% LEQ 0 echo Invalid entry.
@IF %pyselect% LEQ 0 pause
@IF %pyselect% LEQ 0 GOTO pylist
@IF %pyselect% GTR %pythontotal% echo Invalid entry.
@IF %pyselect% GTR %pythontotal% pause
@IF %pyselect% GTR %pythontotal% GOTO pylist

@rem Locate selected Python installation
@setlocal ENABLEDELAYEDEXPANSION
@FOR /F "USEBACKQ tokens=1 skip=1" %%a IN (`py -0 2^>nul`) do @(
@set pythoninstance=%%a
@IF !pythoninstance^:^~1^,-3! EQU 2.7 set goodpython=1
@IF !pythoninstance^:^~1^,-3! GEQ 3.5 set goodpython=1
@IF !goodpython!==1 set /a pythoncount+=1
@IF !pythoncount!==%pyselect% set selectedpython=%%a
{'fraction_non_alphanumeric': 0.12693877551020408, 'fraction_numerical': 0.02979591836734694, 'mean_word_length': 5.686221009549795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2477339', 'n_tokens_mistral': 1795, 'n_tokens_neox': 1729, 'n_words': 606}