# Path: strictyaml/ruamel/compat.py
# class ordereddict(OrderedDict):  # type: ignore
#     if not hasattr(OrderedDict, "insert"):
# 
#         def insert(self, pos, key, value):
#             # type: (int, Any, Any) -> None
#             if pos >= len(self):
#                 self[key] = value
#                 return
#             od = ordereddict()
#             od.update(self)
#             for k in od:
#                 del self[k]
#             for index, old_key in enumerate(od):
#                 if pos == index:
#                     self[key] = value
#                 self[old_key] = od[old_key]
# 
# 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/scalarstring.py
# class ScalarString(text_type):
#     __slots__ = Anchor.attrib
# 
#     def __new__(cls, *args, **kw):
#         # type: (Any, Any) -> Any
#         anchor = kw.pop("anchor", None)  # type: ignore
#         ret_val = text_type.__new__(cls, *args, **kw)  # type: ignore
#         if anchor is not None:
#             ret_val.yaml_set_anchor(anchor, always_dump=True)
#         return ret_val
# 
#     def replace(self, old, new, maxreplace=-1):
#         # type: (Any, Any, int) -> Any
#         return type(self)((text_type.replace(self, old, new, maxreplace)))
# 
#     @property
#     def anchor(self):
#         # type: () -> Any
#         if not hasattr(self, Anchor.attrib):
#             setattr(self, Anchor.attrib, Anchor())
#         return getattr(self, Anchor.attrib)
# 
#     def yaml_anchor(self, any=False):
#         # type: (bool) -> Any
#         if not hasattr(self, Anchor.attrib):
#             return None
#         if any or self.anchor.always_dump:
#             return self.anchor
#         return None
# 
#     def yaml_set_anchor(self, value, always_dump=False):
#         # type: (Any, bool) -> None
#         self.anchor.value = value
#         self.anchor.always_dump = always_dump
# 
# Path: strictyaml/ruamel/anchor.py
# class Anchor(object):
#     __slots__ = "value", "always_dump"
#     attrib = anchor_attrib
# 
#     def __init__(self):
#         # type: () -> None
#         self.value = None
#         self.always_dump = False
# 
#     def __repr__(self):
#         # type: () -> Any
#         ad = ", (always dump)" if self.always_dump else ""
#         return "Anchor({!r}{})".format(self.value, ad)


import sys
import copy
from strictyaml.ruamel.compat import ordereddict  # type: ignore
from strictyaml.ruamel.compat import PY2, string_types, MutableSliceableSequence
from strictyaml.ruamel.scalarstring import ScalarString
from strictyaml.ruamel.anchor import Anchor
    from collections import MutableSet, Sized, Set, Mapping
    from collections.abc import MutableSet, Sized, Set, Mapping
    from typing import Any, Dict, Optional, List, Union, Optional, Iterator  # NOQA
        from .error import CommentMark
        from .tokens import CommentToken
        from strictyaml.ruamel.error import CommentMark
        from strictyaml.ruamel.tokens import CommentToken
        from .tokens import CommentToken
        from .error import CommentMark

    def yaml_set_tag(self, value):
        # type: (Any) -> None
        self.tag.value = value

    def copy_attributes(self, t, memo=None):
        # type: (Any, Any) -> None
        # fmt: off
        for a in [Comment.attrib, Format.attrib, LineCol.attrib, Anchor.attrib,
                  Tag.attrib, merge_attrib]:
            if hasattr(self, a):
                if memo is not None:
                    setattr(t, a, copy.deepcopy(getattr(self, a, memo)))
                else:
                    setattr(t, a, getattr(self, a))
        # fmt: on

    def _yaml_add_eol_comment(self, comment, key):
        # type: (Any, Any) -> None
        raise NotImplementedError

    def _yaml_get_pre_comment(self):
        # type: () -> Any
        raise NotImplementedError

    def _yaml_get_column(self, key):
        # type: (Any) -> Any
        raise NotImplementedError



# Path: strictyaml/ruamel/compat.py
# class ordereddict(OrderedDict):  # type: ignore
#     if not hasattr(OrderedDict, "insert"):
# 
#         def insert(self, pos, key, value):
#             # type: (int, Any, Any) -> None
#             if pos >= len(self):
#                 self[key] = value
#                 return
#             od = ordereddict()
#             od.update(self)
#             for k in od:
#                 del self[k]
#             for index, old_key in enumerate(od):
#                 if pos == index:
#                     self[key] = value
#                 self[old_key] = od[old_key]
# 
# 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/scalarstring.py
# class ScalarString(text_type):
#     __slots__ = Anchor.attrib
# 
#     def __new__(cls, *args, **kw):
#         # type: (Any, Any) -> Any
#         anchor = kw.pop("anchor", None)  # type: ignore
#         ret_val = text_type.__new__(cls, *args, **kw)  # type: ignore
#         if anchor is not None:
#             ret_val.yaml_set_anchor(anchor, always_dump=True)
#         return ret_val
# 
#     def replace(self, old, new, maxreplace=-1):
#         # type: (Any, Any, int) -> Any
#         return type(self)((text_type.replace(self, old, new, maxreplace)))
# 
#     @property
#     def anchor(self):
#         # type: () -> Any
#         if not hasattr(self, Anchor.attrib):
#             setattr(self, Anchor.attrib, Anchor())
#         return getattr(self, Anchor.attrib)
# 
#     def yaml_anchor(self, any=False):
#         # type: (bool) -> Any
#         if not hasattr(self, Anchor.attrib):
#             return None
#         if any or self.anchor.always_dump:
#             return self.anchor
#         return None
# 
#     def yaml_set_anchor(self, value, always_dump=False):
#         # type: (Any, bool) -> None
#         self.anchor.value = value
#         self.anchor.always_dump = always_dump
# 
# Path: strictyaml/ruamel/anchor.py
# class Anchor(object):
#     __slots__ = "value", "always_dump"
#     attrib = anchor_attrib
# 
#     def __init__(self):
#         # type: () -> None
#         self.value = None
#         self.always_dump = False
# 
#     def __repr__(self):
#         # type: () -> Any
#         ad = ", (always dump)" if self.always_dump else ""
#         return "Anchor({!r}{})".format(self.value, ad)


# Path: strictyaml/ruamel/comments.py
import sys
import copy
from strictyaml.ruamel.compat import ordereddict  # type: ignore
from strictyaml.ruamel.compat import PY2, string_types, MutableSliceableSequence
from strictyaml.ruamel.scalarstring import ScalarString
from strictyaml.ruamel.anchor import Anchor
    from collections import MutableSet, Sized, Set, Mapping
    from collections.abc import MutableSet, Sized, Set, Mapping
    from typing import Any, Dict, Optional, List, Union, Optional, Iterator  # NOQA
        from .error import CommentMark
        from .tokens import CommentToken
        from strictyaml.ruamel.error import CommentMark
        from strictyaml.ruamel.tokens import CommentToken
        from .tokens import CommentToken
        from .error import CommentMark


    def yaml_set_tag(self, value):
        # type: (Any) -> None
        self.tag.value = value

    def copy_attributes(self, t, memo=None):
        # type: (Any, Any) -> None
        # fmt: off
        for a in [Comment.attrib, Format.attrib, LineCol.attrib, Anchor.attrib,
                  Tag.attrib, merge_attrib]:
            if hasattr(self, a):
                if memo is not None:
                    setattr(t, a, copy.deepcopy(getattr(self, a, memo)))
                else:
                    setattr(t, a, getattr(self, a))
        # fmt: on

    def _yaml_add_eol_comment(self, comment, key):
        # type: (Any, Any) -> None
        raise NotImplementedError

    def _yaml_get_pre_comment(self):
        # type: () -> Any
        raise NotImplementedError

    def _yaml_get_column(self, key):
        # type: (Any) -> Any
        raise NotImplementedError



class CommentedSeq(MutableSliceableSequence, list, CommentedBase):  # type: ignore