@@ -126,9 +126,8 @@ def labels(self, datasets=None, order_by=None):
126126 id_param , id_param , where , order_by_str ,
127127 query .results_query_part (Label ))
128128
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 )
132131
133132 def export_queued_data_rows (self , timeout_seconds = 120 ):
134133 """ Returns all data rows that are currently enqueued for this project.
@@ -369,13 +368,11 @@ def create_labeler_performance(client, result):
369368 # python isoformat doesn't accept Z as utc timezone
370369 result ["lastActivityTime" ] = datetime .fromisoformat (
371370 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 ()})
376374
377- return PaginatedCollection (self .client , query_str ,
378- {id_param : self .uid },
375+ return PaginatedCollection (self .client , query_str , {id_param : self .uid },
379376 ["project" , "labelerPerformance" ],
380377 create_labeler_performance )
381378
@@ -387,7 +384,7 @@ def review_metrics(self, net_score):
387384 Returns:
388385 int, aggregation count of reviews for given `net_score`.
389386 """
390- if net_score not in (None , ) + tuple (Entity .Review .NetScore ):
387+ if net_score not in (None ,) + tuple (Entity .Review .NetScore ):
391388 raise InvalidQueryError (
392389 "Review metrics net score must be either None "
393390 "or one of Review.NetScore values" )
@@ -512,8 +509,8 @@ def unset_labeling_parameter_overrides(self, data_rows):
512509 query_str = """mutation UnsetLabelingParameterOverridesPyApi($%s: ID!){
513510 project(where: { id: $%s}) {
514511 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 ))
517514 res = self .client .execute (query_str , {id_param : self .uid })
518515 return res ["project" ]["unsetLabelingParameterOverrides" ]["success" ]
519516
0 commit comments