def match(expected, log, is_regex=False):
log_statement = log.pop(<NUM_LIT:0>)<EOL>if is_regex:<EOL><INDENT>assert re.match(expected + '<STR_LIT:$>', log_statement)<EOL><DEDENT>else:<EOL><INDENT>assert expected == log_statement<EOL><DEDENT>return True<EOL>
AssertionError if first log statement doesn't match expected. Supports regex.