Skip to content

Commit 5928fdd

Browse files
committed
test
1 parent 457ea93 commit 5928fdd

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

labelbox/client.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class Client:
3636
authentication key). Provides functions for querying and creating
3737
top-level data objects (Projects, Datasets).
3838
"""
39-
4039
def __init__(self,
4140
api_key=None,
4241
endpoint='https://api.labelbox.com/graphql',
@@ -133,7 +132,8 @@ def convert_value(value):
133132
if query is not None:
134133
if params is not None:
135134
params = {
136-
key: convert_value(value) for key, value in params.items()
135+
key: convert_value(value)
136+
for key, value in params.items()
137137
}
138138
data = json.dumps({
139139
'query': query,
@@ -187,7 +187,6 @@ def check_errors(keywords, *path):
187187
""" Helper that looks for any of the given `keywords` in any of
188188
current errors on paths (like error[path][component][to][keyword]).
189189
"""
190-
191190
for error in errors:
192191
obj = error
193192
for path_elem in path:
@@ -335,18 +334,18 @@ def upload_data(self,
335334

336335
request_data = {
337336
"operations":
338-
json.dumps({
339-
"variables": {
340-
"file": None,
341-
"contentLength": len(content),
342-
"sign": sign
343-
},
344-
"query":
345-
"""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!,
346345
$sign: Boolean) {
347346
uploadFile(file: $file, contentLength: $contentLength,
348347
sign: $sign) {url filename} } """,
349-
}),
348+
}),
350349
"map": (None, json.dumps({"1": ["variables.file"]})),
351350
}
352351
response = requests.post(
@@ -355,7 +354,7 @@ def upload_data(self,
355354
data=request_data,
356355
files={
357356
"1": (filename, content, content_type) if
358-
(filename and content_type) else content
357+
(filename and content_type) else content
359358
})
360359

361360
if response.status_code == 502:
@@ -528,7 +527,9 @@ def _create(self, db_object_type, data):
528527
res = res["create%s" % db_object_type.type_name()]
529528
return db_object_type(self, res)
530529

531-
def create_dataset(self, iam_integration=IAMIntegration._DEFAULT, **kwargs):
530+
def create_dataset(self,
531+
iam_integration=IAMIntegration._DEFAULT,
532+
**kwargs):
532533
""" Creates a Dataset object on the server.
533534
534535
Attribute values are passed as keyword arguments.
@@ -704,7 +705,7 @@ def get_data_row_ids_for_external_ids(
704705
for row in self.execute(
705706
query_str,
706707
{'externalId_in': external_ids[i:i + max_ids_per_request]
707-
})['externalIdsToDataRowIds']:
708+
})['externalIdsToDataRowIds']:
708709
result[row['externalId']].append(row['dataRowId'])
709710
return result
710711

0 commit comments

Comments
 (0)