Search is not available for this dataset
repo stringlengths 2 152 ⌀ | file stringlengths 15 239 | code stringlengths 0 58.4M | file_length int64 0 58.4M | avg_line_length float64 0 1.81M | max_line_length int64 0 12.7M | extension_type stringclasses 364 values |
|---|---|---|---|---|---|---|
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/dataset_type.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class DatasetType(str, Enum):
"""
DatasetType
"""
"""
allowed enum values
"""
CROPS = 'Crops'
IMAGES = 'Images'
VIDEOS = 'Videos'
@classmethod
def from_json(cls, json_str: str) -> 'DatasetType':
"""Create an instance of DatasetType from a JSON string"""
return DatasetType(json.loads(json_str))
| 927 | 20.090909 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/dataset_update_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, constr, validator
class DatasetUpdateRequest(BaseModel):
"""
DatasetUpdateRequest
"""
name: constr(strict=True, min_length=3) = Field(...)
__properties = ["name"]
@validator('name')
def name_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 _-]+$", value):
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 _-]+$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasetUpdateRequest:
"""Create an instance of DatasetUpdateRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasetUpdateRequest:
"""Create an instance of DatasetUpdateRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasetUpdateRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasetUpdateRequest) in the input: " + str(obj))
_obj = DatasetUpdateRequest.parse_obj({
"name": obj.get("name")
})
return _obj
| 2,795 | 31.511628 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
from inspect import getfullargspec
import json
import pprint
import re # noqa: F401
from typing import Any, List, Optional
from pydantic import BaseModel, Field, StrictStr, ValidationError, validator
from lightly.openapi_generated.swagger_client.models.datasource_config_azure import DatasourceConfigAzure
from lightly.openapi_generated.swagger_client.models.datasource_config_gcs import DatasourceConfigGCS
from lightly.openapi_generated.swagger_client.models.datasource_config_lightly import DatasourceConfigLIGHTLY
from lightly.openapi_generated.swagger_client.models.datasource_config_local import DatasourceConfigLOCAL
from lightly.openapi_generated.swagger_client.models.datasource_config_obs import DatasourceConfigOBS
from lightly.openapi_generated.swagger_client.models.datasource_config_s3 import DatasourceConfigS3
from lightly.openapi_generated.swagger_client.models.datasource_config_s3_delegated_access import DatasourceConfigS3DelegatedAccess
from typing import Any, List
from pydantic import StrictStr, Field, Extra
DATASOURCECONFIG_ONE_OF_SCHEMAS = ["DatasourceConfigAzure", "DatasourceConfigGCS", "DatasourceConfigLIGHTLY", "DatasourceConfigLOCAL", "DatasourceConfigOBS", "DatasourceConfigS3", "DatasourceConfigS3DelegatedAccess"]
class DatasourceConfig(BaseModel):
"""
DatasourceConfig
"""
# data type: DatasourceConfigLIGHTLY
oneof_schema_1_validator: Optional[DatasourceConfigLIGHTLY] = None
# data type: DatasourceConfigS3
oneof_schema_2_validator: Optional[DatasourceConfigS3] = None
# data type: DatasourceConfigS3DelegatedAccess
oneof_schema_3_validator: Optional[DatasourceConfigS3DelegatedAccess] = None
# data type: DatasourceConfigGCS
oneof_schema_4_validator: Optional[DatasourceConfigGCS] = None
# data type: DatasourceConfigAzure
oneof_schema_5_validator: Optional[DatasourceConfigAzure] = None
# data type: DatasourceConfigOBS
oneof_schema_6_validator: Optional[DatasourceConfigOBS] = None
# data type: DatasourceConfigLOCAL
oneof_schema_7_validator: Optional[DatasourceConfigLOCAL] = None
actual_instance: Any
one_of_schemas: List[str] = Field(DATASOURCECONFIG_ONE_OF_SCHEMAS, const=True)
class Config:
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
discriminator_value_class_map = {
}
def __init__(self, *args, **kwargs):
if args:
if len(args) > 1:
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
if kwargs:
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
@validator('actual_instance')
def actual_instance_must_validate_oneof(cls, v):
instance = DatasourceConfig.construct()
error_messages = []
match = 0
# validate data type: DatasourceConfigLIGHTLY
if not isinstance(v, DatasourceConfigLIGHTLY):
error_messages.append(f"Error! Input type `{type(v)}` is not `DatasourceConfigLIGHTLY`")
else:
match += 1
# validate data type: DatasourceConfigS3
if not isinstance(v, DatasourceConfigS3):
error_messages.append(f"Error! Input type `{type(v)}` is not `DatasourceConfigS3`")
else:
match += 1
# validate data type: DatasourceConfigS3DelegatedAccess
if not isinstance(v, DatasourceConfigS3DelegatedAccess):
error_messages.append(f"Error! Input type `{type(v)}` is not `DatasourceConfigS3DelegatedAccess`")
else:
match += 1
# validate data type: DatasourceConfigGCS
if not isinstance(v, DatasourceConfigGCS):
error_messages.append(f"Error! Input type `{type(v)}` is not `DatasourceConfigGCS`")
else:
match += 1
# validate data type: DatasourceConfigAzure
if not isinstance(v, DatasourceConfigAzure):
error_messages.append(f"Error! Input type `{type(v)}` is not `DatasourceConfigAzure`")
else:
match += 1
# validate data type: DatasourceConfigOBS
if not isinstance(v, DatasourceConfigOBS):
error_messages.append(f"Error! Input type `{type(v)}` is not `DatasourceConfigOBS`")
else:
match += 1
# validate data type: DatasourceConfigLOCAL
if not isinstance(v, DatasourceConfigLOCAL):
error_messages.append(f"Error! Input type `{type(v)}` is not `DatasourceConfigLOCAL`")
else:
match += 1
if match > 1:
# more than 1 match
raise ValueError("Multiple matches found when setting `actual_instance` in DatasourceConfig with oneOf schemas: DatasourceConfigAzure, DatasourceConfigGCS, DatasourceConfigLIGHTLY, DatasourceConfigLOCAL, DatasourceConfigOBS, DatasourceConfigS3, DatasourceConfigS3DelegatedAccess. Details: " + ", ".join(error_messages))
elif match == 0:
# no match
raise ValueError("No match found when setting `actual_instance` in DatasourceConfig with oneOf schemas: DatasourceConfigAzure, DatasourceConfigGCS, DatasourceConfigLIGHTLY, DatasourceConfigLOCAL, DatasourceConfigOBS, DatasourceConfigS3, DatasourceConfigS3DelegatedAccess. Details: " + ", ".join(error_messages))
else:
return v
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfig:
return cls.from_json(json.dumps(obj))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfig:
"""Returns the object represented by the json string"""
instance = DatasourceConfig.construct()
error_messages = []
match = 0
# use oneOf discriminator to lookup the data type
_data_type = json.loads(json_str).get("type")
if not _data_type:
raise ValueError("Failed to lookup data type from the field `type` in the input.")
# check if data type is `DatasourceConfigAzure`
if _data_type == "AZURE":
instance.actual_instance = DatasourceConfigAzure.from_json(json_str)
return instance
# check if data type is `DatasourceConfigAzure`
if _data_type == "DatasourceConfigAzure":
instance.actual_instance = DatasourceConfigAzure.from_json(json_str)
return instance
# check if data type is `DatasourceConfigGCS`
if _data_type == "DatasourceConfigGCS":
instance.actual_instance = DatasourceConfigGCS.from_json(json_str)
return instance
# check if data type is `DatasourceConfigLIGHTLY`
if _data_type == "DatasourceConfigLIGHTLY":
instance.actual_instance = DatasourceConfigLIGHTLY.from_json(json_str)
return instance
# check if data type is `DatasourceConfigLOCAL`
if _data_type == "DatasourceConfigLOCAL":
instance.actual_instance = DatasourceConfigLOCAL.from_json(json_str)
return instance
# check if data type is `DatasourceConfigOBS`
if _data_type == "DatasourceConfigOBS":
instance.actual_instance = DatasourceConfigOBS.from_json(json_str)
return instance
# check if data type is `DatasourceConfigS3`
if _data_type == "DatasourceConfigS3":
instance.actual_instance = DatasourceConfigS3.from_json(json_str)
return instance
# check if data type is `DatasourceConfigS3DelegatedAccess`
if _data_type == "DatasourceConfigS3DelegatedAccess":
instance.actual_instance = DatasourceConfigS3DelegatedAccess.from_json(json_str)
return instance
# check if data type is `DatasourceConfigGCS`
if _data_type == "GCS":
instance.actual_instance = DatasourceConfigGCS.from_json(json_str)
return instance
# check if data type is `DatasourceConfigLIGHTLY`
if _data_type == "LIGHTLY":
instance.actual_instance = DatasourceConfigLIGHTLY.from_json(json_str)
return instance
# check if data type is `DatasourceConfigLOCAL`
if _data_type == "LOCAL":
instance.actual_instance = DatasourceConfigLOCAL.from_json(json_str)
return instance
# check if data type is `DatasourceConfigOBS`
if _data_type == "OBS":
instance.actual_instance = DatasourceConfigOBS.from_json(json_str)
return instance
# check if data type is `DatasourceConfigS3`
if _data_type == "S3":
instance.actual_instance = DatasourceConfigS3.from_json(json_str)
return instance
# check if data type is `DatasourceConfigS3DelegatedAccess`
if _data_type == "S3DelegatedAccess":
instance.actual_instance = DatasourceConfigS3DelegatedAccess.from_json(json_str)
return instance
# deserialize data into DatasourceConfigLIGHTLY
try:
instance.actual_instance = DatasourceConfigLIGHTLY.from_json(json_str)
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into DatasourceConfigS3
try:
instance.actual_instance = DatasourceConfigS3.from_json(json_str)
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into DatasourceConfigS3DelegatedAccess
try:
instance.actual_instance = DatasourceConfigS3DelegatedAccess.from_json(json_str)
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into DatasourceConfigGCS
try:
instance.actual_instance = DatasourceConfigGCS.from_json(json_str)
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into DatasourceConfigAzure
try:
instance.actual_instance = DatasourceConfigAzure.from_json(json_str)
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into DatasourceConfigOBS
try:
instance.actual_instance = DatasourceConfigOBS.from_json(json_str)
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into DatasourceConfigLOCAL
try:
instance.actual_instance = DatasourceConfigLOCAL.from_json(json_str)
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if match > 1:
# more than 1 match
raise ValueError("Multiple matches found when deserializing the JSON string into DatasourceConfig with oneOf schemas: DatasourceConfigAzure, DatasourceConfigGCS, DatasourceConfigLIGHTLY, DatasourceConfigLOCAL, DatasourceConfigOBS, DatasourceConfigS3, DatasourceConfigS3DelegatedAccess. Details: " + ", ".join(error_messages))
elif match == 0:
# no match
raise ValueError("No match found when deserializing the JSON string into DatasourceConfig with oneOf schemas: DatasourceConfigAzure, DatasourceConfigGCS, DatasourceConfigLIGHTLY, DatasourceConfigLOCAL, DatasourceConfigOBS, DatasourceConfigS3, DatasourceConfigS3DelegatedAccess. Details: " + ", ".join(error_messages))
else:
return instance
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
to_json = getattr(self.actual_instance, "to_json", None)
if callable(to_json):
return self.actual_instance.to_json(by_alias=by_alias)
else:
return json.dumps(self.actual_instance)
def to_dict(self, by_alias: bool = False) -> dict:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
to_dict = getattr(self.actual_instance, "to_dict", None)
if callable(to_dict):
return self.actual_instance.to_dict(by_alias=by_alias)
else:
# primitive type
return self.actual_instance
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.dict(by_alias=by_alias))
| 13,223 | 44.757785 | 337 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_azure.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, constr
from lightly.openapi_generated.swagger_client.models.datasource_config_base import DatasourceConfigBase
class DatasourceConfigAzure(DatasourceConfigBase):
"""
DatasourceConfigAzure
"""
account_name: constr(strict=True, min_length=1) = Field(..., alias="accountName", description="name of the Azure Storage Account")
account_key: constr(strict=True, min_length=1) = Field(..., alias="accountKey", description="key of the Azure Storage Account")
__properties = ["id", "purpose", "type", "fullPath", "thumbSuffix", "accountName", "accountKey"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigAzure:
"""Create an instance of DatasourceConfigAzure from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigAzure:
"""Create an instance of DatasourceConfigAzure from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigAzure.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigAzure) in the input: " + str(obj))
_obj = DatasourceConfigAzure.parse_obj({
"id": obj.get("id"),
"purpose": obj.get("purpose"),
"type": obj.get("type"),
"full_path": obj.get("fullPath"),
"thumb_suffix": obj.get("thumbSuffix"),
"account_name": obj.get("accountName"),
"account_key": obj.get("accountKey")
})
return _obj
| 3,155 | 35.275862 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_azure_all_of.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, constr
class DatasourceConfigAzureAllOf(BaseModel):
"""
DatasourceConfigAzureAllOf
"""
account_name: constr(strict=True, min_length=1) = Field(..., alias="accountName", description="name of the Azure Storage Account")
account_key: constr(strict=True, min_length=1) = Field(..., alias="accountKey", description="key of the Azure Storage Account")
__properties = ["accountName", "accountKey"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigAzureAllOf:
"""Create an instance of DatasourceConfigAzureAllOf from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigAzureAllOf:
"""Create an instance of DatasourceConfigAzureAllOf from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigAzureAllOf.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigAzureAllOf) in the input: " + str(obj))
_obj = DatasourceConfigAzureAllOf.parse_obj({
"account_name": obj.get("accountName"),
"account_key": obj.get("accountKey")
})
return _obj
| 2,822 | 33.851852 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_base.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
import lightly.openapi_generated.swagger_client.models
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictStr, constr, validator
from lightly.openapi_generated.swagger_client.models.datasource_purpose import DatasourcePurpose
class DatasourceConfigBase(BaseModel):
"""
DatasourceConfigBase
"""
id: Optional[constr(strict=True)] = Field(None, description="MongoDB ObjectId")
purpose: DatasourcePurpose = Field(...)
type: StrictStr = Field(...)
full_path: StrictStr = Field(..., alias="fullPath", description="path includes the bucket name and the path within the bucket where you have stored your information")
thumb_suffix: Optional[StrictStr] = Field(None, alias="thumbSuffix", description="the suffix of where to find the thumbnail image. If none is provided, the full image will be loaded where thumbnails would be loaded otherwise. - [filename]: represents the filename without the extension - [extension]: represents the files extension (e.g jpg, png, webp) ")
__properties = ["id", "purpose", "type", "fullPath", "thumbSuffix"]
@validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
# JSON field name that stores the object type
__discriminator_property_name = 'type'
# discriminator mappings
__discriminator_value_class_map = {
'DatasourceConfigAzure': 'DatasourceConfigAzure',
'DatasourceConfigGCS': 'DatasourceConfigGCS',
'DatasourceConfigLIGHTLY': 'DatasourceConfigLIGHTLY',
'DatasourceConfigLOCAL': 'DatasourceConfigLOCAL',
'DatasourceConfigOBS': 'DatasourceConfigOBS',
'DatasourceConfigS3': 'DatasourceConfigS3',
'DatasourceConfigS3DelegatedAccess': 'DatasourceConfigS3DelegatedAccess'
}
@classmethod
def get_discriminator_value(cls, obj: dict) -> str:
"""Returns the discriminator value (object type) of the data"""
discriminator_value = obj[cls.__discriminator_property_name]
if discriminator_value:
return cls.__discriminator_value_class_map.get(discriminator_value)
else:
return None
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> Union(DatasourceConfigAzure, DatasourceConfigGCS, DatasourceConfigLIGHTLY, DatasourceConfigLOCAL, DatasourceConfigOBS, DatasourceConfigS3, DatasourceConfigS3DelegatedAccess):
"""Create an instance of DatasourceConfigBase from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> Union(DatasourceConfigAzure, DatasourceConfigGCS, DatasourceConfigLIGHTLY, DatasourceConfigLOCAL, DatasourceConfigOBS, DatasourceConfigS3, DatasourceConfigS3DelegatedAccess):
"""Create an instance of DatasourceConfigBase from a dict"""
# look up the object type based on discriminator mapping
object_type = cls.get_discriminator_value(obj)
if object_type:
klass = getattr(lightly.openapi_generated.swagger_client.models, object_type)
return klass.from_dict(obj)
else:
raise ValueError("DatasourceConfigBase failed to lookup discriminator value from " +
json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name +
", mapping: " + json.dumps(cls.__discriminator_value_class_map))
| 5,017 | 43.803571 | 359 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_gcs.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictStr, constr
from lightly.openapi_generated.swagger_client.models.datasource_config_base import DatasourceConfigBase
class DatasourceConfigGCS(DatasourceConfigBase):
"""
DatasourceConfigGCS
"""
gcs_project_id: constr(strict=True, min_length=1) = Field(..., alias="gcsProjectId", description="The projectId where you have your bucket configured")
gcs_credentials: StrictStr = Field(..., alias="gcsCredentials", description="this is the content of the credentials JSON file stringified which you downloaded from Google Cloud Platform")
__properties = ["id", "purpose", "type", "fullPath", "thumbSuffix", "gcsProjectId", "gcsCredentials"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigGCS:
"""Create an instance of DatasourceConfigGCS from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigGCS:
"""Create an instance of DatasourceConfigGCS from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigGCS.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigGCS) in the input: " + str(obj))
_obj = DatasourceConfigGCS.parse_obj({
"id": obj.get("id"),
"purpose": obj.get("purpose"),
"type": obj.get("type"),
"full_path": obj.get("fullPath"),
"thumb_suffix": obj.get("thumbSuffix"),
"gcs_project_id": obj.get("gcsProjectId"),
"gcs_credentials": obj.get("gcsCredentials")
})
return _obj
| 3,245 | 36.310345 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_gcs_all_of.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictStr, constr
class DatasourceConfigGCSAllOf(BaseModel):
"""
DatasourceConfigGCSAllOf
"""
gcs_project_id: constr(strict=True, min_length=1) = Field(..., alias="gcsProjectId", description="The projectId where you have your bucket configured")
gcs_credentials: StrictStr = Field(..., alias="gcsCredentials", description="this is the content of the credentials JSON file stringified which you downloaded from Google Cloud Platform")
__properties = ["gcsProjectId", "gcsCredentials"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigGCSAllOf:
"""Create an instance of DatasourceConfigGCSAllOf from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigGCSAllOf:
"""Create an instance of DatasourceConfigGCSAllOf from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigGCSAllOf.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigGCSAllOf) in the input: " + str(obj))
_obj = DatasourceConfigGCSAllOf.parse_obj({
"gcs_project_id": obj.get("gcsProjectId"),
"gcs_credentials": obj.get("gcsCredentials")
})
return _obj
| 2,912 | 34.962963 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_lightly.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel
from lightly.openapi_generated.swagger_client.models.datasource_config_base import DatasourceConfigBase
class DatasourceConfigLIGHTLY(DatasourceConfigBase):
"""
DatasourceConfigLIGHTLY
"""
__properties = ["id", "purpose", "type", "fullPath", "thumbSuffix"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigLIGHTLY:
"""Create an instance of DatasourceConfigLIGHTLY from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigLIGHTLY:
"""Create an instance of DatasourceConfigLIGHTLY from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigLIGHTLY.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigLIGHTLY) in the input: " + str(obj))
_obj = DatasourceConfigLIGHTLY.parse_obj({
"id": obj.get("id"),
"purpose": obj.get("purpose"),
"type": obj.get("type"),
"full_path": obj.get("fullPath"),
"thumb_suffix": obj.get("thumbSuffix")
})
return _obj
| 2,760 | 32.26506 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_local.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel
from lightly.openapi_generated.swagger_client.models.datasource_config_base import DatasourceConfigBase
class DatasourceConfigLOCAL(DatasourceConfigBase):
"""
DatasourceConfigLOCAL
"""
__properties = ["id", "purpose", "type", "fullPath", "thumbSuffix"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigLOCAL:
"""Create an instance of DatasourceConfigLOCAL from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigLOCAL:
"""Create an instance of DatasourceConfigLOCAL from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigLOCAL.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigLOCAL) in the input: " + str(obj))
_obj = DatasourceConfigLOCAL.parse_obj({
"id": obj.get("id"),
"purpose": obj.get("purpose"),
"type": obj.get("type"),
"full_path": obj.get("fullPath"),
"thumb_suffix": obj.get("thumbSuffix")
})
return _obj
| 2,742 | 32.048193 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_obs.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, constr, validator
from lightly.openapi_generated.swagger_client.models.datasource_config_base import DatasourceConfigBase
class DatasourceConfigOBS(DatasourceConfigBase):
"""
DatasourceConfigOBS
"""
obs_endpoint: constr(strict=True, min_length=1) = Field(..., alias="obsEndpoint", description="The Object Storage Service (OBS) endpoint to use of your S3 compatible cloud storage provider")
obs_access_key_id: constr(strict=True, min_length=1) = Field(..., alias="obsAccessKeyId", description="The Access Key Id of the credential you are providing Lightly to use")
obs_secret_access_key: constr(strict=True, min_length=1) = Field(..., alias="obsSecretAccessKey", description="The Secret Access Key of the credential you are providing Lightly to use")
__properties = ["id", "purpose", "type", "fullPath", "thumbSuffix", "obsEndpoint", "obsAccessKeyId", "obsSecretAccessKey"]
@validator('obs_endpoint')
def obs_endpoint_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^https?:\/\/.+$", value):
raise ValueError(r"must validate the regular expression /^https?:\/\/.+$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigOBS:
"""Create an instance of DatasourceConfigOBS from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigOBS:
"""Create an instance of DatasourceConfigOBS from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigOBS.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigOBS) in the input: " + str(obj))
_obj = DatasourceConfigOBS.parse_obj({
"id": obj.get("id"),
"purpose": obj.get("purpose"),
"type": obj.get("type"),
"full_path": obj.get("fullPath"),
"thumb_suffix": obj.get("thumbSuffix"),
"obs_endpoint": obj.get("obsEndpoint"),
"obs_access_key_id": obj.get("obsAccessKeyId"),
"obs_secret_access_key": obj.get("obsSecretAccessKey")
})
return _obj
| 3,850 | 39.114583 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_obs_all_of.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, constr, validator
class DatasourceConfigOBSAllOf(BaseModel):
"""
Object Storage Service (OBS) is a S3 (AWS) compatible cloud storage like openstack
"""
obs_endpoint: constr(strict=True, min_length=1) = Field(..., alias="obsEndpoint", description="The Object Storage Service (OBS) endpoint to use of your S3 compatible cloud storage provider")
obs_access_key_id: constr(strict=True, min_length=1) = Field(..., alias="obsAccessKeyId", description="The Access Key Id of the credential you are providing Lightly to use")
obs_secret_access_key: constr(strict=True, min_length=1) = Field(..., alias="obsSecretAccessKey", description="The Secret Access Key of the credential you are providing Lightly to use")
__properties = ["obsEndpoint", "obsAccessKeyId", "obsSecretAccessKey"]
@validator('obs_endpoint')
def obs_endpoint_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^https?:\/\/.+$", value):
raise ValueError(r"must validate the regular expression /^https?:\/\/.+$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigOBSAllOf:
"""Create an instance of DatasourceConfigOBSAllOf from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigOBSAllOf:
"""Create an instance of DatasourceConfigOBSAllOf from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigOBSAllOf.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigOBSAllOf) in the input: " + str(obj))
_obj = DatasourceConfigOBSAllOf.parse_obj({
"obs_endpoint": obj.get("obsEndpoint"),
"obs_access_key_id": obj.get("obsAccessKeyId"),
"obs_secret_access_key": obj.get("obsSecretAccessKey")
})
return _obj
| 3,575 | 38.733333 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_s3.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, constr, validator
from lightly.openapi_generated.swagger_client.models.datasource_config_base import DatasourceConfigBase
from lightly.openapi_generated.swagger_client.models.s3_region import S3Region
class DatasourceConfigS3(DatasourceConfigBase):
"""
DatasourceConfigS3
"""
s3_region: S3Region = Field(..., alias="s3Region")
s3_access_key_id: constr(strict=True, min_length=1) = Field(..., alias="s3AccessKeyId", description="The accessKeyId of the credential you are providing Lightly to use")
s3_secret_access_key: constr(strict=True, min_length=1) = Field(..., alias="s3SecretAccessKey", description="The secretAccessKey of the credential you are providing Lightly to use")
s3_server_side_encryption_kms_key: Optional[constr(strict=True, min_length=1)] = Field(None, alias="s3ServerSideEncryptionKMSKey", description="If set, Lightly Worker will automatically set the headers to use server side encryption https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html with this value as the appropriate KMS key arn. This will encrypt the files created by Lightly (crops, frames, thumbnails) in the S3 bucket. ")
__properties = ["id", "purpose", "type", "fullPath", "thumbSuffix", "s3Region", "s3AccessKeyId", "s3SecretAccessKey", "s3ServerSideEncryptionKMSKey"]
@validator('s3_server_side_encryption_kms_key')
def s3_server_side_encryption_kms_key_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^arn:aws:kms:[a-zA-Z0-9-]*:[0-9]{12}:key.+$", value):
raise ValueError(r"must validate the regular expression /^arn:aws:kms:[a-zA-Z0-9-]*:[0-9]{12}:key.+$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigS3:
"""Create an instance of DatasourceConfigS3 from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigS3:
"""Create an instance of DatasourceConfigS3 from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigS3.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigS3) in the input: " + str(obj))
_obj = DatasourceConfigS3.parse_obj({
"id": obj.get("id"),
"purpose": obj.get("purpose"),
"type": obj.get("type"),
"full_path": obj.get("fullPath"),
"thumb_suffix": obj.get("thumbSuffix"),
"s3_region": obj.get("s3Region"),
"s3_access_key_id": obj.get("s3AccessKeyId"),
"s3_secret_access_key": obj.get("s3SecretAccessKey"),
"s3_server_side_encryption_kms_key": obj.get("s3ServerSideEncryptionKMSKey")
})
return _obj
| 4,514 | 43.264706 | 457 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_s3_all_of.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, constr, validator
from lightly.openapi_generated.swagger_client.models.s3_region import S3Region
class DatasourceConfigS3AllOf(BaseModel):
"""
DatasourceConfigS3AllOf
"""
s3_region: S3Region = Field(..., alias="s3Region")
s3_access_key_id: constr(strict=True, min_length=1) = Field(..., alias="s3AccessKeyId", description="The accessKeyId of the credential you are providing Lightly to use")
s3_secret_access_key: constr(strict=True, min_length=1) = Field(..., alias="s3SecretAccessKey", description="The secretAccessKey of the credential you are providing Lightly to use")
s3_server_side_encryption_kms_key: Optional[constr(strict=True, min_length=1)] = Field(None, alias="s3ServerSideEncryptionKMSKey", description="If set, Lightly Worker will automatically set the headers to use server side encryption https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html with this value as the appropriate KMS key arn. This will encrypt the files created by Lightly (crops, frames, thumbnails) in the S3 bucket. ")
__properties = ["s3Region", "s3AccessKeyId", "s3SecretAccessKey", "s3ServerSideEncryptionKMSKey"]
@validator('s3_server_side_encryption_kms_key')
def s3_server_side_encryption_kms_key_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^arn:aws:kms:[a-zA-Z0-9-]*:[0-9]{12}:key.+$", value):
raise ValueError(r"must validate the regular expression /^arn:aws:kms:[a-zA-Z0-9-]*:[0-9]{12}:key.+$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigS3AllOf:
"""Create an instance of DatasourceConfigS3AllOf from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigS3AllOf:
"""Create an instance of DatasourceConfigS3AllOf from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigS3AllOf.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigS3AllOf) in the input: " + str(obj))
_obj = DatasourceConfigS3AllOf.parse_obj({
"s3_region": obj.get("s3Region"),
"s3_access_key_id": obj.get("s3AccessKeyId"),
"s3_secret_access_key": obj.get("s3SecretAccessKey"),
"s3_server_side_encryption_kms_key": obj.get("s3ServerSideEncryptionKMSKey")
})
return _obj
| 4,181 | 42.5625 | 457 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_s3_delegated_access.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, constr, validator
from lightly.openapi_generated.swagger_client.models.datasource_config_base import DatasourceConfigBase
from lightly.openapi_generated.swagger_client.models.s3_region import S3Region
class DatasourceConfigS3DelegatedAccess(DatasourceConfigBase):
"""
DatasourceConfigS3DelegatedAccess
"""
s3_region: S3Region = Field(..., alias="s3Region")
s3_external_id: constr(strict=True, min_length=10) = Field(..., alias="s3ExternalId", description="The external ID specified when creating the role.")
s3_arn: constr(strict=True, min_length=12) = Field(..., alias="s3ARN", description="The ARN of the role you created")
s3_server_side_encryption_kms_key: Optional[constr(strict=True, min_length=1)] = Field(None, alias="s3ServerSideEncryptionKMSKey", description="If set, Lightly Worker will automatically set the headers to use server side encryption https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html with this value as the appropriate KMS key arn. This will encrypt the files created by Lightly (crops, frames, thumbnails) in the S3 bucket. ")
__properties = ["id", "purpose", "type", "fullPath", "thumbSuffix", "s3Region", "s3ExternalId", "s3ARN", "s3ServerSideEncryptionKMSKey"]
@validator('s3_external_id')
def s3_external_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-zA-Z0-9_+=,.@:\/-]+$", value):
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9_+=,.@:\/-]+$/")
return value
@validator('s3_arn')
def s3_arn_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^arn:aws:iam::[0-9]{12}:role.+$", value):
raise ValueError(r"must validate the regular expression /^arn:aws:iam::[0-9]{12}:role.+$/")
return value
@validator('s3_server_side_encryption_kms_key')
def s3_server_side_encryption_kms_key_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^arn:aws:kms:[a-zA-Z0-9-]*:[0-9]{12}:key.+$", value):
raise ValueError(r"must validate the regular expression /^arn:aws:kms:[a-zA-Z0-9-]*:[0-9]{12}:key.+$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigS3DelegatedAccess:
"""Create an instance of DatasourceConfigS3DelegatedAccess from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigS3DelegatedAccess:
"""Create an instance of DatasourceConfigS3DelegatedAccess from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigS3DelegatedAccess.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigS3DelegatedAccess) in the input: " + str(obj))
_obj = DatasourceConfigS3DelegatedAccess.parse_obj({
"id": obj.get("id"),
"purpose": obj.get("purpose"),
"type": obj.get("type"),
"full_path": obj.get("fullPath"),
"thumb_suffix": obj.get("thumbSuffix"),
"s3_region": obj.get("s3Region"),
"s3_external_id": obj.get("s3ExternalId"),
"s3_arn": obj.get("s3ARN"),
"s3_server_side_encryption_kms_key": obj.get("s3ServerSideEncryptionKMSKey")
})
return _obj
| 5,170 | 43.577586 | 457 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_s3_delegated_access_all_of.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, constr, validator
from lightly.openapi_generated.swagger_client.models.s3_region import S3Region
class DatasourceConfigS3DelegatedAccessAllOf(BaseModel):
"""
DatasourceConfigS3DelegatedAccessAllOf
"""
s3_region: S3Region = Field(..., alias="s3Region")
s3_external_id: constr(strict=True, min_length=10) = Field(..., alias="s3ExternalId", description="The external ID specified when creating the role.")
s3_arn: constr(strict=True, min_length=12) = Field(..., alias="s3ARN", description="The ARN of the role you created")
s3_server_side_encryption_kms_key: Optional[constr(strict=True, min_length=1)] = Field(None, alias="s3ServerSideEncryptionKMSKey", description="If set, Lightly Worker will automatically set the headers to use server side encryption https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html with this value as the appropriate KMS key arn. This will encrypt the files created by Lightly (crops, frames, thumbnails) in the S3 bucket. ")
__properties = ["s3Region", "s3ExternalId", "s3ARN", "s3ServerSideEncryptionKMSKey"]
@validator('s3_external_id')
def s3_external_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-zA-Z0-9_+=,.@:\/-]+$", value):
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9_+=,.@:\/-]+$/")
return value
@validator('s3_arn')
def s3_arn_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^arn:aws:iam::[0-9]{12}:role.+$", value):
raise ValueError(r"must validate the regular expression /^arn:aws:iam::[0-9]{12}:role.+$/")
return value
@validator('s3_server_side_encryption_kms_key')
def s3_server_side_encryption_kms_key_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^arn:aws:kms:[a-zA-Z0-9-]*:[0-9]{12}:key.+$", value):
raise ValueError(r"must validate the regular expression /^arn:aws:kms:[a-zA-Z0-9-]*:[0-9]{12}:key.+$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigS3DelegatedAccessAllOf:
"""Create an instance of DatasourceConfigS3DelegatedAccessAllOf from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigS3DelegatedAccessAllOf:
"""Create an instance of DatasourceConfigS3DelegatedAccessAllOf from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigS3DelegatedAccessAllOf.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigS3DelegatedAccessAllOf) in the input: " + str(obj))
_obj = DatasourceConfigS3DelegatedAccessAllOf.parse_obj({
"s3_region": obj.get("s3Region"),
"s3_external_id": obj.get("s3ExternalId"),
"s3_arn": obj.get("s3ARN"),
"s3_server_side_encryption_kms_key": obj.get("s3ServerSideEncryptionKMSKey")
})
return _obj
| 4,837 | 42.981818 | 457 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_verify_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictBool
from lightly.openapi_generated.swagger_client.models.datasource_config_verify_data_errors import DatasourceConfigVerifyDataErrors
class DatasourceConfigVerifyData(BaseModel):
"""
DatasourceConfigVerifyData
"""
can_read: StrictBool = Field(..., alias="canRead")
can_write: StrictBool = Field(..., alias="canWrite")
can_list: StrictBool = Field(..., alias="canList")
can_overwrite: StrictBool = Field(..., alias="canOverwrite")
errors: Optional[DatasourceConfigVerifyDataErrors] = None
__properties = ["canRead", "canWrite", "canList", "canOverwrite", "errors"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigVerifyData:
"""Create an instance of DatasourceConfigVerifyData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of errors
if self.errors:
_dict['errors' if by_alias else 'errors'] = self.errors.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigVerifyData:
"""Create an instance of DatasourceConfigVerifyData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigVerifyData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigVerifyData) in the input: " + str(obj))
_obj = DatasourceConfigVerifyData.parse_obj({
"can_read": obj.get("canRead"),
"can_write": obj.get("canWrite"),
"can_list": obj.get("canList"),
"can_overwrite": obj.get("canOverwrite"),
"errors": DatasourceConfigVerifyDataErrors.from_dict(obj.get("errors")) if obj.get("errors") is not None else None
})
return _obj
| 3,459 | 37.021978 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_config_verify_data_errors.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictStr
class DatasourceConfigVerifyDataErrors(BaseModel):
"""
DatasourceConfigVerifyDataErrors
"""
can_read: Optional[StrictStr] = Field(None, alias="canRead")
can_write: Optional[StrictStr] = Field(None, alias="canWrite")
can_list: Optional[StrictStr] = Field(None, alias="canList")
can_overwrite: Optional[StrictStr] = Field(None, alias="canOverwrite")
__properties = ["canRead", "canWrite", "canList", "canOverwrite"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceConfigVerifyDataErrors:
"""Create an instance of DatasourceConfigVerifyDataErrors from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceConfigVerifyDataErrors:
"""Create an instance of DatasourceConfigVerifyDataErrors from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceConfigVerifyDataErrors.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceConfigVerifyDataErrors) in the input: " + str(obj))
_obj = DatasourceConfigVerifyDataErrors.parse_obj({
"can_read": obj.get("canRead"),
"can_write": obj.get("canWrite"),
"can_list": obj.get("canList"),
"can_overwrite": obj.get("canOverwrite")
})
return _obj
| 3,018 | 34.517647 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_processed_until_timestamp_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, conint
class DatasourceProcessedUntilTimestampRequest(BaseModel):
"""
DatasourceProcessedUntilTimestampRequest
"""
processed_until_timestamp: conint(strict=True, ge=0) = Field(..., alias="processedUntilTimestamp", description="unix timestamp in milliseconds")
__properties = ["processedUntilTimestamp"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceProcessedUntilTimestampRequest:
"""Create an instance of DatasourceProcessedUntilTimestampRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceProcessedUntilTimestampRequest:
"""Create an instance of DatasourceProcessedUntilTimestampRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceProcessedUntilTimestampRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceProcessedUntilTimestampRequest) in the input: " + str(obj))
_obj = DatasourceProcessedUntilTimestampRequest.parse_obj({
"processed_until_timestamp": obj.get("processedUntilTimestamp")
})
return _obj
| 2,803 | 34.493671 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_processed_until_timestamp_response.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, conint
class DatasourceProcessedUntilTimestampResponse(BaseModel):
"""
DatasourceProcessedUntilTimestampResponse
"""
processed_until_timestamp: conint(strict=True, ge=0) = Field(..., alias="processedUntilTimestamp", description="unix timestamp in milliseconds")
__properties = ["processedUntilTimestamp"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceProcessedUntilTimestampResponse:
"""Create an instance of DatasourceProcessedUntilTimestampResponse from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceProcessedUntilTimestampResponse:
"""Create an instance of DatasourceProcessedUntilTimestampResponse from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceProcessedUntilTimestampResponse.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceProcessedUntilTimestampResponse) in the input: " + str(obj))
_obj = DatasourceProcessedUntilTimestampResponse.parse_obj({
"processed_until_timestamp": obj.get("processedUntilTimestamp")
})
return _obj
| 2,812 | 34.607595 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_purpose.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class DatasourcePurpose(str, Enum):
"""
The datasource purpose and for which use-cases it is needed. - INPUT_OUTPUT: Is used as source of raw data and predictions/metadata within .lightly as well as destination for writing thumbnails, crops or video frame within .lightly - INPUT: Is only used as source of raw data - LIGHTLY: Is used as source of predictions/metadata within .lightly as well as destination for writing thumbnails, crops or video frames within .lightly
"""
"""
allowed enum values
"""
INPUT_OUTPUT = 'INPUT_OUTPUT'
INPUT = 'INPUT'
LIGHTLY = 'LIGHTLY'
@classmethod
def from_json(cls, json_str: str) -> 'DatasourcePurpose':
"""Create an instance of DatasourcePurpose from a JSON string"""
return DatasourcePurpose(json.loads(json_str))
| 1,384 | 30.477273 | 434 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_raw_samples_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List
from pydantic import Extra, BaseModel, Field, StrictBool, StrictStr, conlist
from lightly.openapi_generated.swagger_client.models.datasource_raw_samples_data_row import DatasourceRawSamplesDataRow
class DatasourceRawSamplesData(BaseModel):
"""
DatasourceRawSamplesData
"""
has_more: StrictBool = Field(..., alias="hasMore", description="Set to `false` if end of list is reached. Otherwise `true`.")
cursor: StrictStr = Field(..., description="A cursor that indicates the current position in the list. Must be passed to future requests to continue reading from the same list. ")
data: conlist(DatasourceRawSamplesDataRow) = Field(..., description="Array containing the sample objects")
__properties = ["hasMore", "cursor", "data"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceRawSamplesData:
"""Create an instance of DatasourceRawSamplesData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of each item in data (list)
_items = []
if self.data:
for _item in self.data:
if _item:
_items.append(_item.to_dict(by_alias=by_alias))
_dict['data' if by_alias else 'data'] = _items
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceRawSamplesData:
"""Create an instance of DatasourceRawSamplesData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceRawSamplesData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceRawSamplesData) in the input: " + str(obj))
_obj = DatasourceRawSamplesData.parse_obj({
"has_more": obj.get("hasMore"),
"cursor": obj.get("cursor"),
"data": [DatasourceRawSamplesDataRow.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None
})
return _obj
| 3,583 | 38.384615 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_raw_samples_data_row.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictStr
class DatasourceRawSamplesDataRow(BaseModel):
"""
Filename and corresponding read url for a sample in the datasource
"""
file_name: StrictStr = Field(..., alias="fileName")
read_url: StrictStr = Field(..., alias="readUrl", description="A URL which allows anyone in possession of said URL to access the resource")
__properties = ["fileName", "readUrl"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceRawSamplesDataRow:
"""Create an instance of DatasourceRawSamplesDataRow from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceRawSamplesDataRow:
"""Create an instance of DatasourceRawSamplesDataRow from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceRawSamplesDataRow.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceRawSamplesDataRow) in the input: " + str(obj))
_obj = DatasourceRawSamplesDataRow.parse_obj({
"file_name": obj.get("fileName"),
"read_url": obj.get("readUrl")
})
return _obj
| 2,788 | 33.432099 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_raw_samples_metadata_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List
from pydantic import Extra, BaseModel, Field, StrictBool, StrictStr, conlist
from lightly.openapi_generated.swagger_client.models.datasource_raw_samples_metadata_data_row import DatasourceRawSamplesMetadataDataRow
class DatasourceRawSamplesMetadataData(BaseModel):
"""
DatasourceRawSamplesMetadataData
"""
has_more: StrictBool = Field(..., alias="hasMore", description="Set to `false` if end of list is reached. Otherwise `true`.")
cursor: StrictStr = Field(..., description="A cursor that indicates the current position in the list. Must be passed to future requests to continue reading from the same list. ")
data: conlist(DatasourceRawSamplesMetadataDataRow) = Field(..., description="Array containing the raw samples metadata objects")
__properties = ["hasMore", "cursor", "data"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceRawSamplesMetadataData:
"""Create an instance of DatasourceRawSamplesMetadataData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of each item in data (list)
_items = []
if self.data:
for _item in self.data:
if _item:
_items.append(_item.to_dict(by_alias=by_alias))
_dict['data' if by_alias else 'data'] = _items
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceRawSamplesMetadataData:
"""Create an instance of DatasourceRawSamplesMetadataData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceRawSamplesMetadataData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceRawSamplesMetadataData) in the input: " + str(obj))
_obj = DatasourceRawSamplesMetadataData.parse_obj({
"has_more": obj.get("hasMore"),
"cursor": obj.get("cursor"),
"data": [DatasourceRawSamplesMetadataDataRow.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None
})
return _obj
| 3,702 | 39.692308 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_raw_samples_metadata_data_row.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictStr
class DatasourceRawSamplesMetadataDataRow(BaseModel):
"""
Filename and corresponding read url for the metadata of a sample in the datasource
"""
file_name: StrictStr = Field(..., alias="fileName")
read_url: StrictStr = Field(..., alias="readUrl", description="A URL which allows anyone in possession of said URL to access the resource")
__properties = ["fileName", "readUrl"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceRawSamplesMetadataDataRow:
"""Create an instance of DatasourceRawSamplesMetadataDataRow from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceRawSamplesMetadataDataRow:
"""Create an instance of DatasourceRawSamplesMetadataDataRow from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceRawSamplesMetadataDataRow.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceRawSamplesMetadataDataRow) in the input: " + str(obj))
_obj = DatasourceRawSamplesMetadataDataRow.parse_obj({
"file_name": obj.get("fileName"),
"read_url": obj.get("readUrl")
})
return _obj
| 2,868 | 34.419753 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_raw_samples_predictions_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List
from pydantic import Extra, BaseModel, Field, StrictBool, StrictStr, conlist
from lightly.openapi_generated.swagger_client.models.datasource_raw_samples_predictions_data_row import DatasourceRawSamplesPredictionsDataRow
class DatasourceRawSamplesPredictionsData(BaseModel):
"""
DatasourceRawSamplesPredictionsData
"""
has_more: StrictBool = Field(..., alias="hasMore", description="Set to `false` if end of list is reached. Otherwise `true`.")
cursor: StrictStr = Field(..., description="A cursor that indicates the current position in the list. Must be passed to future requests to continue reading from the same list. ")
data: conlist(DatasourceRawSamplesPredictionsDataRow) = Field(..., description="Array containing the raw samples prediction objects")
__properties = ["hasMore", "cursor", "data"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceRawSamplesPredictionsData:
"""Create an instance of DatasourceRawSamplesPredictionsData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of each item in data (list)
_items = []
if self.data:
for _item in self.data:
if _item:
_items.append(_item.to_dict(by_alias=by_alias))
_dict['data' if by_alias else 'data'] = _items
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceRawSamplesPredictionsData:
"""Create an instance of DatasourceRawSamplesPredictionsData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceRawSamplesPredictionsData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceRawSamplesPredictionsData) in the input: " + str(obj))
_obj = DatasourceRawSamplesPredictionsData.parse_obj({
"has_more": obj.get("hasMore"),
"cursor": obj.get("cursor"),
"data": [DatasourceRawSamplesPredictionsDataRow.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None
})
return _obj
| 3,743 | 40.142857 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/datasource_raw_samples_predictions_data_row.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictStr
class DatasourceRawSamplesPredictionsDataRow(BaseModel):
"""
Filename and corresponding read url for a samples prediction in the datasource
"""
file_name: StrictStr = Field(..., alias="fileName")
read_url: StrictStr = Field(..., alias="readUrl", description="A URL which allows anyone in possession of said URL to access the resource")
__properties = ["fileName", "readUrl"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DatasourceRawSamplesPredictionsDataRow:
"""Create an instance of DatasourceRawSamplesPredictionsDataRow from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DatasourceRawSamplesPredictionsDataRow:
"""Create an instance of DatasourceRawSamplesPredictionsDataRow from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DatasourceRawSamplesPredictionsDataRow.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DatasourceRawSamplesPredictionsDataRow) in the input: " + str(obj))
_obj = DatasourceRawSamplesPredictionsDataRow.parse_obj({
"file_name": obj.get("fileName"),
"read_url": obj.get("readUrl")
})
return _obj
| 2,888 | 34.666667 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/dimensionality_reduction_method.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class DimensionalityReductionMethod(str, Enum):
"""
Method which was used to create the 2d embeddings
"""
"""
allowed enum values
"""
PCA = 'PCA'
TSNE = 'TSNE'
UMAP = 'UMAP'
@classmethod
def from_json(cls, json_str: str) -> 'DimensionalityReductionMethod':
"""Create an instance of DimensionalityReductionMethod from a JSON string"""
return DimensionalityReductionMethod(json.loads(json_str))
| 1,025 | 22.318182 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_authorization_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, conint
from lightly.openapi_generated.swagger_client.models.docker_task_description import DockerTaskDescription
class DockerAuthorizationRequest(BaseModel):
"""
DockerAuthorizationRequest
"""
timestamp: conint(strict=True, ge=0) = Field(..., description="unix timestamp in milliseconds")
task_description: DockerTaskDescription = Field(..., alias="taskDescription")
__properties = ["timestamp", "taskDescription"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerAuthorizationRequest:
"""Create an instance of DockerAuthorizationRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of task_description
if self.task_description:
_dict['taskDescription' if by_alias else 'task_description'] = self.task_description.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerAuthorizationRequest:
"""Create an instance of DockerAuthorizationRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerAuthorizationRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerAuthorizationRequest) in the input: " + str(obj))
_obj = DockerAuthorizationRequest.parse_obj({
"timestamp": obj.get("timestamp"),
"task_description": DockerTaskDescription.from_dict(obj.get("taskDescription")) if obj.get("taskDescription") is not None else None
})
return _obj
| 3,189 | 36.529412 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_authorization_response.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictStr
class DockerAuthorizationResponse(BaseModel):
"""
DockerAuthorizationResponse
"""
body_string: StrictStr = Field(..., alias="bodyString")
body_hmac: StrictStr = Field(..., alias="bodyHmac")
__properties = ["bodyString", "bodyHmac"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerAuthorizationResponse:
"""Create an instance of DockerAuthorizationResponse from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerAuthorizationResponse:
"""Create an instance of DockerAuthorizationResponse from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerAuthorizationResponse.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerAuthorizationResponse) in the input: " + str(obj))
_obj = DockerAuthorizationResponse.parse_obj({
"body_string": obj.get("bodyString"),
"body_hmac": obj.get("bodyHmac")
})
return _obj
| 2,674 | 32.024691 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_license_information.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictBool, StrictStr, conint
class DockerLicenseInformation(BaseModel):
"""
DockerLicenseInformation
"""
license_type: StrictStr = Field(..., alias="licenseType")
license_expiration_date: conint(strict=True, ge=0) = Field(..., alias="licenseExpirationDate", description="unix timestamp in milliseconds")
license_is_valid: StrictBool = Field(..., alias="licenseIsValid")
__properties = ["licenseType", "licenseExpirationDate", "licenseIsValid"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerLicenseInformation:
"""Create an instance of DockerLicenseInformation from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerLicenseInformation:
"""Create an instance of DockerLicenseInformation from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerLicenseInformation.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerLicenseInformation) in the input: " + str(obj))
_obj = DockerLicenseInformation.parse_obj({
"license_type": obj.get("licenseType"),
"license_expiration_date": obj.get("licenseExpirationDate"),
"license_is_valid": obj.get("licenseIsValid")
})
return _obj
| 2,948 | 34.53012 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_artifact_create_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictStr
from lightly.openapi_generated.swagger_client.models.docker_run_artifact_storage_location import DockerRunArtifactStorageLocation
from lightly.openapi_generated.swagger_client.models.docker_run_artifact_type import DockerRunArtifactType
class DockerRunArtifactCreateRequest(BaseModel):
"""
DockerRunArtifactCreateRequest
"""
file_name: StrictStr = Field(..., alias="fileName", description="the fileName of the artifact")
type: DockerRunArtifactType = Field(...)
storage_location: Optional[DockerRunArtifactStorageLocation] = Field(None, alias="storageLocation")
__properties = ["fileName", "type", "storageLocation"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerRunArtifactCreateRequest:
"""Create an instance of DockerRunArtifactCreateRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerRunArtifactCreateRequest:
"""Create an instance of DockerRunArtifactCreateRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerRunArtifactCreateRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerRunArtifactCreateRequest) in the input: " + str(obj))
_obj = DockerRunArtifactCreateRequest.parse_obj({
"file_name": obj.get("fileName"),
"type": obj.get("type"),
"storage_location": obj.get("storageLocation")
})
return _obj
| 3,158 | 36.164706 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_artifact_created_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictStr
class DockerRunArtifactCreatedData(BaseModel):
"""
DockerRunArtifactCreatedData
"""
signed_write_url: StrictStr = Field(..., alias="signedWriteUrl")
artifact_id: StrictStr = Field(..., alias="artifactId")
__properties = ["signedWriteUrl", "artifactId"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerRunArtifactCreatedData:
"""Create an instance of DockerRunArtifactCreatedData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerRunArtifactCreatedData:
"""Create an instance of DockerRunArtifactCreatedData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerRunArtifactCreatedData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerRunArtifactCreatedData) in the input: " + str(obj))
_obj = DockerRunArtifactCreatedData.parse_obj({
"signed_write_url": obj.get("signedWriteUrl"),
"artifact_id": obj.get("artifactId")
})
return _obj
| 2,715 | 32.530864 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_artifact_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictStr, conint, constr, validator
from lightly.openapi_generated.swagger_client.models.docker_run_artifact_storage_location import DockerRunArtifactStorageLocation
from lightly.openapi_generated.swagger_client.models.docker_run_artifact_type import DockerRunArtifactType
class DockerRunArtifactData(BaseModel):
"""
DockerRunArtifactData
"""
id: constr(strict=True) = Field(..., description="MongoDB ObjectId")
type: DockerRunArtifactType = Field(...)
file_name: StrictStr = Field(..., alias="fileName")
storage_location: Optional[DockerRunArtifactStorageLocation] = Field(None, alias="storageLocation")
created_at: Optional[conint(strict=True, ge=0)] = Field(None, alias="createdAt", description="unix timestamp in milliseconds")
__properties = ["id", "type", "fileName", "storageLocation", "createdAt"]
@validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerRunArtifactData:
"""Create an instance of DockerRunArtifactData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerRunArtifactData:
"""Create an instance of DockerRunArtifactData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerRunArtifactData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerRunArtifactData) in the input: " + str(obj))
_obj = DockerRunArtifactData.parse_obj({
"id": obj.get("id"),
"type": obj.get("type"),
"file_name": obj.get("fileName"),
"storage_location": obj.get("storageLocation"),
"created_at": obj.get("createdAt")
})
return _obj
| 3,644 | 36.96875 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_artifact_storage_location.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class DockerRunArtifactStorageLocation(str, Enum):
"""
DockerRunArtifactStorageLocation
"""
"""
allowed enum values
"""
LIGHTLY = 'LIGHTLY'
DATASOURCE = 'DATASOURCE'
@classmethod
def from_json(cls, json_str: str) -> 'DockerRunArtifactStorageLocation':
"""Create an instance of DockerRunArtifactStorageLocation from a JSON string"""
return DockerRunArtifactStorageLocation(json.loads(json_str))
| 1,022 | 22.790698 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_artifact_type.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class DockerRunArtifactType(str, Enum):
"""
DockerRunArtifactType
"""
"""
allowed enum values
"""
LOG = 'LOG'
MEMLOG = 'MEMLOG'
CHECKPOINT = 'CHECKPOINT'
REPORT_PDF = 'REPORT_PDF'
REPORT_JSON = 'REPORT_JSON'
CORRUPTNESS_CHECK_INFORMATION = 'CORRUPTNESS_CHECK_INFORMATION'
SEQUENCE_INFORMATION = 'SEQUENCE_INFORMATION'
RELEVANT_FILENAMES = 'RELEVANT_FILENAMES'
@classmethod
def from_json(cls, json_str: str) -> 'DockerRunArtifactType':
"""Create an instance of DockerRunArtifactType from a JSON string"""
return DockerRunArtifactType(json.loads(json_str))
| 1,207 | 23.653061 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_create_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictStr, constr, validator
from lightly.openapi_generated.swagger_client.models.creator import Creator
class DockerRunCreateRequest(BaseModel):
"""
DockerRunCreateRequest
"""
docker_version: StrictStr = Field(..., alias="dockerVersion")
dataset_id: Optional[constr(strict=True)] = Field(None, alias="datasetId", description="MongoDB ObjectId")
scheduled_id: Optional[constr(strict=True)] = Field(None, alias="scheduledId", description="MongoDB ObjectId")
config_id: Optional[constr(strict=True)] = Field(None, alias="configId", description="MongoDB ObjectId")
message: Optional[StrictStr] = None
creator: Optional[Creator] = None
__properties = ["dockerVersion", "datasetId", "scheduledId", "configId", "message", "creator"]
@validator('dataset_id')
def dataset_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('scheduled_id')
def scheduled_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('config_id')
def config_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerRunCreateRequest:
"""Create an instance of DockerRunCreateRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerRunCreateRequest:
"""Create an instance of DockerRunCreateRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerRunCreateRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerRunCreateRequest) in the input: " + str(obj))
_obj = DockerRunCreateRequest.parse_obj({
"docker_version": obj.get("dockerVersion"),
"dataset_id": obj.get("datasetId"),
"scheduled_id": obj.get("scheduledId"),
"config_id": obj.get("configId"),
"message": obj.get("message"),
"creator": obj.get("creator")
})
return _obj
| 4,405 | 35.716667 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List, Optional
from pydantic import Extra, BaseModel, Field, StrictStr, conint, conlist, constr, validator
from lightly.openapi_generated.swagger_client.models.docker_run_artifact_data import DockerRunArtifactData
from lightly.openapi_generated.swagger_client.models.docker_run_state import DockerRunState
class DockerRunData(BaseModel):
"""
DockerRunData
"""
id: constr(strict=True) = Field(..., description="MongoDB ObjectId")
user_id: StrictStr = Field(..., alias="userId")
docker_version: StrictStr = Field(..., alias="dockerVersion")
state: DockerRunState = Field(...)
dataset_id: Optional[constr(strict=True)] = Field(None, alias="datasetId", description="MongoDB ObjectId")
config_id: Optional[constr(strict=True)] = Field(None, alias="configId", description="MongoDB ObjectId")
scheduled_id: Optional[constr(strict=True)] = Field(None, alias="scheduledId", description="MongoDB ObjectId")
created_at: conint(strict=True, ge=0) = Field(..., alias="createdAt", description="unix timestamp in milliseconds")
last_modified_at: conint(strict=True, ge=0) = Field(..., alias="lastModifiedAt", description="unix timestamp in milliseconds")
message: Optional[StrictStr] = Field(None, description="last message sent to the docker run")
artifacts: Optional[conlist(DockerRunArtifactData)] = Field(None, description="list of artifacts that were created for a run")
__properties = ["id", "userId", "dockerVersion", "state", "datasetId", "configId", "scheduledId", "createdAt", "lastModifiedAt", "message", "artifacts"]
@validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('dataset_id')
def dataset_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('config_id')
def config_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('scheduled_id')
def scheduled_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerRunData:
"""Create an instance of DockerRunData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of each item in artifacts (list)
_items = []
if self.artifacts:
for _item in self.artifacts:
if _item:
_items.append(_item.to_dict(by_alias=by_alias))
_dict['artifacts' if by_alias else 'artifacts'] = _items
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerRunData:
"""Create an instance of DockerRunData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerRunData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerRunData) in the input: " + str(obj))
_obj = DockerRunData.parse_obj({
"id": obj.get("id"),
"user_id": obj.get("userId"),
"docker_version": obj.get("dockerVersion"),
"state": obj.get("state"),
"dataset_id": obj.get("datasetId"),
"config_id": obj.get("configId"),
"scheduled_id": obj.get("scheduledId"),
"created_at": obj.get("createdAt"),
"last_modified_at": obj.get("lastModifiedAt"),
"message": obj.get("message"),
"artifacts": [DockerRunArtifactData.from_dict(_item) for _item in obj.get("artifacts")] if obj.get("artifacts") is not None else None
})
return _obj
| 6,058 | 40.786207 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_log_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List, Optional
from pydantic import Extra, BaseModel, Field, conint, conlist
from lightly.openapi_generated.swagger_client.models.docker_run_log_entry_data import DockerRunLogEntryData
class DockerRunLogData(BaseModel):
"""
DockerRunLogData
"""
cursor: Optional[conint(strict=True, ge=0)] = Field(0, description="The cursor to use to fetch more logs.")
logs: conlist(DockerRunLogEntryData) = Field(...)
__properties = ["cursor", "logs"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerRunLogData:
"""Create an instance of DockerRunLogData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of each item in logs (list)
_items = []
if self.logs:
for _item in self.logs:
if _item:
_items.append(_item.to_dict(by_alias=by_alias))
_dict['logs' if by_alias else 'logs'] = _items
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerRunLogData:
"""Create an instance of DockerRunLogData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerRunLogData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerRunLogData) in the input: " + str(obj))
_obj = DockerRunLogData.parse_obj({
"cursor": obj.get("cursor") if obj.get("cursor") is not None else 0,
"logs": [DockerRunLogEntryData.from_dict(_item) for _item in obj.get("logs")] if obj.get("logs") is not None else None
})
return _obj
| 3,215 | 35.134831 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_log_entry_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictStr, conint
from lightly.openapi_generated.swagger_client.models.docker_run_log_level import DockerRunLogLevel
from lightly.openapi_generated.swagger_client.models.docker_run_state import DockerRunState
class DockerRunLogEntryData(BaseModel):
"""
DockerRunLogEntryData
"""
msg: StrictStr = Field(...)
ts: conint(strict=True, ge=0) = Field(..., description="unix timestamp in milliseconds")
state: DockerRunState = Field(...)
level: DockerRunLogLevel = Field(...)
__properties = ["msg", "ts", "state", "level"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerRunLogEntryData:
"""Create an instance of DockerRunLogEntryData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerRunLogEntryData:
"""Create an instance of DockerRunLogEntryData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerRunLogEntryData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerRunLogEntryData) in the input: " + str(obj))
_obj = DockerRunLogEntryData.parse_obj({
"msg": obj.get("msg"),
"ts": obj.get("ts"),
"state": obj.get("state"),
"level": obj.get("level")
})
return _obj
| 2,964 | 33.08046 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_log_level.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class DockerRunLogLevel(str, Enum):
"""
DockerRunLogLevel
"""
"""
allowed enum values
"""
VERBOSE = 'VERBOSE'
DEBUG = 'DEBUG'
INFO = 'INFO'
WARN = 'WARN'
ERROR = 'ERROR'
CRITICAL = 'CRITICAL'
@classmethod
def from_json(cls, json_str: str) -> 'DockerRunLogLevel':
"""Create an instance of DockerRunLogLevel from a JSON string"""
return DockerRunLogLevel(json.loads(json_str))
| 1,019 | 20.702128 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_scheduled_create_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List, Optional
from pydantic import Extra, BaseModel, Field, StrictStr, conlist, constr, validator
from lightly.openapi_generated.swagger_client.models.creator import Creator
from lightly.openapi_generated.swagger_client.models.docker_run_scheduled_priority import DockerRunScheduledPriority
class DockerRunScheduledCreateRequest(BaseModel):
"""
DockerRunScheduledCreateRequest
"""
config_id: constr(strict=True) = Field(..., alias="configId", description="MongoDB ObjectId")
priority: DockerRunScheduledPriority = Field(...)
runs_on: Optional[conlist(StrictStr)] = Field(None, alias="runsOn", description="The labels used for specifying the run-worker-relationship")
creator: Optional[Creator] = None
__properties = ["configId", "priority", "runsOn", "creator"]
@validator('config_id')
def config_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerRunScheduledCreateRequest:
"""Create an instance of DockerRunScheduledCreateRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerRunScheduledCreateRequest:
"""Create an instance of DockerRunScheduledCreateRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerRunScheduledCreateRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerRunScheduledCreateRequest) in the input: " + str(obj))
_obj = DockerRunScheduledCreateRequest.parse_obj({
"config_id": obj.get("configId"),
"priority": obj.get("priority"),
"runs_on": obj.get("runsOn"),
"creator": obj.get("creator")
})
return _obj
| 3,577 | 37.06383 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_scheduled_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List, Optional
from pydantic import Extra, BaseModel, Field, StrictStr, conint, conlist, constr, validator
from lightly.openapi_generated.swagger_client.models.docker_run_scheduled_priority import DockerRunScheduledPriority
from lightly.openapi_generated.swagger_client.models.docker_run_scheduled_state import DockerRunScheduledState
class DockerRunScheduledData(BaseModel):
"""
DockerRunScheduledData
"""
id: constr(strict=True) = Field(..., description="MongoDB ObjectId")
dataset_id: constr(strict=True) = Field(..., alias="datasetId", description="MongoDB ObjectId")
user_id: Optional[StrictStr] = Field(None, alias="userId")
config_id: constr(strict=True) = Field(..., alias="configId", description="MongoDB ObjectId")
priority: DockerRunScheduledPriority = Field(...)
runs_on: conlist(StrictStr) = Field(..., alias="runsOn", description="The labels used for specifying the run-worker-relationship")
state: DockerRunScheduledState = Field(...)
created_at: conint(strict=True, ge=0) = Field(..., alias="createdAt", description="unix timestamp in milliseconds")
last_modified_at: conint(strict=True, ge=0) = Field(..., alias="lastModifiedAt", description="unix timestamp in milliseconds")
owner: Optional[constr(strict=True)] = Field(None, description="MongoDB ObjectId")
__properties = ["id", "datasetId", "userId", "configId", "priority", "runsOn", "state", "createdAt", "lastModifiedAt", "owner"]
@validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('dataset_id')
def dataset_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('config_id')
def config_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('owner')
def owner_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerRunScheduledData:
"""Create an instance of DockerRunScheduledData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerRunScheduledData:
"""Create an instance of DockerRunScheduledData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerRunScheduledData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerRunScheduledData) in the input: " + str(obj))
_obj = DockerRunScheduledData.parse_obj({
"id": obj.get("id"),
"dataset_id": obj.get("datasetId"),
"user_id": obj.get("userId"),
"config_id": obj.get("configId"),
"priority": obj.get("priority"),
"runs_on": obj.get("runsOn"),
"state": obj.get("state"),
"created_at": obj.get("createdAt"),
"last_modified_at": obj.get("lastModifiedAt"),
"owner": obj.get("owner")
})
return _obj
| 5,358 | 40.223077 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_scheduled_priority.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class DockerRunScheduledPriority(str, Enum):
"""
DockerRunScheduledPriority
"""
"""
allowed enum values
"""
LOW = 'LOW'
MID = 'MID'
HIGH = 'HIGH'
CRITICAL = 'CRITICAL'
@classmethod
def from_json(cls, json_str: str) -> 'DockerRunScheduledPriority':
"""Create an instance of DockerRunScheduledPriority from a JSON string"""
return DockerRunScheduledPriority(json.loads(json_str))
| 1,014 | 21.555556 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_scheduled_state.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class DockerRunScheduledState(str, Enum):
"""
DockerRunScheduledState
"""
"""
allowed enum values
"""
OPEN = 'OPEN'
LOCKED = 'LOCKED'
DONE = 'DONE'
CANCELED = 'CANCELED'
@classmethod
def from_json(cls, json_str: str) -> 'DockerRunScheduledState':
"""Create an instance of DockerRunScheduledState from a JSON string"""
return DockerRunScheduledState(json.loads(json_str))
| 1,007 | 21.4 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_scheduled_update_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List, Optional
from pydantic import Extra, BaseModel, Field, StrictStr, conlist
from lightly.openapi_generated.swagger_client.models.docker_run_scheduled_priority import DockerRunScheduledPriority
from lightly.openapi_generated.swagger_client.models.docker_run_scheduled_state import DockerRunScheduledState
class DockerRunScheduledUpdateRequest(BaseModel):
"""
DockerRunScheduledUpdateRequest
"""
state: DockerRunScheduledState = Field(...)
priority: Optional[DockerRunScheduledPriority] = None
runs_on: Optional[conlist(StrictStr)] = Field(None, alias="runsOn", description="The labels used for specifying the run-worker-relationship")
__properties = ["state", "priority", "runsOn"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerRunScheduledUpdateRequest:
"""Create an instance of DockerRunScheduledUpdateRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerRunScheduledUpdateRequest:
"""Create an instance of DockerRunScheduledUpdateRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerRunScheduledUpdateRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerRunScheduledUpdateRequest) in the input: " + str(obj))
_obj = DockerRunScheduledUpdateRequest.parse_obj({
"state": obj.get("state"),
"priority": obj.get("priority"),
"runs_on": obj.get("runsOn")
})
return _obj
| 3,151 | 36.082353 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_state.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class DockerRunState(str, Enum):
"""
DockerRunState
"""
"""
allowed enum values
"""
STARTED = 'STARTED'
INITIALIZING = 'INITIALIZING'
LOADING_DATASET = 'LOADING_DATASET'
LOADING_PREDICTION = 'LOADING_PREDICTION'
CHECKING_CORRUPTNESS = 'CHECKING_CORRUPTNESS'
INITIALIZING_OBJECT_CROPS = 'INITIALIZING_OBJECT_CROPS'
LOADING_METADATA = 'LOADING_METADATA'
COMPUTING_METADATA = 'COMPUTING_METADATA'
TRAINING = 'TRAINING'
EMBEDDING = 'EMBEDDING'
EMBEDDING_OBJECT_CROPS = 'EMBEDDING_OBJECT_CROPS'
PRETAGGING = 'PRETAGGING'
COMPUTING_ACTIVE_LEARNING_SCORES = 'COMPUTING_ACTIVE_LEARNING_SCORES'
SAMPLING = 'SAMPLING'
EMBEDDING_FULL_IMAGES = 'EMBEDDING_FULL_IMAGES'
SAVING_RESULTS = 'SAVING_RESULTS'
UPLOADING_DATASET = 'UPLOADING_DATASET'
GENERATING_REPORT = 'GENERATING_REPORT'
UPLOADING_REPORT = 'UPLOADING_REPORT'
UPLOADED_REPORT = 'UPLOADED_REPORT'
UPLOADING_ARTIFACTS = 'UPLOADING_ARTIFACTS'
UPLOADED_ARTIFACTS = 'UPLOADED_ARTIFACTS'
COMPLETED = 'COMPLETED'
FAILED = 'FAILED'
CRASHED = 'CRASHED'
ABORTED = 'ABORTED'
@classmethod
def from_json(cls, json_str: str) -> 'DockerRunState':
"""Create an instance of DockerRunState from a JSON string"""
return DockerRunState(json.loads(json_str))
| 1,910 | 27.522388 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_run_update_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictStr
from lightly.openapi_generated.swagger_client.models.docker_run_state import DockerRunState
class DockerRunUpdateRequest(BaseModel):
"""
DockerRunUpdateRequest
"""
state: DockerRunState = Field(...)
message: Optional[StrictStr] = None
__properties = ["state", "message"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerRunUpdateRequest:
"""Create an instance of DockerRunUpdateRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerRunUpdateRequest:
"""Create an instance of DockerRunUpdateRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerRunUpdateRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerRunUpdateRequest) in the input: " + str(obj))
_obj = DockerRunUpdateRequest.parse_obj({
"state": obj.get("state"),
"message": obj.get("message")
})
return _obj
| 2,691 | 31.829268 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_task_description.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Union
from pydantic import Extra, BaseModel, Field, StrictStr, confloat, conint
from lightly.openapi_generated.swagger_client.models.sampling_config import SamplingConfig
from lightly.openapi_generated.swagger_client.models.sampling_method import SamplingMethod
class DockerTaskDescription(BaseModel):
"""
DockerTaskDescription
"""
embeddings_filename: StrictStr = Field(..., alias="embeddingsFilename")
embeddings_hash: StrictStr = Field(..., alias="embeddingsHash")
method: SamplingMethod = Field(...)
existing_selection_column_name: StrictStr = Field(..., alias="existingSelectionColumnName")
active_learning_scores_column_name: StrictStr = Field(..., alias="activeLearningScoresColumnName")
masked_out_column_name: StrictStr = Field(..., alias="maskedOutColumnName")
sampling_config: SamplingConfig = Field(..., alias="samplingConfig")
n_data: Union[confloat(ge=0, strict=True), conint(ge=0, strict=True)] = Field(..., alias="nData", description="the number of samples in the current embeddings file")
__properties = ["embeddingsFilename", "embeddingsHash", "method", "existingSelectionColumnName", "activeLearningScoresColumnName", "maskedOutColumnName", "samplingConfig", "nData"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerTaskDescription:
"""Create an instance of DockerTaskDescription from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of sampling_config
if self.sampling_config:
_dict['samplingConfig' if by_alias else 'sampling_config'] = self.sampling_config.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerTaskDescription:
"""Create an instance of DockerTaskDescription from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerTaskDescription.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerTaskDescription) in the input: " + str(obj))
_obj = DockerTaskDescription.parse_obj({
"embeddings_filename": obj.get("embeddingsFilename"),
"embeddings_hash": obj.get("embeddingsHash"),
"method": obj.get("method"),
"existing_selection_column_name": obj.get("existingSelectionColumnName"),
"active_learning_scores_column_name": obj.get("activeLearningScoresColumnName"),
"masked_out_column_name": obj.get("maskedOutColumnName"),
"sampling_config": SamplingConfig.from_dict(obj.get("samplingConfig")) if obj.get("samplingConfig") is not None else None,
"n_data": obj.get("nData")
})
return _obj
| 4,314 | 43.030612 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_user_stats.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Any, Dict
from pydantic import Extra, BaseModel, Field, StrictStr, conint
class DockerUserStats(BaseModel):
"""
DockerUserStats
"""
run_id: StrictStr = Field(..., alias="runId")
action: StrictStr = Field(...)
data: Dict[str, Any] = Field(...)
timestamp: conint(strict=True, ge=0) = Field(..., description="unix timestamp in milliseconds")
pip_version: StrictStr = Field(..., alias="pipVersion")
docker_version: StrictStr = Field(..., alias="dockerVersion")
__properties = ["runId", "action", "data", "timestamp", "pipVersion", "dockerVersion"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerUserStats:
"""Create an instance of DockerUserStats from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerUserStats:
"""Create an instance of DockerUserStats from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerUserStats.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerUserStats) in the input: " + str(obj))
_obj = DockerUserStats.parse_obj({
"run_id": obj.get("runId"),
"action": obj.get("action"),
"data": obj.get("data"),
"timestamp": obj.get("timestamp"),
"pip_version": obj.get("pipVersion"),
"docker_version": obj.get("dockerVersion")
})
return _obj
| 3,055 | 33.337079 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_authorization_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictStr
class DockerWorkerAuthorizationRequest(BaseModel):
"""
DockerWorkerAuthorizationRequest
"""
hashed_task_description: StrictStr = Field(..., alias="hashedTaskDescription")
__properties = ["hashedTaskDescription"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerAuthorizationRequest:
"""Create an instance of DockerWorkerAuthorizationRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerAuthorizationRequest:
"""Create an instance of DockerWorkerAuthorizationRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerAuthorizationRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerAuthorizationRequest) in the input: " + str(obj))
_obj = DockerWorkerAuthorizationRequest.parse_obj({
"hashed_task_description": obj.get("hashedTaskDescription")
})
return _obj
| 2,662 | 32.708861 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Any, Dict, Optional
from pydantic import Extra, BaseModel, Field
from lightly.openapi_generated.swagger_client.models.docker_worker_type import DockerWorkerType
from lightly.openapi_generated.swagger_client.models.selection_config import SelectionConfig
class DockerWorkerConfig(BaseModel):
"""
DockerWorkerConfig
"""
worker_type: DockerWorkerType = Field(..., alias="workerType")
docker: Optional[Dict[str, Any]] = Field(None, description="docker run configurations, keys should match the structure of https://github.com/lightly-ai/lightly-core/blob/develop/onprem-docker/lightly_worker/src/lightly_worker/resources/docker/docker.yaml ")
lightly: Optional[Dict[str, Any]] = Field(None, description="lightly configurations which are passed to a docker run, keys should match structure of https://github.com/lightly-ai/lightly/blob/master/lightly/cli/config/config.yaml ")
selection: Optional[SelectionConfig] = None
__properties = ["workerType", "docker", "lightly", "selection"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfig:
"""Create an instance of DockerWorkerConfig from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of selection
if self.selection:
_dict['selection' if by_alias else 'selection'] = self.selection.to_dict(by_alias=by_alias)
# set to None if docker (nullable) is None
# and __fields_set__ contains the field
if self.docker is None and "docker" in self.__fields_set__:
_dict['docker' if by_alias else 'docker'] = None
# set to None if lightly (nullable) is None
# and __fields_set__ contains the field
if self.lightly is None and "lightly" in self.__fields_set__:
_dict['lightly' if by_alias else 'lightly'] = None
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfig:
"""Create an instance of DockerWorkerConfig from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfig.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfig) in the input: " + str(obj))
_obj = DockerWorkerConfig.parse_obj({
"worker_type": obj.get("workerType"),
"docker": obj.get("docker"),
"lightly": obj.get("lightly"),
"selection": SelectionConfig.from_dict(obj.get("selection")) if obj.get("selection") is not None else None
})
return _obj
| 4,169 | 40.7 | 261 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_create_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field
from lightly.openapi_generated.swagger_client.models.creator import Creator
from lightly.openapi_generated.swagger_client.models.docker_worker_config import DockerWorkerConfig
class DockerWorkerConfigCreateRequest(BaseModel):
"""
DockerWorkerConfigCreateRequest
"""
config: DockerWorkerConfig = Field(...)
creator: Optional[Creator] = None
__properties = ["config", "creator"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigCreateRequest:
"""Create an instance of DockerWorkerConfigCreateRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of config
if self.config:
_dict['config' if by_alias else 'config'] = self.config.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigCreateRequest:
"""Create an instance of DockerWorkerConfigCreateRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigCreateRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigCreateRequest) in the input: " + str(obj))
_obj = DockerWorkerConfigCreateRequest.parse_obj({
"config": DockerWorkerConfig.from_dict(obj.get("config")) if obj.get("config") is not None else None,
"creator": obj.get("creator")
})
return _obj
| 3,128 | 35.383721 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictStr, conint, constr, validator
from lightly.openapi_generated.swagger_client.models.docker_worker_config import DockerWorkerConfig
class DockerWorkerConfigData(BaseModel):
"""
DockerWorkerConfigData
"""
id: constr(strict=True) = Field(..., description="MongoDB ObjectId")
version: Optional[StrictStr] = None
config: DockerWorkerConfig = Field(...)
config_orig: Optional[DockerWorkerConfig] = Field(None, alias="configOrig")
created_at: Optional[conint(strict=True, ge=0)] = Field(None, alias="createdAt", description="unix timestamp in milliseconds")
__properties = ["id", "version", "config", "configOrig", "createdAt"]
@validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigData:
"""Create an instance of DockerWorkerConfigData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of config
if self.config:
_dict['config' if by_alias else 'config'] = self.config.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of config_orig
if self.config_orig:
_dict['configOrig' if by_alias else 'config_orig'] = self.config_orig.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigData:
"""Create an instance of DockerWorkerConfigData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigData) in the input: " + str(obj))
_obj = DockerWorkerConfigData.parse_obj({
"id": obj.get("id"),
"version": obj.get("version"),
"config": DockerWorkerConfig.from_dict(obj.get("config")) if obj.get("config") is not None else None,
"config_orig": DockerWorkerConfig.from_dict(obj.get("configOrig")) if obj.get("configOrig") is not None else None,
"created_at": obj.get("createdAt")
})
return _obj
| 4,044 | 39.049505 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v2.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2_docker import DockerWorkerConfigV2Docker
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2_lightly import DockerWorkerConfigV2Lightly
from lightly.openapi_generated.swagger_client.models.docker_worker_type import DockerWorkerType
from lightly.openapi_generated.swagger_client.models.selection_config import SelectionConfig
class DockerWorkerConfigV2(BaseModel):
"""
DockerWorkerConfigV2
"""
worker_type: DockerWorkerType = Field(..., alias="workerType")
docker: Optional[DockerWorkerConfigV2Docker] = None
lightly: Optional[DockerWorkerConfigV2Lightly] = None
selection: Optional[SelectionConfig] = None
__properties = ["workerType", "docker", "lightly", "selection"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV2:
"""Create an instance of DockerWorkerConfigV2 from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of docker
if self.docker:
_dict['docker' if by_alias else 'docker'] = self.docker.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of lightly
if self.lightly:
_dict['lightly' if by_alias else 'lightly'] = self.lightly.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of selection
if self.selection:
_dict['selection' if by_alias else 'selection'] = self.selection.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV2:
"""Create an instance of DockerWorkerConfigV2 from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV2.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV2) in the input: " + str(obj))
_obj = DockerWorkerConfigV2.parse_obj({
"worker_type": obj.get("workerType"),
"docker": DockerWorkerConfigV2Docker.from_dict(obj.get("docker")) if obj.get("docker") is not None else None,
"lightly": DockerWorkerConfigV2Lightly.from_dict(obj.get("lightly")) if obj.get("lightly") is not None else None,
"selection": SelectionConfig.from_dict(obj.get("selection")) if obj.get("selection") is not None else None
})
return _obj
| 4,143 | 41.285714 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v2_create_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field
from lightly.openapi_generated.swagger_client.models.creator import Creator
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2 import DockerWorkerConfigV2
class DockerWorkerConfigV2CreateRequest(BaseModel):
"""
DockerWorkerConfigV2CreateRequest
"""
config: DockerWorkerConfigV2 = Field(...)
creator: Optional[Creator] = None
__properties = ["config", "creator"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV2CreateRequest:
"""Create an instance of DockerWorkerConfigV2CreateRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of config
if self.config:
_dict['config' if by_alias else 'config'] = self.config.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV2CreateRequest:
"""Create an instance of DockerWorkerConfigV2CreateRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV2CreateRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV2CreateRequest) in the input: " + str(obj))
_obj = DockerWorkerConfigV2CreateRequest.parse_obj({
"config": DockerWorkerConfigV2.from_dict(obj.get("config")) if obj.get("config") is not None else None,
"creator": obj.get("creator")
})
return _obj
| 3,155 | 35.697674 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v2_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictStr, conint, constr, validator
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2 import DockerWorkerConfigV2
class DockerWorkerConfigV2Data(BaseModel):
"""
DockerWorkerConfigV2Data
"""
id: constr(strict=True) = Field(..., description="MongoDB ObjectId")
version: Optional[StrictStr] = None
config: DockerWorkerConfigV2 = Field(...)
config_orig: Optional[DockerWorkerConfigV2] = Field(None, alias="configOrig")
created_at: Optional[conint(strict=True, ge=0)] = Field(None, alias="createdAt", description="unix timestamp in milliseconds")
__properties = ["id", "version", "config", "configOrig", "createdAt"]
@validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV2Data:
"""Create an instance of DockerWorkerConfigV2Data from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of config
if self.config:
_dict['config' if by_alias else 'config'] = self.config.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of config_orig
if self.config_orig:
_dict['configOrig' if by_alias else 'config_orig'] = self.config_orig.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV2Data:
"""Create an instance of DockerWorkerConfigV2Data from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV2Data.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV2Data) in the input: " + str(obj))
_obj = DockerWorkerConfigV2Data.parse_obj({
"id": obj.get("id"),
"version": obj.get("version"),
"config": DockerWorkerConfigV2.from_dict(obj.get("config")) if obj.get("config") is not None else None,
"config_orig": DockerWorkerConfigV2.from_dict(obj.get("configOrig")) if obj.get("configOrig") is not None else None,
"created_at": obj.get("createdAt")
})
return _obj
| 4,075 | 39.356436 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v2_docker.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictBool, StrictStr, conint
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2_docker_object_level import DockerWorkerConfigV2DockerObjectLevel
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2_docker_stopping_condition import DockerWorkerConfigV2DockerStoppingCondition
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_docker_corruptness_check import DockerWorkerConfigV3DockerCorruptnessCheck
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_docker_datasource import DockerWorkerConfigV3DockerDatasource
from lightly.openapi_generated.swagger_client.models.lightly_docker_selection_method import LightlyDockerSelectionMethod
class DockerWorkerConfigV2Docker(BaseModel):
"""
docker run configurations, keys should match the structure of https://github.com/lightly-ai/lightly-core/blob/develop/onprem-docker/lightly_worker/src/lightly_worker/resources/docker/docker.yaml
"""
checkpoint: Optional[StrictStr] = None
corruptness_check: Optional[DockerWorkerConfigV3DockerCorruptnessCheck] = Field(None, alias="corruptnessCheck")
datasource: Optional[DockerWorkerConfigV3DockerDatasource] = None
embeddings: Optional[StrictStr] = None
enable_training: Optional[StrictBool] = Field(None, alias="enableTraining")
method: Optional[LightlyDockerSelectionMethod] = None
normalize_embeddings: Optional[StrictBool] = Field(None, alias="normalizeEmbeddings")
output_image_format: Optional[StrictStr] = Field(None, alias="outputImageFormat")
object_level: Optional[DockerWorkerConfigV2DockerObjectLevel] = Field(None, alias="objectLevel")
pretagging: Optional[StrictBool] = None
pretagging_upload: Optional[StrictBool] = Field(None, alias="pretaggingUpload")
relevant_filenames_file: Optional[StrictStr] = Field(None, alias="relevantFilenamesFile")
selected_sequence_length: Optional[conint(strict=True, ge=1)] = Field(None, alias="selectedSequenceLength")
stopping_condition: Optional[DockerWorkerConfigV2DockerStoppingCondition] = Field(None, alias="stoppingCondition")
upload_report: Optional[StrictBool] = Field(None, alias="uploadReport")
__properties = ["checkpoint", "corruptnessCheck", "datasource", "embeddings", "enableTraining", "method", "normalizeEmbeddings", "outputImageFormat", "objectLevel", "pretagging", "pretaggingUpload", "relevantFilenamesFile", "selectedSequenceLength", "stoppingCondition", "uploadReport"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV2Docker:
"""Create an instance of DockerWorkerConfigV2Docker from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of corruptness_check
if self.corruptness_check:
_dict['corruptnessCheck' if by_alias else 'corruptness_check'] = self.corruptness_check.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of datasource
if self.datasource:
_dict['datasource' if by_alias else 'datasource'] = self.datasource.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of object_level
if self.object_level:
_dict['objectLevel' if by_alias else 'object_level'] = self.object_level.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of stopping_condition
if self.stopping_condition:
_dict['stoppingCondition' if by_alias else 'stopping_condition'] = self.stopping_condition.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV2Docker:
"""Create an instance of DockerWorkerConfigV2Docker from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV2Docker.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV2Docker) in the input: " + str(obj))
_obj = DockerWorkerConfigV2Docker.parse_obj({
"checkpoint": obj.get("checkpoint"),
"corruptness_check": DockerWorkerConfigV3DockerCorruptnessCheck.from_dict(obj.get("corruptnessCheck")) if obj.get("corruptnessCheck") is not None else None,
"datasource": DockerWorkerConfigV3DockerDatasource.from_dict(obj.get("datasource")) if obj.get("datasource") is not None else None,
"embeddings": obj.get("embeddings"),
"enable_training": obj.get("enableTraining"),
"method": obj.get("method"),
"normalize_embeddings": obj.get("normalizeEmbeddings"),
"output_image_format": obj.get("outputImageFormat"),
"object_level": DockerWorkerConfigV2DockerObjectLevel.from_dict(obj.get("objectLevel")) if obj.get("objectLevel") is not None else None,
"pretagging": obj.get("pretagging"),
"pretagging_upload": obj.get("pretaggingUpload"),
"relevant_filenames_file": obj.get("relevantFilenamesFile"),
"selected_sequence_length": obj.get("selectedSequenceLength"),
"stopping_condition": DockerWorkerConfigV2DockerStoppingCondition.from_dict(obj.get("stoppingCondition")) if obj.get("stoppingCondition") is not None else None,
"upload_report": obj.get("uploadReport")
})
return _obj
| 7,094 | 56.217742 | 290 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v2_docker_object_level.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional, Union
from pydantic import Extra, BaseModel, Field, StrictFloat, StrictInt, constr, validator
class DockerWorkerConfigV2DockerObjectLevel(BaseModel):
"""
DockerWorkerConfigV2DockerObjectLevel
"""
crop_dataset_name: Optional[constr(strict=True)] = Field(None, alias="cropDatasetName", description="Identical limitations than DatasetName however it can be empty")
padding: Optional[Union[StrictFloat, StrictInt]] = None
task_name: Optional[constr(strict=True)] = Field(None, alias="taskName", description="Since we sometimes stitch together SelectionInputTask+ActiveLearningScoreType, they need to follow the same specs of ActiveLearningScoreType. However, this can be an empty string due to internal logic. ")
__properties = ["cropDatasetName", "padding", "taskName"]
@validator('crop_dataset_name')
def crop_dataset_name_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-zA-Z0-9 _-]*$", value):
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9 _-]*$/")
return value
@validator('task_name')
def task_name_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-zA-Z0-9_+=,.@:\/-]*$", value):
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9_+=,.@:\/-]*$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV2DockerObjectLevel:
"""Create an instance of DockerWorkerConfigV2DockerObjectLevel from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV2DockerObjectLevel:
"""Create an instance of DockerWorkerConfigV2DockerObjectLevel from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV2DockerObjectLevel.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV2DockerObjectLevel) in the input: " + str(obj))
_obj = DockerWorkerConfigV2DockerObjectLevel.parse_obj({
"crop_dataset_name": obj.get("cropDatasetName"),
"padding": obj.get("padding"),
"task_name": obj.get("taskName")
})
return _obj
| 4,043 | 38.262136 | 294 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v2_docker_stopping_condition.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional, Union
from pydantic import Extra, BaseModel, Field, StrictFloat, StrictInt
class DockerWorkerConfigV2DockerStoppingCondition(BaseModel):
"""
DockerWorkerConfigV2DockerStoppingCondition
"""
min_distance: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="minDistance")
n_samples: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="nSamples")
__properties = ["minDistance", "nSamples"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV2DockerStoppingCondition:
"""Create an instance of DockerWorkerConfigV2DockerStoppingCondition from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV2DockerStoppingCondition:
"""Create an instance of DockerWorkerConfigV2DockerStoppingCondition from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV2DockerStoppingCondition.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV2DockerStoppingCondition) in the input: " + str(obj))
_obj = DockerWorkerConfigV2DockerStoppingCondition.parse_obj({
"min_distance": obj.get("minDistance"),
"n_samples": obj.get("nSamples")
})
return _obj
| 2,932 | 35.209877 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v2_lightly.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2_lightly_collate import DockerWorkerConfigV2LightlyCollate
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2_lightly_model import DockerWorkerConfigV2LightlyModel
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2_lightly_trainer import DockerWorkerConfigV2LightlyTrainer
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_lightly_criterion import DockerWorkerConfigV3LightlyCriterion
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_lightly_loader import DockerWorkerConfigV3LightlyLoader
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_lightly_optimizer import DockerWorkerConfigV3LightlyOptimizer
class DockerWorkerConfigV2Lightly(BaseModel):
"""
Lightly configurations which are passed to a Lightly Worker run. For information about the options see https://docs.lightly.ai/docs/all-configuration-options#run-configuration.
"""
loader: Optional[DockerWorkerConfigV3LightlyLoader] = None
model: Optional[DockerWorkerConfigV2LightlyModel] = None
trainer: Optional[DockerWorkerConfigV2LightlyTrainer] = None
criterion: Optional[DockerWorkerConfigV3LightlyCriterion] = None
optimizer: Optional[DockerWorkerConfigV3LightlyOptimizer] = None
collate: Optional[DockerWorkerConfigV2LightlyCollate] = None
__properties = ["loader", "model", "trainer", "criterion", "optimizer", "collate"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV2Lightly:
"""Create an instance of DockerWorkerConfigV2Lightly from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of loader
if self.loader:
_dict['loader' if by_alias else 'loader'] = self.loader.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of model
if self.model:
_dict['model' if by_alias else 'model'] = self.model.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of trainer
if self.trainer:
_dict['trainer' if by_alias else 'trainer'] = self.trainer.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of criterion
if self.criterion:
_dict['criterion' if by_alias else 'criterion'] = self.criterion.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of optimizer
if self.optimizer:
_dict['optimizer' if by_alias else 'optimizer'] = self.optimizer.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of collate
if self.collate:
_dict['collate' if by_alias else 'collate'] = self.collate.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV2Lightly:
"""Create an instance of DockerWorkerConfigV2Lightly from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV2Lightly.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV2Lightly) in the input: " + str(obj))
_obj = DockerWorkerConfigV2Lightly.parse_obj({
"loader": DockerWorkerConfigV3LightlyLoader.from_dict(obj.get("loader")) if obj.get("loader") is not None else None,
"model": DockerWorkerConfigV2LightlyModel.from_dict(obj.get("model")) if obj.get("model") is not None else None,
"trainer": DockerWorkerConfigV2LightlyTrainer.from_dict(obj.get("trainer")) if obj.get("trainer") is not None else None,
"criterion": DockerWorkerConfigV3LightlyCriterion.from_dict(obj.get("criterion")) if obj.get("criterion") is not None else None,
"optimizer": DockerWorkerConfigV3LightlyOptimizer.from_dict(obj.get("optimizer")) if obj.get("optimizer") is not None else None,
"collate": DockerWorkerConfigV2LightlyCollate.from_dict(obj.get("collate")) if obj.get("collate") is not None else None
})
return _obj
| 5,927 | 51.460177 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v2_lightly_collate.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List, Optional, Union
from pydantic import Extra, BaseModel, Field, confloat, conint, conlist
class DockerWorkerConfigV2LightlyCollate(BaseModel):
"""
DockerWorkerConfigV2LightlyCollate
"""
input_size: Optional[conint(strict=True, ge=1)] = Field(None, alias="inputSize")
cj_prob: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="cjProb")
cj_bright: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="cjBright")
cj_contrast: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="cjContrast")
cj_sat: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="cjSat")
cj_hue: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="cjHue")
min_scale: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="minScale")
random_gray_scale: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="randomGrayScale")
gaussian_blur: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="gaussianBlur")
kernel_size: Optional[Union[confloat(ge=0.0, strict=True), conint(ge=0, strict=True)]] = Field(None, alias="kernelSize")
sigmas: Optional[conlist(Union[confloat(gt=0, strict=True), conint(gt=0, strict=True)], max_items=2, min_items=2)] = None
vf_prob: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="vfProb")
hf_prob: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="hfProb")
rr_prob: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="rrProb")
__properties = ["inputSize", "cjProb", "cjBright", "cjContrast", "cjSat", "cjHue", "minScale", "randomGrayScale", "gaussianBlur", "kernelSize", "sigmas", "vfProb", "hfProb", "rrProb"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV2LightlyCollate:
"""Create an instance of DockerWorkerConfigV2LightlyCollate from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV2LightlyCollate:
"""Create an instance of DockerWorkerConfigV2LightlyCollate from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV2LightlyCollate.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV2LightlyCollate) in the input: " + str(obj))
_obj = DockerWorkerConfigV2LightlyCollate.parse_obj({
"input_size": obj.get("inputSize"),
"cj_prob": obj.get("cjProb"),
"cj_bright": obj.get("cjBright"),
"cj_contrast": obj.get("cjContrast"),
"cj_sat": obj.get("cjSat"),
"cj_hue": obj.get("cjHue"),
"min_scale": obj.get("minScale"),
"random_gray_scale": obj.get("randomGrayScale"),
"gaussian_blur": obj.get("gaussianBlur"),
"kernel_size": obj.get("kernelSize"),
"sigmas": obj.get("sigmas"),
"vf_prob": obj.get("vfProb"),
"hf_prob": obj.get("hfProb"),
"rr_prob": obj.get("rrProb")
})
return _obj
| 5,187 | 48.409524 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v2_lightly_model.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, conint
from lightly.openapi_generated.swagger_client.models.lightly_model_v2 import LightlyModelV2
class DockerWorkerConfigV2LightlyModel(BaseModel):
"""
DockerWorkerConfigV2LightlyModel
"""
name: Optional[LightlyModelV2] = None
out_dim: Optional[conint(strict=True, ge=1)] = Field(None, alias="outDim")
num_ftrs: Optional[conint(strict=True, ge=1)] = Field(None, alias="numFtrs")
width: Optional[conint(strict=True, ge=1)] = None
__properties = ["name", "outDim", "numFtrs", "width"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV2LightlyModel:
"""Create an instance of DockerWorkerConfigV2LightlyModel from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV2LightlyModel:
"""Create an instance of DockerWorkerConfigV2LightlyModel from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV2LightlyModel.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV2LightlyModel) in the input: " + str(obj))
_obj = DockerWorkerConfigV2LightlyModel.parse_obj({
"name": obj.get("name"),
"out_dim": obj.get("outDim"),
"num_ftrs": obj.get("numFtrs"),
"width": obj.get("width")
})
return _obj
| 3,053 | 34.511628 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v2_lightly_trainer.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, conint
from lightly.openapi_generated.swagger_client.models.lightly_trainer_precision_v2 import LightlyTrainerPrecisionV2
class DockerWorkerConfigV2LightlyTrainer(BaseModel):
"""
DockerWorkerConfigV2LightlyTrainer
"""
gpus: Optional[conint(strict=True, ge=0)] = None
max_epochs: Optional[conint(strict=True, ge=0)] = Field(None, alias="maxEpochs")
precision: Optional[LightlyTrainerPrecisionV2] = None
__properties = ["gpus", "maxEpochs", "precision"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV2LightlyTrainer:
"""Create an instance of DockerWorkerConfigV2LightlyTrainer from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV2LightlyTrainer:
"""Create an instance of DockerWorkerConfigV2LightlyTrainer from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV2LightlyTrainer.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV2LightlyTrainer) in the input: " + str(obj))
_obj = DockerWorkerConfigV2LightlyTrainer.parse_obj({
"gpus": obj.get("gpus"),
"max_epochs": obj.get("maxEpochs"),
"precision": obj.get("precision")
})
return _obj
| 3,000 | 34.72619 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_docker import DockerWorkerConfigV3Docker
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_lightly import DockerWorkerConfigV3Lightly
from lightly.openapi_generated.swagger_client.models.docker_worker_type import DockerWorkerType
from lightly.openapi_generated.swagger_client.models.selection_config import SelectionConfig
class DockerWorkerConfigV3(BaseModel):
"""
DockerWorkerConfigV3
"""
worker_type: DockerWorkerType = Field(..., alias="workerType")
docker: Optional[DockerWorkerConfigV3Docker] = None
lightly: Optional[DockerWorkerConfigV3Lightly] = None
selection: Optional[SelectionConfig] = None
__properties = ["workerType", "docker", "lightly", "selection"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3:
"""Create an instance of DockerWorkerConfigV3 from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of docker
if self.docker:
_dict['docker' if by_alias else 'docker'] = self.docker.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of lightly
if self.lightly:
_dict['lightly' if by_alias else 'lightly'] = self.lightly.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of selection
if self.selection:
_dict['selection' if by_alias else 'selection'] = self.selection.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3:
"""Create an instance of DockerWorkerConfigV3 from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3) in the input: " + str(obj))
_obj = DockerWorkerConfigV3.parse_obj({
"worker_type": obj.get("workerType"),
"docker": DockerWorkerConfigV3Docker.from_dict(obj.get("docker")) if obj.get("docker") is not None else None,
"lightly": DockerWorkerConfigV3Lightly.from_dict(obj.get("lightly")) if obj.get("lightly") is not None else None,
"selection": SelectionConfig.from_dict(obj.get("selection")) if obj.get("selection") is not None else None
})
return _obj
| 4,143 | 41.285714 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_create_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field
from lightly.openapi_generated.swagger_client.models.creator import Creator
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3 import DockerWorkerConfigV3
class DockerWorkerConfigV3CreateRequest(BaseModel):
"""
DockerWorkerConfigV3CreateRequest
"""
config: DockerWorkerConfigV3 = Field(...)
creator: Optional[Creator] = None
__properties = ["config", "creator"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3CreateRequest:
"""Create an instance of DockerWorkerConfigV3CreateRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of config
if self.config:
_dict['config' if by_alias else 'config'] = self.config.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3CreateRequest:
"""Create an instance of DockerWorkerConfigV3CreateRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3CreateRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3CreateRequest) in the input: " + str(obj))
_obj = DockerWorkerConfigV3CreateRequest.parse_obj({
"config": DockerWorkerConfigV3.from_dict(obj.get("config")) if obj.get("config") is not None else None,
"creator": obj.get("creator")
})
return _obj
| 3,155 | 35.697674 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictStr, conint, constr, validator
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3 import DockerWorkerConfigV3
class DockerWorkerConfigV3Data(BaseModel):
"""
DockerWorkerConfigV3Data
"""
id: constr(strict=True) = Field(..., description="MongoDB ObjectId")
version: Optional[StrictStr] = None
config: DockerWorkerConfigV3 = Field(...)
config_orig: Optional[DockerWorkerConfigV3] = Field(None, alias="configOrig")
created_at: Optional[conint(strict=True, ge=0)] = Field(None, alias="createdAt", description="unix timestamp in milliseconds")
__properties = ["id", "version", "config", "configOrig", "createdAt"]
@validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3Data:
"""Create an instance of DockerWorkerConfigV3Data from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of config
if self.config:
_dict['config' if by_alias else 'config'] = self.config.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of config_orig
if self.config_orig:
_dict['configOrig' if by_alias else 'config_orig'] = self.config_orig.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3Data:
"""Create an instance of DockerWorkerConfigV3Data from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3Data.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3Data) in the input: " + str(obj))
_obj = DockerWorkerConfigV3Data.parse_obj({
"id": obj.get("id"),
"version": obj.get("version"),
"config": DockerWorkerConfigV3.from_dict(obj.get("config")) if obj.get("config") is not None else None,
"config_orig": DockerWorkerConfigV3.from_dict(obj.get("configOrig")) if obj.get("configOrig") is not None else None,
"created_at": obj.get("createdAt")
})
return _obj
| 4,075 | 39.356436 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_docker.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictBool, StrictStr, conint
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_docker_corruptness_check import DockerWorkerConfigV3DockerCorruptnessCheck
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_docker_datasource import DockerWorkerConfigV3DockerDatasource
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_docker_training import DockerWorkerConfigV3DockerTraining
class DockerWorkerConfigV3Docker(BaseModel):
"""
docker run configurations, keys should match the structure of https://github.com/lightly-ai/lightly-core/blob/develop/onprem-docker/lightly_worker/src/lightly_worker/resources/docker/docker.yaml
"""
checkpoint: Optional[StrictStr] = None
corruptness_check: Optional[DockerWorkerConfigV3DockerCorruptnessCheck] = Field(None, alias="corruptnessCheck")
datasource: Optional[DockerWorkerConfigV3DockerDatasource] = None
embeddings: Optional[StrictStr] = None
enable_training: Optional[StrictBool] = Field(None, alias="enableTraining")
training: Optional[DockerWorkerConfigV3DockerTraining] = None
normalize_embeddings: Optional[StrictBool] = Field(None, alias="normalizeEmbeddings")
num_processes: Optional[conint(strict=True, ge=-1)] = Field(None, alias="numProcesses")
num_threads: Optional[conint(strict=True, ge=-1)] = Field(None, alias="numThreads")
output_image_format: Optional[StrictStr] = Field(None, alias="outputImageFormat")
pretagging: Optional[StrictBool] = None
pretagging_upload: Optional[StrictBool] = Field(None, alias="pretaggingUpload")
relevant_filenames_file: Optional[StrictStr] = Field(None, alias="relevantFilenamesFile")
selected_sequence_length: Optional[conint(strict=True, ge=1)] = Field(None, alias="selectedSequenceLength")
upload_report: Optional[StrictBool] = Field(None, alias="uploadReport")
use_datapool: Optional[StrictBool] = Field(None, alias="useDatapool")
__properties = ["checkpoint", "corruptnessCheck", "datasource", "embeddings", "enableTraining", "training", "normalizeEmbeddings", "numProcesses", "numThreads", "outputImageFormat", "pretagging", "pretaggingUpload", "relevantFilenamesFile", "selectedSequenceLength", "uploadReport", "useDatapool"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3Docker:
"""Create an instance of DockerWorkerConfigV3Docker from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of corruptness_check
if self.corruptness_check:
_dict['corruptnessCheck' if by_alias else 'corruptness_check'] = self.corruptness_check.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of datasource
if self.datasource:
_dict['datasource' if by_alias else 'datasource'] = self.datasource.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of training
if self.training:
_dict['training' if by_alias else 'training'] = self.training.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3Docker:
"""Create an instance of DockerWorkerConfigV3Docker from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3Docker.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3Docker) in the input: " + str(obj))
_obj = DockerWorkerConfigV3Docker.parse_obj({
"checkpoint": obj.get("checkpoint"),
"corruptness_check": DockerWorkerConfigV3DockerCorruptnessCheck.from_dict(obj.get("corruptnessCheck")) if obj.get("corruptnessCheck") is not None else None,
"datasource": DockerWorkerConfigV3DockerDatasource.from_dict(obj.get("datasource")) if obj.get("datasource") is not None else None,
"embeddings": obj.get("embeddings"),
"enable_training": obj.get("enableTraining"),
"training": DockerWorkerConfigV3DockerTraining.from_dict(obj.get("training")) if obj.get("training") is not None else None,
"normalize_embeddings": obj.get("normalizeEmbeddings"),
"num_processes": obj.get("numProcesses"),
"num_threads": obj.get("numThreads"),
"output_image_format": obj.get("outputImageFormat"),
"pretagging": obj.get("pretagging"),
"pretagging_upload": obj.get("pretaggingUpload"),
"relevant_filenames_file": obj.get("relevantFilenamesFile"),
"selected_sequence_length": obj.get("selectedSequenceLength"),
"upload_report": obj.get("uploadReport"),
"use_datapool": obj.get("useDatapool")
})
return _obj
| 6,512 | 52.826446 | 301 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_docker_corruptness_check.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional, Union
from pydantic import Extra, BaseModel, Field, confloat, conint
class DockerWorkerConfigV3DockerCorruptnessCheck(BaseModel):
"""
DockerWorkerConfigV3DockerCorruptnessCheck
"""
corruption_threshold: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="corruptionThreshold")
__properties = ["corruptionThreshold"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3DockerCorruptnessCheck:
"""Create an instance of DockerWorkerConfigV3DockerCorruptnessCheck from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3DockerCorruptnessCheck:
"""Create an instance of DockerWorkerConfigV3DockerCorruptnessCheck from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3DockerCorruptnessCheck.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3DockerCorruptnessCheck) in the input: " + str(obj))
_obj = DockerWorkerConfigV3DockerCorruptnessCheck.parse_obj({
"corruption_threshold": obj.get("corruptionThreshold")
})
return _obj
| 2,860 | 35.21519 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_docker_datasource.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictBool
class DockerWorkerConfigV3DockerDatasource(BaseModel):
"""
DockerWorkerConfigV3DockerDatasource
"""
bypass_verify: Optional[StrictBool] = Field(None, alias="bypassVerify")
enable_datapool_update: Optional[StrictBool] = Field(None, alias="enableDatapoolUpdate")
process_all: Optional[StrictBool] = Field(None, alias="processAll")
__properties = ["bypassVerify", "enableDatapoolUpdate", "processAll"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3DockerDatasource:
"""Create an instance of DockerWorkerConfigV3DockerDatasource from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3DockerDatasource:
"""Create an instance of DockerWorkerConfigV3DockerDatasource from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3DockerDatasource.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3DockerDatasource) in the input: " + str(obj))
_obj = DockerWorkerConfigV3DockerDatasource.parse_obj({
"bypass_verify": obj.get("bypassVerify"),
"enable_datapool_update": obj.get("enableDatapoolUpdate"),
"process_all": obj.get("processAll")
})
return _obj
| 3,015 | 35.337349 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_docker_training.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, constr, validator
class DockerWorkerConfigV3DockerTraining(BaseModel):
"""
DockerWorkerConfigV3DockerTraining
"""
task_name: Optional[constr(strict=True)] = Field(None, alias="taskName", description="Since we sometimes stitch together SelectionInputTask+ActiveLearningScoreType, they need to follow the same specs of ActiveLearningScoreType. However, this can be an empty string due to internal logic. ")
__properties = ["taskName"]
@validator('task_name')
def task_name_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-zA-Z0-9_+=,.@:\/-]*$", value):
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9_+=,.@:\/-]*$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3DockerTraining:
"""Create an instance of DockerWorkerConfigV3DockerTraining from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3DockerTraining:
"""Create an instance of DockerWorkerConfigV3DockerTraining from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3DockerTraining.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3DockerTraining) in the input: " + str(obj))
_obj = DockerWorkerConfigV3DockerTraining.parse_obj({
"task_name": obj.get("taskName")
})
return _obj
| 3,253 | 35.561798 | 294 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_lightly.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictInt
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_lightly_checkpoint_callback import DockerWorkerConfigV3LightlyCheckpointCallback
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_lightly_collate import DockerWorkerConfigV3LightlyCollate
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_lightly_criterion import DockerWorkerConfigV3LightlyCriterion
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_lightly_loader import DockerWorkerConfigV3LightlyLoader
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_lightly_model import DockerWorkerConfigV3LightlyModel
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_lightly_optimizer import DockerWorkerConfigV3LightlyOptimizer
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v3_lightly_trainer import DockerWorkerConfigV3LightlyTrainer
class DockerWorkerConfigV3Lightly(BaseModel):
"""
Lightly configurations which are passed to a Lightly Worker run. For information about the options see https://docs.lightly.ai/docs/all-configuration-options#run-configuration.
"""
seed: Optional[StrictInt] = Field(None, description="Random seed.")
checkpoint_callback: Optional[DockerWorkerConfigV3LightlyCheckpointCallback] = Field(None, alias="checkpointCallback")
loader: Optional[DockerWorkerConfigV3LightlyLoader] = None
model: Optional[DockerWorkerConfigV3LightlyModel] = None
trainer: Optional[DockerWorkerConfigV3LightlyTrainer] = None
criterion: Optional[DockerWorkerConfigV3LightlyCriterion] = None
optimizer: Optional[DockerWorkerConfigV3LightlyOptimizer] = None
collate: Optional[DockerWorkerConfigV3LightlyCollate] = None
__properties = ["seed", "checkpointCallback", "loader", "model", "trainer", "criterion", "optimizer", "collate"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3Lightly:
"""Create an instance of DockerWorkerConfigV3Lightly from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of checkpoint_callback
if self.checkpoint_callback:
_dict['checkpointCallback' if by_alias else 'checkpoint_callback'] = self.checkpoint_callback.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of loader
if self.loader:
_dict['loader' if by_alias else 'loader'] = self.loader.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of model
if self.model:
_dict['model' if by_alias else 'model'] = self.model.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of trainer
if self.trainer:
_dict['trainer' if by_alias else 'trainer'] = self.trainer.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of criterion
if self.criterion:
_dict['criterion' if by_alias else 'criterion'] = self.criterion.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of optimizer
if self.optimizer:
_dict['optimizer' if by_alias else 'optimizer'] = self.optimizer.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of collate
if self.collate:
_dict['collate' if by_alias else 'collate'] = self.collate.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3Lightly:
"""Create an instance of DockerWorkerConfigV3Lightly from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3Lightly.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3Lightly) in the input: " + str(obj))
_obj = DockerWorkerConfigV3Lightly.parse_obj({
"seed": obj.get("seed"),
"checkpoint_callback": DockerWorkerConfigV3LightlyCheckpointCallback.from_dict(obj.get("checkpointCallback")) if obj.get("checkpointCallback") is not None else None,
"loader": DockerWorkerConfigV3LightlyLoader.from_dict(obj.get("loader")) if obj.get("loader") is not None else None,
"model": DockerWorkerConfigV3LightlyModel.from_dict(obj.get("model")) if obj.get("model") is not None else None,
"trainer": DockerWorkerConfigV3LightlyTrainer.from_dict(obj.get("trainer")) if obj.get("trainer") is not None else None,
"criterion": DockerWorkerConfigV3LightlyCriterion.from_dict(obj.get("criterion")) if obj.get("criterion") is not None else None,
"optimizer": DockerWorkerConfigV3LightlyOptimizer.from_dict(obj.get("optimizer")) if obj.get("optimizer") is not None else None,
"collate": DockerWorkerConfigV3LightlyCollate.from_dict(obj.get("collate")) if obj.get("collate") is not None else None
})
return _obj
| 6,811 | 55.297521 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_lightly_checkpoint_callback.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictBool
class DockerWorkerConfigV3LightlyCheckpointCallback(BaseModel):
"""
DockerWorkerConfigV3LightlyCheckpointCallback
"""
save_last: Optional[StrictBool] = Field(None, alias="saveLast", description="If True, the checkpoint from the last epoch is saved.")
__properties = ["saveLast"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3LightlyCheckpointCallback:
"""Create an instance of DockerWorkerConfigV3LightlyCheckpointCallback from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3LightlyCheckpointCallback:
"""Create an instance of DockerWorkerConfigV3LightlyCheckpointCallback from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3LightlyCheckpointCallback.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3LightlyCheckpointCallback) in the input: " + str(obj))
_obj = DockerWorkerConfigV3LightlyCheckpointCallback.parse_obj({
"save_last": obj.get("saveLast")
})
return _obj
| 2,821 | 34.721519 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_lightly_collate.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List, Optional, Union
from pydantic import Extra, BaseModel, Field, StrictFloat, StrictInt, confloat, conint, conlist
class DockerWorkerConfigV3LightlyCollate(BaseModel):
"""
DockerWorkerConfigV3LightlyCollate
"""
input_size: Optional[conint(strict=True, ge=1)] = Field(None, alias="inputSize")
cj_prob: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="cjProb")
cj_bright: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="cjBright")
cj_contrast: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="cjContrast")
cj_sat: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="cjSat")
cj_hue: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="cjHue")
min_scale: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="minScale")
random_gray_scale: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="randomGrayScale")
gaussian_blur: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="gaussianBlur")
kernel_size: Optional[Union[confloat(ge=0.0, strict=True), conint(ge=0, strict=True)]] = Field(None, alias="kernelSize")
sigmas: Optional[conlist(Union[confloat(gt=0, strict=True), conint(gt=0, strict=True)], max_items=2, min_items=2)] = None
vf_prob: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="vfProb")
hf_prob: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="hfProb")
rr_prob: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="rrProb")
rr_degrees: Optional[conlist(Union[StrictFloat, StrictInt], max_items=2, min_items=2)] = Field(None, alias="rrDegrees")
__properties = ["inputSize", "cjProb", "cjBright", "cjContrast", "cjSat", "cjHue", "minScale", "randomGrayScale", "gaussianBlur", "kernelSize", "sigmas", "vfProb", "hfProb", "rrProb", "rrDegrees"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3LightlyCollate:
"""Create an instance of DockerWorkerConfigV3LightlyCollate from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# set to None if rr_degrees (nullable) is None
# and __fields_set__ contains the field
if self.rr_degrees is None and "rr_degrees" in self.__fields_set__:
_dict['rrDegrees' if by_alias else 'rr_degrees'] = None
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3LightlyCollate:
"""Create an instance of DockerWorkerConfigV3LightlyCollate from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3LightlyCollate.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3LightlyCollate) in the input: " + str(obj))
_obj = DockerWorkerConfigV3LightlyCollate.parse_obj({
"input_size": obj.get("inputSize"),
"cj_prob": obj.get("cjProb"),
"cj_bright": obj.get("cjBright"),
"cj_contrast": obj.get("cjContrast"),
"cj_sat": obj.get("cjSat"),
"cj_hue": obj.get("cjHue"),
"min_scale": obj.get("minScale"),
"random_gray_scale": obj.get("randomGrayScale"),
"gaussian_blur": obj.get("gaussianBlur"),
"kernel_size": obj.get("kernelSize"),
"sigmas": obj.get("sigmas"),
"vf_prob": obj.get("vfProb"),
"hf_prob": obj.get("hfProb"),
"rr_prob": obj.get("rrProb"),
"rr_degrees": obj.get("rrDegrees")
})
return _obj
| 5,644 | 49.401786 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_lightly_criterion.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional, Union
from pydantic import Extra, BaseModel, confloat, conint
class DockerWorkerConfigV3LightlyCriterion(BaseModel):
"""
DockerWorkerConfigV3LightlyCriterion
"""
temperature: Optional[Union[confloat(gt=0.0, strict=True), conint(gt=0, strict=True)]] = None
__properties = ["temperature"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3LightlyCriterion:
"""Create an instance of DockerWorkerConfigV3LightlyCriterion from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3LightlyCriterion:
"""Create an instance of DockerWorkerConfigV3LightlyCriterion from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3LightlyCriterion.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3LightlyCriterion) in the input: " + str(obj))
_obj = DockerWorkerConfigV3LightlyCriterion.parse_obj({
"temperature": obj.get("temperature")
})
return _obj
| 2,715 | 33.379747 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_lightly_loader.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictBool, conint
class DockerWorkerConfigV3LightlyLoader(BaseModel):
"""
DockerWorkerConfigV3LightlyLoader
"""
batch_size: Optional[conint(strict=True, ge=1)] = Field(None, alias="batchSize")
shuffle: Optional[StrictBool] = None
num_workers: Optional[conint(strict=True, ge=-1)] = Field(None, alias="numWorkers")
drop_last: Optional[StrictBool] = Field(None, alias="dropLast")
__properties = ["batchSize", "shuffle", "numWorkers", "dropLast"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3LightlyLoader:
"""Create an instance of DockerWorkerConfigV3LightlyLoader from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3LightlyLoader:
"""Create an instance of DockerWorkerConfigV3LightlyLoader from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3LightlyLoader.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3LightlyLoader) in the input: " + str(obj))
_obj = DockerWorkerConfigV3LightlyLoader.parse_obj({
"batch_size": obj.get("batchSize"),
"shuffle": obj.get("shuffle"),
"num_workers": obj.get("numWorkers"),
"drop_last": obj.get("dropLast")
})
return _obj
| 3,045 | 34.835294 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_lightly_model.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, conint
from lightly.openapi_generated.swagger_client.models.lightly_model_v3 import LightlyModelV3
class DockerWorkerConfigV3LightlyModel(BaseModel):
"""
DockerWorkerConfigV3LightlyModel
"""
name: Optional[LightlyModelV3] = None
out_dim: Optional[conint(strict=True, ge=1)] = Field(None, alias="outDim")
num_ftrs: Optional[conint(strict=True, ge=1)] = Field(None, alias="numFtrs")
width: Optional[conint(strict=True, ge=1)] = None
__properties = ["name", "outDim", "numFtrs", "width"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3LightlyModel:
"""Create an instance of DockerWorkerConfigV3LightlyModel from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3LightlyModel:
"""Create an instance of DockerWorkerConfigV3LightlyModel from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3LightlyModel.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3LightlyModel) in the input: " + str(obj))
_obj = DockerWorkerConfigV3LightlyModel.parse_obj({
"name": obj.get("name"),
"out_dim": obj.get("outDim"),
"num_ftrs": obj.get("numFtrs"),
"width": obj.get("width")
})
return _obj
| 3,053 | 34.511628 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_lightly_optimizer.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional, Union
from pydantic import Extra, BaseModel, Field, confloat, conint
class DockerWorkerConfigV3LightlyOptimizer(BaseModel):
"""
DockerWorkerConfigV3LightlyOptimizer
"""
lr: Optional[Union[confloat(ge=0.0, strict=True), conint(ge=0, strict=True)]] = None
weight_decay: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = Field(None, alias="weightDecay")
__properties = ["lr", "weightDecay"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3LightlyOptimizer:
"""Create an instance of DockerWorkerConfigV3LightlyOptimizer from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3LightlyOptimizer:
"""Create an instance of DockerWorkerConfigV3LightlyOptimizer from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3LightlyOptimizer.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3LightlyOptimizer) in the input: " + str(obj))
_obj = DockerWorkerConfigV3LightlyOptimizer.parse_obj({
"lr": obj.get("lr"),
"weight_decay": obj.get("weightDecay")
})
return _obj
| 2,894 | 34.740741 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_config_v3_lightly_trainer.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, conint
from lightly.openapi_generated.swagger_client.models.lightly_trainer_precision_v3 import LightlyTrainerPrecisionV3
class DockerWorkerConfigV3LightlyTrainer(BaseModel):
"""
DockerWorkerConfigV3LightlyTrainer
"""
gpus: Optional[conint(strict=True, ge=0)] = None
max_epochs: Optional[conint(strict=True, ge=0)] = Field(None, alias="maxEpochs")
precision: Optional[LightlyTrainerPrecisionV3] = None
__properties = ["gpus", "maxEpochs", "precision"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerConfigV3LightlyTrainer:
"""Create an instance of DockerWorkerConfigV3LightlyTrainer from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerConfigV3LightlyTrainer:
"""Create an instance of DockerWorkerConfigV3LightlyTrainer from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerConfigV3LightlyTrainer.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigV3LightlyTrainer) in the input: " + str(obj))
_obj = DockerWorkerConfigV3LightlyTrainer.parse_obj({
"gpus": obj.get("gpus"),
"max_epochs": obj.get("maxEpochs"),
"precision": obj.get("precision")
})
return _obj
| 3,000 | 34.72619 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_registry_entry_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List, Optional
from pydantic import Extra, BaseModel, Field, StrictStr, conint, conlist, constr, validator
from lightly.openapi_generated.swagger_client.models.docker_worker_state import DockerWorkerState
from lightly.openapi_generated.swagger_client.models.docker_worker_type import DockerWorkerType
class DockerWorkerRegistryEntryData(BaseModel):
"""
DockerWorkerRegistryEntryData
"""
id: constr(strict=True) = Field(..., description="MongoDB ObjectId")
user_id: StrictStr = Field(..., alias="userId")
name: constr(strict=True, min_length=3) = Field(...)
worker_type: DockerWorkerType = Field(..., alias="workerType")
state: DockerWorkerState = Field(...)
created_at: conint(strict=True, ge=0) = Field(..., alias="createdAt", description="unix timestamp in milliseconds")
last_modified_at: conint(strict=True, ge=0) = Field(..., alias="lastModifiedAt", description="unix timestamp in milliseconds")
labels: conlist(StrictStr) = Field(..., description="The labels used for specifying the run-worker-relationship")
docker_version: Optional[StrictStr] = Field(None, alias="dockerVersion")
__properties = ["id", "userId", "name", "workerType", "state", "createdAt", "lastModifiedAt", "labels", "dockerVersion"]
@validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('name')
def name_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 _-]+$", value):
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 _-]+$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> DockerWorkerRegistryEntryData:
"""Create an instance of DockerWorkerRegistryEntryData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> DockerWorkerRegistryEntryData:
"""Create an instance of DockerWorkerRegistryEntryData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return DockerWorkerRegistryEntryData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerRegistryEntryData) in the input: " + str(obj))
_obj = DockerWorkerRegistryEntryData.parse_obj({
"id": obj.get("id"),
"user_id": obj.get("userId"),
"name": obj.get("name"),
"worker_type": obj.get("workerType"),
"state": obj.get("state"),
"created_at": obj.get("createdAt"),
"last_modified_at": obj.get("lastModifiedAt"),
"labels": obj.get("labels"),
"docker_version": obj.get("dockerVersion")
})
return _obj
| 4,556 | 40.054054 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_state.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class DockerWorkerState(str, Enum):
"""
DockerWorkerState
"""
"""
allowed enum values
"""
OFFLINE = 'OFFLINE'
CRASHED = 'CRASHED'
IDLE = 'IDLE'
BUSY = 'BUSY'
@classmethod
def from_json(cls, json_str: str) -> 'DockerWorkerState':
"""Create an instance of DockerWorkerState from a JSON string"""
return DockerWorkerState(json.loads(json_str))
| 977 | 20.733333 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/docker_worker_type.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class DockerWorkerType(str, Enum):
"""
DockerWorkerType
"""
"""
allowed enum values
"""
FULL = 'FULL'
@classmethod
def from_json(cls, json_str: str) -> 'DockerWorkerType':
"""Create an instance of DockerWorkerType from a JSON string"""
return DockerWorkerType(json.loads(json_str))
| 906 | 20.595238 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/embedding2d_create_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List, Union
from pydantic import Extra, BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist
from lightly.openapi_generated.swagger_client.models.dimensionality_reduction_method import DimensionalityReductionMethod
class Embedding2dCreateRequest(BaseModel):
"""
Embedding2dCreateRequest
"""
name: StrictStr = Field(..., description="Name of the 2d embedding (default is embedding name + __2d)")
dimensionality_reduction_method: DimensionalityReductionMethod = Field(..., alias="dimensionalityReductionMethod")
coordinates_dimension1: conlist(Union[StrictFloat, StrictInt], min_items=1) = Field(..., alias="coordinatesDimension1", description="Array of coordinates of a 2d embedding")
coordinates_dimension2: conlist(Union[StrictFloat, StrictInt], min_items=1) = Field(..., alias="coordinatesDimension2", description="Array of coordinates of a 2d embedding")
__properties = ["name", "dimensionalityReductionMethod", "coordinatesDimension1", "coordinatesDimension2"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> Embedding2dCreateRequest:
"""Create an instance of Embedding2dCreateRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> Embedding2dCreateRequest:
"""Create an instance of Embedding2dCreateRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return Embedding2dCreateRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in Embedding2dCreateRequest) in the input: " + str(obj))
_obj = Embedding2dCreateRequest.parse_obj({
"name": obj.get("name"),
"dimensionality_reduction_method": obj.get("dimensionalityReductionMethod"),
"coordinates_dimension1": obj.get("coordinatesDimension1"),
"coordinates_dimension2": obj.get("coordinatesDimension2")
})
return _obj
| 3,538 | 40.151163 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/embedding2d_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import List, Optional, Union
from pydantic import Extra, BaseModel, Field, StrictFloat, StrictInt, StrictStr, conint, conlist, constr, validator
from lightly.openapi_generated.swagger_client.models.dimensionality_reduction_method import DimensionalityReductionMethod
class Embedding2dData(BaseModel):
"""
Embedding2dData
"""
id: constr(strict=True) = Field(..., description="MongoDB ObjectId")
dataset_id: constr(strict=True) = Field(..., alias="datasetId", description="MongoDB ObjectId")
embedding_id: constr(strict=True) = Field(..., alias="embeddingId", description="MongoDB ObjectId")
name: StrictStr = Field(..., description="Name of the 2d embedding (default is embedding name + __2d)")
created_at: conint(strict=True, ge=0) = Field(..., alias="createdAt", description="unix timestamp in milliseconds")
dimensionality_reduction_method: DimensionalityReductionMethod = Field(..., alias="dimensionalityReductionMethod")
coordinates_dimension1: Optional[conlist(Union[StrictFloat, StrictInt], min_items=1)] = Field(None, alias="coordinatesDimension1", description="Array of coordinates of a 2d embedding")
coordinates_dimension2: Optional[conlist(Union[StrictFloat, StrictInt], min_items=1)] = Field(None, alias="coordinatesDimension2", description="Array of coordinates of a 2d embedding")
__properties = ["id", "datasetId", "embeddingId", "name", "createdAt", "dimensionalityReductionMethod", "coordinatesDimension1", "coordinatesDimension2"]
@validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('dataset_id')
def dataset_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('embedding_id')
def embedding_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> Embedding2dData:
"""Create an instance of Embedding2dData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> Embedding2dData:
"""Create an instance of Embedding2dData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return Embedding2dData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in Embedding2dData) in the input: " + str(obj))
_obj = Embedding2dData.parse_obj({
"id": obj.get("id"),
"dataset_id": obj.get("datasetId"),
"embedding_id": obj.get("embeddingId"),
"name": obj.get("name"),
"created_at": obj.get("createdAt"),
"dimensionality_reduction_method": obj.get("dimensionalityReductionMethod"),
"coordinates_dimension1": obj.get("coordinatesDimension1"),
"coordinates_dimension2": obj.get("coordinatesDimension2")
})
return _obj
| 5,017 | 42.634783 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/embedding_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictStr, constr, validator
class EmbeddingData(BaseModel):
"""
EmbeddingData
"""
id: constr(strict=True) = Field(..., description="MongoDB ObjectId")
dataset: constr(strict=True) = Field(..., description="MongoDB ObjectId")
name: StrictStr = Field(...)
__properties = ["id", "dataset", "name"]
@validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('dataset')
def dataset_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> EmbeddingData:
"""Create an instance of EmbeddingData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> EmbeddingData:
"""Create an instance of EmbeddingData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return EmbeddingData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in EmbeddingData) in the input: " + str(obj))
_obj = EmbeddingData.parse_obj({
"id": obj.get("id"),
"dataset": obj.get("dataset"),
"name": obj.get("name")
})
return _obj
| 3,221 | 32.216495 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/file_name_format.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class FileNameFormat(str, Enum):
"""
When the filename is output, which format shall be used. E.g for a sample called 'frame0.png' that was uploaded from a datasource 's3://my_bucket/datasets/for_lightly/' in the folder 'car/green/' - NAME: car/green/frame0.png - DATASOURCE_FULL: s3://my_bucket/datasets/for_lightly/car/green/frame0.png - REDIRECTED_READ_URL: https://api.lightly.ai/v1/datasets/{datasetId}/samples/{sampleId}/readurlRedirect?publicToken={jsonWebToken}
"""
"""
allowed enum values
"""
NAME = 'NAME'
DATASOURCE_FULL = 'DATASOURCE_FULL'
REDIRECTED_READ_URL = 'REDIRECTED_READ_URL'
@classmethod
def from_json(cls, json_str: str) -> 'FileNameFormat':
"""Create an instance of FileNameFormat from a JSON string"""
return FileNameFormat(json.loads(json_str))
| 1,404 | 30.931818 | 438 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/file_output_format.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class FileOutputFormat(str, Enum):
"""
FileOutputFormat
"""
"""
allowed enum values
"""
JSON = 'JSON'
PLAIN = 'PLAIN'
@classmethod
def from_json(cls, json_str: str) -> 'FileOutputFormat':
"""Create an instance of FileOutputFormat from a JSON string"""
return FileOutputFormat(json.loads(json_str))
| 926 | 20.55814 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/filename_and_read_url.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictStr
class FilenameAndReadUrl(BaseModel):
"""
Filename and corresponding read url for a sample in a tag
"""
file_name: StrictStr = Field(..., alias="fileName")
read_url: StrictStr = Field(..., alias="readUrl", description="A URL which allows anyone in possession of said URL to access the resource")
__properties = ["fileName", "readUrl"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> FilenameAndReadUrl:
"""Create an instance of FilenameAndReadUrl from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> FilenameAndReadUrl:
"""Create an instance of FilenameAndReadUrl from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return FilenameAndReadUrl.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in FilenameAndReadUrl) in the input: " + str(obj))
_obj = FilenameAndReadUrl.parse_obj({
"file_name": obj.get("fileName"),
"read_url": obj.get("readUrl")
})
return _obj
| 2,707 | 32.432099 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/image_type.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class ImageType(str, Enum):
"""
ImageType
"""
"""
allowed enum values
"""
FULL = 'full'
THUMBNAIL = 'thumbnail'
META = 'meta'
@classmethod
def from_json(cls, json_str: str) -> 'ImageType':
"""Create an instance of ImageType from a JSON string"""
return ImageType(json.loads(json_str))
| 917 | 19.863636 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/initial_tag_create_request.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, constr, validator
from lightly.openapi_generated.swagger_client.models.image_type import ImageType
from lightly.openapi_generated.swagger_client.models.tag_creator import TagCreator
class InitialTagCreateRequest(BaseModel):
"""
InitialTagCreateRequest
"""
name: Optional[constr(strict=True, min_length=3)] = Field(None, description="The name of the tag")
creator: Optional[TagCreator] = None
img_type: ImageType = Field(..., alias="imgType")
run_id: Optional[constr(strict=True)] = Field(None, alias="runId", description="MongoDB ObjectId")
__properties = ["name", "creator", "imgType", "runId"]
@validator('name')
def name_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 .:;=@_-]+$", value):
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 .:;=@_-]+$/")
return value
@validator('run_id')
def run_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> InitialTagCreateRequest:
"""Create an instance of InitialTagCreateRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> InitialTagCreateRequest:
"""Create an instance of InitialTagCreateRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return InitialTagCreateRequest.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in InitialTagCreateRequest) in the input: " + str(obj))
_obj = InitialTagCreateRequest.parse_obj({
"name": obj.get("name"),
"creator": obj.get("creator"),
"img_type": obj.get("imgType"),
"run_id": obj.get("runId")
})
return _obj
| 3,817 | 34.682243 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/internal_debug_latency.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional, Union
from pydantic import Extra, BaseModel, Field, StrictFloat, StrictInt
from lightly.openapi_generated.swagger_client.models.internal_debug_latency_mongodb import InternalDebugLatencyMongodb
class InternalDebugLatency(BaseModel):
"""
InternalDebugLatency
"""
express: Optional[Union[StrictFloat, StrictInt]] = None
mongodb: Optional[InternalDebugLatencyMongodb] = None
redis_cache: Optional[InternalDebugLatencyMongodb] = Field(None, alias="redisCache")
redis_worker: Optional[InternalDebugLatencyMongodb] = Field(None, alias="redisWorker")
__properties = ["express", "mongodb", "redisCache", "redisWorker"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> InternalDebugLatency:
"""Create an instance of InternalDebugLatency from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of mongodb
if self.mongodb:
_dict['mongodb' if by_alias else 'mongodb'] = self.mongodb.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of redis_cache
if self.redis_cache:
_dict['redisCache' if by_alias else 'redis_cache'] = self.redis_cache.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of redis_worker
if self.redis_worker:
_dict['redisWorker' if by_alias else 'redis_worker'] = self.redis_worker.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> InternalDebugLatency:
"""Create an instance of InternalDebugLatency from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return InternalDebugLatency.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in InternalDebugLatency) in the input: " + str(obj))
_obj = InternalDebugLatency.parse_obj({
"express": obj.get("express"),
"mongodb": InternalDebugLatencyMongodb.from_dict(obj.get("mongodb")) if obj.get("mongodb") is not None else None,
"redis_cache": InternalDebugLatencyMongodb.from_dict(obj.get("redisCache")) if obj.get("redisCache") is not None else None,
"redis_worker": InternalDebugLatencyMongodb.from_dict(obj.get("redisWorker")) if obj.get("redisWorker") is not None else None
})
return _obj
| 4,002 | 41.136842 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/internal_debug_latency_mongodb.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional, Union
from pydantic import Extra, BaseModel, StrictFloat, StrictInt
class InternalDebugLatencyMongodb(BaseModel):
"""
InternalDebugLatencyMongodb
"""
connection: Optional[Union[StrictFloat, StrictInt]] = None
query: Optional[Union[StrictFloat, StrictInt]] = None
__properties = ["connection", "query"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> InternalDebugLatencyMongodb:
"""Create an instance of InternalDebugLatencyMongodb from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> InternalDebugLatencyMongodb:
"""Create an instance of InternalDebugLatencyMongodb from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return InternalDebugLatencyMongodb.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in InternalDebugLatencyMongodb) in the input: " + str(obj))
_obj = InternalDebugLatencyMongodb.parse_obj({
"connection": obj.get("connection"),
"query": obj.get("query")
})
return _obj
| 2,708 | 32.444444 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/job_result_type.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class JobResultType(str, Enum):
"""
JobResultType
"""
"""
allowed enum values
"""
DATASET_PROCESSING = 'DATASET_PROCESSING'
IMAGEMETA = 'IMAGEMETA'
EMBEDDING = 'EMBEDDING'
EMBEDDINGS2D = 'EMBEDDINGS2D'
SAMPLING = 'SAMPLING'
@classmethod
def from_json(cls, json_str: str) -> 'JobResultType':
"""Create an instance of JobResultType from a JSON string"""
return JobResultType(json.loads(json_str))
| 1,035 | 21.521739 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/job_state.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class JobState(str, Enum):
"""
JobState
"""
"""
allowed enum values
"""
UNKNOWN = 'UNKNOWN'
WAITING = 'WAITING'
RUNNING = 'RUNNING'
FAILED = 'FAILED'
FINISHED = 'FINISHED'
@classmethod
def from_json(cls, json_str: str) -> 'JobState':
"""Create an instance of JobState from a JSON string"""
return JobState(json.loads(json_str))
| 968 | 20.065217 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/job_status_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictInt, StrictStr, conint, constr, validator
from lightly.openapi_generated.swagger_client.models.job_state import JobState
from lightly.openapi_generated.swagger_client.models.job_status_data_result import JobStatusDataResult
from lightly.openapi_generated.swagger_client.models.job_status_meta import JobStatusMeta
class JobStatusData(BaseModel):
"""
JobStatusData
"""
id: constr(strict=True) = Field(..., description="MongoDB ObjectId")
dataset_id: Optional[constr(strict=True)] = Field(None, alias="datasetId", description="MongoDB ObjectId")
status: JobState = Field(...)
meta: Optional[JobStatusMeta] = None
wait_time_till_next_poll: StrictInt = Field(..., alias="waitTimeTillNextPoll", description="The time in seconds the client should wait before doing the next poll.")
created_at: conint(strict=True, ge=0) = Field(..., alias="createdAt", description="unix timestamp in milliseconds")
last_modified_at: Optional[conint(strict=True, ge=0)] = Field(None, alias="lastModifiedAt", description="unix timestamp in milliseconds")
finished_at: Optional[conint(strict=True, ge=0)] = Field(None, alias="finishedAt", description="unix timestamp in milliseconds")
error: Optional[StrictStr] = None
result: Optional[JobStatusDataResult] = None
__properties = ["id", "datasetId", "status", "meta", "waitTimeTillNextPoll", "createdAt", "lastModifiedAt", "finishedAt", "error", "result"]
@validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('dataset_id')
def dataset_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> JobStatusData:
"""Create an instance of JobStatusData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of meta
if self.meta:
_dict['meta' if by_alias else 'meta'] = self.meta.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of result
if self.result:
_dict['result' if by_alias else 'result'] = self.result.to_dict(by_alias=by_alias)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> JobStatusData:
"""Create an instance of JobStatusData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return JobStatusData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in JobStatusData) in the input: " + str(obj))
_obj = JobStatusData.parse_obj({
"id": obj.get("id"),
"dataset_id": obj.get("datasetId"),
"status": obj.get("status"),
"meta": JobStatusMeta.from_dict(obj.get("meta")) if obj.get("meta") is not None else None,
"wait_time_till_next_poll": obj.get("waitTimeTillNextPoll"),
"created_at": obj.get("createdAt"),
"last_modified_at": obj.get("lastModifiedAt"),
"finished_at": obj.get("finishedAt"),
"error": obj.get("error"),
"result": JobStatusDataResult.from_dict(obj.get("result")) if obj.get("result") is not None else None
})
return _obj
| 5,317 | 42.235772 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/job_status_data_result.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Any, Optional
from pydantic import Extra, BaseModel, Field
from lightly.openapi_generated.swagger_client.models.job_result_type import JobResultType
class JobStatusDataResult(BaseModel):
"""
JobStatusDataResult
"""
type: JobResultType = Field(...)
data: Optional[Any] = Field(None, description="Depending on the job type, this can be anything")
__properties = ["type", "data"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> JobStatusDataResult:
"""Create an instance of JobStatusDataResult from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
# set to None if data (nullable) is None
# and __fields_set__ contains the field
if self.data is None and "data" in self.__fields_set__:
_dict['data' if by_alias else 'data'] = None
return _dict
@classmethod
def from_dict(cls, obj: dict) -> JobStatusDataResult:
"""Create an instance of JobStatusDataResult from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return JobStatusDataResult.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in JobStatusDataResult) in the input: " + str(obj))
_obj = JobStatusDataResult.parse_obj({
"type": obj.get("type"),
"data": obj.get("data")
})
return _obj
| 2,922 | 32.597701 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/job_status_meta.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictBool, StrictInt
from lightly.openapi_generated.swagger_client.models.job_status_upload_method import JobStatusUploadMethod
class JobStatusMeta(BaseModel):
"""
JobStatusMeta
"""
total: StrictInt = Field(...)
processed: StrictInt = Field(...)
upload_method: Optional[JobStatusUploadMethod] = Field(None, alias="uploadMethod")
is_registered: Optional[StrictBool] = Field(None, alias="isRegistered", description="Flag which indicates whether the job was registered or not.")
__properties = ["total", "processed", "uploadMethod", "isRegistered"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> JobStatusMeta:
"""Create an instance of JobStatusMeta from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> JobStatusMeta:
"""Create an instance of JobStatusMeta from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return JobStatusMeta.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in JobStatusMeta) in the input: " + str(obj))
_obj = JobStatusMeta.parse_obj({
"total": obj.get("total"),
"processed": obj.get("processed"),
"upload_method": obj.get("uploadMethod"),
"is_registered": obj.get("isRegistered")
})
return _obj
| 3,014 | 34.05814 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/job_status_upload_method.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore
class JobStatusUploadMethod(str, Enum):
"""
JobStatusUploadMethod
"""
"""
allowed enum values
"""
USER_WEBAPP = 'USER_WEBAPP'
USER_PIP = 'USER_PIP'
INTERNAL = 'INTERNAL'
@classmethod
def from_json(cls, json_str: str) -> 'JobStatusUploadMethod':
"""Create an instance of JobStatusUploadMethod from a JSON string"""
return JobStatusUploadMethod(json.loads(json_str))
| 997 | 21.681818 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/jobs_data.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import Extra, BaseModel, Field, StrictStr, conint, constr, validator
from lightly.openapi_generated.swagger_client.models.job_result_type import JobResultType
from lightly.openapi_generated.swagger_client.models.job_state import JobState
class JobsData(BaseModel):
"""
JobsData
"""
id: constr(strict=True) = Field(..., description="MongoDB ObjectId")
job_id: StrictStr = Field(..., alias="jobId")
job_type: JobResultType = Field(..., alias="jobType")
dataset_id: Optional[constr(strict=True)] = Field(None, alias="datasetId", description="MongoDB ObjectId")
status: JobState = Field(...)
finished_at: Optional[conint(strict=True, ge=0)] = Field(None, alias="finishedAt", description="unix timestamp in milliseconds")
created_at: conint(strict=True, ge=0) = Field(..., alias="createdAt", description="unix timestamp in milliseconds")
__properties = ["id", "jobId", "jobType", "datasetId", "status", "finishedAt", "createdAt"]
@validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
@validator('dataset_id')
def dataset_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^[a-f0-9]{24}$", value):
raise ValueError(r"must validate the regular expression /^[a-f0-9]{24}$/")
return value
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> JobsData:
"""Create an instance of JobsData from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> JobsData:
"""Create an instance of JobsData from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return JobsData.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in JobsData) in the input: " + str(obj))
_obj = JobsData.parse_obj({
"id": obj.get("id"),
"job_id": obj.get("jobId"),
"job_type": obj.get("jobType"),
"dataset_id": obj.get("datasetId"),
"status": obj.get("status"),
"finished_at": obj.get("finishedAt"),
"created_at": obj.get("createdAt")
})
return _obj
| 4,075 | 36.054545 | 220 | py |
lightly | lightly-master/lightly/openapi_generated/swagger_client/models/label_box_data_row.py | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: support@lightly.ai
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import Extra, BaseModel, Field, StrictStr
class LabelBoxDataRow(BaseModel):
"""
LabelBoxDataRow
"""
external_id: StrictStr = Field(..., alias="externalId", description="The task_id for importing into LabelBox.")
image_url: StrictStr = Field(..., alias="imageUrl", description="A URL which allows anyone in possession of said URL for the time specified by the expiresIn query param to access the resource")
__properties = ["externalId", "imageUrl"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = Extra.forbid
def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))
def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))
@classmethod
def from_json(cls, json_str: str) -> LabelBoxDataRow:
"""Create an instance of LabelBoxDataRow from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> LabelBoxDataRow:
"""Create an instance of LabelBoxDataRow from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return LabelBoxDataRow.parse_obj(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in LabelBoxDataRow) in the input: " + str(obj))
_obj = LabelBoxDataRow.parse_obj({
"external_id": obj.get("externalId"),
"image_url": obj.get("imageUrl")
})
return _obj
| 2,764 | 33.135802 | 220 | py |