<s> """<STR_LIT>""" <EOL> import sys <EOL> from traceback import print_exception <EOL> from StringIO import StringIO <EOL> class ConstraintError ( ValueError ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class CircularDependencyError ( RuntimeError ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class RunInterrupted ( RuntimeError ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class RunStopped ( RuntimeError ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class NoFlatError ( TypeError ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def traceback_str ( exc ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( exc , tuple ) and len ( exc ) == <NUM_LIT:3> : <EOL> s = StringIO ( ) <EOL> print_exception ( * exc , file = s ) <EOL> return s . getvalue ( ) . strip ( ) <EOL> try : <EOL> return exc . traceback <EOL> except AttributeError : <EOL> return str ( exc ) <EOL> def exception_str ( exc ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( exc , tuple ) and len ( exc ) == <NUM_LIT:3> : <EOL> return str ( exc [ <NUM_LIT:1> ] ) <EOL> return str ( exc ) </s>
