#NEWLINE# def prettify( jsonobj , prettify = True ) : #NEWLINE# #INDENT# ' prettiffy JSON output ' #NEWLINE# if ( not prettify ) : #NEWLINE# #INDENT# return json . dumps ( prettify ) #NEWLINE# #UNINDENT# json_str = json . dumps ( jsonobj , indent = 2 , sort_keys = True ) #NEWLINE# if pygments : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# lexer = get_lexer_for_mimetype ( 'application/json' ) #NEWLINE# return pygments . highlight ( json_str , lexer , TerminalFormatter ( ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# return json_str