def METHOD_NAME(self, endpoints):
    currentGroupId = 0
    groupIdsArray = endpoints.GetCellData().GetArray(self.GroupIdsArrayName)
    for i in range(groupIdsArray.GetNumberOfTuples()):
        minGroupId = sys.maxsize # int is unbounded in Python 3
        for j in range(groupIdsArray.GetNumberOfTuples()):
            groupId = groupIdsArray.GetValue(j)
            if groupId < minGroupId and groupId >= currentGroupId:
                minGroupId = groupId
        for j in range(groupIdsArray.GetNumberOfTuples()):
            if groupIdsArray.GetValue(j) == minGroupId:
                groupIdsArray.SetValue(j,currentGroupId)
        currentGroupId += 1