MCPcopy Create free account
hub / github.com/HumanSignal/label-studio / annotators

Method annotators

label_studio/projects/models.py:956–977  ·  view source on GitHub ↗

Annotators connected to this project including team members

(self)

Source from the content-addressed store, hash-verified

954 return hasattr(self, 'team_link') and self.team_link.team.has_user(user)
955
956 def annotators(self):
957 """Annotators connected to this project including team members"""
958 from users.models import User
959
960 member_ids = self.get_member_ids()
961 team_members = User.objects.filter(id__in=member_ids).order_by('email')
962
963 # add members from invited projects
964 project_member_ids = self.members.values_list('user__id', flat=True)
965 project_members = User.objects.filter(id__in=project_member_ids)
966
967 annotators = team_members | project_members
968
969 # set annotator.team_member=True if annotator is not an invited user
970 annotators = annotators.annotate(
971 team_member=Case(
972 When(id__in=project_member_ids, then=Value(False)),
973 default=Value(True),
974 output_field=BooleanField(),
975 )
976 )
977 return annotators
978
979 def annotators_with_annotations(self, min_count=500):
980 """Annotators with annotation number > min_number

Callers 2

Calls 2

get_member_idsMethod · 0.95
filterMethod · 0.80

Tested by

no test coverage detected