def remove(self, op: Operation):
        """
        Remove an op from the data structure.
        """
        node = self.op_to_node[op]
        prev_node, next_node = node.prev, node.next

        # reconnect the linked list
        if prev_node is None:
            self.start = next_node
        else:
            prev_node.next = next_node

        if next_node is None:
            self.end = prev_node
        else:
            next_node.prev = prev_node

        node.prev = node.next = self.INVALID_NODE

        # remove op from the cache
        del self.op_to_node[op]

        Remove an op from the data structure.
        
coremltools/converters/mil/mil/utils.py