def sever_segment_between_sockets(
        self,
        parent,
        child,
        signal_parent=True,
        signal_child=True,
    ):
        """Sever segment between given sockets.

        Also performs other needed tasks.

        Parameters
        ==========
        parent (graphman.socket.output.OutputSocket instance)
            parent socket.
        child (
             graphman.socket.input.InputSocket instance
          or graphman.socket.proxy.ProxySocket instance
        )
            child socket.
        signal_parent, signal_child (boolean)
            indicates whether a reference to the parent or child
            respectively must be stored so that the severance of
            the segment can be signaled to its node (this may be
            desirable to made the node aware of the segment's
            severance, in order to perform admin tasks if needed.
            The reason why the reference is kept for being signaled
            later is because when a severance is made, its effects can
            reposition other sockets and their segments, and end up
            severing other segments accidentally, hence the signaling
            being made later, so such effects only take place after
            the severance is performed.
        """
        ### begin by removing the child from the parent
        parent.children.remove(child)

        ### perform extra tasks depending on whether the
        ### parent still has children left or not

        if parent.children:

            ## update the parent's tree data to take into
            ## accound the removal of the child socket

            parent_id = parent.get_id()
            child_id = child.get_id()

            for parent_data in self.parent_sockets_data:

                if not parent_data["id"] == parent_id:
                    continue

                for child_data in parent_data["children"]:
                    if child_data["id"] == child_id:
                        break

                break

            parent_data["children"].remove(child_data)

        else:

            ## delete its children attribute
            del parent.children

            ## remove it from the list of existing parents
            self.parents.remove(parent)

            ## remove parent tree data, since it doesn't
            ## form a tree anymore (the socket alone isn't
            ## considered a valid tree, that is, the tree
            ## must have at least height 1)

            parent_id = parent.get_id()

            for parent_data in self.parent_sockets_data:

                if parent_data["id"] == parent_id:
                    break

            self.parent_sockets_data.remove(parent_data)

            ## if requested, store reference to parent, so its node is
            ## notified of the severance

            if signal_parent:
                self.parents_for_signaling.append(parent)

        ### the children must then have its 'parent'
        ### attribute removed
        del child.parent

        ### finally, if requested, the child must be stored
        ### so that its node can later be signaled about the
        ### severance we just performed

        if signal_child:
            self.children_for_signaling.append(child)
Sever segment between given sockets.

        Also performs other needed tasks.

        Parameters
        ==========
        parent (graphman.socket.output.OutputSocket instance)
            parent socket.
        child (
             graphman.socket.input.InputSocket instance
          or graphman.socket.proxy.ProxySocket instance
        )
            child socket.
        signal_parent, signal_child (boolean)
            indicates whether a reference to the parent or child
            respectively must be stored so that the severance of
            the segment can be signaled to its node (this may be
            desirable to made the node aware of the segment's
            severance, in order to perform admin tasks if needed.
            The reason why the reference is kept for being signaled
            later is because when a severance is made, its effects can
            reposition other sockets and their segments, and end up
            severing other segments accidentally, hence the signaling
            being made later, so such effects only take place after
            the severance is performed.
        
nodezator/graphman/socketparenthood/support.py