#NEWLINE# def YamlDumper( aff4object ) : #NEWLINE# #INDENT# 'Dumps the given aff4object into a yaml representation.' #NEWLINE# aff4object . Flush ( ) #NEWLINE# result = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( attribute , values ) in aff4object . synced_attributes . items ( ) : #NEWLINE# #INDENT# result [ attribute . predicate ] = [ ] #NEWLINE# for value in attribute : #NEWLINE# #INDENT# value = value . ToRDFValue ( ) #NEWLINE# result [ attribute . predicate ] . append ( [ value . __class__ . __name__ , value . SerializeToString ( ) , str ( value . age ) ] ) #NEWLINE# #UNINDENT# #UNINDENT# return yaml . dump ( dict ( aff4_class = aff4object . __class__ . __name__ , _urn = aff4object . urn . SerializeToString ( ) , attributes = result , age_policy = aff4object . age_policy ) )