def normalize_text(text, line_len=80, indent='', rest=False):
 if rest:
  normp = normalize_rest_paragraph
 else:
  normp = normalize_paragraph
 result = []
 for text in _BLANKLINES_RGX.split(text):
  result.append(normp(text, line_len, indent))
 return ('%s%s%s' % (linesep, indent, linesep)).join(result)

def normalize_text ( text , line_len = 80 , indent = '' , rest = False ) : if rest : normp = normalize_rest_paragraph else : normp = normalize_paragraph result = [ ] for text in _BLANKLINES_RGX . split ( text ) : result . append ( normp ( text , line_len , indent ) ) return ( '%s%s%s' % ( linesep , indent , linesep ) ) . join ( result )
normalize a text to display it with a maximum line size and optionally arbitrary indentation .