(
    tag, path, kind=None, Loader=None, Dumper=None, resolver=Resolver
)
Add a path based resolver for the given tag.
    A path is a list of keys that forms a path
    to a node in the representation tree.
    Keys can be string values, integers, or None.
Add a path based resolver for the given tag.
    A path is a list of keys that forms a path
    to a node in the representation tree.
    Keys can be string values, integers, or None.
Add a path based resolver for the given tag . A path is a list of keys that forms a path to a node in the representation tree . Keys can be string values integers or None .
def add_path_resolver(
    tag, path, kind=None, Loader=None, Dumper=None, resolver=Resolver
):
    # type: (Any, Any, Any, Any, Any, Any) -> None
    """
    Add a path based resolver for the given tag.
    A path is a list of keys that forms a path
    to a node in the representation tree.
    Keys can be string values, integers, or None.
    """
    if Loader is None and Dumper is None:
        resolver.add_path_resolver(tag, path, kind)
        return
    if Loader:
        if hasattr(Loader, "add_path_resolver"):
            Loader.add_path_resolver(tag, path, kind)
        elif issubclass(
            Loader, (BaseLoader, SafeLoader, loader.Loader, RoundTripLoader)
        ):
            Resolver.add_path_resolver(tag, path, kind)
        else:
            raise NotImplementedError
    if Dumper:
        if hasattr(Dumper, "add_path_resolver"):
            Dumper.add_path_resolver(tag, path, kind)
        elif issubclass(
            Dumper, (BaseDumper, SafeDumper, dumper.Dumper, RoundTripDumper)
        ):
            Resolver.add_path_resolver(tag, path, kind)
        else:
            raise NotImplementedError
def add_path_resolver ( tag , path , kind = None , Loader = None , Dumper = None , resolver = Resolver ) : # type: (Any, Any, Any, Any, Any, Any) -> None if Loader is None and Dumper is None : resolver . add_path_resolver ( tag , path , kind ) return if Loader : if hasattr ( Loader , "add_path_resolver" ) : Loader . add_path_resolver ( tag , path , kind ) elif issubclass ( Loader , ( BaseLoader , SafeLoader , loader . Loader , RoundTripLoader ) ) : Resolver . add_path_resolver ( tag , path , kind ) else : raise NotImplementedError if Dumper : if hasattr ( Dumper , "add_path_resolver" ) : Dumper . add_path_resolver ( tag , path , kind ) elif issubclass ( Dumper , ( BaseDumper , SafeDumper , dumper . Dumper , RoundTripDumper ) ) : Resolver . add_path_resolver ( tag , path , kind ) else : raise NotImplementedError