<commit_before>import os

import openbabel
import external.cclib as cclib
import logging
from subprocess import Popen, PIPE

from qmdata import CCLibData
from molecule import QMMolecule

class Gaussian:
    """
    A base class for all QM calculations that use Gaussian.
    
    Classes such as :class:`GaussianMol` will inherit from this class.
    """
    
    inputFileExtension = '.gjf'
    outputFileExtension = '.log'
    
    gaussEnv = os.getenv('GAUSS_EXEDIR')
    if os.path.exists(os.path.join(gaussEnv , 'g09')):
        executablePath = os.path.join(gaussEnv , 'g09')
    elif os.path.exists(os.path.join(gaussEnv , 'g03')):
        executablePath = os.path.join(gaussEnv , 'g03')
    else:
        executablePath = os.path.join(gaussEnv , '(g03 or g09)')

    usePolar = False
    
    #: List of phrases that indicate failure
    #: NONE of these must be present in a succesful job.
    failureKeys = [
                   'ERROR TERMINATION',
                   'IMAGINARY FREQUENCIES'
                   ]
    
    #: List of phrases to indicate success.
    #: ALL of these must be present in a successful job.
    successKeys = [
                   'Normal termination of Gaussian'
                  ]
 
    def testReady(self):
        if not os.path.exists(self.executablePath):
            raise Exception("Couldn't find Gaussian executable at {0}. Try setting your GAUSS_EXEDIR environment variable.".format(self.executablePath))

   <commit_msg>Fix for people without the environment variable GAUSS_EXEDIR set<commit_after>import os

import openbabel
import external.cclib as cclib
import logging
from subprocess import Popen, PIPE

from qmdata import CCLibData
from molecule import QMMolecule

class Gaussian:
    """
    A base class for all QM calculations that use Gaussian.
    
    Classes such as :class:`GaussianMol` will inherit from this class.
    """
    
    inputFileExtension = '.gjf'
    outputFileExtension = '.log'
    
    gaussEnv = os.getenv('GAUSS_EXEDIR') or os.getenv('g09root') or os.getenv('g03root') or ""
    if os.path.exists(os.path.join(gaussEnv , 'g09')):
        executablePath = os.path.join(gaussEnv , 'g09')
    elif os.path.exists(os.path.join(gaussEnv , 'g03')):
        executablePath = os.path.join(gaussEnv , 'g03')
    else:
        executablePath = os.path.join(gaussEnv , '(g03 or g09)')

    usePolar = False
    
    #: List of phrases that indicate failure
    #: NONE of these must be present in a succesful job.
    failureKeys = [
                   'ERROR TERMINATION',
                   'IMAGINARY FREQUENCIES'
                   ]
    
    #: List of phrases to indicate success.
    #: ALL of these must be present in a successful job.
    successKeys = [
                   'Normal termination of Gaussian'
                  ]
 
    def testReady(self):
        if not os.path.exists(self.executablePath):
            raise Exception("Couldn't find Gaussian executable at {0}. Try setting your GAUSS_EXEDIR environment variable.".format(self.executablePath))

   
{'fraction_non_alphanumeric': 0.0893854748603352, 'fraction_numerical': 0.009858692080184028, 'mean_word_length': 2.4788571428571426, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4852282', 'n_tokens_mistral': 963, 'n_tokens_neox': 897, 'n_words': 273}