# Path: strictyaml/ruamel/error.py
# class YAMLError(Exception):
#     pass
# 
# class YAMLStreamError(Exception):
#     pass
# 
# Path: strictyaml/ruamel/compat.py
# _DEFAULT_YAML_VERSION = (1, 2)
# PY2 = sys.version_info[0] == 2
# PY3 = sys.version_info[0] == 3
#     MAXSIZE = sys.maxsize
# UNICODE_SIZE = 4 if sys.maxunicode > 65535 else 2
# DBG_TOKEN = 1
# DBG_EVENT = 2
# DBG_NODE = 4
#     class ordereddict(OrderedDict):  # type: ignore
#     class ObjectCounter(object):
# class Nprint(object):
# class MutableSliceableSequence(MutableSequence):  # type: ignore
#             def insert(self, pos, key, value):
#     def utf8(s):
#     def to_str(s):
#     def to_unicode(s):
#     def utf8(s):
#     def to_str(s):
#     def to_unicode(s):
# def with_metaclass(meta, *bases):
#         def __init__(self):
#         def __call__(self, k):
#         def dump(self):
# def dbg(val=None):
#     def __init__(self, file_name=None):
#     def __call__(self, *args, **kw):
#     def set_max_print(self, i):
# def check_namespace_char(ch):
# def check_anchorname_char(ch):
# def version_tnf(t1, t2=None):
#     def __getitem__(self, index):
#     def __setitem__(self, index, value):
#     def __delitem__(self, index):
#     def __getsingleitem__(self, index):
#     def __setsingleitem__(self, index, value):
#     def __delsingleitem__(self, index):


import sys
from strictyaml.ruamel.error import YAMLError, YAMLStreamError
from strictyaml.ruamel.events import *  # NOQA
from strictyaml.ruamel.compat import utf8, text_type, PY2, nprint, dbg, DBG_EVENT, \
    check_anchorname_char
    from typing import Any, Dict, List, Union, Text, Tuple, Optional  # NOQA
    from strictyaml.ruamel.compat import StreamType  # NOQA
        while end < len(suffix):
            ch = suffix[end]
            if (
                u"0" <= ch <= u"9"
                or u"A" <= ch <= u"Z"
                or u"a" <= ch <= u"z"
                or ch in ch_set
                or (ch == u"!" and handle != u"!")
            ):
                end += 1
            else:
                if start < end:
                    chunks.append(suffix[start:end])
                start = end = end + 1
                data = utf8(ch)
                for ch in data:
                    chunks.append(u"%%%02X" % ord(ch))
        if start < end:
            chunks.append(suffix[start:end])
        suffix_text = "".join(chunks)
        if handle:
            return u"%s%s" % (handle, suffix_text)
        else:
            return u"!<%s>" % suffix_text

    def prepare_anchor(self, anchor):
        # type: (Any) -> Any
        if not anchor:
            raise EmitterError("anchor must not be empty")
        for ch in anchor:

# Path: strictyaml/ruamel/error.py
# class YAMLError(Exception):
#     pass
# 
# class YAMLStreamError(Exception):
#     pass
# 
# Path: strictyaml/ruamel/compat.py
# _DEFAULT_YAML_VERSION = (1, 2)
# PY2 = sys.version_info[0] == 2
# PY3 = sys.version_info[0] == 3
#     MAXSIZE = sys.maxsize
# UNICODE_SIZE = 4 if sys.maxunicode > 65535 else 2
# DBG_TOKEN = 1
# DBG_EVENT = 2
# DBG_NODE = 4
#     class ordereddict(OrderedDict):  # type: ignore
#     class ObjectCounter(object):
# class Nprint(object):
# class MutableSliceableSequence(MutableSequence):  # type: ignore
#             def insert(self, pos, key, value):
#     def utf8(s):
#     def to_str(s):
#     def to_unicode(s):
#     def utf8(s):
#     def to_str(s):
#     def to_unicode(s):
# def with_metaclass(meta, *bases):
#         def __init__(self):
#         def __call__(self, k):
#         def dump(self):
# def dbg(val=None):
#     def __init__(self, file_name=None):
#     def __call__(self, *args, **kw):
#     def set_max_print(self, i):
# def check_namespace_char(ch):
# def check_anchorname_char(ch):
# def version_tnf(t1, t2=None):
#     def __getitem__(self, index):
#     def __setitem__(self, index, value):
#     def __delitem__(self, index):
#     def __getsingleitem__(self, index):
#     def __setsingleitem__(self, index, value):
#     def __delsingleitem__(self, index):


# Path: strictyaml/ruamel/emitter.py
import sys
from strictyaml.ruamel.error import YAMLError, YAMLStreamError
from strictyaml.ruamel.events import *  # NOQA
from strictyaml.ruamel.compat import utf8, text_type, PY2, nprint, dbg, DBG_EVENT, \
    check_anchorname_char
    from typing import Any, Dict, List, Union, Text, Tuple, Optional  # NOQA
    from strictyaml.ruamel.compat import StreamType  # NOQA

        while end < len(suffix):
            ch = suffix[end]
            if (
                u"0" <= ch <= u"9"
                or u"A" <= ch <= u"Z"
                or u"a" <= ch <= u"z"
                or ch in ch_set
                or (ch == u"!" and handle != u"!")
            ):
                end += 1
            else:
                if start < end:
                    chunks.append(suffix[start:end])
                start = end = end + 1
                data = utf8(ch)
                for ch in data:
                    chunks.append(u"%%%02X" % ord(ch))
        if start < end:
            chunks.append(suffix[start:end])
        suffix_text = "".join(chunks)
        if handle:
            return u"%s%s" % (handle, suffix_text)
        else:
            return u"!<%s>" % suffix_text

    def prepare_anchor(self, anchor):
        # type: (Any) -> Any
        if not anchor:
            raise EmitterError("anchor must not be empty")
        for ch in anchor:

            if not check_anchorname_char(ch):