def METHOD_NAME(self, items, on_desktop):
    # Create item (script/phrase) section
    if cm.ConfigManager.SETTINGS[cm_constants.SORT_BY_USAGE_COUNT]:
        items.sort(key=lambda obj: obj.usageCount, reverse=True)
    else:
        items.sort(key=lambda obj: str(obj))
    for item in items:
        if on_desktop:
            self._add_item(item.get_description(self.service.lastStackState), item)
        else:
            self._add_item(item.description, item)