#NEWLINE# def val_to_py( val ) : #NEWLINE# #INDENT# 'Convert a json ovsdb return value to native python object' #NEWLINE# if ( isinstance ( val , collections . Sequence ) and ( len ( val ) == 2 ) ) : #NEWLINE# #INDENT# if ( val [ 0 ] == 'uuid' ) : #NEWLINE# #INDENT# return uuid . UUID ( val [ 1 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( val [ 0 ] == 'set' ) : #NEWLINE# #INDENT# return [ val_to_py ( x ) for x in val [ 1 ] ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( y [ 0 ] == 'map' ) : #NEWLINE# #INDENT# return { val_to_py ( x ) : val_to_py ( y ) for ( x , y ) in val [ 1 ] } #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return val