def add_lines(self, *lines, **kwargs):
assert len(lines) > <NUM_LIT:0><EOL>lines = [_endline(line) for line in lines]<EOL>all_stages = kwargs.pop('<STR_LIT>', False)<EOL>at_start = kwargs.pop('<STR_LIT>', False)<EOL>skip_scratch = kwargs.pop('<STR_LIT>', False)<EOL>assert not kwargs, "<STR_LIT>".format(kwargs.keys())<EOL>froms = [<EOL>instr for instr in self.structure<EOL>if instr['<STR_LIT>'] == '<STR_LIT>'<EOL>] or [{'<STR_LIT>': -<NUM_LIT:1>}]  <EOL>if not all_stages:  <EOL><INDENT>froms = [froms[-<NUM_LIT:1>]]<EOL><DEDENT>df_lines = self.lines<EOL>if df_lines and not at_start:<EOL><INDENT>df_lines[-<NUM_LIT:1>] = _endline(df_lines[-<NUM_LIT:1>])<EOL><DEDENT>froms.append({'<STR_LIT>': len(df_lines) + <NUM_LIT:1>})<EOL>for stage in range(len(froms)-<NUM_LIT:2>, -<NUM_LIT:1>, -<NUM_LIT:1>):  <EOL><INDENT>start, finish = froms[stage], froms[stage+<NUM_LIT:1>]<EOL>linenum = start['<STR_LIT>'] + <NUM_LIT:1> if at_start else finish['<STR_LIT>']<EOL>if skip_scratch and froms[stage]['<STR_LIT:value>'] == '<STR_LIT>':<EOL><INDENT>continue<EOL><DEDENT>df_lines[linenum:linenum] = lines<EOL><DEDENT>self.lines = df_lines<EOL>
Add lines to the beginning or end of the build.
:param lines: one or more lines to add to the content, by default at the end.
:param all_stages: bool for whether to add in all stages for a multistage build
                   or (by default) only the last.
:param at_start: adds at the beginning (after FROM) of the stage(s) instead of the end.
:param skip_scratch: skip stages which use "FROM scratch"