code: def set_tag(self, key, value, update_session=True):
          
          existing_tags = {x.key: x for x in self.tags}
          if key in existing_tags:
              tag = existing_tags[key]
  
              if tag.value == value:
                  return False
  
              tag.value = value
          else:
              tag = Tag()
              tag.resource_id = self.id
              tag.key = key
              tag.value = value
              self.tags.append(tag)
  
          if update_session:
              db.session.add(tag)
          return True
docs: Create or set the value of the tag with `key` to `value`. Returns `True` if the tag was created or updated or
          `False` if there were no changes to be made.
  
          Args:
              key (str): Key of the tag
              value (str): Value of the tag
              update_session (bool): Automatically add the change to the SQLAlchemy session. Default: True
  
          Returns:
              `bool`