@classmethod
def delete_token_and_descendents(cls, token):
    """
        Yup, don't understand this.

        TODO:
            - Understand this.

        :type token: Token
        """
    from py_rete.negative_node import NegativeNode
    from py_rete.ncc_node import NccPartnerNode, NccNode
    for child in token.children:
        cls.delete_token_and_descendents(child)
    if not isinstance(token.node, NccPartnerNode):
        token.node.items.remove(token)
    if token.wme:
        token.wme.tokens.remove(token)
    if token.parent:
        token.parent.children.remove(token)
    if isinstance(token.node, NegativeNode):
        for jr in token.join_results:
            jr.wme.negative_join_results.remove(jr)
    elif isinstance(token.node, NccNode):
        for result_tok in token.ncc_results:
            result_tok.wme.tokens.remove(result_tok)
            result_tok.parent.children.remove(result_tok)
    elif isinstance(token.node, NccPartnerNode):
        token.owner.ncc_results.remove(token)
        if not token.owner.ncc_results:
            for child in token.node.ncc_node.children:
                child.left_activation(token.owner, None)
