def check_got_vs_want(want, got_stdout, got_eval=constants.NOT_EVALED,<EOL>runstate=None):
<EOL>if got_eval is constants.NOT_EVALED:<EOL><INDENT>got = got_stdout<EOL>flag = check_output(got, want, runstate)<EOL><DEDENT>else:<EOL><INDENT>if not got_stdout:<EOL><INDENT>got = repr(got_eval)<EOL>flag = check_output(got, want, runstate)<EOL><DEDENT>else:<EOL><INDENT>got = got_stdout<EOL>flag = check_output(got, want, runstate)<EOL>if not flag:<EOL><INDENT>got = repr(got_eval)<EOL>flag = check_output(got, want, runstate)<EOL>if not flag:<EOL><INDENT>got = got_stdout<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if not flag:<EOL><INDENT>msg = '<STR_LIT>'<EOL>ex = GotWantException(msg, got, want)<EOL>raise ex<EOL><DEDENT>return flag<EOL>
Determines to check against either got_stdout or got_eval, and then does
the comparison.

If both stdout and eval "got" outputs are specified, then the "want"
target may match either value.

Args:
    want (str): target to match against
    got_stdout (str): output from stdout
    got_eval (str): output from an eval statement.

Raises:
    GotWantException - If the "got" differs from this parts want.