code: def merge_tags(left, right, factory=Tags):
      
  
      if isinstance(left, Mapping):
          tags = dict(left)
      elif hasattr(left, 'tags'):
          tags = _tags_to_dict(left.tags)
      else:
          tags = _tags_to_dict(left)
  
      if isinstance(right, Mapping):
          tags.update(right)
      elif hasattr(left, 'tags'):
          tags.update(_tags_to_dict(right.tags))
      else:
          tags.update(_tags_to_dict(right))
  
      return factory(**tags)
docs: Merge two sets of tags into a new troposphere object
  
      Args:
          left (Union[dict, troposphere.Tags]): dictionary or Tags object to be
              merged with lower priority
          right (Union[dict, troposphere.Tags]): dictionary or Tags object to be
              merged with higher priority
          factory (type): Type of object to create. Defaults to the troposphere
              Tags class.