def get_compile_mode(node):
 if (not isinstance(node, mod)):
  raise TypeError(('expected mod node, got %r' % node.__class__.__name__))
 return {Expression: 'eval', Interactive: 'single'}.get(node.__class__, 'expr')

def get_compile_mode ( node ) : if ( not isinstance ( node , mod ) ) : raise TypeError ( ( 'expected mod node, got %r' % node . __class__ . __name__ ) ) return { Expression : 'eval' , Interactive : 'single' } . get ( node . __class__ , 'expr' )
get the mode for compile of a given node .