def do_indent(s, width=4, indentfirst=False):
 indention = (u' ' * width)
 rv = (u'\n' + indention).join(s.splitlines())
 if indentfirst:
  rv = (indention + rv)
 return rv

def do_indent ( s , width = 4 , indentfirst = False ) : indention = ( u' ' * width ) rv = ( u'\n' + indention ) . join ( s . splitlines ( ) ) if indentfirst : rv = ( indention + rv ) return rv
return a copy of the passed string .