<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _tristate_parent(self, item):
 """ Put the box of item in tristate and change the state of the boxes of item's ancestors accordingly. """

        self.change_state(item, "tristate")
        parent = self.parent(item)
        if parent:
            self._tristate_parent(parent)