<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(self, node):
 """ Deletes given Node associated path. :param node: Node. :type node: ProjectNode or DirectoryNode or FileNode :return: Method success. :rtype: bool """


        path = node.path
        if self.__script_editor.model.is_authoring_node(node):
            if not foundations.common.path_exists(path):
                return False

        if message_box.message_box("Question", "Question",
                                   "Are you sure you want to delete '{0}' {1}?".format(
                                           path, "file" if os.path.isfile(path) else "directory"),
                                   buttons=QMessageBox.Yes | QMessageBox.No) == QMessageBox.Yes:
            if os.path.isfile(path):
                LOGGER.info("{0} | Deleting '{1}' file!".format(self.__class__.__name__, path))
                self.__delete_file(path)
            else:
                LOGGER.info("{0} | Deleting '{1}' directory!".format(self.__class__.__name__, path))
                self.__delete_directory(path)
        return True