dtlpy 1.113.10__py3-none-any.whl → 1.114.13__py3-none-any.whl

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.
Files changed (243) hide show
  1. dtlpy/__init__.py +488 -488
  2. dtlpy/__version__.py +1 -1
  3. dtlpy/assets/__init__.py +26 -26
  4. dtlpy/assets/__pycache__/__init__.cpython-38.pyc +0 -0
  5. dtlpy/assets/code_server/config.yaml +2 -2
  6. dtlpy/assets/code_server/installation.sh +24 -24
  7. dtlpy/assets/code_server/launch.json +13 -13
  8. dtlpy/assets/code_server/settings.json +2 -2
  9. dtlpy/assets/main.py +53 -53
  10. dtlpy/assets/main_partial.py +18 -18
  11. dtlpy/assets/mock.json +11 -11
  12. dtlpy/assets/model_adapter.py +83 -83
  13. dtlpy/assets/package.json +61 -61
  14. dtlpy/assets/package_catalog.json +29 -29
  15. dtlpy/assets/package_gitignore +307 -307
  16. dtlpy/assets/service_runners/__init__.py +33 -33
  17. dtlpy/assets/service_runners/converter.py +96 -96
  18. dtlpy/assets/service_runners/multi_method.py +49 -49
  19. dtlpy/assets/service_runners/multi_method_annotation.py +54 -54
  20. dtlpy/assets/service_runners/multi_method_dataset.py +55 -55
  21. dtlpy/assets/service_runners/multi_method_item.py +52 -52
  22. dtlpy/assets/service_runners/multi_method_json.py +52 -52
  23. dtlpy/assets/service_runners/single_method.py +37 -37
  24. dtlpy/assets/service_runners/single_method_annotation.py +43 -43
  25. dtlpy/assets/service_runners/single_method_dataset.py +43 -43
  26. dtlpy/assets/service_runners/single_method_item.py +41 -41
  27. dtlpy/assets/service_runners/single_method_json.py +42 -42
  28. dtlpy/assets/service_runners/single_method_multi_input.py +45 -45
  29. dtlpy/assets/voc_annotation_template.xml +23 -23
  30. dtlpy/caches/base_cache.py +32 -32
  31. dtlpy/caches/cache.py +473 -473
  32. dtlpy/caches/dl_cache.py +201 -201
  33. dtlpy/caches/filesystem_cache.py +89 -89
  34. dtlpy/caches/redis_cache.py +84 -84
  35. dtlpy/dlp/__init__.py +20 -20
  36. dtlpy/dlp/cli_utilities.py +367 -367
  37. dtlpy/dlp/command_executor.py +764 -764
  38. dtlpy/dlp/dlp +1 -1
  39. dtlpy/dlp/dlp.bat +1 -1
  40. dtlpy/dlp/dlp.py +128 -128
  41. dtlpy/dlp/parser.py +651 -651
  42. dtlpy/entities/__init__.py +83 -83
  43. dtlpy/entities/analytic.py +311 -311
  44. dtlpy/entities/annotation.py +1879 -1879
  45. dtlpy/entities/annotation_collection.py +699 -699
  46. dtlpy/entities/annotation_definitions/__init__.py +20 -20
  47. dtlpy/entities/annotation_definitions/base_annotation_definition.py +100 -100
  48. dtlpy/entities/annotation_definitions/box.py +195 -195
  49. dtlpy/entities/annotation_definitions/classification.py +67 -67
  50. dtlpy/entities/annotation_definitions/comparison.py +72 -72
  51. dtlpy/entities/annotation_definitions/cube.py +204 -204
  52. dtlpy/entities/annotation_definitions/cube_3d.py +149 -149
  53. dtlpy/entities/annotation_definitions/description.py +32 -32
  54. dtlpy/entities/annotation_definitions/ellipse.py +124 -124
  55. dtlpy/entities/annotation_definitions/free_text.py +62 -62
  56. dtlpy/entities/annotation_definitions/gis.py +69 -69
  57. dtlpy/entities/annotation_definitions/note.py +139 -139
  58. dtlpy/entities/annotation_definitions/point.py +117 -117
  59. dtlpy/entities/annotation_definitions/polygon.py +182 -182
  60. dtlpy/entities/annotation_definitions/polyline.py +111 -111
  61. dtlpy/entities/annotation_definitions/pose.py +92 -92
  62. dtlpy/entities/annotation_definitions/ref_image.py +86 -86
  63. dtlpy/entities/annotation_definitions/segmentation.py +240 -240
  64. dtlpy/entities/annotation_definitions/subtitle.py +34 -34
  65. dtlpy/entities/annotation_definitions/text.py +85 -85
  66. dtlpy/entities/annotation_definitions/undefined_annotation.py +74 -74
  67. dtlpy/entities/app.py +220 -220
  68. dtlpy/entities/app_module.py +107 -107
  69. dtlpy/entities/artifact.py +174 -174
  70. dtlpy/entities/assignment.py +399 -399
  71. dtlpy/entities/base_entity.py +214 -214
  72. dtlpy/entities/bot.py +113 -113
  73. dtlpy/entities/codebase.py +296 -296
  74. dtlpy/entities/collection.py +38 -38
  75. dtlpy/entities/command.py +169 -169
  76. dtlpy/entities/compute.py +442 -442
  77. dtlpy/entities/dataset.py +1285 -1285
  78. dtlpy/entities/directory_tree.py +44 -44
  79. dtlpy/entities/dpk.py +470 -470
  80. dtlpy/entities/driver.py +222 -222
  81. dtlpy/entities/execution.py +397 -397
  82. dtlpy/entities/feature.py +124 -124
  83. dtlpy/entities/feature_set.py +145 -145
  84. dtlpy/entities/filters.py +641 -641
  85. dtlpy/entities/gis_item.py +107 -107
  86. dtlpy/entities/integration.py +184 -184
  87. dtlpy/entities/item.py +953 -953
  88. dtlpy/entities/label.py +123 -123
  89. dtlpy/entities/links.py +85 -85
  90. dtlpy/entities/message.py +175 -175
  91. dtlpy/entities/model.py +694 -691
  92. dtlpy/entities/node.py +1005 -1005
  93. dtlpy/entities/ontology.py +803 -803
  94. dtlpy/entities/organization.py +287 -287
  95. dtlpy/entities/package.py +657 -657
  96. dtlpy/entities/package_defaults.py +5 -5
  97. dtlpy/entities/package_function.py +185 -185
  98. dtlpy/entities/package_module.py +113 -113
  99. dtlpy/entities/package_slot.py +118 -118
  100. dtlpy/entities/paged_entities.py +290 -267
  101. dtlpy/entities/pipeline.py +593 -593
  102. dtlpy/entities/pipeline_execution.py +279 -279
  103. dtlpy/entities/project.py +394 -394
  104. dtlpy/entities/prompt_item.py +499 -499
  105. dtlpy/entities/recipe.py +301 -301
  106. dtlpy/entities/reflect_dict.py +102 -102
  107. dtlpy/entities/resource_execution.py +138 -138
  108. dtlpy/entities/service.py +958 -958
  109. dtlpy/entities/service_driver.py +117 -117
  110. dtlpy/entities/setting.py +294 -294
  111. dtlpy/entities/task.py +491 -491
  112. dtlpy/entities/time_series.py +143 -143
  113. dtlpy/entities/trigger.py +426 -426
  114. dtlpy/entities/user.py +118 -118
  115. dtlpy/entities/webhook.py +124 -124
  116. dtlpy/examples/__init__.py +19 -19
  117. dtlpy/examples/add_labels.py +135 -135
  118. dtlpy/examples/add_metadata_to_item.py +21 -21
  119. dtlpy/examples/annotate_items_using_model.py +65 -65
  120. dtlpy/examples/annotate_video_using_model_and_tracker.py +75 -75
  121. dtlpy/examples/annotations_convert_to_voc.py +9 -9
  122. dtlpy/examples/annotations_convert_to_yolo.py +9 -9
  123. dtlpy/examples/convert_annotation_types.py +51 -51
  124. dtlpy/examples/converter.py +143 -143
  125. dtlpy/examples/copy_annotations.py +22 -22
  126. dtlpy/examples/copy_folder.py +31 -31
  127. dtlpy/examples/create_annotations.py +51 -51
  128. dtlpy/examples/create_video_annotations.py +83 -83
  129. dtlpy/examples/delete_annotations.py +26 -26
  130. dtlpy/examples/filters.py +113 -113
  131. dtlpy/examples/move_item.py +23 -23
  132. dtlpy/examples/play_video_annotation.py +13 -13
  133. dtlpy/examples/show_item_and_mask.py +53 -53
  134. dtlpy/examples/triggers.py +49 -49
  135. dtlpy/examples/upload_batch_of_items.py +20 -20
  136. dtlpy/examples/upload_items_and_custom_format_annotations.py +55 -55
  137. dtlpy/examples/upload_items_with_modalities.py +43 -43
  138. dtlpy/examples/upload_segmentation_annotations_from_mask_image.py +44 -44
  139. dtlpy/examples/upload_yolo_format_annotations.py +70 -70
  140. dtlpy/exceptions.py +125 -125
  141. dtlpy/miscellaneous/__init__.py +20 -20
  142. dtlpy/miscellaneous/dict_differ.py +95 -95
  143. dtlpy/miscellaneous/git_utils.py +217 -217
  144. dtlpy/miscellaneous/json_utils.py +14 -14
  145. dtlpy/miscellaneous/list_print.py +105 -105
  146. dtlpy/miscellaneous/zipping.py +130 -130
  147. dtlpy/ml/__init__.py +20 -20
  148. dtlpy/ml/base_feature_extractor_adapter.py +27 -27
  149. dtlpy/ml/base_model_adapter.py +945 -940
  150. dtlpy/ml/metrics.py +461 -461
  151. dtlpy/ml/predictions_utils.py +274 -274
  152. dtlpy/ml/summary_writer.py +57 -57
  153. dtlpy/ml/train_utils.py +60 -60
  154. dtlpy/new_instance.py +252 -252
  155. dtlpy/repositories/__init__.py +56 -56
  156. dtlpy/repositories/analytics.py +85 -85
  157. dtlpy/repositories/annotations.py +916 -916
  158. dtlpy/repositories/apps.py +383 -383
  159. dtlpy/repositories/artifacts.py +452 -452
  160. dtlpy/repositories/assignments.py +599 -599
  161. dtlpy/repositories/bots.py +213 -213
  162. dtlpy/repositories/codebases.py +559 -559
  163. dtlpy/repositories/collections.py +332 -348
  164. dtlpy/repositories/commands.py +158 -158
  165. dtlpy/repositories/compositions.py +61 -61
  166. dtlpy/repositories/computes.py +434 -406
  167. dtlpy/repositories/datasets.py +1291 -1291
  168. dtlpy/repositories/downloader.py +895 -895
  169. dtlpy/repositories/dpks.py +433 -433
  170. dtlpy/repositories/drivers.py +266 -266
  171. dtlpy/repositories/executions.py +817 -817
  172. dtlpy/repositories/feature_sets.py +226 -226
  173. dtlpy/repositories/features.py +238 -238
  174. dtlpy/repositories/integrations.py +484 -484
  175. dtlpy/repositories/items.py +909 -915
  176. dtlpy/repositories/messages.py +94 -94
  177. dtlpy/repositories/models.py +877 -867
  178. dtlpy/repositories/nodes.py +80 -80
  179. dtlpy/repositories/ontologies.py +511 -511
  180. dtlpy/repositories/organizations.py +525 -525
  181. dtlpy/repositories/packages.py +1941 -1941
  182. dtlpy/repositories/pipeline_executions.py +448 -448
  183. dtlpy/repositories/pipelines.py +642 -642
  184. dtlpy/repositories/projects.py +539 -539
  185. dtlpy/repositories/recipes.py +399 -399
  186. dtlpy/repositories/resource_executions.py +137 -137
  187. dtlpy/repositories/schema.py +120 -120
  188. dtlpy/repositories/service_drivers.py +213 -213
  189. dtlpy/repositories/services.py +1704 -1704
  190. dtlpy/repositories/settings.py +339 -339
  191. dtlpy/repositories/tasks.py +1124 -1124
  192. dtlpy/repositories/times_series.py +278 -278
  193. dtlpy/repositories/triggers.py +536 -536
  194. dtlpy/repositories/upload_element.py +257 -257
  195. dtlpy/repositories/uploader.py +651 -651
  196. dtlpy/repositories/webhooks.py +249 -249
  197. dtlpy/services/__init__.py +22 -22
  198. dtlpy/services/aihttp_retry.py +131 -131
  199. dtlpy/services/api_client.py +1782 -1782
  200. dtlpy/services/api_reference.py +40 -40
  201. dtlpy/services/async_utils.py +133 -133
  202. dtlpy/services/calls_counter.py +44 -44
  203. dtlpy/services/check_sdk.py +68 -68
  204. dtlpy/services/cookie.py +115 -115
  205. dtlpy/services/create_logger.py +156 -156
  206. dtlpy/services/events.py +84 -84
  207. dtlpy/services/logins.py +235 -235
  208. dtlpy/services/reporter.py +256 -256
  209. dtlpy/services/service_defaults.py +91 -91
  210. dtlpy/utilities/__init__.py +20 -20
  211. dtlpy/utilities/annotations/__init__.py +16 -16
  212. dtlpy/utilities/annotations/annotation_converters.py +269 -269
  213. dtlpy/utilities/base_package_runner.py +264 -264
  214. dtlpy/utilities/converter.py +1650 -1650
  215. dtlpy/utilities/dataset_generators/__init__.py +1 -1
  216. dtlpy/utilities/dataset_generators/dataset_generator.py +670 -670
  217. dtlpy/utilities/dataset_generators/dataset_generator_tensorflow.py +23 -23
  218. dtlpy/utilities/dataset_generators/dataset_generator_torch.py +21 -21
  219. dtlpy/utilities/local_development/__init__.py +1 -1
  220. dtlpy/utilities/local_development/local_session.py +179 -179
  221. dtlpy/utilities/reports/__init__.py +2 -2
  222. dtlpy/utilities/reports/figures.py +343 -343
  223. dtlpy/utilities/reports/report.py +71 -71
  224. dtlpy/utilities/videos/__init__.py +17 -17
  225. dtlpy/utilities/videos/video_player.py +598 -598
  226. dtlpy/utilities/videos/videos.py +470 -470
  227. {dtlpy-1.113.10.data → dtlpy-1.114.13.data}/scripts/dlp +1 -1
  228. dtlpy-1.114.13.data/scripts/dlp.bat +2 -0
  229. {dtlpy-1.113.10.data → dtlpy-1.114.13.data}/scripts/dlp.py +128 -128
  230. {dtlpy-1.113.10.dist-info → dtlpy-1.114.13.dist-info}/LICENSE +200 -200
  231. {dtlpy-1.113.10.dist-info → dtlpy-1.114.13.dist-info}/METADATA +172 -172
  232. dtlpy-1.114.13.dist-info/RECORD +240 -0
  233. {dtlpy-1.113.10.dist-info → dtlpy-1.114.13.dist-info}/WHEEL +1 -1
  234. tests/features/environment.py +551 -550
  235. dtlpy-1.113.10.data/scripts/dlp.bat +0 -2
  236. dtlpy-1.113.10.dist-info/RECORD +0 -244
  237. tests/assets/__init__.py +0 -0
  238. tests/assets/models_flow/__init__.py +0 -0
  239. tests/assets/models_flow/failedmain.py +0 -52
  240. tests/assets/models_flow/main.py +0 -62
  241. tests/assets/models_flow/main_model.py +0 -54
  242. {dtlpy-1.113.10.dist-info → dtlpy-1.114.13.dist-info}/entry_points.txt +0 -0
  243. {dtlpy-1.113.10.dist-info → dtlpy-1.114.13.dist-info}/top_level.txt +0 -0
dtlpy/__init__.py CHANGED
@@ -1,488 +1,488 @@
1
- #! /usr/bin/env python3
2
- # This file is part of DTLPY.
3
- #
4
- # DTLPY is free software: you can redistribute it and/or modify
5
- # it under the terms of the GNU General Public License as published by
6
- # the Free Software Foundation, either version 3 of the License, or
7
- # (at your option) any later version.
8
- #
9
- # DTLPY is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- # GNU General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU General Public License
15
- # along with DTLPY. If not, see <http://www.gnu.org/licenses/>.
16
- import warnings
17
- import logging
18
- import sys
19
- import os
20
-
21
- ##########
22
- # Logger #
23
- ##########
24
- from .services import DataloopLogger, DtlpyFilter
25
- from .__version__ import version as __version__
26
-
27
- logger = logging.getLogger(name='dtlpy')
28
- logging.getLogger(name='filelock').setLevel(level=logging.CRITICAL)
29
- if len(logger.handlers) == 0:
30
- logger.setLevel(logging.DEBUG)
31
- log_filepath = DataloopLogger.get_log_filepath()
32
- # set file handler to save all logs to file
33
- stream_formatter = logging.Formatter(
34
- fmt="[%(asctime)-s][%(levelname).3s][%(name)s:v" + __version__ + "][%(relativepath)-s:%(lineno)-d] %(message)s",
35
- datefmt="%Y-%m-%d %H:%M:%S",
36
- )
37
- file_formatter = logging.Formatter(
38
- fmt="[%(asctime)s.%(msecs)03d][%(threadName)s][%(levelname).3s][%(name)s:v" +
39
- __version__ + "][%(relativepath)-s:%(lineno)-d](%(funcName)-s): %(message)s",
40
- datefmt="%Y-%m-%d %H:%M:%S",
41
- )
42
- package_path = os.path.dirname(__file__)
43
- # relative function path filtering
44
- filtering = DtlpyFilter(package_path)
45
- fh = DataloopLogger(log_filepath, maxBytes=(1048 * 1000 * 5))
46
- fh.setLevel(logging.DEBUG)
47
- fh.setFormatter(file_formatter)
48
- fh.addFilter(filtering)
49
- sh = logging.StreamHandler()
50
- sh.setLevel(logging.WARNING)
51
- sh.setFormatter(stream_formatter)
52
- sh.addFilter(filtering)
53
- # set handlers to main logger
54
- logger.addHandler(sh)
55
- logger.addHandler(fh)
56
-
57
- from .services.api_client import client as client_api
58
- from .services.api_client import VerboseLoggingLevel, ApiClient
59
- from .services import DataloopLogger, DtlpyFilter, check_sdk, Reporter, service_defaults
60
- from .services.api_reference import api_reference as _api_reference
61
- from .caches.cache import CacheConfig, CacheType
62
- from .exceptions import PlatformException
63
- from . import repositories, exceptions, entities, examples
64
- from .entities import (
65
- # main entities
66
- Project, Dataset, ExpirationOptions, ExportVersion, Trigger, Item, Execution, AnnotationCollection, Annotation,
67
- Recipe, IndexDriver, AttributesTypes, AttributesRange, Dpk, App, AppModule, AppScope,
68
- Ontology, Label, Task, TaskPriority, ConsensusTaskType, Assignment, Service, Package, Codebase, Model,
69
- PackageModule, PackageFunction,
70
- # annotations
71
- Box, Cube, Cube3d, Point, Note, Message, Segmentation, Ellipse, Classification, Subtitle, Polyline, Pose, Gis, GisType,
72
- Description,
73
- Polygon, Text, FreeText, RefImage,
74
- # filters
75
- Filters, FiltersKnownFields, FiltersResource, FiltersOperations, FiltersMethod, FiltersOrderByDirection,
76
- FiltersKnownFields as KnownFields,
77
- # triggers
78
- TriggerResource, TriggerAction, TriggerExecutionMode, TriggerType,
79
- # faas
80
- FunctionIO, KubernetesAutoscalerType, KubernetesRabbitmqAutoscaler, KubernetesAutoscaler, KubernetesRuntime,
81
- InstanceCatalog, PackageInputType, ServiceType, ServiceModeType, KubernetesRPSAutoscaler,
82
- PackageSlot, SlotPostAction, SlotPostActionType, SlotDisplayScope, SlotDisplayScopeResource, UiBindingPanel,
83
- # roberto
84
- DatasetSubsetType, ModelStatus, PlotSample, ArtifactType, Artifact, ItemArtifact, LinkArtifact, LocalArtifact,
85
- EntityScopeLevel,
86
- # features
87
- FeatureEntityType, Feature, FeatureSet,
88
- #
89
- RequirementOperator, PackageRequirement,
90
- Command, CommandsStatus,
91
- LocalCodebase, GitCodebase, ItemCodebase, FilesystemCodebase, PackageCodebaseType,
92
- MemberRole, MemberOrgRole,
93
- Webhook, HttpMethod,
94
- ViewAnnotationOptions, AnnotationStatus, AnnotationType,
95
- ItemStatus, ExecutionStatus, ExportMetadata,
96
- PromptItem, Prompt, PromptType, ItemGis, Layer,
97
- ItemLink, UrlLink, LinkTypeEnum,
98
- Modality, ModalityTypeEnum, ModalityRefTypeEnum,
99
- Workload, WorkloadUnit, ItemAction,
100
- PipelineExecution, PipelineExecutionStatus, CycleRerunMethod, PipelineExecutionNode, Pipeline, PipelineConnection,
101
- PipelineNode, TaskNode, CodeNode, PipelineStats, PipelineSettings,
102
- PipelineNodeType, PipelineNameSpace, PipelineResumeOption, Variable, CompositionStatus,
103
- FunctionNode, DatasetNode, PipelineConnectionPort, PipelineNodeIO, Organization, OrganizationsPlans, Integration,
104
- Driver, S3Driver, GcsDriver, AzureBlobDriver, CacheAction, PodType,
105
- ExternalStorage, IntegrationType, Role, PlatformEntityType, SettingsValueTypes, SettingsTypes, SettingsSectionNames,
106
- SettingScope, BaseSetting, UserSetting, Setting, ServiceSample, ExecutionSample, PipelineExecutionSample,
107
- ResourceExecution, Message, NotificationEventContext,
108
- # compute
109
- ClusterProvider, ComputeType, ComputeStatus, Toleration, DeploymentResource, DeploymentResources,
110
- NodePool, AuthenticationIntegration, Authentication, ComputeCluster, ComputeContext, Compute, KubernetesCompute,
111
- ServiceDriver
112
- )
113
- from .ml import BaseModelAdapter
114
- from .utilities import Converter, BaseServiceRunner, Progress, Context, AnnotationFormat
115
- from .repositories import FUNCTION_END_LINE, PackageCatalog
116
-
117
- warnings.simplefilter('once', DeprecationWarning)
118
-
119
- # check python version
120
- if sys.version_info.major != 3:
121
- if sys.version_info.minor not in [5, 6]:
122
- sys.stderr.write(
123
- 'Error: Your Python version "{}.{}" is NOT supported by Dataloop SDK dtlpy. '
124
- "Supported version are 3.5, 3.6)\n".format(
125
- sys.version_info.major, sys.version_info.minor
126
- )
127
- )
128
- sys.exit(-1)
129
-
130
- if os.name == "nt":
131
- # set encoding for windows printing
132
- os.environ["PYTHONIOENCODING"] = ":replace"
133
-
134
- """
135
- Main Platform Interface module for Dataloop
136
- """
137
-
138
- ################
139
- # Repositories #
140
- ################
141
- # Create repositories instances
142
- projects = repositories.Projects(client_api=client_api)
143
- datasets = repositories.Datasets(client_api=client_api, project=None)
144
- items = repositories.Items(client_api=client_api, datasets=datasets)
145
- packages = repositories.Packages(client_api=client_api)
146
- executions = repositories.Executions(client_api=client_api)
147
- commands = repositories.Commands(client_api=client_api)
148
- services = repositories.Services(client_api=client_api)
149
- webhooks = repositories.Webhooks(client_api=client_api)
150
- triggers = repositories.Triggers(client_api=client_api)
151
- assignments = repositories.Assignments(client_api=client_api)
152
- tasks = repositories.Tasks(client_api=client_api)
153
- annotations = repositories.Annotations(client_api=client_api)
154
- models = repositories.Models(client_api=client_api)
155
- ontologies = repositories.Ontologies(client_api=client_api)
156
- recipes = repositories.Recipes(client_api=client_api)
157
- pipelines = repositories.Pipelines(client_api=client_api)
158
- pipeline_executions = repositories.PipelineExecutions(client_api=client_api)
159
- feature_sets = repositories.FeatureSets(client_api=client_api)
160
- features = repositories.Features(client_api=client_api)
161
- organizations = repositories.Organizations(client_api=client_api)
162
- analytics = repositories.Analytics(client_api=client_api)
163
- integrations = repositories.Integrations(client_api=client_api)
164
- drivers = repositories.Drivers(client_api=client_api)
165
- settings = repositories.Settings(client_api=client_api)
166
- apps = repositories.Apps(client_api=client_api)
167
- dpks = repositories.Dpks(client_api=client_api)
168
- messages = repositories.Messages(client_api=client_api)
169
- compositions = repositories.Compositions(client_api=client_api)
170
- computes = repositories.Computes(client_api=client_api)
171
- service_drivers = repositories.ServiceDrivers(client_api=client_api)
172
- collections = repositories.Collections(client_api=client_api)
173
-
174
- try:
175
- check_sdk.check(version=__version__, client_api=client_api)
176
- except Exception:
177
- logger.debug("Failed to check SDK! Continue without")
178
-
179
- verbose = client_api.verbose
180
- login = client_api.login
181
- logout = client_api.logout
182
- login_token = client_api.login_token
183
- login_secret = client_api.login_secret
184
- login_api_key = client_api.login_api_key
185
- login_m2m = client_api.login_m2m
186
- add_environment = client_api.add_environment
187
- setenv = client_api.setenv
188
- token_expired = client_api.token_expired
189
- info = client_api.info
190
- cache_state = client_api.cache_state
191
- attributes_mode = client_api.attributes_mode
192
- sdk_cache = client_api.sdk_cache
193
-
194
-
195
- def get_secret(secret):
196
- return os.environ.get(secret, None)
197
-
198
-
199
- def token():
200
- """
201
- token
202
- :return: token in use
203
- """
204
- return client_api.token
205
-
206
-
207
- def environment():
208
- """
209
- environment
210
- :return: current environment
211
- """
212
- return client_api.environment
213
-
214
-
215
- def init():
216
- """
217
- init current directory as a Dataloop working directory
218
- :return:
219
- """
220
- from .services import CookieIO
221
-
222
- client_api.state_io = CookieIO.init_local_cookie(create=True)
223
- assert isinstance(client_api.state_io, CookieIO)
224
- logger.info(".Dataloop directory initiated successfully in {}".format(os.getcwd()))
225
-
226
-
227
- def checkout_state():
228
- """
229
- Return the current checked out state
230
- :return:
231
- """
232
- state = client_api.state_io.read_json()
233
- return state
234
-
235
- class LoggingLevel:
236
- DEBUG = "debug"
237
- WARNING = "warning"
238
- CRITICAL = "critical"
239
- INFO = "info"
240
- ERROR = "error"
241
-
242
-
243
- #################
244
- # ENUMS #
245
- #################
246
- CallbackEvent = client_api.callbacks.CallbackEvent
247
- LOGGING_LEVEL_DEBUG = LoggingLevel.DEBUG
248
- LOGGING_LEVEL_WARNING = LoggingLevel.WARNING
249
- LOGGING_LEVEL_CRITICAL = LoggingLevel.CRITICAL
250
- LOGGING_LEVEL_INFO = LoggingLevel.INFO
251
-
252
- VERBOSE_LOGGING_LEVEL_DEBUG = VerboseLoggingLevel.DEBUG
253
- VERBOSE_LOGGING_LEVEL_INFO = VerboseLoggingLevel.INFO
254
- VERBOSE_LOGGING_LEVEL_WARNING = VerboseLoggingLevel.WARNING
255
- VERBOSE_LOGGING_LEVEL_ERROR = VerboseLoggingLevel.ERROR
256
- VERBOSE_LOGGING_LEVEL_CRITICAL = VerboseLoggingLevel.CRITICAL
257
-
258
- HTTP_METHOD_POST = HttpMethod.POST
259
- HTTP_METHOD_GET = HttpMethod.GET
260
- HTTP_METHOD_DELETE = HttpMethod.DELETE
261
- HTTP_METHOD_PATCH = HttpMethod.PATCH
262
-
263
- VIEW_ANNOTATION_OPTIONS_JSON = ViewAnnotationOptions.JSON
264
- VIEW_ANNOTATION_OPTIONS_MASK = ViewAnnotationOptions.MASK
265
- VIEW_ANNOTATION_OPTIONS_ANNOTATION_ON_IMAGE = ViewAnnotationOptions.ANNOTATION_ON_IMAGE
266
- VIEW_ANNOTATION_OPTIONS_INSTANCE = ViewAnnotationOptions.INSTANCE
267
- VIEW_ANNOTATION_OPTIONS_VTT = ViewAnnotationOptions.VTT
268
- VIEW_ANNOTATION_OPTIONS_OBJECT_ID = ViewAnnotationOptions.OBJECT_ID
269
-
270
- ANNOTATION_STATUS_ISSUE = AnnotationStatus.ISSUE
271
- ANNOTATION_STATUS_REVIEW = AnnotationStatus.REVIEW
272
- ANNOTATION_STATUS_APPROVED = AnnotationStatus.APPROVED
273
- ANNOTATION_STATUS_CLEAR = AnnotationStatus.CLEAR
274
-
275
- ORGANIZATION_PLAN_FREEMIUM = OrganizationsPlans.FREEMIUM
276
- ORGANIZATION_PLAN_PREMIUM = OrganizationsPlans.PREMIUM
277
-
278
- EXPORT_METADATA_FROM_JSON = ExportMetadata.FROM_JSON
279
-
280
- EXPORT_VERSION_V1 = ExportVersion.V1
281
- EXPORT_VERSION_V2 = ExportVersion.V2
282
-
283
- # class
284
- ANNOTATION_TYPE_BOX = AnnotationType.BOX
285
- ANNOTATION_TYPE_CLASSIFICATION = AnnotationType.CLASSIFICATION
286
- ANNOTATION_TYPE_COMPARISON = AnnotationType.COMPARISON
287
- ANNOTATION_TYPE_ELLIPSE = AnnotationType.ELLIPSE
288
- ANNOTATION_TYPE_NOTE = AnnotationType.NOTE
289
- ANNOTATION_TYPE_POINT = AnnotationType.POINT
290
- ANNOTATION_TYPE_POLYGON = AnnotationType.POLYGON
291
- ANNOTATION_TYPE_POLYLINE = AnnotationType.POLYLINE
292
- ANNOTATION_TYPE_POSE = AnnotationType.POSE
293
- ANNOTATION_TYPE_SEGMENTATION = AnnotationType.SEGMENTATION
294
- ANNOTATION_TYPE_SUBTITLE = AnnotationType.SUBTITLE
295
- ANNOTATION_TYPE_TEXT = AnnotationType.TEXT
296
- ANNOTATION_TYPE_FREE_TEXT = AnnotationType.FREE_TEXT
297
- ANNOTATION_TYPE_REF_IMAGE = AnnotationType.REF_IMAGE
298
-
299
- ITEM_STATUS_COMPLETED = ItemStatus.COMPLETED
300
- ITEM_STATUS_APPROVED = ItemStatus.APPROVED
301
- ITEM_STATUS_DISCARDED = ItemStatus.DISCARDED
302
-
303
- EXECUTION_STATUS_CREATED = ExecutionStatus.CREATED
304
- EXECUTION_STATUS_IN_PROGRESS = ExecutionStatus.IN_PROGRESS
305
- EXECUTION_STATUS_SUCCESS = ExecutionStatus.SUCCESS
306
- EXECUTION_STATUS_FAILED = ExecutionStatus.FAILED
307
-
308
- LINK_TYPE_ID = LinkTypeEnum.ID
309
- LINK_TYPE_URL = LinkTypeEnum.URL
310
-
311
- KUBERNETES_AUTUSCALER_TYPE_CPU = KubernetesAutoscalerType.CPU
312
- KUBERNETES_AUTUSCALER_TYPE_RABBITMQ = KubernetesAutoscalerType.RABBITMQ
313
-
314
- INSTANCE_CATALOG_REGULAR_XS = InstanceCatalog.REGULAR_XS
315
- INSTANCE_CATALOG_REGULAR_S = InstanceCatalog.REGULAR_S
316
- INSTANCE_CATALOG_REGULAR_M = InstanceCatalog.REGULAR_M
317
- INSTANCE_CATALOG_REGULAR_L = InstanceCatalog.REGULAR_L
318
- INSTANCE_CATALOG_HIGHMEM_XS = InstanceCatalog.HIGHMEM_XS
319
- INSTANCE_CATALOG_HIGHMEM_S = InstanceCatalog.HIGHMEM_S
320
- INSTANCE_CATALOG_HIGHMEM_M = InstanceCatalog.HIGHMEM_M
321
- INSTANCE_CATALOG_HIGHMEM_L = InstanceCatalog.HIGHMEM_L
322
- INSTANCE_CATALOG_GPU_T4_S = InstanceCatalog.GPU_T4_S
323
- INSTANCE_CATALOG_GPU_T4_M = InstanceCatalog.GPU_T4_M
324
-
325
- MODALITY_TYPE_OVERLAY = ModalityTypeEnum.OVERLAY
326
- MODALITY_TYPE_PREVIEW = ModalityTypeEnum.PREVIEW
327
- MODALITY_TYPE_REPLACE = ModalityTypeEnum.REPLACE
328
-
329
- MODALITY_REF_TYPE_ID = ModalityRefTypeEnum.ID
330
- MODALITY_REF_TYPE_URL = ModalityRefTypeEnum.URL
331
-
332
- FILTERS_KNOWN_FIELDS_DIR = FiltersKnownFields.DIR
333
- FILTERS_KNOWN_FIELDS_ANNOTATED = FiltersKnownFields.ANNOTATED
334
- FILTERS_KNOWN_FIELDS_FILENAME = FiltersKnownFields.FILENAME
335
- FILTERS_KNOWN_FIELDS_CREATED_AT = FiltersKnownFields.CREATED_AT
336
- FILTERS_KNOWN_FIELDS_UPDATED_AT = FiltersKnownFields.UPDATED_AT
337
- FILTERS_KNOWN_FIELDS_LABEL = FiltersKnownFields.LABEL
338
- FILTERS_KNOWN_FIELDS_NAME = FiltersKnownFields.NAME
339
- FILTERS_KNOWN_FIELDS_HIDDEN = FiltersKnownFields.HIDDEN
340
- FILTERS_KNOWN_FIELDS_TYPE = FiltersKnownFields.TYPE
341
-
342
- FILTERS_RESOURCE_ITEM = FiltersResource.ITEM
343
- FILTERS_RESOURCE_ANNOTATION = FiltersResource.ANNOTATION
344
- FILTERS_RESOURCE_EXECUTION = FiltersResource.EXECUTION
345
- FILTERS_RESOURCE_PACKAGE = FiltersResource.PACKAGE
346
- FILTERS_RESOURCE_SERVICE = FiltersResource.SERVICE
347
- FILTERS_RESOURCE_TRIGGER = FiltersResource.TRIGGER
348
- FILTERS_RESOURCE_MODEL = FiltersResource.MODEL
349
- FILTERS_RESOURCE_WEBHOOK = FiltersResource.WEBHOOK
350
- FILTERS_RESOURCE_RECIPE = FiltersResource.RECIPE
351
- FILTERS_RESOURCE_DATASET = FiltersResource.DATASET
352
- FILTERS_RESOURCE_ONTOLOGY = FiltersResource.ONTOLOGY
353
-
354
- FILTERS_OPERATIONS_OR = FiltersOperations.OR
355
- FILTERS_OPERATIONS_AND = FiltersOperations.AND
356
- FILTERS_OPERATIONS_IN = FiltersOperations.IN
357
- FILTERS_OPERATIONS_NOT_EQUAL = FiltersOperations.NOT_EQUAL
358
- FILTERS_OPERATIONS_EQUAL = FiltersOperations.EQUAL
359
- FILTERS_OPERATIONS_GREATER_THAN = FiltersOperations.GREATER_THAN
360
- FILTERS_OPERATIONS_LESS_THAN = FiltersOperations.LESS_THAN
361
- FILTERS_OPERATIONS_EXISTS = FiltersOperations.EXISTS
362
-
363
- FILTERS_METHOD_OR = FiltersMethod.OR
364
- FILTERS_METHOD_AND = FiltersMethod.AND
365
-
366
- FILTERS_ORDERBY_DIRECTION_DESCENDING = FiltersOrderByDirection.DESCENDING
367
- FILTERS_ORDERBY_DIRECTION_ASCENDING = FiltersOrderByDirection.ASCENDING
368
-
369
- TRIGGER_RESOURCE_ITEM = TriggerResource.ITEM
370
- TRIGGER_RESOURCE_DATASET = TriggerResource.DATASET
371
- TRIGGER_RESOURCE_ANNOTATION = TriggerResource.ANNOTATION
372
- TRIGGER_RESOURCE_ITEM_STATUS = TriggerResource.ITEM_STATUS
373
-
374
- TRIGGER_ACTION_CREATED = TriggerAction.CREATED
375
- TRIGGER_ACTION_UPDATED = TriggerAction.UPDATED
376
- TRIGGER_ACTION_DELETED = TriggerAction.DELETED
377
- TRIGGER_ACTION_STATUS_CHANGED = TriggerAction.STATUS_CHANGED
378
- TRIGGER_ACTION_CLONE = TriggerAction.CLONE
379
-
380
- TRIGGER_EXECUTION_MODE_ONCE = TriggerExecutionMode.ONCE
381
- TRIGGER_EXECUTION_MODE_ALWAYS = TriggerExecutionMode.ALWAYS
382
-
383
- TRIGGER_TYPE_EVENT = TriggerType.EVENT
384
- TRIGGER_TYPE_CRON = TriggerType.CRON
385
-
386
- PACKAGE_INPUT_TYPE_ITEM = PackageInputType.ITEM
387
- PACKAGE_INPUT_TYPE_DATASET = PackageInputType.DATASET
388
- PACKAGE_INPUT_TYPE_ANNOTATION = PackageInputType.ANNOTATION
389
- PACKAGE_INPUT_TYPE_JSON = PackageInputType.JSON
390
- PACKAGE_INPUT_TYPE_MODEL = PackageInputType.MODEL
391
- PACKAGE_INPUT_TYPE_PACKAGE = PackageInputType.PACKAGE
392
- PACKAGE_INPUT_TYPE_SERVICE = PackageInputType.SERVICE
393
- PACKAGE_INPUT_TYPE_PROJECT = PackageInputType.PROJECT
394
- PACKAGE_INPUT_TYPE_EXECUTION = PackageInputType.EXECUTION
395
- PACKAGE_INPUT_TYPE_TASK = PackageInputType.TASK
396
- PACKAGE_INPUT_TYPE_ASSIGNMENT = PackageInputType.ASSIGNMENT
397
- PACKAGE_INPUT_TYPE_RECIPE = PackageInputType.RECIPE
398
- PACKAGE_INPUT_TYPE_STRING = PackageInputType.STRING
399
- PACKAGE_INPUT_TYPE_NUMBER = PackageInputType.NUMBER
400
- PACKAGE_INPUT_TYPE_INT = PackageInputType.INT
401
- PACKAGE_INPUT_TYPE_FLOAT = PackageInputType.FLOAT
402
- PACKAGE_INPUT_TYPE_BOOLEAN = PackageInputType.BOOLEAN
403
- PACKAGE_INPUT_TYPE_DATASETS = PackageInputType.DATASETS
404
- PACKAGE_INPUT_TYPE_ITEMS = PackageInputType.ITEMS
405
- PACKAGE_INPUT_TYPE_ANNOTATIONS = PackageInputType.ANNOTATIONS
406
- PACKAGE_INPUT_TYPE_EXECUTIONS = PackageInputType.EXECUTIONS
407
- PACKAGE_INPUT_TYPE_TASKS = PackageInputType.TASKS
408
- PACKAGE_INPUT_TYPE_ASSIGNMENTS = PackageInputType.ASSIGNMENTS
409
- PACKAGE_INPUT_TYPE_SERVICES = PackageInputType.SERVICES
410
- PACKAGE_INPUT_TYPE_PACKAGES = PackageInputType.PACKAGES
411
- PACKAGE_INPUT_TYPE_PROJECTS = PackageInputType.PROJECTS
412
- PACKAGE_INPUT_TYPE_JSONS = PackageInputType.JSONS
413
- PACKAGE_INPUT_TYPE_STRINGS = PackageInputType.STRINGS
414
- PACKAGE_INPUT_TYPE_NUMBERS = PackageInputType.NUMBERS
415
- PACKAGE_INPUT_TYPE_INTS = PackageInputType.INTS
416
- PACKAGE_INPUT_TYPE_FLOATS = PackageInputType.FLOATS
417
- PACKAGE_INPUT_TYPE_BOOLEANS = PackageInputType.BOOLEANS
418
- PACKAGE_INPUT_TYPE_MODELS = PackageInputType.MODELS
419
- PACKAGE_INPUT_TYPE_RECIPES = PackageInputType.RECIPES
420
-
421
- FUNCTION_POST_ACTION_TYPE_DOWNLOAD = SlotPostActionType.DOWNLOAD
422
- FUNCTION_POST_ACTION_TYPE_DRAW_ANNOTATION = SlotPostActionType.DRAW_ANNOTATION
423
- FUNCTION_POST_ACTION_TYPE_NO_ACTION = SlotPostActionType.NO_ACTION
424
-
425
- FUNCTION_DISPLAY_SCOPE_RESOURCE_ANNOTATION = SlotDisplayScopeResource.ANNOTATION
426
- FUNCTION_DISPLAY_SCOPE_RESOURCE_ITEM = SlotDisplayScopeResource.ITEM
427
- FUNCTION_DISPLAY_SCOPE_RESOURCE_DATASET = SlotDisplayScopeResource.DATASET
428
- FUNCTION_DISPLAY_SCOPE_RESOURCE_DATASET_QUERY = SlotDisplayScopeResource.DATASET_QUERY
429
- FUNCTION_DISPLAY_SCOPE_RESOURCE_TASK = SlotDisplayScopeResource.TASK
430
-
431
- UI_BINDING_PANEL_ALL = UiBindingPanel.ALL
432
- UI_BINDING_PANEL_TABLE = UiBindingPanel.TABLE
433
- UI_BINDING_PANEL_STUDIO = UiBindingPanel.STUDIO
434
- UI_BINDING_PANEL_BROWSER = UiBindingPanel.BROWSER
435
-
436
- COMMANDS_STATUS_CREATED = CommandsStatus.CREATED
437
- COMMANDS_STATUS_MAKING_CHILDREN = CommandsStatus.MAKING_CHILDREN
438
- COMMANDS_STATUS_WAITING_CHILDREN = CommandsStatus.WAITING_CHILDREN
439
- COMMANDS_STATUS_IN_PROGRESS = CommandsStatus.IN_PROGRESS
440
- COMMANDS_STATUS_ABORTED = CommandsStatus.ABORTED
441
- COMMANDS_STATUS_CANCELED = CommandsStatus.CANCELED
442
- COMMANDS_STATUS_FINALIZING = CommandsStatus.FINALIZING
443
- COMMANDS_STATUS_SUCCESS = CommandsStatus.SUCCESS
444
- COMMANDS_STATUS_FAILED = CommandsStatus.FAILED
445
- COMMANDS_STATUS_TIMEOUT = CommandsStatus.TIMEOUT
446
-
447
- MEMBER_ROLE_OWNER = MemberRole.OWNER
448
- MEMBER_ROLE_DEVELOPER = MemberRole.DEVELOPER
449
- MEMBER_ROLE_ANNOTATOR = MemberRole.ANNOTATOR
450
- MEMBER_ROLE_ANNOTATION_MANAGER = MemberRole.ANNOTATION_MANAGER
451
-
452
- MEMBER_ORG_ROLE_OWNER = MemberOrgRole.OWNER
453
- MEMBER_ORG_ROLE_ADMIN = MemberOrgRole.ADMIN
454
- MEMBER_ORG_ROLE_MEMBER = MemberOrgRole.MEMBER
455
- MEMBER_ORG_ROLE_WORKER = MemberOrgRole.WORKER
456
-
457
- PACKAGE_REQUIREMENT_OP_EQUAL = RequirementOperator.EQUAL
458
- PACKAGE_REQUIREMENT_OP_GREATER_THAN = RequirementOperator.GREATER_THAN
459
- PACKAGE_REQUIREMENT_OP_LESS_THAN = RequirementOperator.LESS_THAN
460
- PACKAGE_REQUIREMENT_OP_EQUAL_OR_LESS_THAN = RequirementOperator.EQUAL_OR_LESS_THAN
461
- PACKAGE_REQUIREMENT_OP_EQUAL_OR_GREATER_THAN = RequirementOperator.EQUAL_OR_GREATER_THAN
462
-
463
- INDEX_DRIVER_V1 = IndexDriver.V1
464
- INDEX_DRIVER_V2 = IndexDriver.V2
465
-
466
- CACHE_ACTION_APPLY = CacheAction.APPLY
467
- CACHE_ACTION_DESTROY = CacheAction.DESTROY
468
-
469
- POD_TYPE_SMALL = PodType.SMALL
470
- POD_TYPE_MEDIUM = PodType.MEDIUM
471
- POD_TYPE_HIGH = PodType.HIGH
472
-
473
- ATTRIBUTES_TYPES_CHECKBOX = AttributesTypes.CHECKBOX
474
- ATTRIBUTES_TYPES_RADIO_BUTTON = AttributesTypes.RADIO_BUTTON
475
- ATTRIBUTES_TYPES_YES_NO = AttributesTypes.YES_NO
476
- ATTRIBUTES_TYPES_SLIDER = AttributesTypes.SLIDER
477
- ATTRIBUTES_TYPES_FREE_TEXT = AttributesTypes.FREE_TEXT
478
-
479
- TASK_PRIORITY_LOW = TaskPriority.LOW
480
- TASK_PRIORITY_MEDIUM = TaskPriority.MEDIUM
481
- TASK_PRIORITY_HIGH = TaskPriority.HIGH
482
-
483
- CONSENSUS_TASK_TYPE_CONSENSUS = ConsensusTaskType.CONSENSUS
484
- CONSENSUS_TASK_TYPE_QUALIFICATION = ConsensusTaskType.QUALIFICATION
485
- CONSENSUS_TASK_TYPE_HONEYPOT = ConsensusTaskType.HONEYPOT
486
-
487
- SERVICE_MODE_TYPE_REGULAR = ServiceModeType.REGULAR
488
- SERVICE_MODE_TYPE_DEBUG = ServiceModeType.DEBUG
1
+ #! /usr/bin/env python3
2
+ # This file is part of DTLPY.
3
+ #
4
+ # DTLPY is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # DTLPY is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with DTLPY. If not, see <http://www.gnu.org/licenses/>.
16
+ import warnings
17
+ import logging
18
+ import sys
19
+ import os
20
+
21
+ ##########
22
+ # Logger #
23
+ ##########
24
+ from .services import DataloopLogger, DtlpyFilter
25
+ from .__version__ import version as __version__
26
+
27
+ logger = logging.getLogger(name='dtlpy')
28
+ logging.getLogger(name='filelock').setLevel(level=logging.CRITICAL)
29
+ if len(logger.handlers) == 0:
30
+ logger.setLevel(logging.DEBUG)
31
+ log_filepath = DataloopLogger.get_log_filepath()
32
+ # set file handler to save all logs to file
33
+ stream_formatter = logging.Formatter(
34
+ fmt="[%(asctime)-s][%(levelname).3s][%(name)s:v" + __version__ + "][%(relativepath)-s:%(lineno)-d] %(message)s",
35
+ datefmt="%Y-%m-%d %H:%M:%S",
36
+ )
37
+ file_formatter = logging.Formatter(
38
+ fmt="[%(asctime)s.%(msecs)03d][%(threadName)s][%(levelname).3s][%(name)s:v" +
39
+ __version__ + "][%(relativepath)-s:%(lineno)-d](%(funcName)-s): %(message)s",
40
+ datefmt="%Y-%m-%d %H:%M:%S",
41
+ )
42
+ package_path = os.path.dirname(__file__)
43
+ # relative function path filtering
44
+ filtering = DtlpyFilter(package_path)
45
+ fh = DataloopLogger(log_filepath, maxBytes=(1048 * 1000 * 5))
46
+ fh.setLevel(logging.DEBUG)
47
+ fh.setFormatter(file_formatter)
48
+ fh.addFilter(filtering)
49
+ sh = logging.StreamHandler()
50
+ sh.setLevel(logging.WARNING)
51
+ sh.setFormatter(stream_formatter)
52
+ sh.addFilter(filtering)
53
+ # set handlers to main logger
54
+ logger.addHandler(sh)
55
+ logger.addHandler(fh)
56
+
57
+ from .services.api_client import client as client_api
58
+ from .services.api_client import VerboseLoggingLevel, ApiClient
59
+ from .services import DataloopLogger, DtlpyFilter, check_sdk, Reporter, service_defaults
60
+ from .services.api_reference import api_reference as _api_reference
61
+ from .caches.cache import CacheConfig, CacheType
62
+ from .exceptions import PlatformException
63
+ from . import repositories, exceptions, entities, examples
64
+ from .entities import (
65
+ # main entities
66
+ Project, Dataset, ExpirationOptions, ExportVersion, Trigger, Item, Execution, AnnotationCollection, Annotation,
67
+ Recipe, IndexDriver, AttributesTypes, AttributesRange, Dpk, App, AppModule, AppScope,
68
+ Ontology, Label, Task, TaskPriority, ConsensusTaskType, Assignment, Service, Package, Codebase, Model,
69
+ PackageModule, PackageFunction,
70
+ # annotations
71
+ Box, Cube, Cube3d, Point, Note, Message, Segmentation, Ellipse, Classification, Subtitle, Polyline, Pose, Gis, GisType,
72
+ Description,
73
+ Polygon, Text, FreeText, RefImage,
74
+ # filters
75
+ Filters, FiltersKnownFields, FiltersResource, FiltersOperations, FiltersMethod, FiltersOrderByDirection,
76
+ FiltersKnownFields as KnownFields,
77
+ # triggers
78
+ TriggerResource, TriggerAction, TriggerExecutionMode, TriggerType,
79
+ # faas
80
+ FunctionIO, KubernetesAutoscalerType, KubernetesRabbitmqAutoscaler, KubernetesAutoscaler, KubernetesRuntime,
81
+ InstanceCatalog, PackageInputType, ServiceType, ServiceModeType, KubernetesRPSAutoscaler,
82
+ PackageSlot, SlotPostAction, SlotPostActionType, SlotDisplayScope, SlotDisplayScopeResource, UiBindingPanel,
83
+ # roberto
84
+ DatasetSubsetType, ModelStatus, PlotSample, ArtifactType, Artifact, ItemArtifact, LinkArtifact, LocalArtifact,
85
+ EntityScopeLevel,
86
+ # features
87
+ FeatureEntityType, Feature, FeatureSet,
88
+ #
89
+ RequirementOperator, PackageRequirement,
90
+ Command, CommandsStatus,
91
+ LocalCodebase, GitCodebase, ItemCodebase, FilesystemCodebase, PackageCodebaseType,
92
+ MemberRole, MemberOrgRole,
93
+ Webhook, HttpMethod,
94
+ ViewAnnotationOptions, AnnotationStatus, AnnotationType,
95
+ ItemStatus, ExecutionStatus, ExportMetadata,
96
+ PromptItem, Prompt, PromptType, ItemGis, Layer,
97
+ ItemLink, UrlLink, LinkTypeEnum,
98
+ Modality, ModalityTypeEnum, ModalityRefTypeEnum,
99
+ Workload, WorkloadUnit, ItemAction,
100
+ PipelineExecution, PipelineExecutionStatus, CycleRerunMethod, PipelineExecutionNode, Pipeline, PipelineConnection,
101
+ PipelineNode, TaskNode, CodeNode, PipelineStats, PipelineSettings,
102
+ PipelineNodeType, PipelineNameSpace, PipelineResumeOption, Variable, CompositionStatus,
103
+ FunctionNode, DatasetNode, PipelineConnectionPort, PipelineNodeIO, Organization, OrganizationsPlans, Integration,
104
+ Driver, S3Driver, GcsDriver, AzureBlobDriver, CacheAction, PodType,
105
+ ExternalStorage, IntegrationType, Role, PlatformEntityType, SettingsValueTypes, SettingsTypes, SettingsSectionNames,
106
+ SettingScope, BaseSetting, UserSetting, Setting, ServiceSample, ExecutionSample, PipelineExecutionSample,
107
+ ResourceExecution, Message, NotificationEventContext,
108
+ # compute
109
+ ClusterProvider, ComputeType, ComputeStatus, Toleration, DeploymentResource, DeploymentResources,
110
+ NodePool, AuthenticationIntegration, Authentication, ComputeCluster, ComputeContext, Compute, KubernetesCompute,
111
+ ServiceDriver
112
+ )
113
+ from .ml import BaseModelAdapter
114
+ from .utilities import Converter, BaseServiceRunner, Progress, Context, AnnotationFormat
115
+ from .repositories import FUNCTION_END_LINE, PackageCatalog
116
+
117
+ warnings.simplefilter('once', DeprecationWarning)
118
+
119
+ # check python version
120
+ if sys.version_info.major != 3:
121
+ if sys.version_info.minor not in [5, 6]:
122
+ sys.stderr.write(
123
+ 'Error: Your Python version "{}.{}" is NOT supported by Dataloop SDK dtlpy. '
124
+ "Supported version are 3.5, 3.6)\n".format(
125
+ sys.version_info.major, sys.version_info.minor
126
+ )
127
+ )
128
+ sys.exit(-1)
129
+
130
+ if os.name == "nt":
131
+ # set encoding for windows printing
132
+ os.environ["PYTHONIOENCODING"] = ":replace"
133
+
134
+ """
135
+ Main Platform Interface module for Dataloop
136
+ """
137
+
138
+ ################
139
+ # Repositories #
140
+ ################
141
+ # Create repositories instances
142
+ projects = repositories.Projects(client_api=client_api)
143
+ datasets = repositories.Datasets(client_api=client_api, project=None)
144
+ items = repositories.Items(client_api=client_api, datasets=datasets)
145
+ packages = repositories.Packages(client_api=client_api)
146
+ executions = repositories.Executions(client_api=client_api)
147
+ commands = repositories.Commands(client_api=client_api)
148
+ services = repositories.Services(client_api=client_api)
149
+ webhooks = repositories.Webhooks(client_api=client_api)
150
+ triggers = repositories.Triggers(client_api=client_api)
151
+ assignments = repositories.Assignments(client_api=client_api)
152
+ tasks = repositories.Tasks(client_api=client_api)
153
+ annotations = repositories.Annotations(client_api=client_api)
154
+ models = repositories.Models(client_api=client_api)
155
+ ontologies = repositories.Ontologies(client_api=client_api)
156
+ recipes = repositories.Recipes(client_api=client_api)
157
+ pipelines = repositories.Pipelines(client_api=client_api)
158
+ pipeline_executions = repositories.PipelineExecutions(client_api=client_api)
159
+ feature_sets = repositories.FeatureSets(client_api=client_api)
160
+ features = repositories.Features(client_api=client_api)
161
+ organizations = repositories.Organizations(client_api=client_api)
162
+ analytics = repositories.Analytics(client_api=client_api)
163
+ integrations = repositories.Integrations(client_api=client_api)
164
+ drivers = repositories.Drivers(client_api=client_api)
165
+ settings = repositories.Settings(client_api=client_api)
166
+ apps = repositories.Apps(client_api=client_api)
167
+ dpks = repositories.Dpks(client_api=client_api)
168
+ messages = repositories.Messages(client_api=client_api)
169
+ compositions = repositories.Compositions(client_api=client_api)
170
+ computes = repositories.Computes(client_api=client_api)
171
+ service_drivers = repositories.ServiceDrivers(client_api=client_api)
172
+ collections = repositories.Collections(client_api=client_api)
173
+
174
+ try:
175
+ check_sdk.check(version=__version__, client_api=client_api)
176
+ except Exception:
177
+ logger.debug("Failed to check SDK! Continue without")
178
+
179
+ verbose = client_api.verbose
180
+ login = client_api.login
181
+ logout = client_api.logout
182
+ login_token = client_api.login_token
183
+ login_secret = client_api.login_secret
184
+ login_api_key = client_api.login_api_key
185
+ login_m2m = client_api.login_m2m
186
+ add_environment = client_api.add_environment
187
+ setenv = client_api.setenv
188
+ token_expired = client_api.token_expired
189
+ info = client_api.info
190
+ cache_state = client_api.cache_state
191
+ attributes_mode = client_api.attributes_mode
192
+ sdk_cache = client_api.sdk_cache
193
+
194
+
195
+ def get_secret(secret):
196
+ return os.environ.get(secret, None)
197
+
198
+
199
+ def token():
200
+ """
201
+ token
202
+ :return: token in use
203
+ """
204
+ return client_api.token
205
+
206
+
207
+ def environment():
208
+ """
209
+ environment
210
+ :return: current environment
211
+ """
212
+ return client_api.environment
213
+
214
+
215
+ def init():
216
+ """
217
+ init current directory as a Dataloop working directory
218
+ :return:
219
+ """
220
+ from .services import CookieIO
221
+
222
+ client_api.state_io = CookieIO.init_local_cookie(create=True)
223
+ assert isinstance(client_api.state_io, CookieIO)
224
+ logger.info(".Dataloop directory initiated successfully in {}".format(os.getcwd()))
225
+
226
+
227
+ def checkout_state():
228
+ """
229
+ Return the current checked out state
230
+ :return:
231
+ """
232
+ state = client_api.state_io.read_json()
233
+ return state
234
+
235
+ class LoggingLevel:
236
+ DEBUG = "debug"
237
+ WARNING = "warning"
238
+ CRITICAL = "critical"
239
+ INFO = "info"
240
+ ERROR = "error"
241
+
242
+
243
+ #################
244
+ # ENUMS #
245
+ #################
246
+ CallbackEvent = client_api.callbacks.CallbackEvent
247
+ LOGGING_LEVEL_DEBUG = LoggingLevel.DEBUG
248
+ LOGGING_LEVEL_WARNING = LoggingLevel.WARNING
249
+ LOGGING_LEVEL_CRITICAL = LoggingLevel.CRITICAL
250
+ LOGGING_LEVEL_INFO = LoggingLevel.INFO
251
+
252
+ VERBOSE_LOGGING_LEVEL_DEBUG = VerboseLoggingLevel.DEBUG
253
+ VERBOSE_LOGGING_LEVEL_INFO = VerboseLoggingLevel.INFO
254
+ VERBOSE_LOGGING_LEVEL_WARNING = VerboseLoggingLevel.WARNING
255
+ VERBOSE_LOGGING_LEVEL_ERROR = VerboseLoggingLevel.ERROR
256
+ VERBOSE_LOGGING_LEVEL_CRITICAL = VerboseLoggingLevel.CRITICAL
257
+
258
+ HTTP_METHOD_POST = HttpMethod.POST
259
+ HTTP_METHOD_GET = HttpMethod.GET
260
+ HTTP_METHOD_DELETE = HttpMethod.DELETE
261
+ HTTP_METHOD_PATCH = HttpMethod.PATCH
262
+
263
+ VIEW_ANNOTATION_OPTIONS_JSON = ViewAnnotationOptions.JSON
264
+ VIEW_ANNOTATION_OPTIONS_MASK = ViewAnnotationOptions.MASK
265
+ VIEW_ANNOTATION_OPTIONS_ANNOTATION_ON_IMAGE = ViewAnnotationOptions.ANNOTATION_ON_IMAGE
266
+ VIEW_ANNOTATION_OPTIONS_INSTANCE = ViewAnnotationOptions.INSTANCE
267
+ VIEW_ANNOTATION_OPTIONS_VTT = ViewAnnotationOptions.VTT
268
+ VIEW_ANNOTATION_OPTIONS_OBJECT_ID = ViewAnnotationOptions.OBJECT_ID
269
+
270
+ ANNOTATION_STATUS_ISSUE = AnnotationStatus.ISSUE
271
+ ANNOTATION_STATUS_REVIEW = AnnotationStatus.REVIEW
272
+ ANNOTATION_STATUS_APPROVED = AnnotationStatus.APPROVED
273
+ ANNOTATION_STATUS_CLEAR = AnnotationStatus.CLEAR
274
+
275
+ ORGANIZATION_PLAN_FREEMIUM = OrganizationsPlans.FREEMIUM
276
+ ORGANIZATION_PLAN_PREMIUM = OrganizationsPlans.PREMIUM
277
+
278
+ EXPORT_METADATA_FROM_JSON = ExportMetadata.FROM_JSON
279
+
280
+ EXPORT_VERSION_V1 = ExportVersion.V1
281
+ EXPORT_VERSION_V2 = ExportVersion.V2
282
+
283
+ # class
284
+ ANNOTATION_TYPE_BOX = AnnotationType.BOX
285
+ ANNOTATION_TYPE_CLASSIFICATION = AnnotationType.CLASSIFICATION
286
+ ANNOTATION_TYPE_COMPARISON = AnnotationType.COMPARISON
287
+ ANNOTATION_TYPE_ELLIPSE = AnnotationType.ELLIPSE
288
+ ANNOTATION_TYPE_NOTE = AnnotationType.NOTE
289
+ ANNOTATION_TYPE_POINT = AnnotationType.POINT
290
+ ANNOTATION_TYPE_POLYGON = AnnotationType.POLYGON
291
+ ANNOTATION_TYPE_POLYLINE = AnnotationType.POLYLINE
292
+ ANNOTATION_TYPE_POSE = AnnotationType.POSE
293
+ ANNOTATION_TYPE_SEGMENTATION = AnnotationType.SEGMENTATION
294
+ ANNOTATION_TYPE_SUBTITLE = AnnotationType.SUBTITLE
295
+ ANNOTATION_TYPE_TEXT = AnnotationType.TEXT
296
+ ANNOTATION_TYPE_FREE_TEXT = AnnotationType.FREE_TEXT
297
+ ANNOTATION_TYPE_REF_IMAGE = AnnotationType.REF_IMAGE
298
+
299
+ ITEM_STATUS_COMPLETED = ItemStatus.COMPLETED
300
+ ITEM_STATUS_APPROVED = ItemStatus.APPROVED
301
+ ITEM_STATUS_DISCARDED = ItemStatus.DISCARDED
302
+
303
+ EXECUTION_STATUS_CREATED = ExecutionStatus.CREATED
304
+ EXECUTION_STATUS_IN_PROGRESS = ExecutionStatus.IN_PROGRESS
305
+ EXECUTION_STATUS_SUCCESS = ExecutionStatus.SUCCESS
306
+ EXECUTION_STATUS_FAILED = ExecutionStatus.FAILED
307
+
308
+ LINK_TYPE_ID = LinkTypeEnum.ID
309
+ LINK_TYPE_URL = LinkTypeEnum.URL
310
+
311
+ KUBERNETES_AUTUSCALER_TYPE_CPU = KubernetesAutoscalerType.CPU
312
+ KUBERNETES_AUTUSCALER_TYPE_RABBITMQ = KubernetesAutoscalerType.RABBITMQ
313
+
314
+ INSTANCE_CATALOG_REGULAR_XS = InstanceCatalog.REGULAR_XS
315
+ INSTANCE_CATALOG_REGULAR_S = InstanceCatalog.REGULAR_S
316
+ INSTANCE_CATALOG_REGULAR_M = InstanceCatalog.REGULAR_M
317
+ INSTANCE_CATALOG_REGULAR_L = InstanceCatalog.REGULAR_L
318
+ INSTANCE_CATALOG_HIGHMEM_XS = InstanceCatalog.HIGHMEM_XS
319
+ INSTANCE_CATALOG_HIGHMEM_S = InstanceCatalog.HIGHMEM_S
320
+ INSTANCE_CATALOG_HIGHMEM_M = InstanceCatalog.HIGHMEM_M
321
+ INSTANCE_CATALOG_HIGHMEM_L = InstanceCatalog.HIGHMEM_L
322
+ INSTANCE_CATALOG_GPU_T4_S = InstanceCatalog.GPU_T4_S
323
+ INSTANCE_CATALOG_GPU_T4_M = InstanceCatalog.GPU_T4_M
324
+
325
+ MODALITY_TYPE_OVERLAY = ModalityTypeEnum.OVERLAY
326
+ MODALITY_TYPE_PREVIEW = ModalityTypeEnum.PREVIEW
327
+ MODALITY_TYPE_REPLACE = ModalityTypeEnum.REPLACE
328
+
329
+ MODALITY_REF_TYPE_ID = ModalityRefTypeEnum.ID
330
+ MODALITY_REF_TYPE_URL = ModalityRefTypeEnum.URL
331
+
332
+ FILTERS_KNOWN_FIELDS_DIR = FiltersKnownFields.DIR
333
+ FILTERS_KNOWN_FIELDS_ANNOTATED = FiltersKnownFields.ANNOTATED
334
+ FILTERS_KNOWN_FIELDS_FILENAME = FiltersKnownFields.FILENAME
335
+ FILTERS_KNOWN_FIELDS_CREATED_AT = FiltersKnownFields.CREATED_AT
336
+ FILTERS_KNOWN_FIELDS_UPDATED_AT = FiltersKnownFields.UPDATED_AT
337
+ FILTERS_KNOWN_FIELDS_LABEL = FiltersKnownFields.LABEL
338
+ FILTERS_KNOWN_FIELDS_NAME = FiltersKnownFields.NAME
339
+ FILTERS_KNOWN_FIELDS_HIDDEN = FiltersKnownFields.HIDDEN
340
+ FILTERS_KNOWN_FIELDS_TYPE = FiltersKnownFields.TYPE
341
+
342
+ FILTERS_RESOURCE_ITEM = FiltersResource.ITEM
343
+ FILTERS_RESOURCE_ANNOTATION = FiltersResource.ANNOTATION
344
+ FILTERS_RESOURCE_EXECUTION = FiltersResource.EXECUTION
345
+ FILTERS_RESOURCE_PACKAGE = FiltersResource.PACKAGE
346
+ FILTERS_RESOURCE_SERVICE = FiltersResource.SERVICE
347
+ FILTERS_RESOURCE_TRIGGER = FiltersResource.TRIGGER
348
+ FILTERS_RESOURCE_MODEL = FiltersResource.MODEL
349
+ FILTERS_RESOURCE_WEBHOOK = FiltersResource.WEBHOOK
350
+ FILTERS_RESOURCE_RECIPE = FiltersResource.RECIPE
351
+ FILTERS_RESOURCE_DATASET = FiltersResource.DATASET
352
+ FILTERS_RESOURCE_ONTOLOGY = FiltersResource.ONTOLOGY
353
+
354
+ FILTERS_OPERATIONS_OR = FiltersOperations.OR
355
+ FILTERS_OPERATIONS_AND = FiltersOperations.AND
356
+ FILTERS_OPERATIONS_IN = FiltersOperations.IN
357
+ FILTERS_OPERATIONS_NOT_EQUAL = FiltersOperations.NOT_EQUAL
358
+ FILTERS_OPERATIONS_EQUAL = FiltersOperations.EQUAL
359
+ FILTERS_OPERATIONS_GREATER_THAN = FiltersOperations.GREATER_THAN
360
+ FILTERS_OPERATIONS_LESS_THAN = FiltersOperations.LESS_THAN
361
+ FILTERS_OPERATIONS_EXISTS = FiltersOperations.EXISTS
362
+
363
+ FILTERS_METHOD_OR = FiltersMethod.OR
364
+ FILTERS_METHOD_AND = FiltersMethod.AND
365
+
366
+ FILTERS_ORDERBY_DIRECTION_DESCENDING = FiltersOrderByDirection.DESCENDING
367
+ FILTERS_ORDERBY_DIRECTION_ASCENDING = FiltersOrderByDirection.ASCENDING
368
+
369
+ TRIGGER_RESOURCE_ITEM = TriggerResource.ITEM
370
+ TRIGGER_RESOURCE_DATASET = TriggerResource.DATASET
371
+ TRIGGER_RESOURCE_ANNOTATION = TriggerResource.ANNOTATION
372
+ TRIGGER_RESOURCE_ITEM_STATUS = TriggerResource.ITEM_STATUS
373
+
374
+ TRIGGER_ACTION_CREATED = TriggerAction.CREATED
375
+ TRIGGER_ACTION_UPDATED = TriggerAction.UPDATED
376
+ TRIGGER_ACTION_DELETED = TriggerAction.DELETED
377
+ TRIGGER_ACTION_STATUS_CHANGED = TriggerAction.STATUS_CHANGED
378
+ TRIGGER_ACTION_CLONE = TriggerAction.CLONE
379
+
380
+ TRIGGER_EXECUTION_MODE_ONCE = TriggerExecutionMode.ONCE
381
+ TRIGGER_EXECUTION_MODE_ALWAYS = TriggerExecutionMode.ALWAYS
382
+
383
+ TRIGGER_TYPE_EVENT = TriggerType.EVENT
384
+ TRIGGER_TYPE_CRON = TriggerType.CRON
385
+
386
+ PACKAGE_INPUT_TYPE_ITEM = PackageInputType.ITEM
387
+ PACKAGE_INPUT_TYPE_DATASET = PackageInputType.DATASET
388
+ PACKAGE_INPUT_TYPE_ANNOTATION = PackageInputType.ANNOTATION
389
+ PACKAGE_INPUT_TYPE_JSON = PackageInputType.JSON
390
+ PACKAGE_INPUT_TYPE_MODEL = PackageInputType.MODEL
391
+ PACKAGE_INPUT_TYPE_PACKAGE = PackageInputType.PACKAGE
392
+ PACKAGE_INPUT_TYPE_SERVICE = PackageInputType.SERVICE
393
+ PACKAGE_INPUT_TYPE_PROJECT = PackageInputType.PROJECT
394
+ PACKAGE_INPUT_TYPE_EXECUTION = PackageInputType.EXECUTION
395
+ PACKAGE_INPUT_TYPE_TASK = PackageInputType.TASK
396
+ PACKAGE_INPUT_TYPE_ASSIGNMENT = PackageInputType.ASSIGNMENT
397
+ PACKAGE_INPUT_TYPE_RECIPE = PackageInputType.RECIPE
398
+ PACKAGE_INPUT_TYPE_STRING = PackageInputType.STRING
399
+ PACKAGE_INPUT_TYPE_NUMBER = PackageInputType.NUMBER
400
+ PACKAGE_INPUT_TYPE_INT = PackageInputType.INT
401
+ PACKAGE_INPUT_TYPE_FLOAT = PackageInputType.FLOAT
402
+ PACKAGE_INPUT_TYPE_BOOLEAN = PackageInputType.BOOLEAN
403
+ PACKAGE_INPUT_TYPE_DATASETS = PackageInputType.DATASETS
404
+ PACKAGE_INPUT_TYPE_ITEMS = PackageInputType.ITEMS
405
+ PACKAGE_INPUT_TYPE_ANNOTATIONS = PackageInputType.ANNOTATIONS
406
+ PACKAGE_INPUT_TYPE_EXECUTIONS = PackageInputType.EXECUTIONS
407
+ PACKAGE_INPUT_TYPE_TASKS = PackageInputType.TASKS
408
+ PACKAGE_INPUT_TYPE_ASSIGNMENTS = PackageInputType.ASSIGNMENTS
409
+ PACKAGE_INPUT_TYPE_SERVICES = PackageInputType.SERVICES
410
+ PACKAGE_INPUT_TYPE_PACKAGES = PackageInputType.PACKAGES
411
+ PACKAGE_INPUT_TYPE_PROJECTS = PackageInputType.PROJECTS
412
+ PACKAGE_INPUT_TYPE_JSONS = PackageInputType.JSONS
413
+ PACKAGE_INPUT_TYPE_STRINGS = PackageInputType.STRINGS
414
+ PACKAGE_INPUT_TYPE_NUMBERS = PackageInputType.NUMBERS
415
+ PACKAGE_INPUT_TYPE_INTS = PackageInputType.INTS
416
+ PACKAGE_INPUT_TYPE_FLOATS = PackageInputType.FLOATS
417
+ PACKAGE_INPUT_TYPE_BOOLEANS = PackageInputType.BOOLEANS
418
+ PACKAGE_INPUT_TYPE_MODELS = PackageInputType.MODELS
419
+ PACKAGE_INPUT_TYPE_RECIPES = PackageInputType.RECIPES
420
+
421
+ FUNCTION_POST_ACTION_TYPE_DOWNLOAD = SlotPostActionType.DOWNLOAD
422
+ FUNCTION_POST_ACTION_TYPE_DRAW_ANNOTATION = SlotPostActionType.DRAW_ANNOTATION
423
+ FUNCTION_POST_ACTION_TYPE_NO_ACTION = SlotPostActionType.NO_ACTION
424
+
425
+ FUNCTION_DISPLAY_SCOPE_RESOURCE_ANNOTATION = SlotDisplayScopeResource.ANNOTATION
426
+ FUNCTION_DISPLAY_SCOPE_RESOURCE_ITEM = SlotDisplayScopeResource.ITEM
427
+ FUNCTION_DISPLAY_SCOPE_RESOURCE_DATASET = SlotDisplayScopeResource.DATASET
428
+ FUNCTION_DISPLAY_SCOPE_RESOURCE_DATASET_QUERY = SlotDisplayScopeResource.DATASET_QUERY
429
+ FUNCTION_DISPLAY_SCOPE_RESOURCE_TASK = SlotDisplayScopeResource.TASK
430
+
431
+ UI_BINDING_PANEL_ALL = UiBindingPanel.ALL
432
+ UI_BINDING_PANEL_TABLE = UiBindingPanel.TABLE
433
+ UI_BINDING_PANEL_STUDIO = UiBindingPanel.STUDIO
434
+ UI_BINDING_PANEL_BROWSER = UiBindingPanel.BROWSER
435
+
436
+ COMMANDS_STATUS_CREATED = CommandsStatus.CREATED
437
+ COMMANDS_STATUS_MAKING_CHILDREN = CommandsStatus.MAKING_CHILDREN
438
+ COMMANDS_STATUS_WAITING_CHILDREN = CommandsStatus.WAITING_CHILDREN
439
+ COMMANDS_STATUS_IN_PROGRESS = CommandsStatus.IN_PROGRESS
440
+ COMMANDS_STATUS_ABORTED = CommandsStatus.ABORTED
441
+ COMMANDS_STATUS_CANCELED = CommandsStatus.CANCELED
442
+ COMMANDS_STATUS_FINALIZING = CommandsStatus.FINALIZING
443
+ COMMANDS_STATUS_SUCCESS = CommandsStatus.SUCCESS
444
+ COMMANDS_STATUS_FAILED = CommandsStatus.FAILED
445
+ COMMANDS_STATUS_TIMEOUT = CommandsStatus.TIMEOUT
446
+
447
+ MEMBER_ROLE_OWNER = MemberRole.OWNER
448
+ MEMBER_ROLE_DEVELOPER = MemberRole.DEVELOPER
449
+ MEMBER_ROLE_ANNOTATOR = MemberRole.ANNOTATOR
450
+ MEMBER_ROLE_ANNOTATION_MANAGER = MemberRole.ANNOTATION_MANAGER
451
+
452
+ MEMBER_ORG_ROLE_OWNER = MemberOrgRole.OWNER
453
+ MEMBER_ORG_ROLE_ADMIN = MemberOrgRole.ADMIN
454
+ MEMBER_ORG_ROLE_MEMBER = MemberOrgRole.MEMBER
455
+ MEMBER_ORG_ROLE_WORKER = MemberOrgRole.WORKER
456
+
457
+ PACKAGE_REQUIREMENT_OP_EQUAL = RequirementOperator.EQUAL
458
+ PACKAGE_REQUIREMENT_OP_GREATER_THAN = RequirementOperator.GREATER_THAN
459
+ PACKAGE_REQUIREMENT_OP_LESS_THAN = RequirementOperator.LESS_THAN
460
+ PACKAGE_REQUIREMENT_OP_EQUAL_OR_LESS_THAN = RequirementOperator.EQUAL_OR_LESS_THAN
461
+ PACKAGE_REQUIREMENT_OP_EQUAL_OR_GREATER_THAN = RequirementOperator.EQUAL_OR_GREATER_THAN
462
+
463
+ INDEX_DRIVER_V1 = IndexDriver.V1
464
+ INDEX_DRIVER_V2 = IndexDriver.V2
465
+
466
+ CACHE_ACTION_APPLY = CacheAction.APPLY
467
+ CACHE_ACTION_DESTROY = CacheAction.DESTROY
468
+
469
+ POD_TYPE_SMALL = PodType.SMALL
470
+ POD_TYPE_MEDIUM = PodType.MEDIUM
471
+ POD_TYPE_HIGH = PodType.HIGH
472
+
473
+ ATTRIBUTES_TYPES_CHECKBOX = AttributesTypes.CHECKBOX
474
+ ATTRIBUTES_TYPES_RADIO_BUTTON = AttributesTypes.RADIO_BUTTON
475
+ ATTRIBUTES_TYPES_YES_NO = AttributesTypes.YES_NO
476
+ ATTRIBUTES_TYPES_SLIDER = AttributesTypes.SLIDER
477
+ ATTRIBUTES_TYPES_FREE_TEXT = AttributesTypes.FREE_TEXT
478
+
479
+ TASK_PRIORITY_LOW = TaskPriority.LOW
480
+ TASK_PRIORITY_MEDIUM = TaskPriority.MEDIUM
481
+ TASK_PRIORITY_HIGH = TaskPriority.HIGH
482
+
483
+ CONSENSUS_TASK_TYPE_CONSENSUS = ConsensusTaskType.CONSENSUS
484
+ CONSENSUS_TASK_TYPE_QUALIFICATION = ConsensusTaskType.QUALIFICATION
485
+ CONSENSUS_TASK_TYPE_HONEYPOT = ConsensusTaskType.HONEYPOT
486
+
487
+ SERVICE_MODE_TYPE_REGULAR = ServiceModeType.REGULAR
488
+ SERVICE_MODE_TYPE_DEBUG = ServiceModeType.DEBUG