<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def code(self, text, lang=None):
 """Add a code block."""

        # WARNING: lang is discarded currently.
        with self.paragraph(stylename='code'):
            lines = text.splitlines()
            for line in lines[:-1]:
                self._code_line(line)
                self.linebreak()
            self._code_line(lines[-1])