<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def formatWarnings(self, warnings):
 """ Format warnings to a list of results. @param warnings: a dict of warnings produced by parseWarnings @return: a list of warnings in string """

        lines = []
        for modulename in sorted(warnings):
            lines.append(self.prefixModuleName + modulename)
            lines.extend(sorted(warnings[modulename],
                         key=lambda x: x.split(":")[1]))

        return "\n".join(lines)