def _WrapEndMarker(tree):
 if (isinstance(tree, pytree.Leaf) and (tree.type == token.ENDMARKER)):
  return pytree.Node(pygram.python_symbols.file_input, [tree])
 return tree

def _WrapEndMarker ( tree ) : if ( isinstance ( tree , pytree . Leaf ) and ( tree . type == token . ENDMARKER ) ) : return pytree . Node ( pygram . python_symbols . file_input , [ tree ] ) return tree
wrap a single endmarker token in a "file_input" node .