def add_date(self, date, lines):
_lines = lines[:]<EOL>_lines = trim(_lines)<EOL>if self.add_date_to_bottom is None:<EOL><INDENT>add_date_to_bottom = is_top_down(lines)<EOL><DEDENT>else:<EOL><INDENT>add_date_to_bottom = self.add_date_to_bottom<EOL><DEDENT>if add_date_to_bottom:<EOL><INDENT>_lines.append(TextLine('<STR_LIT>'))<EOL>_lines.append(DateLine(date))<EOL><DEDENT>else:<EOL><INDENT>_lines.insert(<NUM_LIT:0>, TextLine('<STR_LIT>'))<EOL>_lines.insert(<NUM_LIT:0>, DateLine(date))<EOL><DEDENT>return trim(_lines)<EOL>
Return the given `lines` with the `date` added in the right place (ie. to the beginning or to the end of the
given lines, depending on the `add_date_to_bottom` property).