<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def collapse_whitespace(message):
 """Collapses consecutive whitespace into a single space"""

    return u' '.join(map(lambda s: s.strip(),
                         filter(None, message.strip().splitlines())))