<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def messageToFile(message):
 """ Flattens a message into a file-like object. """

    outFile = StringIO()
    messageGenerator = generator.Generator(outFile, False)
    messageGenerator.flatten(message)
    outFile.seek(0, 0)
    return outFile