@@ -126,9 +126,8 @@ def labels(self, datasets=None, order_by=None):
126
126
id_param , id_param , where , order_by_str ,
127
127
query .results_query_part (Label ))
128
128
129
- return PaginatedCollection (self .client , query_str ,
130
- {id_param : self .uid }, ["project" , "labels" ],
131
- Label )
129
+ return PaginatedCollection (self .client , query_str , {id_param : self .uid },
130
+ ["project" , "labels" ], Label )
132
131
133
132
def export_queued_data_rows (self , timeout_seconds = 120 ):
134
133
""" Returns all data rows that are currently enqueued for this project.
@@ -369,13 +368,11 @@ def create_labeler_performance(client, result):
369
368
# python isoformat doesn't accept Z as utc timezone
370
369
result ["lastActivityTime" ] = datetime .fromisoformat (
371
370
result ["lastActivityTime" ].replace ('Z' , '+00:00' ))
372
- return LabelerPerformance (** {
373
- utils .snake_case (key ): value
374
- for key , value in result .items ()
375
- })
371
+ return LabelerPerformance (
372
+ **
373
+ {utils .snake_case (key ): value for key , value in result .items ()})
376
374
377
- return PaginatedCollection (self .client , query_str ,
378
- {id_param : self .uid },
375
+ return PaginatedCollection (self .client , query_str , {id_param : self .uid },
379
376
["project" , "labelerPerformance" ],
380
377
create_labeler_performance )
381
378
@@ -387,7 +384,7 @@ def review_metrics(self, net_score):
387
384
Returns:
388
385
int, aggregation count of reviews for given `net_score`.
389
386
"""
390
- if net_score not in (None , ) + tuple (Entity .Review .NetScore ):
387
+ if net_score not in (None ,) + tuple (Entity .Review .NetScore ):
391
388
raise InvalidQueryError (
392
389
"Review metrics net score must be either None "
393
390
"or one of Review.NetScore values" )
@@ -512,8 +509,8 @@ def unset_labeling_parameter_overrides(self, data_rows):
512
509
query_str = """mutation UnsetLabelingParameterOverridesPyApi($%s: ID!){
513
510
project(where: { id: $%s}) {
514
511
unsetLabelingParameterOverrides(data: [%s]) { success }}}""" % (
515
- id_param , id_param , ",\n " .join ("{dataRowId: \" %s \" }" % row . uid
516
- for row in data_rows ))
512
+ id_param , id_param , ",\n " .join (
513
+ "{dataRowId: \" %s \" }" % row . uid for row in data_rows ))
517
514
res = self .client .execute (query_str , {id_param : self .uid })
518
515
return res ["project" ]["unsetLabelingParameterOverrides" ]["success" ]
519
516
0 commit comments