<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add(self, text, checked=False, sort=None):
 """Add a new sub item to the list. This item must already be attached to a list. Args: text (str):
 The text. checked (bool):
 Whether this item is checked. sort (int):
 Item id for sorting. """

        if self.parent is None:
            raise exception.InvalidException('Item has no parent')
        node = self.parent.add(text, checked, sort)
        self.indent(node)
        return node