@magic_arguments.magic_arguments()<EOL><INDENT>@magic_arguments.argument('<STR_LIT>', type=str, default='<STR_LIT>', nargs='<STR_LIT:?>',<EOL>help="""<STR_LIT>"""<EOL>)<EOL>@magic_arguments.argument('<STR_LIT>', action="<STR_LIT:store_true>",<EOL>help="""<STR_LIT>"""<EOL>)<EOL>@magic_arguments.argument('<STR_LIT>', action="<STR_LIT:store_true>",<EOL>help="""<STR_LIT>"""<EOL>)<EOL>@cell_magic<EOL>def capture(self, line, cell):<DEDENT>
args = magic_arguments.parse_argstring(self.capture, line)<EOL>out = not args.no_stdout<EOL>err = not args.no_stderr<EOL>with capture_output(out, err) as io:<EOL><INDENT>self.shell.run_cell(cell)<EOL><DEDENT>if args.output:<EOL><INDENT>self.shell.user_ns[args.output] = io<EOL><DEDENT>
run the cell, capturing stdout/err