def _one_line_summary_from_text(text, length=78, escapes={'\n': '\\n', '\r': '\\r', ' DCTB ': '\\t'}):
 if (len(text) > length):
  head = text[:(length - 3)]
 else:
  head = text
 escaped = _escaped_text_from_text(head, escapes)
 if (len(text) > length):
  summary = (escaped[:(length - 3)] + '...')
 else:
  summary = escaped
 return summary

def _one_line_summary_from_text ( text , length = 78 , escapes = { '\n' : '\\n' , '\r' : '\\r' , ' DCTB ' : '\\t' } ) : if ( len ( text ) > length ) : head = text [ : ( length - 3 ) ] else : head = text escaped = _escaped_text_from_text ( head , escapes ) if ( len ( text ) > length ) : summary = ( escaped [ : ( length - 3 ) ] + '...' ) else : summary = escaped return summary
summarize the given text with one line of the given length .