<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def WriteMessagesFile(file_descriptor, package, version, printer):
 """Write the given extended file descriptor to out as a message file."""

    _WriteFile(file_descriptor, package, version,
               _Proto2Printer(printer))