#NEWLINE# def _union( self , cmdset_a , cmdset_b ) : #NEWLINE# #INDENT# '\n        Merge two sets using union merger\n\n        Args:\n            cmdset_a (Cmdset): Cmdset given higher priority in the case of a tie.\n            cmdset_b (Cmdset): Cmdset given lower priority in the case of a tie.\n\n        Returns:\n            cmdset_c (Cmdset): The result of A U B operation.\n\n        Notes:\n            Union, C = A U B,  means that C gets all elements from both A and B.\n\n        ' #NEWLINE# cmdset_c = cmdset_a . _duplicate ( ) #NEWLINE# cmdset_c . commands = cmdset_a . commands [ : ] #NEWLINE# if ( cmdset_a . duplicates and ( cmdset_a . priority == cmdset_b . priority ) ) : #NEWLINE# #INDENT# cmdset_c . commands . extend ( cmdset_b . commands ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cmdset_c . commands . extend ( [ cmd for cmd in cmdset_b if ( not ( cmd in cmdset_a ) ) ] ) #NEWLINE# #UNINDENT# return cmdset_c