def get_source(self, source, line_index=-<NUM_LIT:1>, excinfo=None, short=False):
import _pytest._code<EOL>lines = []<EOL>if source is None or line_index >= len(source.lines):<EOL><INDENT>source = _pytest._code.Source("<STR_LIT>")<EOL>line_index = <NUM_LIT:0><EOL><DEDENT>if line_index < <NUM_LIT:0>:<EOL><INDENT>line_index += len(source)<EOL><DEDENT>space_prefix = "<STR_LIT:U+0020>"<EOL>if short:<EOL><INDENT>lines.append(space_prefix + source.lines[line_index].strip())<EOL><DEDENT>else:<EOL><INDENT>for line in source.lines[:line_index]:<EOL><INDENT>lines.append(space_prefix + line)<EOL><DEDENT>lines.append(self.flow_marker + "<STR_LIT:U+0020>" + source.lines[line_index])<EOL>for line in source.lines[line_index + <NUM_LIT:1> :]:<EOL><INDENT>lines.append(space_prefix + line)<EOL><DEDENT><DEDENT>if excinfo is not None:<EOL><INDENT>indent = <NUM_LIT:4> if short else self._getindent(source)<EOL>lines.extend(self.get_exconly(excinfo, indent=indent, markall=True))<EOL><DEDENT>return lines<EOL>
return formatted and marked up source lines.