#NEWLINE# def _flatten_json( json , result = None , path = ( ) ) : #NEWLINE# #INDENT# if ( result is None ) : #NEWLINE# #INDENT# result = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if isinstance ( json , dict ) : #NEWLINE# #INDENT# for ( key , value ) in json . items ( ) : #NEWLINE# #INDENT# _flatten_json ( value , result , ( path + ( key , ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( json , list ) : #NEWLINE# #INDENT# for ( i , value ) in enumerate ( json ) : #NEWLINE# #INDENT# _flatten_json ( value , result , ( path + ( i , ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# result [ path ] = json #NEWLINE# #UNINDENT# #UNINDENT# return result