Given a series of event logs from a broadcast stream, detect missing frames or data anomalies and output a corrected time-series sequence.
Implement def correct_stream(logs):. Each log is [timestamp, value], timestamps are integers, and values are numeric or null. Return [timestamp, value] entries for every integer timestamp from the earliest to latest log. Sort out-of-order logs, keep the last entry for duplicate timestamps, and linearly interpolate missing or null values. The first and last unique timestamps always have numeric values.
def correct_stream(logs):