 """<STR_LIT>""" <EOL> import sys <EOL> import logging <EOL> class MissingModule ( object ) : <EOL> __slots__ = [ "<STR_LIT>" ] <EOL> def __init__ ( self , name ) : <EOL> self . __name = name <EOL> def __getattr__ ( self , name ) : <EOL> if name . startswith ( "<STR_LIT>" ) : 
 raise AttributeError ( "<STR_LIT>" % ( self . __name , ) ) 
 """<STR_LIT>""" <EOL> import sys <EOL> import logging <EOL> class MissingModule ( object ) : <EOL> __slots__ = [ "<STR_LIT>" ] <EOL> def __init__ ( self , name ) : <EOL> self . __name = name <EOL> def __getattr__ ( self , name ) : <EOL> if name . startswith ( "<STR_LIT>" ) : <EOL> raise AttributeError ( "<STR_LIT>" % ( self . __name , ) ) <EOL> raise ImportError ( "<STR_LIT>" % ( self . __name , ) ) <EOL> def __bool__ ( self ) : <EOL> return False <EOL> __nonzero__ = __bool__ <EOL> def safe_import ( name ) : <EOL> try : <EOL> mod = __import__ ( name , None , None , "<STR_LIT:*>" ) <EOL> except ImportError : <EOL> mod = MissingModule ( name ) <EOL> except Exception : <EOL> if sys . platform == "<STR_LIT>" and name == "<STR_LIT>" : <EOL> mod = MissingModule ( name ) <EOL> else : <EOL> raise <EOL> return mod <EOL> def setup_logger ( options ) : <EOL> logging_options = { } <EOL> if options . quiet : <EOL> logging_options [ '<STR_LIT>' ] = logging . ERROR <EOL> else : <EOL> logging_options [ '<STR_LIT>' ] = logging . DEBUG <EOL> if options . logfile : <EOL> logging_options [ '<STR_LIT:file>' ] = options . logfile <EOL> logging . basicConfig ( ** logging_options ) </s>
