def METHOD_NAME(self, category):
    categories = [category]
    for i in range(category.getNumChildren()):
        child = category.getChild(i)
        categories.append(self.METHOD_NAME(child))
    return categories