#NEWLINE# def printjson( x , indent = 2 , level = 0 ) : #NEWLINE# #INDENT# if isinstance ( indent , int ) : #NEWLINE# #INDENT# indent = ( ' ' * indent ) #NEWLINE# #UNINDENT# x = getjson ( x ) #NEWLINE# if isinstance ( x , dict ) : #NEWLINE# #INDENT# ret = printjsonobject ( x , indent , level ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( x , list ) : #NEWLINE# #INDENT# if ( ( len ( x ) > 0 ) and isinstance ( getjson ( x [ 0 ] ) , dict ) ) : #NEWLINE# #INDENT# ret = printjsonobjectarray ( indent , indent , level ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret = printjsonsimplearray ( x , indent , level ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# ret = printjsonprimitive ( x ) #NEWLINE# #UNINDENT# #UNINDENT# if ( ( level == 0 ) and ret . startswith ( '\n' ) ) : #NEWLINE# #INDENT# ret = ret [ 1 : ] #NEWLINE# #UNINDENT# return ret