(s, n=1, indent_str="  ")
return "".join((p + l) if l.lstrip() else l for l in s.splitlines(True))
Inserts `n * indent_str` at the start of each non-empty line in `s`.
Inserts `n * indent_str` at the start of each non-empty line in `s`.
Inserts n * indent_str at the start of each non - empty line in s .
def indent(s, n=1, indent_str="  "):
  """Inserts `n * indent_str` at the start of each non-empty line in `s`."""
  p = n * indent_str
  return "".join((p + l) if l.lstrip() else l for l in s.splitlines(True))
def indent ( s , n = 1 , indent_str = "  " ) : p = n * indent_str return "" . join ( ( p + l ) if l . lstrip ( ) else l for l in s . splitlines ( True ) )