<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def format(self):
 """Format the message parts to a string. :Returns: A string of all the message parts separated into paragraphs, with header and footer paragraphs if they were specified in the constructor. """

        message = ""
        if self.paragraphs:
            if self.header:
                message += (self.header + '\n\n')
            message += "\n\n".join(self.paragraphs)
            if self.footer:
                message += ('\n\n' + self.footer)
        return message