<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def leaf_count(self):
 """ The number of leaf category nodes under this category. Returns 1 if this category has no sub-categories. """

        if not self._sub_categories:
            return 1
        return sum(category.leaf_count for category in self._sub_categories)