Skip to content

Commit 99d90ef

Browse files
committed
removed all unused imports
1 parent 353d553 commit 99d90ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+25
-152
lines changed

libs/labelbox/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ dev-dependencies = [
7474
line-length = 80
7575

7676
[tool.ruff.lint]
77-
ignore = ["F", "E722"]
77+
ignore = ["F841", "E722", "F811", "F402", "F601", "F403", "F821", "F541"]
7878
exclude = ["**/__init__.py"]
7979

8080
[tool.rye.scripts]

libs/labelbox/src/labelbox/client.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
import urllib.parse
99
import warnings
1010
from collections import defaultdict
11-
from datetime import datetime, timezone
1211
from types import MappingProxyType
13-
from typing import Any, Callable, Dict, List, Optional, Set, Union, overload
12+
from typing import Any, Callable, Dict, List, Optional, Set, Union
1413

1514
import requests
1615
import requests.exceptions
@@ -67,10 +66,6 @@
6766
from labelbox.schema.organization import Organization
6867
from labelbox.schema.project import Project
6968
from labelbox.schema.quality_mode import (
70-
BENCHMARK_AUTO_AUDIT_NUMBER_OF_LABELS,
71-
BENCHMARK_AUTO_AUDIT_PERCENTAGE,
72-
CONSENSUS_AUTO_AUDIT_NUMBER_OF_LABELS,
73-
CONSENSUS_AUTO_AUDIT_PERCENTAGE,
7469
QualityMode,
7570
)
7671
from labelbox.schema.role import Role

libs/labelbox/src/labelbox/data/annotation_types/collection.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import logging
2-
import warnings
32
from typing import Callable, Generator, Iterable, Union
43

5-
from labelbox.orm.model import Entity
6-
from labelbox.schema import ontology
74

85
from ..generator import PrefetchGenerator
96
from .label import Label

libs/labelbox/src/labelbox/data/annotation_types/data/tiled_image.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from functools import lru_cache
21
import math
32
import logging
43
from enum import Enum

libs/labelbox/src/labelbox/data/annotation_types/feature.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Optional
2-
from pydantic import BaseModel, model_validator, model_serializer
2+
from pydantic import BaseModel, model_validator
33

44
from ...annotated_types import Cuid
55

libs/labelbox/src/labelbox/data/annotation_types/label.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
from collections import defaultdict
22
from typing import Any, Callable, Dict, List, Union, Optional, get_args
3-
import warnings
43

54
import labelbox
65
from labelbox.data.annotation_types.data import GenericDataRowData, MaskData
7-
from labelbox.schema import ontology
86

97
from ...annotated_types import Cuid
108
from .annotation import ClassificationAnnotation, ObjectAnnotation
@@ -16,7 +14,6 @@
1614
from .video import VideoClassificationAnnotation
1715
from .video import VideoObjectAnnotation, VideoMaskAnnotation
1816
from .mmc import MessageEvaluationTaskAnnotation
19-
from ..ontology import get_feature_schema_lookup
2017
from pydantic import BaseModel, field_validator
2118

2219

libs/labelbox/src/labelbox/data/annotation_types/metrics/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
BaseModel,
77
model_serializer,
88
field_validator,
9-
error_wrappers,
109
)
11-
from pydantic_core import ValidationError, InitErrorDetails
1210

1311
ConfidenceValue = confloat(ge=0, le=1)
1412

libs/labelbox/src/labelbox/data/annotation_types/metrics/confusion_matrix.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from enum import Enum
22
from typing import Optional, Tuple, Dict, Union
33

4-
from pydantic import conint, Field
4+
from pydantic import conint
55

66
from .base import ConfidenceValue, BaseMetric
7-
from typing import Literal
87

98
Count = conint(ge=0, le=1e10)
109

libs/labelbox/src/labelbox/data/annotation_types/video.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
model_validator,
2121
BaseModel,
2222
field_validator,
23-
model_serializer,
2423
Field,
2524
ConfigDict,
2625
AliasChoices,

libs/labelbox/src/labelbox/data/metrics/confusion_matrix/confusion_matrix.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
# type: ignore
2-
from collections import defaultdict
3-
from labelbox.data.annotation_types import feature
42
from labelbox.data.annotation_types.metrics import ConfusionMatrixMetric
5-
from typing import List, Optional, Union
3+
from typing import List, Union
64
from ...annotation_types import (
7-
Label,
85
ObjectAnnotation,
96
ClassificationAnnotation,
107
)
118

129
from ..group import get_feature_pairs
1310
from .calculation import confusion_matrix
1411
from .calculation import feature_confusion_matrix
15-
import numpy as np
1612

1713

1814
def confusion_matrix_metric(

libs/labelbox/src/labelbox/data/metrics/group.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from labelbox.data.annotation_types.annotation import ClassificationAnnotation
99
from labelbox.data.annotation_types.classification.classification import (
1010
Checklist,
11-
ClassificationAnswer,
1211
Radio,
1312
Text,
1413
)

libs/labelbox/src/labelbox/data/serialization/ndjson/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
from uuid import uuid4
33

44
from labelbox.utils import _CamelCaseMixin, is_exactly_one_set
5-
from pydantic import model_validator, ConfigDict, BaseModel, Field
5+
from pydantic import model_validator, Field
66
from uuid import uuid4
7-
import threading
87

98
from ....annotated_types import Cuid
109

libs/labelbox/src/labelbox/data/serialization/ndjson/converter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import logging
33
import uuid
44
from collections import defaultdict, deque
5-
from typing import Any, Deque, Dict, Generator, Iterable, List, Set, Union
5+
from typing import Any, Deque, Dict, Generator, List, Set, Union
66

77
from labelbox.data.annotation_types.annotation import ObjectAnnotation
88
from labelbox.data.annotation_types.classification.classification import (
@@ -14,7 +14,7 @@
1414
from labelbox.data.annotation_types.metrics.scalar import ScalarMetric
1515
from labelbox.data.annotation_types.video import VideoMaskAnnotation
1616

17-
from ...annotation_types.collection import LabelCollection, LabelGenerator
17+
from ...annotation_types.collection import LabelCollection
1818
from ...annotation_types.relationship import RelationshipAnnotation
1919
from ...annotation_types.mmc import MessageEvaluationTaskAnnotation
2020
from .label import NDLabel

libs/labelbox/src/labelbox/data/serialization/ndjson/label.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
)
1010
from ...annotation_types.relationship import RelationshipAnnotation
1111
from ...annotation_types.video import (
12-
DICOMObjectAnnotation,
1312
VideoClassificationAnnotation,
1413
)
1514
from ...annotation_types.video import VideoObjectAnnotation, VideoMaskAnnotation
1615
from ...annotation_types.collection import LabelCollection, LabelGenerator
1716
from ...annotation_types.data.generic_data_row_data import GenericDataRowData
1817
from ...annotation_types.label import Label
19-
from ...annotation_types.ner import TextEntity, ConversationEntity
2018
from ...annotation_types.metrics import ScalarMetric, ConfusionMatrixMetric
2119
from ...annotation_types.llm_prompt_response.prompt import (
2220
PromptClassificationAnnotation,
@@ -44,9 +42,7 @@
4442
from .mmc import NDMessageTask
4543
from .relationship import NDRelationship
4644
from .base import DataRow
47-
from pydantic import BaseModel, ValidationError
48-
from pydantic_core import PydanticUndefined
49-
from contextlib import suppress
45+
from pydantic import BaseModel
5046

5147
AnnotationType = Union[
5248
NDObjectType,

libs/labelbox/src/labelbox/data/serialization/ndjson/mmc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Dict, List, Optional, Union
1+
from typing import Union
22

33
from labelbox.utils import _CamelCaseMixin
44

libs/labelbox/src/labelbox/data/serialization/ndjson/objects.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import numpy as np
2121

2222
from PIL import Image
23-
from labelbox.data.annotation_types import feature
2423

2524
from labelbox.data.annotation_types.data import GenericDataRowData
2625

@@ -49,7 +48,6 @@
4948
MaskInstance,
5049
)
5150
from .classification import (
52-
NDClassification,
5351
NDSubclassification,
5452
NDSubclassificationType,
5553
)

libs/labelbox/src/labelbox/data/serialization/ndjson/relationship.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from typing import Union
21
from pydantic import BaseModel
32
from .base import NDAnnotation, DataRow
43
from ...annotation_types.data import GenericDataRowData

libs/labelbox/src/labelbox/schema/asset_attachment.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import warnings
21
from enum import Enum
32
from typing import Dict, Optional
43

libs/labelbox/src/labelbox/schema/catalog.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import Any, Dict, List, Optional, Tuple, Union
22
import warnings
3-
from labelbox.orm.db_object import experimental
43
from labelbox.schema.export_filters import CatalogExportFilters, build_filters
54

65
from labelbox.schema.export_params import (

libs/labelbox/src/labelbox/schema/create_batches_task.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from labelbox.orm.model import Entity
55

66
if TYPE_CHECKING:
7-
from labelbox import User
87

98
def lru_cache() -> Callable[..., Callable[..., Dict[str, Any]]]:
109
pass

libs/labelbox/src/labelbox/schema/data_row.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22
from enum import Enum
3-
from typing import TYPE_CHECKING, List, Optional, Tuple, Union, Any
3+
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
44
import json
55
import warnings
66

@@ -9,7 +9,6 @@
99
DbObject,
1010
Updateable,
1111
BulkDeletable,
12-
experimental,
1312
)
1413
from labelbox.orm.model import Entity, Field, Relationship
1514
from labelbox.schema.asset_attachment import AttachmentType

libs/labelbox/src/labelbox/schema/data_row_metadata.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# type: ignore
2-
import warnings
32
from copy import deepcopy
43
from datetime import datetime
54
from enum import Enum

libs/labelbox/src/labelbox/schema/export_task.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import json
22
import os
33
import tempfile
4-
import warnings
54
from abc import ABC, abstractmethod
65
from dataclasses import dataclass
76
from enum import Enum

libs/labelbox/src/labelbox/schema/foundry/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import Any, Dict, Optional
2-
from pydantic import BaseModel, ConfigDict, AliasGenerator
3-
from pydantic.alias_generators import to_camel, to_snake
2+
from pydantic import ConfigDict
43
from labelbox.utils import _CamelCaseMixin
54

65

libs/labelbox/src/labelbox/schema/internal/data_row_uploader.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
from concurrent.futures import ThreadPoolExecutor, as_completed
2-
31
from typing import List
42

53
from labelbox.schema.internal.data_row_upsert_item import (
64
DataRowItemBase,
7-
DataRowUpsertItem,
8-
DataRowCreateItem,
95
)
106
from labelbox.schema.internal.descriptor_file_creator import (
117
DescriptorFileCreator,

libs/labelbox/src/labelbox/schema/model_run.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
Any,
1717
)
1818

19-
import requests
2019

21-
from labelbox import parser
2220
from labelbox.orm.db_object import DbObject, experimental
2321
from labelbox.orm.model import Field, Relationship, Entity
2422
from labelbox.orm.query import results_query_part
@@ -28,7 +26,7 @@
2826
)
2927
from labelbox.schema.export_params import ModelRunExportParams
3028
from labelbox.schema.export_task import ExportTask
31-
from labelbox.schema.identifiables import UniqueIds, GlobalKeys, DataRowIds
29+
from labelbox.schema.identifiables import GlobalKeys, DataRowIds
3230
from labelbox.schema.send_to_annotate_params import (
3331
SendToAnnotateFromModelParams,
3432
build_destination_task_queue_input,

libs/labelbox/src/labelbox/schema/project.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,9 @@
3838
)
3939
from labelbox.schema.export_params import ProjectExportParams
4040
from labelbox.schema.export_task import ExportTask
41-
from labelbox.schema.id_type import IdType
42-
from labelbox.schema.identifiable import DataRowIdentifier, GlobalKey, UniqueId
41+
from labelbox.schema.identifiable import DataRowIdentifier
4342
from labelbox.schema.identifiables import (
4443
DataRowIdentifiers,
45-
GlobalKeys,
46-
UniqueIds,
4744
)
4845
from labelbox.schema.labeling_service import (
4946
LabelingService,

libs/labelbox/src/labelbox/schema/project_resource_tag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from labelbox.orm.db_object import DbObject, Updateable
2-
from labelbox.orm.model import Field, Relationship
2+
from labelbox.orm.model import Field
33

44

55
class ProjectResourceTag(DbObject, Updateable):

libs/labelbox/src/labelbox/schema/resource_tag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from labelbox.orm.db_object import DbObject, Updateable
2-
from labelbox.orm.model import Field, Relationship
2+
from labelbox.orm.model import Field
33

44

55
class ResourceTag(DbObject, Updateable):

libs/labelbox/src/labelbox/schema/role.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from dataclasses import dataclass
22
from typing import Dict, Optional, TYPE_CHECKING
33

4-
from labelbox.orm.model import Field, Entity
4+
from labelbox.orm.model import Field
55
from labelbox.orm.db_object import DbObject
66

77
if TYPE_CHECKING:

libs/labelbox/src/labelbox/schema/serialization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import cast, Any, Dict, Generator, List, TYPE_CHECKING, Union
1+
from typing import cast, Any, Dict, List, TYPE_CHECKING, Union
22

33
if TYPE_CHECKING:
44
from labelbox.types import Label

libs/labelbox/src/labelbox/schema/slice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from dataclasses import dataclass
22
from typing import Optional, Tuple, Union
33
import warnings
4-
from labelbox.orm.db_object import DbObject, experimental
4+
from labelbox.orm.db_object import DbObject
55
from labelbox.orm.model import Field
66
from labelbox.pagination import PaginatedCollection
77
from labelbox.schema.export_params import (

libs/labelbox/src/labelbox/schema/webhook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22
from enum import Enum
3-
from typing import Iterable, List
3+
from typing import Iterable
44

55
from labelbox.orm import query
66
from labelbox.orm.db_object import DbObject, Updateable

libs/labelbox/src/labelbox/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
BaseModel,
1111
ConfigDict,
1212
model_serializer,
13-
AliasGenerator,
14-
AliasChoices,
1513
)
16-
from pydantic.alias_generators import to_camel, to_pascal
14+
from pydantic.alias_generators import to_camel
1715

1816
UPPERCASE_COMPONENTS = ["uri", "rgb"]
1917
ISO_DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"

libs/labelbox/tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
Client,
2020
DataRow,
2121
Dataset,
22-
LabelingFrontend,
2322
MediaType,
2423
OntologyBuilder,
2524
Option,

libs/labelbox/tests/data/annotation_import/test_annotation_import_limit.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import itertools
2-
import uuid
32
from labelbox.schema.annotation_import import (
43
AnnotationImport,
5-
MALPredictionImport,
64
)
75
from labelbox.schema.media_type import MediaType
86
import pytest

0 commit comments

Comments
 (0)