'Merge two sets using union merger
Args:
cmdset_a (Cmdset): Cmdset given higher priority in the case of a tie.
cmdset_b (Cmdset): Cmdset given lower priority in the case of a tie.
Returns:
cmdset_c (Cmdset): The result of A U B operation.
Notes:
Union, C = A U B,  means that C gets all elements from both A and B.'

def _union(self, cmdset_a, cmdset_b):

    cmdset_c = cmdset_a._duplicate()
    cmdset_c.commands = cmdset_a.commands[:]
    if (cmdset_a.duplicates and (cmdset_a.priority == cmdset_b.priority)):
        cmdset_c.commands.extend(cmdset_b.commands)
    else:
        cmdset_c.commands.extend([cmd for cmd in cmdset_b if (not (cmd in cmdset_a))])
    return cmdset_c
