Write a script to parse a large log file and extract the top ten most frequent IP addresses.
Implement top_ten_ip_addresses(log_lines), where log_lines is an iterable of log-line strings. Extract valid IPv4 addresses, count their occurrences, and return up to ten addresses ordered by descending frequency, then lexicographically for ties. Process the input as a stream rather than reading the entire file at once.
def top_ten_ip_addresses(log_lines):