code: def set_category(self, category):
          
          # For some reason, packages only have the category name, not the
          # ID.
          if isinstance(category, Category):
              name = category.name
          else:
              name = category
          self.find("category").text = name
docs: Set package category
  
          Args:
              category: String of an existing category's name, or a
                  Category object.