#NEWLINE# def construct_mapping( self , node , deep = False ) : #NEWLINE# #INDENT# if isinstance ( node , yaml . MappingNode ) : #NEWLINE# #INDENT# self . flatten_mapping ( node ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise yaml . constructor . ConstructorError ( None , None , ( 'expected a mapping node, but found %s' % node . id ) , node . start_mark ) #NEWLINE# #UNINDENT# mapping = OrderedDict ( ) #NEWLINE# for ( key_node , value_node ) in node . value : #NEWLINE# #INDENT# key = self . construct_object ( key_node , deep = deep ) #NEWLINE# try : #NEWLINE# #INDENT# hash ( key ) #NEWLINE# #UNINDENT# except TypeError as exc : #NEWLINE# #INDENT# raise yaml . constructor . ConstructorError ( 'while constructing a mapping' , node . start_mark , ( 'found unacceptable key (%s)' % exc ) , key_node . start_mark ) #NEWLINE# #UNINDENT# value = self . construct_object ( value , deep = deep ) #NEWLINE# mapping [ key ] = value #NEWLINE# #UNINDENT# return mapping