# Buggy code
def parse(self, s, filename="<code>", mode="exec", debug_level=0):
    """Returns an abstract syntax tree of xonsh code.

    Parameters
    ----------
    s : str
        The xonsh code.
    filename : str, optional
        Name of the file.
    mode : str, optional
        Execution mode, one of: exec, eval, or single.
    debug_level : str, optional
        Debugging level passed down to yacc.

    Returns
    -------
    tree : AST
    """
    self.reset()
    self.xonsh_code = s
    self.lexer.fname = filename
    while self.parser is None:
        time.sleep(0.01)  # block until the parser is ready
    tree = self.parser.parse(input=s, lexer=self.lexer, debug=debug_level)
    # hack for getting modes right
    if mode == "single":
        if isinstance(tree, ast.Expression):
            tree = ast.Interactive(body=[self.expr(tree.body)])
        elif isinstance(tree, ast.Module):
            tree = ast.Interactive(body=tree.body)
    return tree


# Traceback (ValueError)
xonshmaster=🐚 fdjskflj --arg=$ENVTraceback (most recent call last):
File "/Users/aaronmeurer/anaconda3/bin/xonsh", line 6, in <module>
sys.exit(xonsh.main.main())
File "/Users/aaronmeurer/Documents/xonsh/xonsh/main.py", line 236, in main
shell.cmdloop()
File "/Users/aaronmeurer/Documents/xonsh/xonsh/ptk/shell.py", line 111, in cmdloop
line = self.singleline(auto_suggest=auto_suggest)
File "/Users/aaronmeurer/Documents/xonsh/xonsh/ptk/shell.py", line 80, in singleline
display_completions_in_columns=multicolumn)
File "/Users/aaronmeurer/Documents/xonsh/xonsh/ptk/shortcuts.py", line 104, in prompt
document = cli.run(reset_current_buffer=False)
File "/Users/aaronmeurer/anaconda/lib/python3.5/site-packages/prompt_toolkit-0.57-py3.5.egg/prompt_toolkit/interface.py", line 353, in run
File "/Users/aaronmeurer/anaconda/lib/python3.5/site-packages/prompt_toolkit-0.57-py3.5.egg/prompt_toolkit/eventloop/posix.py", line 150, in run
File "/Users/aaronmeurer/anaconda/lib/python3.5/site-packages/prompt_toolkit-0.57-py3.5.egg/prompt_toolkit/eventloop/posix.py", line 82, in read_from_stdin
File "/Users/aaronmeurer/anaconda/lib/python3.5/site-packages/prompt_toolkit-0.57-py3.5.egg/prompt_toolkit/terminal/vt100_input.py", line 373, in feed
File "/Users/aaronmeurer/anaconda/lib/python3.5/site-packages/prompt_toolkit-0.57-py3.5.egg/prompt_toolkit/terminal/vt100_input.py", line 292, in _input_par
File "/Users/aaronmeurer/anaconda/lib/python3.5/site-packages/prompt_toolkit-0.57-py3.5.egg/prompt_toolkit/terminal/vt100_input.py", line 325, in _call_hanr
File "/Users/aaronmeurer/anaconda/lib/python3.5/site-packages/prompt_toolkit-0.57-py3.5.egg/prompt_toolkit/interface.py", line 830, in feed_key
File "/Users/aaronmeurer/anaconda/lib/python3.5/site-packages/prompt_toolkit-0.57-py3.5.egg/prompt_toolkit/key_binding/input_processor.py", line 172, in fey
File "/Users/aaronmeurer/anaconda/lib/python3.5/site-packages/prompt_toolkit-0.57-py3.5.egg/prompt_toolkit/key_binding/input_processor.py", line 144, in _ps
File "/Users/aaronmeurer/anaconda/lib/python3.5/site-packages/prompt_toolkit-0.57-py3.5.egg/prompt_toolkit/key_binding/input_processor.py", line 187, in _cr
File "/Users/aaronmeurer/anaconda/lib/python3.5/site-packages/prompt_toolkit-0.57-py3.5.egg/prompt_toolkit/key_binding/registry.py", line 32, in call
File "/Users/aaronmeurer/Documents/xonsh/xonsh/ptk/key_bindings.py", line 110, in multiline_carriage_return
carriage_return(b, event.cli)
File "/Users/aaronmeurer/Documents/xonsh/xonsh/ptk/key_bindings.py", line 55, in carriage_return
elif not current_line_blank and not can_compile(b.document.text):
File "/Users/aaronmeurer/Documents/xonsh/xonsh/ptk/key_bindings.py", line 80, in can_compile
locs=builtins.__xonsh_ctx__)
File "/Users/aaronmeurer/Documents/xonsh/xonsh/execer.py", line 95, in compile
code = compile(tree, filename, mode)
ValueError: expression which can't be assigned to in Store context

# Fixed code
def parse(self, s, filename="<code>", mode="exec", debug_level=0):
    """Returns an abstract syntax tree of xonsh code.

    Parameters
    ----------
    s : str
        The xonsh code.
    filename : str, optional
        Name of the file.
    mode : str, optional
        Execution mode, one of: exec, eval, or single.
    debug_level : str, optional
        Debugging level passed down to yacc.

    Returns
    -------
    tree : AST
    """
    self.reset()
    self.xonsh_code = s
    self.lexer.fname = filename
    while self.parser is None:
        time.sleep(0.01)  # block until the parser is ready
    tree = self.parser.parse(input=s, lexer=self.lexer, debug=debug_level)
    if tree is not None:
        check_contexts(tree)
    # hack for getting modes right
    if mode == "single":
        if isinstance(tree, ast.Expression):
            tree = ast.Interactive(body=[self.expr(tree.body)])
        elif isinstance(tree, ast.Module):
            tree = ast.Interactive(body=tree.body)
    return tree