@@ -107,7 +107,9 @@ def _execute_operation(
107107 operation_name : str ,
108108 ) -> Output :
109109 try :
110- return self ._handle_execution (input , plugins , serialize , deserialize , config , operation_name )
110+ return self ._handle_execution (
111+ input , plugins , serialize , deserialize , config , operation_name
112+ )
111113 except Exception as e :
112114 # Make sure every exception that we throw is an instance of ServiceError so
113115 # customers can reliably catch everything we throw.
@@ -171,7 +173,9 @@ def _handle_execution(
171173 interceptor .read_before_serialization (context )
172174
173175 # Step 4: Serialize the request
174- context_with_transport_request = cast (InterceptorContext [Input , None , DafnyRequest , None ], context )
176+ context_with_transport_request = cast (
177+ InterceptorContext [Input , None , DafnyRequest , None ], context
178+ )
175179 context_with_transport_request ._transport_request = serialize (
176180 context_with_transport_request .request , config
177181 )
@@ -182,8 +186,8 @@ def _handle_execution(
182186
183187 # Step 6: Invoke modify_before_retry_loop
184188 for interceptor in interceptors :
185- context_with_transport_request ._transport_request = interceptor . modify_before_retry_loop (
186- context_with_transport_request
189+ context_with_transport_request ._transport_request = (
190+ interceptor . modify_before_retry_loop ( context_with_transport_request )
187191 )
188192
189193 # Step 7: Acquire the retry token.
@@ -233,7 +237,9 @@ def _handle_execution(
233237 # The response will be set either with the modeled output or an exception. The
234238 # transport_request and transport_response may be set or None.
235239 execution_context = cast (
236- InterceptorContext [Input , Output , DafnyRequest | None , DafnyResponse | None ],
240+ InterceptorContext [
241+ Input , Output , DafnyRequest | None , DafnyResponse | None
242+ ],
237243 context ,
238244 )
239245 return self ._finalize_execution (interceptors , execution_context )
@@ -255,10 +261,14 @@ def _handle_attempt(
255261 if config .dafnyImplInterface .impl is None :
256262 raise Exception ("No impl found on the operation config." )
257263
258- context_with_response = cast (InterceptorContext [Input , None , DafnyRequest , DafnyResponse ], context )
264+ context_with_response = cast (
265+ InterceptorContext [Input , None , DafnyRequest , DafnyResponse ], context
266+ )
259267
260- context_with_response ._transport_response = config .dafnyImplInterface .handle_request (
261- input = context_with_response .transport_request
268+ context_with_response ._transport_response = (
269+ config .dafnyImplInterface .handle_request (
270+ input = context_with_response .transport_request
271+ )
262272 )
263273
264274 # Step 7n: Invoke read_after_transmit
@@ -267,8 +277,8 @@ def _handle_attempt(
267277
268278 # Step 7o: Invoke modify_before_deserialization
269279 for interceptor in interceptors :
270- context_with_response ._transport_response = interceptor . modify_before_deserialization (
271- context_with_response
280+ context_with_response ._transport_response = (
281+ interceptor . modify_before_deserialization ( context_with_response )
272282 )
273283
274284 # Step 7p: Invoke read_before_deserialization
@@ -280,7 +290,9 @@ def _handle_attempt(
280290 InterceptorContext [Input , Output , DafnyRequest , DafnyResponse ],
281291 context_with_response ,
282292 )
283- context_with_output ._response = deserialize (context_with_output ._transport_response , config )
293+ context_with_output ._response = deserialize (
294+ context_with_output ._transport_response , config
295+ )
284296
285297 # Step 7r: Invoke read_after_deserialization
286298 for interceptor in interceptors :
@@ -306,7 +318,9 @@ def _finalize_attempt(
306318 # Step 7s: Invoke modify_before_attempt_completion
307319 try :
308320 for interceptor in interceptors :
309- context ._response = interceptor .modify_before_attempt_completion (context )
321+ context ._response = interceptor .modify_before_attempt_completion (
322+ context
323+ )
310324 except Exception as e :
311325 context ._response = e
312326
@@ -322,7 +336,9 @@ def _finalize_attempt(
322336 def _finalize_execution (
323337 self ,
324338 interceptors : list [Interceptor [Input , Output , DafnyRequest , DafnyResponse ]],
325- context : InterceptorContext [Input , Output , DafnyRequest | None , DafnyResponse | None ],
339+ context : InterceptorContext [
340+ Input , Output , DafnyRequest | None , DafnyResponse | None
341+ ],
326342 ) -> Output :
327343 try :
328344 # Step 9: Invoke modify_before_completion
0 commit comments