<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_messages_by_stream(messages_by_stream):
 """ Parse messages returned by stream Messages returned by XREAD arrive in the form: [stream_name, [ ], ] Here we parse this into (with the help of the above parse_messages() function):
 [ [stream_name, message_id, OrderedDict( (key1, value1), (key2, value2),. )], ] """

    if messages_by_stream is None:
        return []

    parsed = []
    for stream, messages in messages_by_stream:
        for message_id, fields in parse_messages(messages):
            parsed.append((stream, message_id, fields))
    return parsed