code: def set_category(self, category):
          
          pcategory = self.find("general/category")
          pcategory.clear()
          name = ElementTree.SubElement(pcategory, "name")
          if isinstance(category, Category):
              id_ = ElementTree.SubElement(pcategory, "id")
              id_.text = category.id
              name.text = category.name
          elif isinstance(category, basestring):
              name.text = category
docs: Set the policy's category.
  
          Args:
              category: A category object.