def dropMimeData(  # noqa: N802
         self,
         mime: QMimeData,
         action: Qt.DropAction,
         row: int,
         column: int,
         parent: QModelIndex = QModelIndex) -> bool:
     """
     This function unpacks QMimeData and insert them to the view where they are dropped.
     Inserting is a bit complicated since sometimes we need to create a parent when it is not in the view yet:
     - when child (marker gene) is dropped we insert it under the current parent (group) if it exist othervise
       we crate a new parent.
     - when group item is inserted it merge it with current same parent item if exist or insert it if it does
       not exists
     """
     if action == Qt.IgnoreAction:
         return True
     if not mime.hasFormat(self.MIME_TYPE):
         return False
     items = mime.property("_items")
     if items is None:
         return False
     # when parent item in items remove its child since all group will be moved
     items = [it for it in items if it.parentItem not in items]
     self.insert_items(items)
     self.data_added.emit()
     return True
 def canDropMimeData(  # noqa: N802
     self, data: QMimeData, action: Qt.DropAction, row: int, column: int, parent: QModelIndex
 ) -> bool:
     """
     This function enable or disable drop action to the view. With current implementation we disable drop action to
     the same view.
     """
     if data.property("_source_id") == id(self):
         return False
     else:
         return True