(
    tag, regexp, first=None, Loader=None, Dumper=None, resolver=Resolver
)
Add an implicit scalar detector.
    If an implicit scalar value matches the given regexp,
    the corresponding tag is assigned to the scalar.
    first is a sequence of possible initial characters or None.
Add an implicit scalar detector.
    If an implicit scalar value matches the given regexp,
    the corresponding tag is assigned to the scalar.
    first is a sequence of possible initial characters or None.
Add an implicit scalar detector . If an implicit scalar value matches the given regexp the corresponding tag is assigned to the scalar . first is a sequence of possible initial characters or None .
def add_implicit_resolver(
    tag, regexp, first=None, Loader=None, Dumper=None, resolver=Resolver
):
    # type: (Any, Any, Any, Any, Any, Any) -> None
    """
    Add an implicit scalar detector.
    If an implicit scalar value matches the given regexp,
    the corresponding tag is assigned to the scalar.
    first is a sequence of possible initial characters or None.
    """
    if Loader is None and Dumper is None:
        resolver.add_implicit_resolver(tag, regexp, first)
        return
    if Loader:
        if hasattr(Loader, "add_implicit_resolver"):
            Loader.add_implicit_resolver(tag, regexp, first)
        elif issubclass(
            Loader, (BaseLoader, SafeLoader, loader.Loader, RoundTripLoader)
        ):
            Resolver.add_implicit_resolver(tag, regexp, first)
        else:
            raise NotImplementedError
    if Dumper:
        if hasattr(Dumper, "add_implicit_resolver"):
            Dumper.add_implicit_resolver(tag, regexp, first)
        elif issubclass(
            Dumper, (BaseDumper, SafeDumper, dumper.Dumper, RoundTripDumper)
        ):
            Resolver.add_implicit_resolver(tag, regexp, first)
        else:
            raise NotImplementedError
def add_implicit_resolver ( tag , regexp , first = 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_implicit_resolver ( tag , regexp , first ) return if Loader : if hasattr ( Loader , "add_implicit_resolver" ) : Loader . add_implicit_resolver ( tag , regexp , first ) elif issubclass ( Loader , ( BaseLoader , SafeLoader , loader . Loader , RoundTripLoader ) ) : Resolver . add_implicit_resolver ( tag , regexp , first ) else : raise NotImplementedError if Dumper : if hasattr ( Dumper , "add_implicit_resolver" ) : Dumper . add_implicit_resolver ( tag , regexp , first ) elif issubclass ( Dumper , ( BaseDumper , SafeDumper , dumper . Dumper , RoundTripDumper ) ) : Resolver . add_implicit_resolver ( tag , regexp , first ) else : raise NotImplementedError