@@ -272,7 +272,9 @@ def ensure_required_components_exist(
272272 raise exceptions .MissingComponentError (uri , * missing_components )
273273
274274
275- def is_valid (value : t .Optional [str ], matcher : t .Pattern [str ], require : bool ) -> bool :
275+ def is_valid (
276+ value : t .Optional [str ], matcher : t .Pattern [str ], require : bool
277+ ) -> bool :
276278 """Determine if a value is valid based on the provided matcher.
277279
278280 :param str value:
@@ -289,7 +291,9 @@ def is_valid(value: t.Optional[str], matcher: t.Pattern[str], require: bool) ->
289291 return value is None or bool (matcher .match (value ))
290292
291293
292- def authority_is_valid (authority : str , host : t .Optional [str ] = None , require : bool = False ) -> bool :
294+ def authority_is_valid (
295+ authority : str , host : t .Optional [str ] = None , require : bool = False
296+ ) -> bool :
293297 """Determine if the authority string is valid.
294298
295299 :param str authority:
@@ -374,7 +378,9 @@ def query_is_valid(query: t.Optional[str], require: bool = False) -> bool:
374378 return is_valid (query , misc .QUERY_MATCHER , require )
375379
376380
377- def fragment_is_valid (fragment : t .Optional [str ], require : bool = False ) -> bool :
381+ def fragment_is_valid (
382+ fragment : t .Optional [str ], require : bool = False
383+ ) -> bool :
378384 """Determine if the fragment component is valid.
379385
380386 :param str fragment:
@@ -406,7 +412,9 @@ def valid_ipv4_host_address(host: str) -> bool:
406412_SUBAUTHORITY_VALIDATORS = {"userinfo" , "host" , "port" }
407413
408414
409- def subauthority_component_is_valid (uri : "uri.URIReference" , component : str ) -> bool :
415+ def subauthority_component_is_valid (
416+ uri : "uri.URIReference" , component : str
417+ ) -> bool :
410418 """Determine if the userinfo, host, and port are valid."""
411419 try :
412420 subauthority_dict = uri .authority_info ()
@@ -430,7 +438,9 @@ def subauthority_component_is_valid(uri: "uri.URIReference", component: str) ->
430438 return 0 <= port <= 65535
431439
432440
433- def ensure_components_are_valid (uri : "uri.URIReference" , validated_components : t .List [str ]) -> None :
441+ def ensure_components_are_valid (
442+ uri : "uri.URIReference" , validated_components : t .List [str ]
443+ ) -> None :
434444 """Assert that all components are valid in the URI."""
435445 invalid_components : set [str ] = set ()
436446 for component in validated_components :
0 commit comments