#NEWLINE# def Merge( self , first , second ) : #NEWLINE# #INDENT# "Merge two AFF4 objects and return a new object.\n\n    Args:\n      first: The first object (Can be None).\n      second: The second object (Can be None).\n\n    Returns:\n      A new object with the type of the latest object, but with both first and\n      second's attributes.\n    " #NEWLINE# if ( first is None ) : #NEWLINE# #INDENT# return second #NEWLINE# #UNINDENT# if ( second is None ) : #NEWLINE# #INDENT# return first #NEWLINE# #UNINDENT# if ( first . Get ( 'type' ) . age < second . Get ( 'type' ) . age ) : #NEWLINE# #INDENT# ( first , second ) = ( second , first ) #NEWLINE# #UNINDENT# for ( k , v ) in second . synced_attributes . iteritems ( ) : #NEWLINE# #INDENT# first . synced_attributes . setdefault ( k , [ ] ) . extend ( v ) #NEWLINE# #UNINDENT# for ( k , v ) in second . new_attributes . iteritems ( ) : #NEWLINE# #INDENT# first . new_attributes . setdefault ( k , [ ] ) . extend ( v ) #NEWLINE# #UNINDENT# return first