<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_project(self, path, ensure_uniqueness=False):
 """ Registers given path in the Model as a project. :param path: Project path to register. :type path: unicode :param ensure_uniqueness: Ensure registrar uniqueness. :type ensure_uniqueness: bool :return: ProjectNode. :rtype: ProjectNode """


        if ensure_uniqueness:
            if self.get_project_nodes(path):
                raise foundations.exceptions.ProgrammingError("{0} | '{1}' project is already registered!".format(
                    self.__class__.__name__, path))

        LOGGER.debug("> Registering '{0}' project.".format(path))

        row = self.root_node.children_count()
        self.beginInsertRows(self.get_node_index(self.root_node, ), row, row)
        project_node = ProjectNode(name=os.path.basename(path),
                                   path=path,
                                   parent=self.root_node)
        self.endInsertRows()

        self.project_registered.emit(project_node)

        return project_node