Set the given browser level selection to the one that matches with obj

        This is going to compare the internal_data of the model with the obj

        :param browser:
        :type browser:
        :param lvl: the depth level to set
        :type lvl: int
        :param obj: the object to compare the indexes with
        :type obj: object
        :returns: None
        :rtype: None
        :raises: None

def set_level(self, browser, lvl, obj):
        """Set the given browser level selection to the one that matches with obj

        This is going to compare the internal_data of the model with the obj

        :param browser:
        :type browser:
        :param lvl: the depth level to set
        :type lvl: int
        :param obj: the object to compare the indexes with
        :type obj: object
        :returns: None
        :rtype: None
        :raises: None
        """
        if lvl == 0:
            index = QtCore.QModelIndex()
            root = browser.model.root
            items = root.childItems
        else:
            index = browser.selected_indexes(lvl-1)[0]
            item = index.internalPointer()
            items = item.childItems
        for row, item in enumerate(items):
            data = item.internal_data()
            if data == obj:
                newindex = browser.model.index(row, 0, index)
                break
        else:
            raise ValueError("Could not select the given object in the browser. %s not found." % obj)
        browser.set_index(lvl, newindex)