def _depends_on(self, node_state, other, other_ctx_id):
        """
        returns True of other appears in this nodes dependency
        graph either directly or indirectly.

        Nodes are dependent on themselves for the purpose of this
        function.

        read as: self[node_state.ctx] depends on other[other_ctx]
        """
        try:
            return node_state.depends_on_cache[(other, other_ctx_id)]
        except KeyError:
            pass

        # do a breadth first search of the graph to find any callee
        # that matches the other node
        remaining_callees = cqueue()
        cqueue_push(remaining_callees, (node_state.ctx_id, self))

        seen = set()
        callee = cython.declare(MDFNode)
        callee_state = cython.declare(NodeState)
        ctx_id = cython.declare(int)
        while cqueue_len(remaining_callees) > 0:
            ctx_id, callee = remaining_callees.popleft()

            if (ctx_id, callee) in seen:
                continue
            seen.add((ctx_id, callee))

            if ctx_id == other_ctx_id and callee is other:
                node_state.depends_on_cache[(other, other_ctx_id)] = True
                return True

            try:
                callee_state = callee._states[ctx_id]
            except __HOLE__:
                continue

            # add the callees of this node to the search
            for ctx_id, callees in callee_state.callees.iteritems():
                for callee in callees:
                    cqueue_push(remaining_callees, (ctx_id, callee))

        node_state.depends_on_cache[(other, other_ctx_id)] = False
        return False
dataset/ETHPy150Open manahl/mdf/mdf/nodes.py/MDFNode._depends_on