<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def OnMouseUp(self, event):
 """Generate a dropIndex. Process: check self.IsInControl, check self.IsDrag, HitTest, compare HitTest value The mouse can end up in 5 different places: Outside the Control On itself Above its starting point and on another item Below its starting point and on another item Below its starting point and not on another item """


        if not self.IsInControl:  # 1. Outside the control : Do Nothing
            self.IsDrag = False
        elif self.IsDrag:
            if not self.IsDrag:
                # In control and is a drag event : Determine Location
                self.hitIndex = self.HitTest(event.GetPosition())
                self.dropIndex = self.hitIndex[0]
                # Drop index indicates where the drop location is;
                # what index number

                # Determine dropIndex and its validity

                # 2. On itself or below control : Do Nothing
                if not (self.dropIndex == self.startIndex or
                        self.dropIndex == -1):
                    # Now that dropIndex has been established do 3 things
                    # 1. gather item data
                    # 2. delete item in list
                    # 3. insert item & it's data into the list at the new index

                    # dropList is a list of field values from the list control
                    dropList = []

                    thisItem = self.GetItem(self.startIndex)
                    for x in xrange(self.GetColumnCount()):
                        dropList.append(
                            self.GetItem(self.startIndex, x).GetText())
                    thisItem.SetId(self.dropIndex)
                    self.DeleteItem(self.startIndex)
                    self.InsertItem(thisItem)
                    for x in range(self.GetColumnCount()):
                        self.SetStringItem(self.dropIndex, x, dropList[x])
            # If in control but not a drag event : Do Nothing

        self.IsDrag = False
        event.Skip()