<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_child(self, child):
 """ Add a child to this node. """

        assert child != self
        child.parent = self
        child.ranks = self.ranks
        child.index = self.index
        assert child.tax_id not in self.index
        self.index[child.tax_id] = child
        self.children.add(child)