def btnstate(self, item= None):
        """ Function to handle difficult examples
        Update on each object """
        if not self.canvas.editing():
            return

        item = self.currentItem()
        if not item: # If not selected Item, take the first one
            item = self.labelList.item(self.labelList.count()-1)

        difficult = self.diffcButton.isChecked()

        try:
            shape = self.itemsToShapes[item]
        except:
            pass
        # Checked and Update
        try:
            if difficult != shape.difficult:
                shape.difficult = difficult
                self.setDirty()
            else:  # User probably changed item visibility
                self.canvas.setShapeVisible(shape, item.checkState() == Qt.Checked)
        except:
            pass
def btnstate ( self , item = None ) : if not self . canvas . editing ( ) : return item = self . currentItem ( ) if not item : item = self . labelList . item ( self . labelList . count ( ) - 1 ) difficult = self . diffcButton . isChecked ( ) try : shape = self . itemsToShapes [ item ] except : pass try : if difficult != shape . difficult : shape . difficult = difficult self . setDirty ( ) else : self . canvas . setShapeVisible ( shape , item . checkState ( ) == Qt . Checked ) except : pass
Function to handle difficult examples
        Update on each object