Exemplo n.º 1
0
 def create_or_update_active_learning_score_by_tag_id(self, body, dataset_id, tag_id, **kwargs) -> \
         CreateEntityResponse:
     _check_dataset_id(dataset_id)
     if len(body.scores) > 0 and not isinstance(body.scores[0], float):
         raise AttributeError
     response_ = CreateEntityResponse(id="sampled_tag_id_xyz")
     return response_
Exemplo n.º 2
0
 def perform_tag_arithmetics(self, body: TagArithmeticsRequest, dataset_id,
                             **kwargs):
     _check_dataset_id(dataset_id)
     if (body.new_tag_name is None) or (body.new_tag_name == ''):
         return TagBitMaskResponse(bit_mask_data="0x2")
     else:
         return CreateEntityResponse(id="tag-arithmetic-created")
 def create_dataset(self, body: DatasetCreateRequest, **kwargs):
     assert isinstance(body, DatasetCreateRequest)
     id = body.name + "_id"
     dataset = DatasetData(id=id, name=body.name, last_modified_at=len(self.datasets) + 1,
                           type="", size_in_bytes=-1, n_samples=-1, created_at=-1)
     self.datasets += [dataset]
     response_ = CreateEntityResponse(id=id)
     return response_
 def create_initial_tag_by_dataset_id(self, body, dataset_id, **kwargs):
     assert isinstance(body, InitialTagCreateRequest)
     assert isinstance(dataset_id, str)
     response_ = CreateEntityResponse(id="xyz")
     return response_
 def create_sample_by_dataset_id(self, body, dataset_id, **kwargs):
     assert isinstance(body, SampleCreateRequest)
     response_ = CreateEntityResponse(id="xyz")
     return response_
 def create_or_update_active_learning_score_by_tag_id(self, body, dataset_id, tag_id, **kwargs) -> \
         CreateEntityResponse:
     response_ = CreateEntityResponse(id="sampled_tag_id_xyz")
     return response_
Exemplo n.º 7
0
 def create_sample_by_dataset_id(self, body, dataset_id, **kwargs):
     _check_dataset_id(dataset_id)
     assert isinstance(body, SampleCreateRequest)
     response_ = CreateEntityResponse(id="xyz")
     self.sample_create_requests.append(body)
     return response_