Alten QA engineers review automated test output to identify failed or unstable executions. Given a list of log lines from an Alten QA run, count the entries whose severity level is ERROR.
Each valid line follows this format:
timestamp [LEVEL] message
The LEVEL value may be INFO, WARNING, ERROR, or another uppercase or lowercase severity. Count only lines whose parsed level equals ERROR, ignoring letter case. Ignore malformed lines that do not contain a complete bracketed level such as [ERROR].
Implement count_error_messages(log_lines).
log_lines, a list of strings.ERROR.def count_error_messages(log_lines):