# Path: srsly/ruamel_yaml/error.py
# class MarkedYAMLError(YAMLError):
#     def __init__(
#         self,
#         context=None,
#         context_mark=None,
#         problem=None,
#         problem_mark=None,
#         note=None,
#         warn=None,
#     ):
#         # type: (Any, Any, Any, Any, Any, Any) -> None
#         self.context = context
#         self.context_mark = context_mark
#         self.problem = problem
#         self.problem_mark = problem_mark
#         self.note = note
#         # warn is ignored
# 
#     def __str__(self):
#         # type: () -> Any
#         lines = []  # type: List[str]
#         if self.context is not None:
#             lines.append(self.context)
#         if self.context_mark is not None and (
#             self.problem is None
#             or self.problem_mark is None
#             or self.context_mark.name != self.problem_mark.name
#             or self.context_mark.line != self.problem_mark.line
#             or self.context_mark.column != self.problem_mark.column
#         ):
#             lines.append(str(self.context_mark))
#         if self.problem is not None:
#             lines.append(self.problem)
#         if self.problem_mark is not None:
#             lines.append(str(self.problem_mark))
#         if self.note is not None and self.note:
#             note = textwrap.dedent(self.note)
#             lines.append(note)
#         return "\n".join(lines)
# 
# Path: srsly/ruamel_yaml/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):


from .error import MarkedYAMLError
from .tokens import *  # NOQA
from .compat import utf8, unichr, PY3, check_anchorname_char, nprint  # NOQA
    from typing import Any, Dict, Optional, List, Union, Text  # NOQA
    from .compat import VersionType  # NOQA
        if ch not in "\0 \r\n\x85\u2028\u2029":
            raise ScannerError(
                "while scanning a directive",
                start_mark,
                "expected alphabetic or numeric character, but found %r" % utf8(ch),
                self.reader.get_mark(),
            )
        return value

    def scan_yaml_directive_value(self, start_mark):
        # type: (Any) -> Any
        # See the specification for details.
        srp = self.reader.peek
        srf = self.reader.forward
        while srp() == " ":
            srf()
        major = self.scan_yaml_directive_number(start_mark)
        if srp() != ".":
            raise ScannerError(
                "while scanning a directive",
                start_mark,
                "expected a digit or '.', but found %r" % utf8(srp()),
                self.reader.get_mark(),
            )
        srf()
        minor = self.scan_yaml_directive_number(start_mark)
        if srp() not in "\0 \r\n\x85\u2028\u2029":
            raise ScannerError(
                "while scanning a directive",
                start_mark,

# Path: srsly/ruamel_yaml/error.py
# class MarkedYAMLError(YAMLError):
#     def __init__(
#         self,
#         context=None,
#         context_mark=None,
#         problem=None,
#         problem_mark=None,
#         note=None,
#         warn=None,
#     ):
#         # type: (Any, Any, Any, Any, Any, Any) -> None
#         self.context = context
#         self.context_mark = context_mark
#         self.problem = problem
#         self.problem_mark = problem_mark
#         self.note = note
#         # warn is ignored
# 
#     def __str__(self):
#         # type: () -> Any
#         lines = []  # type: List[str]
#         if self.context is not None:
#             lines.append(self.context)
#         if self.context_mark is not None and (
#             self.problem is None
#             or self.problem_mark is None
#             or self.context_mark.name != self.problem_mark.name
#             or self.context_mark.line != self.problem_mark.line
#             or self.context_mark.column != self.problem_mark.column
#         ):
#             lines.append(str(self.context_mark))
#         if self.problem is not None:
#             lines.append(self.problem)
#         if self.problem_mark is not None:
#             lines.append(str(self.problem_mark))
#         if self.note is not None and self.note:
#             note = textwrap.dedent(self.note)
#             lines.append(note)
#         return "\n".join(lines)
# 
# Path: srsly/ruamel_yaml/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: srsly/ruamel_yaml/scanner.py
from .error import MarkedYAMLError
from .tokens import *  # NOQA
from .compat import utf8, unichr, PY3, check_anchorname_char, nprint  # NOQA
    from typing import Any, Dict, Optional, List, Union, Text  # NOQA
    from .compat import VersionType  # NOQA

        if ch not in "\0 \r\n\x85\u2028\u2029":
            raise ScannerError(
                "while scanning a directive",
                start_mark,
                "expected alphabetic or numeric character, but found %r" % utf8(ch),
                self.reader.get_mark(),
            )
        return value

    def scan_yaml_directive_value(self, start_mark):
        # type: (Any) -> Any
        # See the specification for details.
        srp = self.reader.peek
        srf = self.reader.forward
        while srp() == " ":
            srf()
        major = self.scan_yaml_directive_number(start_mark)
        if srp() != ".":
            raise ScannerError(
                "while scanning a directive",
                start_mark,
                "expected a digit or '.', but found %r" % utf8(srp()),
                self.reader.get_mark(),
            )
        srf()
        minor = self.scan_yaml_directive_number(start_mark)
        if srp() not in "\0 \r\n\x85\u2028\u2029":
            raise ScannerError(
                "while scanning a directive",
                start_mark,

                "expected a digit or ' ', but found %r" % utf8(srp()),