(self, text, prefix='    ')
return '\n'.join(lines)
Indent text by prepending a given prefix to each line.
Indent text by prepending a given prefix to each line.
Indent text by prepending a given prefix to each line .
def indent(self, text, prefix='    '):
        """Indent text by prepending a given prefix to each line."""
        if not text: return ''
        lines = [prefix + line for line in text.split('\n')]
        if lines: lines[-1] = lines[-1].rstrip()
        return '\n'.join(lines)
def indent ( self , text , prefix = '    ' ) : if not text : return '' lines = [ prefix + line for line in text . split ( '\n' ) ] if lines : lines [ - 1 ] = lines [ - 1 ] . rstrip ( ) return '\n' . join ( lines )