label_studio/projects/functions/next_task.py
def _try_ground_truth(tasks, project, user):
    """Returns task from ground truth set"""
    ground_truth = Annotation.objects.filter(task=OuterRef('pk'), ground_truth=True)
    not_solved_tasks_with_ground_truths = tasks.annotate(has_ground_truths=Exists(ground_truth)).filter(
        has_ground_truths=True
    )
    if not_solved_tasks_with_ground_truths.exists():
        if project.sampling == project.SEQUENCE:
            return _get_first_unlocked(not_solved_tasks_with_ground_truths, user)
        return _get_random_unlocked(not_solved_tasks_with_ground_truths, user)
Returns task from ground truth set
Returns task from ground truth set
Returns task from ground truth set
def _try_ground_truth(tasks, project, user):
    ground_truth = Annotation.objects.filter(task=OuterRef('pk'), ground_truth=True)
    not_solved_tasks_with_ground_truths = tasks.annotate(has_ground_truths=Exists(ground_truth)).filter(
        has_ground_truths=True
    )
    if not_solved_tasks_with_ground_truths.exists():
        if project.sampling == project.SEQUENCE:
            return _get_first_unlocked(not_solved_tasks_with_ground_truths, user)
        return _get_random_unlocked(not_solved_tasks_with_ground_truths, user)
def _try_ground_truth ( tasks , project , user ) : ground_truth = Annotation . objects . filter ( task = OuterRef ( 'pk' ) , ground_truth = True ) not_solved_tasks_with_ground_truths = tasks . annotate ( has_ground_truths = Exists ( ground_truth ) ) . filter ( has_ground_truths = True ) if not_solved_tasks_with_ground_truths . exists ( ) : if project . sampling == project . SEQUENCE : return _get_first_unlocked ( not_solved_tasks_with_ground_truths , user ) return _get_random_unlocked ( not_solved_tasks_with_ground_truths , user )
Returns task from ground truth set
Returns task from ground truth set
"""Returns task from ground truth set"""
tasks
project
user