<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete_prefix(self, name):
 # noqa: D302 r""" Delete hierarchy levels from all nodes in the tree. :param nodes: Prefix to delete :type nodes: :ref:`NodeName` :raises: * RuntimeError (Argument \`name\` is not a valid prefix) * RuntimeError (Argument \`name\` is not valid) For example: hello/world/root ├anode (*) ├bnode (*) │└anode (*) └cnode (*) └anode └leaf (*) root ├anode (*) ├bnode (*) │└anode (*) └cnode (*) └anode └leaf (*) """

        if self._validate_node_name(name):
            raise RuntimeError("Argument `name` is not valid")
        if (not self.root_name.startswith(name)) or (self.root_name == name):
            raise RuntimeError("Argument `name` is not a valid prefix")
        self._delete_prefix(name)