<s> from __future__ import print_function <EOL> from copy import deepcopy <EOL> import json <EOL> import os <EOL> import sys <EOL> def checkIfFileExists ( filename ) : <EOL> return os . path . isfile ( filename ) <EOL> def readConfigurationFile ( filename , allowTermination = True ) : <EOL> try : jsonData = open ( filename ) <EOL> except : <EOL> if allowTermination : print ( '<STR_LIT>' + str ( filename ) ) ; exit ( <NUM_LIT:0> ) <EOL> else : return False <EOL> try : data = json . load ( jsonData ) <EOL> except : <EOL> if allowTermination : <EOL> exc_type , exc_value , exc_traceback = sys . exc_info ( ) <EOL> print ( '<STR_LIT>' + str ( filename ) ) <EOL> print ( exc_type , exc_value , exc_traceback ) <EOL> exit ( <NUM_LIT:0> ) <EOL> else : return False <EOL> return data </s>
