Skip to content

Commit bc49d5c

Browse files
committed
yapf
1 parent 83555cb commit bc49d5c

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

labelbox/schema/annotation_import.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,9 @@ def create_from_file(cls, client: "labelbox.Client", project_id: str,
489489
raise ValueError(f"File {path} is not accessible")
490490

491491
@classmethod
492-
def create_from_objects(
493-
cls, client: "labelbox.Client", project_id: str, name: str,
494-
labels: List[Dict[str, Any]]) -> "LabelImport":
492+
def create_from_objects(cls, client: "labelbox.Client", project_id: str,
493+
name: str,
494+
labels: List[Dict[str, Any]]) -> "LabelImport":
495495
"""
496496
Create an label import job from an in memory dictionary
497497
@@ -507,8 +507,8 @@ def create_from_objects(
507507
if not data_str:
508508
raise ValueError('labels cannot be empty')
509509
data = data_str.encode('utf-8')
510-
return cls._create_label_import_from_bytes(client, project_id, name, data,
511-
len(data))
510+
return cls._create_label_import_from_bytes(client, project_id, name,
511+
data, len(data))
512512

513513
@classmethod
514514
def create_from_url(cls, client: "labelbox.Client", project_id: str,
@@ -529,13 +529,12 @@ def create_from_url(cls, client: "labelbox.Client", project_id: str,
529529
query_str = cls._get_url_mutation()
530530
return cls(
531531
client,
532-
client.execute(
533-
query_str,
534-
params={
535-
"fileUrl": url,
536-
"projectId": project_id,
537-
'name': name
538-
})["createLabelImport"])
532+
client.execute(query_str,
533+
params={
534+
"fileUrl": url,
535+
"projectId": project_id,
536+
'name': name
537+
})["createLabelImport"])
539538
else:
540539
raise ValueError(f"Url {url} is not reachable")
541540

@@ -566,8 +565,7 @@ def from_name(cls,
566565
}
567566
response = client.execute(query_str, params)
568567
if response is None:
569-
raise labelbox.exceptions.ResourceNotFoundError(
570-
LabelImport, params)
568+
raise labelbox.exceptions.ResourceNotFoundError(LabelImport, params)
571569
response = response["labelImport"]
572570
if as_json:
573571
return response
@@ -592,9 +590,10 @@ def _get_file_mutation(cls) -> str:
592590
}""" % query.results_query_part(cls)
593591

594592
@classmethod
595-
def _create_label_import_from_bytes(
596-
cls, client: "labelbox.Client", project_id: str, name: str,
597-
bytes_data: BinaryIO, content_len: int) -> "LabelImport":
593+
def _create_label_import_from_bytes(cls, client: "labelbox.Client",
594+
project_id: str, name: str,
595+
bytes_data: BinaryIO,
596+
content_len: int) -> "LabelImport":
598597
file_name = f"{project_id}__{name}.ndjson"
599598
variables = {
600599
"file": None,

0 commit comments

Comments
 (0)