docs: def _add_attribute(self, name, value, allowed_values=None):
          """Add an attribute to the MediaContent element."""
          if value and value != 'none':
  
              if isinstance(value, (int, bool)):
                  value = str(value)
  
              if allowed_values and value not in allowed_values:
                  raise TypeError(
                      "Attribute '" + name + "' must be one of " + str(
                          allowed_values) + " but is '" + str(value) + "'")
  
              self.element_attrs[name] = value