code: 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')
docs: Get the mode for `compile` of a given node.  If the node is not a `mod`
      node (`Expression`, `Module` etc.) a `TypeError` is thrown.