Cruise autonomous vehicle services emit structured log lines during operation. Given a collection of log lines, identify recurring ERROR message patterns even when variable values such as IDs, timestamps, or numeric measurements differ.
Each log line has the format [timestamp] LEVEL message, where timestamp contains no spaces, LEVEL is INFO, WARN, or ERROR, and message is the remaining text. Consider two error messages equivalent when they become identical after replacing every UUID with <UUID>, hexadecimal value beginning with 0x with <HEX>, and decimal integer with <NUM>.
Implement identify_error_patterns(logs, min_occurrences). Return a list of dictionaries for normalized error patterns occurring at least min_occurrences times. Each dictionary must contain pattern and count. Sort results by decreasing count, then by pattern in lexicographic order.
def identify_error_patterns(logs, min_occurrences):