superannotate 4.4.31.dev2__tar.gz → 4.4.32__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {superannotate-4.4.31.dev2/src/superannotate.egg-info → superannotate-4.4.32}/PKG-INFO +1 -1
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/__init__.py +1 -1
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/interface/sdk_interface.py +20 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/serviceproviders.py +8 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/annotations.py +1 -1
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/items.py +46 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/annotation_adapter.py +1 -1
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/controller.py +14 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/services/explore.py +23 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/stream_data_handler.py +58 -41
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/utils.py +2 -2
- {superannotate-4.4.31.dev2 → superannotate-4.4.32/src/superannotate.egg-info}/PKG-INFO +1 -1
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/LICENSE +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/MANIFEST.in +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/README.rst +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/requirements.txt +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/setup.cfg +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/setup.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/analytics/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/analytics/aggregators.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/analytics/common.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/bin/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/bin/superannotate.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/common.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/exceptions.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/helpers.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/conversion.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/baseStrategy.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/coco_converters/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/coco_converters/coco_api.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/coco_converters/coco_converter.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/coco_converters/coco_strategies.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/coco_converters/coco_to_sa_pixel.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/coco_converters/coco_to_sa_vector.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/coco_converters/sa_pixel_to_coco.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/coco_converters/sa_vector_to_coco.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/converters.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/dataloop_converters/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/dataloop_converters/dataloop_helper.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/dataloop_converters/dataloop_strategies.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/dataloop_converters/dataloop_to_sa_vector.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/googlecloud_converters/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/googlecloud_converters/googlecloud_strategies.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/googlecloud_converters/googlecloud_to_sa_vector.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/labelbox_converters/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/labelbox_converters/labelbox_helper.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/labelbox_converters/labelbox_strategies.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/labelbox_converters/labelbox_to_sa_pixel.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/labelbox_converters/labelbox_to_sa_vector.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/sa_json_helper.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/sagemaker_converters/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/sagemaker_converters/sagemaker_strategies.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/sagemaker_converters/sagemaker_to_sa_pixel.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/sagemaker_converters/sagemaker_to_sa_vector.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/supervisely_converters/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/supervisely_converters/supervisely_helper.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/supervisely_converters/supervisely_strategies.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/supervisely_converters/supervisely_to_sa_pixel.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/supervisely_converters/supervisely_to_sa_vector.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/vgg_converters/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/vgg_converters/vgg_helper.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/vgg_converters/vgg_strategies.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/vgg_converters/vgg_to_sa_vector.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/voc_converters/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/voc_converters/voc_helper.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/voc_converters/voc_strategies.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/voc_converters/voc_to_sa_pixel.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/voc_converters/voc_to_sa_vector.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/vott_converters/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/vott_converters/vott_strategies.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/vott_converters/vott_to_sa_vector.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/yolo_converters/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/yolo_converters/yolo_strategies.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/converters/yolo_converters/yolo_to_sa_vector.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/export_from_sa_conversions.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/import_to_sa_conversions.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/input_converters/sa_conversion.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/interface/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/interface/base_interface.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/interface/cli_interface.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/interface/sdk/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/interface/sdk/folders.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/interface/sdk/project.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/interface/types.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/serializers.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/base_usecases.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/conditions.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/config.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/base.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/classes.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/filters.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/folder.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/integrations.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/items.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/project.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/project_entities.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/work_managament.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/enums.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/exceptions.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/jsx_conditions.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/plugin.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/pydantic_v1.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/reporter.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/repositories.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/response.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/service_types.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/types.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/base.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/classes.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/custom_fields.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/folders.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/images.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/integrations.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/models.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/projects.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/utils.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/video_convertor.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/custom_entities.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/helpers.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/query_builder.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/repositories.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/serviceprovider.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/services/__init__.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/services/annotation.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/services/annotation_class.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/services/folder.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/services/http_client.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/services/integration.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/services/item.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/services/item_service.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/services/project.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/services/work_management.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/validators.py +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate.egg-info/SOURCES.txt +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate.egg-info/dependency_links.txt +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate.egg-info/entry_points.txt +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate.egg-info/requires.txt +0 -0
- {superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate.egg-info/top_level.txt +0 -0
|
@@ -461,6 +461,16 @@ class SAClient(BaseInterfaceFacade, metaclass=TrackableMeta):
|
|
|
461
461
|
def pause_user_activity(
|
|
462
462
|
self, pk: Union[int, str], projects: Union[List[int], List[str], Literal["*"]]
|
|
463
463
|
):
|
|
464
|
+
"""
|
|
465
|
+
Block the team contributor from requesting items from the projects.
|
|
466
|
+
|
|
467
|
+
:param pk: The email address or user ID of the team contributor.
|
|
468
|
+
:type pk: str or int
|
|
469
|
+
|
|
470
|
+
:param projects: A list of project names or IDs from which the user should be blocked.
|
|
471
|
+
The special value "*" means block access to all projects
|
|
472
|
+
:type projects: Union[List[int], List[str], Literal["*"]]
|
|
473
|
+
"""
|
|
464
474
|
user = self.controller.work_management.get_user_metadata(pk=pk)
|
|
465
475
|
if user.role is not WMUserTypeEnum.Contributor:
|
|
466
476
|
raise AppException("User must have a contributor role to pause activity.")
|
|
@@ -474,6 +484,16 @@ class SAClient(BaseInterfaceFacade, metaclass=TrackableMeta):
|
|
|
474
484
|
def resume_user_activity(
|
|
475
485
|
self, pk: Union[int, str], projects: Union[List[int], List[str], Literal["*"]]
|
|
476
486
|
):
|
|
487
|
+
"""
|
|
488
|
+
Resume the team contributor from requesting items from the projects.
|
|
489
|
+
|
|
490
|
+
:param pk: The email address or user ID of the team contributor.
|
|
491
|
+
:type pk: str or int
|
|
492
|
+
|
|
493
|
+
:param projects: A list of project names or IDs from which the user should be resumed.
|
|
494
|
+
The special value "*" means resume access to all projects
|
|
495
|
+
:type projects: Union[List[int], List[str], Literal["*"]]
|
|
496
|
+
"""
|
|
477
497
|
user = self.controller.work_management.get_user_metadata(pk=pk)
|
|
478
498
|
if user.role is not WMUserTypeEnum.Contributor:
|
|
479
499
|
raise AppException("User must have a contributor role to resume activity.")
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/serviceproviders.py
RENAMED
|
@@ -672,6 +672,14 @@ class BaseExploreService(SuperannotateServiceProvider):
|
|
|
672
672
|
) -> ServiceResponse:
|
|
673
673
|
raise NotImplementedError
|
|
674
674
|
|
|
675
|
+
@abstractmethod
|
|
676
|
+
def query_item_count(
|
|
677
|
+
self,
|
|
678
|
+
project: entities.ProjectEntity,
|
|
679
|
+
query: str = None,
|
|
680
|
+
) -> ServiceResponse:
|
|
681
|
+
raise NotImplementedError
|
|
682
|
+
|
|
675
683
|
|
|
676
684
|
class BaseServiceProvider:
|
|
677
685
|
projects: BaseProjectService
|
|
@@ -2046,7 +2046,7 @@ class UploadMultiModalAnnotationsUseCase(BaseReportableUseCase):
|
|
|
2046
2046
|
f"annotations to the project {self._project.name}."
|
|
2047
2047
|
)
|
|
2048
2048
|
if not self._root_folder.is_root:
|
|
2049
|
-
if len(distributed_items) > 1 or
|
|
2049
|
+
if len(distributed_items) > 1 or "" not in distributed_items:
|
|
2050
2050
|
raise AppException(
|
|
2051
2051
|
"You can't include a folder when uploading from within a folder."
|
|
2052
2052
|
)
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/items.py
RENAMED
|
@@ -163,6 +163,52 @@ class QueryEntitiesUseCase(BaseReportableUseCase):
|
|
|
163
163
|
return self._response
|
|
164
164
|
|
|
165
165
|
|
|
166
|
+
class QueryEntitiesCountUseCase(BaseReportableUseCase):
|
|
167
|
+
def __init__(
|
|
168
|
+
self,
|
|
169
|
+
reporter: Reporter,
|
|
170
|
+
project: ProjectEntity,
|
|
171
|
+
service_provider: BaseServiceProvider,
|
|
172
|
+
query: str,
|
|
173
|
+
):
|
|
174
|
+
super().__init__(reporter)
|
|
175
|
+
self._project = project
|
|
176
|
+
self._service_provider = service_provider
|
|
177
|
+
self._query = query
|
|
178
|
+
|
|
179
|
+
def validate_arguments(self):
|
|
180
|
+
if self._query:
|
|
181
|
+
response = self._service_provider.explore.validate_saqul_query(
|
|
182
|
+
project=self._project, query=self._query
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
if not response.ok:
|
|
186
|
+
raise AppException(response.error)
|
|
187
|
+
if response.data["isValidQuery"]:
|
|
188
|
+
self._query = response.data["parsedQuery"]
|
|
189
|
+
else:
|
|
190
|
+
raise AppException("Incorrect query.")
|
|
191
|
+
else:
|
|
192
|
+
response = self._service_provider.explore.validate_saqul_query(
|
|
193
|
+
self._project, "-"
|
|
194
|
+
)
|
|
195
|
+
if not response.ok:
|
|
196
|
+
raise AppException(response.error)
|
|
197
|
+
|
|
198
|
+
def execute(self) -> Response:
|
|
199
|
+
if self.is_valid():
|
|
200
|
+
query_kwargs = {"query": self._query}
|
|
201
|
+
service_response = self._service_provider.explore.query_item_count(
|
|
202
|
+
self._project,
|
|
203
|
+
**query_kwargs,
|
|
204
|
+
)
|
|
205
|
+
if service_response.ok:
|
|
206
|
+
self._response.data = service_response.data
|
|
207
|
+
else:
|
|
208
|
+
self._response.errors = service_response.data
|
|
209
|
+
return self._response
|
|
210
|
+
|
|
211
|
+
|
|
166
212
|
class AssignItemsUseCase(BaseUseCase):
|
|
167
213
|
CHUNK_SIZE = 500
|
|
168
214
|
|
|
@@ -44,7 +44,7 @@ class BaseMultimodalAnnotationAdapter(ABC):
|
|
|
44
44
|
return None
|
|
45
45
|
|
|
46
46
|
def set_component_value(self, component_id: str, value: Any):
|
|
47
|
-
self.annotation
|
|
47
|
+
self.annotation.setdefault("data", {}).setdefault(component_id, {})["value"] = value
|
|
48
48
|
return self
|
|
49
49
|
|
|
50
50
|
|
|
@@ -1678,3 +1678,17 @@ class Controller(BaseController):
|
|
|
1678
1678
|
return ItemManager.process_response(
|
|
1679
1679
|
self.service_provider, items, project, folder, map_fields=False
|
|
1680
1680
|
)
|
|
1681
|
+
|
|
1682
|
+
def query_items_count(self, project_name: str, query: str = None) -> int:
|
|
1683
|
+
project = self.get_project(project_name)
|
|
1684
|
+
|
|
1685
|
+
use_case = usecases.QueryEntitiesCountUseCase(
|
|
1686
|
+
reporter=self.get_default_reporter(),
|
|
1687
|
+
project=project,
|
|
1688
|
+
query=query,
|
|
1689
|
+
service_provider=self.service_provider,
|
|
1690
|
+
)
|
|
1691
|
+
response = use_case.execute()
|
|
1692
|
+
if response.errors:
|
|
1693
|
+
raise AppException(response.errors)
|
|
1694
|
+
return response.data["count"]
|
|
@@ -10,6 +10,7 @@ from lib.core.service_types import ServiceResponse
|
|
|
10
10
|
from lib.core.service_types import SubsetListResponse
|
|
11
11
|
from lib.core.service_types import UploadCustomFieldValuesResponse
|
|
12
12
|
from lib.core.serviceproviders import BaseExploreService
|
|
13
|
+
from superannotate import AppException
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class ExploreService(BaseExploreService):
|
|
@@ -25,6 +26,7 @@ class ExploreService(BaseExploreService):
|
|
|
25
26
|
URL_UPLOAD_CUSTOM_VALUE = "custom/metadata/item"
|
|
26
27
|
URL_SAQUL_QUERY = "items/search"
|
|
27
28
|
URL_VALIDATE_SAQUL_QUERY = "items/parse/query"
|
|
29
|
+
URL_QUERY_COUNT = "items/count"
|
|
28
30
|
|
|
29
31
|
@property
|
|
30
32
|
def explore_service_url(self):
|
|
@@ -201,3 +203,24 @@ class ExploreService(BaseExploreService):
|
|
|
201
203
|
else:
|
|
202
204
|
response = ServiceResponse(status=200, res_data=[])
|
|
203
205
|
return response
|
|
206
|
+
|
|
207
|
+
def query_item_count(
|
|
208
|
+
self,
|
|
209
|
+
project: entities.ProjectEntity,
|
|
210
|
+
query: str = None,
|
|
211
|
+
) -> ServiceResponse:
|
|
212
|
+
|
|
213
|
+
params = {
|
|
214
|
+
"project_id": project.id,
|
|
215
|
+
"includeFolderNames": True,
|
|
216
|
+
}
|
|
217
|
+
data = {"query": query}
|
|
218
|
+
response = self.client.request(
|
|
219
|
+
urljoin(self.explore_service_url, self.URL_QUERY_COUNT),
|
|
220
|
+
"post",
|
|
221
|
+
params=params,
|
|
222
|
+
data=data,
|
|
223
|
+
)
|
|
224
|
+
if not response.ok:
|
|
225
|
+
raise AppException(response.error)
|
|
226
|
+
return response
|
|
@@ -2,7 +2,10 @@ import copy
|
|
|
2
2
|
import json
|
|
3
3
|
import logging
|
|
4
4
|
import os
|
|
5
|
+
import threading
|
|
6
|
+
import time
|
|
5
7
|
import typing
|
|
8
|
+
from functools import lru_cache
|
|
6
9
|
from typing import Callable
|
|
7
10
|
|
|
8
11
|
import aiohttp
|
|
@@ -24,6 +27,7 @@ logger = logging.getLogger("sa")
|
|
|
24
27
|
class StreamedAnnotations:
|
|
25
28
|
DELIMITER = "\\n;)\\n"
|
|
26
29
|
DELIMITER_LEN = len(DELIMITER)
|
|
30
|
+
VERIFY_SSL = False
|
|
27
31
|
|
|
28
32
|
def __init__(
|
|
29
33
|
self,
|
|
@@ -50,7 +54,6 @@ class StreamedAnnotations:
|
|
|
50
54
|
async def fetch(
|
|
51
55
|
self,
|
|
52
56
|
method: str,
|
|
53
|
-
session: AIOHttpSession,
|
|
54
57
|
url: str,
|
|
55
58
|
data: dict = None,
|
|
56
59
|
params: dict = None,
|
|
@@ -58,7 +61,9 @@ class StreamedAnnotations:
|
|
|
58
61
|
kwargs = {"params": params, "json": data}
|
|
59
62
|
if data:
|
|
60
63
|
kwargs["json"].update(data)
|
|
61
|
-
response = await
|
|
64
|
+
response = await self.get_session().request(
|
|
65
|
+
method, url, **kwargs, timeout=TIMEOUT
|
|
66
|
+
) # noqa
|
|
62
67
|
if not response.ok:
|
|
63
68
|
logger.error(response.text)
|
|
64
69
|
buffer = ""
|
|
@@ -86,6 +91,7 @@ class StreamedAnnotations:
|
|
|
86
91
|
"Invalid JSON detected in small annotations stream process."
|
|
87
92
|
)
|
|
88
93
|
else:
|
|
94
|
+
self.rest_session()
|
|
89
95
|
raise BackendError(
|
|
90
96
|
"Invalid JSON detected at the start of the small annotations stream process."
|
|
91
97
|
)
|
|
@@ -103,33 +109,47 @@ class StreamedAnnotations:
|
|
|
103
109
|
)
|
|
104
110
|
break
|
|
105
111
|
|
|
112
|
+
@lru_cache(maxsize=32)
|
|
113
|
+
def _get_session(self, thread_id, ttl=None): # noqa
|
|
114
|
+
del ttl
|
|
115
|
+
del thread_id
|
|
116
|
+
return AIOHttpSession(
|
|
117
|
+
headers=self._headers,
|
|
118
|
+
timeout=TIMEOUT,
|
|
119
|
+
connector=aiohttp.TCPConnector(
|
|
120
|
+
ssl=self.VERIFY_SSL, keepalive_timeout=2**32
|
|
121
|
+
),
|
|
122
|
+
raise_for_status=True,
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
def get_session(self):
|
|
126
|
+
return self._get_session(
|
|
127
|
+
thread_id=threading.get_ident(), ttl=round(time.time() / 360)
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
def rest_session(self):
|
|
131
|
+
self._get_session.cache_clear()
|
|
132
|
+
|
|
106
133
|
async def list_annotations(
|
|
107
134
|
self,
|
|
108
135
|
method: str,
|
|
109
136
|
url: str,
|
|
110
137
|
data: typing.List[int] = None,
|
|
111
138
|
params: dict = None,
|
|
112
|
-
verify_ssl=False,
|
|
113
139
|
):
|
|
114
140
|
params = copy.copy(params)
|
|
115
141
|
params["limit"] = len(data)
|
|
116
142
|
annotations = []
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
self._process_data(data),
|
|
128
|
-
params=copy.copy(params),
|
|
129
|
-
):
|
|
130
|
-
annotations.append(
|
|
131
|
-
self._callback(annotation) if self._callback else annotation
|
|
132
|
-
)
|
|
143
|
+
|
|
144
|
+
async for annotation in self.fetch(
|
|
145
|
+
method,
|
|
146
|
+
url,
|
|
147
|
+
self._process_data(data),
|
|
148
|
+
params=copy.copy(params),
|
|
149
|
+
):
|
|
150
|
+
annotations.append(
|
|
151
|
+
self._callback(annotation) if self._callback else annotation
|
|
152
|
+
)
|
|
133
153
|
|
|
134
154
|
return annotations
|
|
135
155
|
|
|
@@ -143,28 +163,22 @@ class StreamedAnnotations:
|
|
|
143
163
|
):
|
|
144
164
|
params = copy.copy(params)
|
|
145
165
|
params["limit"] = len(data)
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
self.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
self._store_annotation(
|
|
163
|
-
download_path,
|
|
164
|
-
annotation,
|
|
165
|
-
self._callback,
|
|
166
|
-
)
|
|
167
|
-
self._items_downloaded += 1
|
|
166
|
+
|
|
167
|
+
async for annotation in self.fetch(
|
|
168
|
+
method,
|
|
169
|
+
url,
|
|
170
|
+
self._process_data(data),
|
|
171
|
+
params=params,
|
|
172
|
+
):
|
|
173
|
+
self._annotations.append(
|
|
174
|
+
self._callback(annotation) if self._callback else annotation
|
|
175
|
+
)
|
|
176
|
+
self._store_annotation(
|
|
177
|
+
download_path,
|
|
178
|
+
annotation,
|
|
179
|
+
self._callback,
|
|
180
|
+
)
|
|
181
|
+
self._items_downloaded += 1
|
|
168
182
|
|
|
169
183
|
@staticmethod
|
|
170
184
|
def _store_annotation(path, annotation: dict, callback: Callable = None):
|
|
@@ -177,3 +191,6 @@ class StreamedAnnotations:
|
|
|
177
191
|
if data and self._map_function:
|
|
178
192
|
return self._map_function(data)
|
|
179
193
|
return data
|
|
194
|
+
|
|
195
|
+
def __del__(self):
|
|
196
|
+
self.rest_session()
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/utils.py
RENAMED
|
@@ -149,11 +149,11 @@ class RoleCache(BaseCachedWorkManagementRepository):
|
|
|
149
149
|
self._K_V_map[project.id] = {
|
|
150
150
|
"role_name_id_map": {
|
|
151
151
|
**{role["role"]["name"]: role["role_id"] for role in roles},
|
|
152
|
-
"ProjectAdmin": 3
|
|
152
|
+
"ProjectAdmin": 3,
|
|
153
153
|
},
|
|
154
154
|
"role_id_name_map": {
|
|
155
155
|
**{role["role_id"]: role["role"]["name"] for role in roles},
|
|
156
|
-
3: "ProjectAdmin"
|
|
156
|
+
3: "ProjectAdmin",
|
|
157
157
|
},
|
|
158
158
|
}
|
|
159
159
|
self._update_cache_timestamp(project.id)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/analytics/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/analytics/common.py
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/bin/__init__.py
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/bin/superannotate.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/interface/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/app/interface/types.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/base_usecases.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/__init__.py
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/base.py
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/classes.py
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/filters.py
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/folder.py
RENAMED
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/items.py
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/entities/project.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/jsx_conditions.py
RENAMED
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/pydantic_v1.py
RENAMED
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/repositories.py
RENAMED
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/service_types.py
RENAMED
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/__init__.py
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/base.py
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/classes.py
RENAMED
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/folders.py
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/images.py
RENAMED
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/models.py
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/usecases/projects.py
RENAMED
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/core/video_convertor.py
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate/lib/infrastructure/helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{superannotate-4.4.31.dev2 → superannotate-4.4.32}/src/superannotate.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|