Skip to content

Commit a6658fa

Browse files
committed
test
1 parent 4832839 commit a6658fa

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

labelbox/client.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Client:
3636
authentication key). Provides functions for querying and creating
3737
top-level data objects (Projects, Datasets).
3838
"""
39+
3940
def __init__(self,
4041
api_key=None,
4142
endpoint='https://api.labelbox.com/graphql',
@@ -132,8 +133,7 @@ def convert_value(value):
132133
if query is not None:
133134
if params is not None:
134135
params = {
135-
key: convert_value(value)
136-
for key, value in params.items()
136+
key: convert_value(value) for key, value in params.items()
137137
}
138138
data = json.dumps({
139139
'query': query,
@@ -334,18 +334,18 @@ def upload_data(self,
334334

335335
request_data = {
336336
"operations":
337-
json.dumps({
338-
"variables": {
339-
"file": None,
340-
"contentLength": len(content),
341-
"sign": sign
342-
},
343-
"query":
344-
"""mutation UploadFile($file: Upload!, $contentLength: Int!,
337+
json.dumps({
338+
"variables": {
339+
"file": None,
340+
"contentLength": len(content),
341+
"sign": sign
342+
},
343+
"query":
344+
"""mutation UploadFile($file: Upload!, $contentLength: Int!,
345345
$sign: Boolean) {
346346
uploadFile(file: $file, contentLength: $contentLength,
347347
sign: $sign) {url filename} } """,
348-
}),
348+
}),
349349
"map": (None, json.dumps({"1": ["variables.file"]})),
350350
}
351351
response = requests.post(
@@ -354,7 +354,7 @@ def upload_data(self,
354354
data=request_data,
355355
files={
356356
"1": (filename, content, content_type) if
357-
(filename and content_type) else content
357+
(filename and content_type) else content
358358
})
359359

360360
if response.status_code == 502:
@@ -527,9 +527,7 @@ def _create(self, db_object_type, data):
527527
res = res["create%s" % db_object_type.type_name()]
528528
return db_object_type(self, res)
529529

530-
def create_dataset(self,
531-
iam_integration=IAMIntegration._DEFAULT,
532-
**kwargs):
530+
def create_dataset(self, iam_integration=IAMIntegration._DEFAULT, **kwargs):
533531
""" Creates a Dataset object on the server.
534532
535533
Attribute values are passed as keyword arguments.
@@ -705,7 +703,7 @@ def get_data_row_ids_for_external_ids(
705703
for row in self.execute(
706704
query_str,
707705
{'externalId_in': external_ids[i:i + max_ids_per_request]
708-
})['externalIdsToDataRowIds']:
706+
})['externalIdsToDataRowIds']:
709707
result[row['externalId']].append(row['dataRowId'])
710708
return result
711709

0 commit comments

Comments
 (0)