<commit_before>import re
import pandas as pd
import sys
import os
import traceback
import numpy as np
import glob
import itertools
import pdb
import shutil
import platform
from distutils import spawn
import builtins
import inspect
import logging

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('gdxpy')
logger.debug('Logger created')


RESHAPE_NONE, RESHAPE_SERIES, RESHAPE_FRAME, RESHAPE_PANEL = range(4)
RESHAPE_DEFAULT = RESHAPE_SERIES

_pyver = (sys.version_info.major, sys.version_info.minor)
_findexe = shutil.which if (_pyver[0] >= 3) else spawn.find_executable
_onwindows = (os.name == 'nt')
_gamsexe = 'gams.exe' if _onwindows else 'gams'
_gamsnotfound = 'GAMS not found: either set GAMSDIR or add "{}" path to the PATH environment variable'.format(_gamsexe)
try:
    _gamsdir = os.environ['GAMSDIR'].split(';')[-1]
    _gamsexepath = os.path.join(_gamsdir, _gamsexe)
    assert os.path.exists(_gamsexepath)
except:
    _gamsexepath = _findexe(_gamsexe)
    assert _gamsexepath != None, _gamsnotfound
    _gamsdir = os.path.dirname(_gamsexepath)
_gamsbit = platform.architecture(_gamsexepath)[0][:2]
_pypath = sys.executable
_pybit = platform.architecture(_pypath)[0][:2]<commit_msg>test all GAMSDIR paths for a GAMS binary before using PATH<commit_after>import re
import pandas as pd
import sys
import os
import traceback
import numpy as np
import glob
import itertools
import pdb
import shutil
import platform
from distutils import spawn
import builtins
import inspect
import logging

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('gdxpy')
logger.debug('Logger created')


RESHAPE_NONE, RESHAPE_SERIES, RESHAPE_FRAME, RESHAPE_PANEL = range(4)
RESHAPE_DEFAULT = RESHAPE_SERIES

_pyver = (sys.version_info.major, sys.version_info.minor)
_findexe = shutil.which if (_pyver[0] >= 3) else spawn.find_executable
_onwindows = (os.name == 'nt')
_gamsexe = 'gams.exe' if _onwindows else 'gams'
_gamsnotfound = 'GAMS not found: either set GAMSDIR or add "{}" path to the PATH environment variable'.format(_gamsexe)
try:
    _gamsfound = False
    for _gamsdir in os.environ['GAMSDIR'].split(';'):
        _gamsexepath = os.path.join(_gamsdir, _gamsexe)
        if os.path.exists(_gamsexepath):
            _gamsfound = True
            break
    assert _gamsfound
except:
    _gamsexepath = _findexe(_gamsexe)
    assert _gamsexepath != None, _gamsnotfound
    _gamsdir = os.path.dirname(_gamsexepath)
_gamsbit = platform.architecture(_gamsexepath)[0][:2]
_pypath = sys.executable
_pybit = platform.architecture(_pypath)[0][:2]
{'fraction_non_alphanumeric': 0.09809264305177112, 'fraction_numerical': 0.0058388478007006615, 'mean_word_length': 5.237864077669903, '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': '2431101', 'n_tokens_mistral': 940, 'n_tokens_neox': 925, 'n_words': 228}