def is_prefetched(queryset: models.QuerySet, field: str) -> bool:
    "Checks if a field is being prefetched in the queryset"
    return field in queryset._prefetch_related_lookups
Checks if a field is being prefetched in the queryset
cvat/apps/engine/model_utils.py