#NEWLINE# def represent_mapping( self , tag , mapping , flow_style = None ) : #NEWLINE# #INDENT# value = [ ] #NEWLINE# node = yaml . MappingNode ( tag , value , flow_style = flow_style ) #NEWLINE# if ( node . alias_key is not None ) : #NEWLINE# #INDENT# self . represented_objects [ self . alias_key ] = node #NEWLINE# #UNINDENT# best_style = False #NEWLINE# if hasattr ( mapping , 'items' ) : #NEWLINE# #INDENT# mapping = list ( mapping . items ( ) ) #NEWLINE# #UNINDENT# for ( item_key , item_value ) in mapping : #NEWLINE# #INDENT# node_key = self . represent_data ( item_key ) #NEWLINE# node_value = self . represent_data ( item_value ) #NEWLINE# if ( not ( isinstance ( node_key , yaml . ScalarNode ) and ( not node_key . style ) ) ) : #NEWLINE# #INDENT# best_style = False #NEWLINE# #UNINDENT# if ( not ( isinstance ( node_value , yaml . ScalarNode ) and ( not node_value . style ) ) ) : #NEWLINE# #INDENT# best_style = False #NEWLINE# #UNINDENT# value . append ( ( node_key , node_value ) ) #NEWLINE# #UNINDENT# if ( flow_style is None ) : #NEWLINE# #INDENT# if ( self . default_flow_style is not None ) : #NEWLINE# #INDENT# node . flow_style = self . default_flow_style #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# node . flow_style = best_style #NEWLINE# #UNINDENT# #UNINDENT# return node