<s> def pptable ( table ) : <EOL> head = table [ '<STR_LIT>' ] <EOL> body = table [ '<STR_LIT:body>' ] <EOL> pretty_head = [ <EOL> '<STR_LIT:+>' + '<STR_LIT:+>' . join ( [ '<STR_LIT>' . format ( '<STR_LIT>' ) for n in head ] ) + '<STR_LIT:+>' , <EOL> '<STR_LIT:|>' + '<STR_LIT:|>' . join ( [ '<STR_LIT>' . format ( str ( n ) [ - <NUM_LIT> : ] ) for n in head ] ) + '<STR_LIT:|>' , <EOL> '<STR_LIT:+>' + '<STR_LIT:+>' . join ( [ '<STR_LIT>' . format ( '<STR_LIT>' ) for n in head ] ) + '<STR_LIT:+>' , <EOL> ] <EOL> pretty_body = [ ] <EOL> for row in body : <EOL> pretty_body . append ( <EOL> '<STR_LIT:|>' + '<STR_LIT:|>' . join ( [ '<STR_LIT>' . format ( str ( n ) [ - <NUM_LIT> : ] ) for n in row ] ) + '<STR_LIT:|>' , <EOL> ) <EOL> pretty_body . append ( <EOL> '<STR_LIT:+>' + '<STR_LIT:+>' . join ( [ '<STR_LIT>' . format ( '<STR_LIT>' ) for n in head ] ) + '<STR_LIT:+>' , <EOL> ) <EOL> prettytable = '<STR_LIT:\n>' . join ( <EOL> pretty_head + pretty_body <EOL> ) <EOL> print ( prettytable ) </s>
