"""
This type stub file was generated by pyright.
"""

import collections.abc
import io
import os
from abc import abstractmethod
from collections import OrderedDict
from typing import (
    Any,
    Optional,
    Union,
)

from ruamel.yaml.docinfo import Version

try:
    from typing import SupportsIndex as SupportsIndex  # in order to reexport for mypy
except ImportError:
    SupportsIndex = int  # type: ignore

StreamType = Any
StreamTextType = StreamType
VersionType = Union[str, tuple[int, int], list[int], Version, None]
_DEFAULT_YAML_VERSION = ...

class ordereddict(OrderedDict):
    if not hasattr(OrderedDict, "insert"):
        def insert(self, pos: int, key: Any, value: Any) -> None: ...

StringIO = io.StringIO
BytesIO = io.BytesIO
builtins_module = ...

def with_metaclass(meta: Any, *bases: Any) -> Any:
    """Create a base class with a metaclass."""
    ...

DBG_TOKEN = ...
DBG_EVENT = ...
DBG_NODE = ...
_debug: Optional[int] = ...
if "RUAMELDEBUG" in os.environ:
    _debugx = ...
if bool(_debug):
    class ObjectCounter:
        def __init__(self) -> None: ...
        def __call__(self, k: Any) -> None: ...
        def dump(self) -> None: ...

    object_counter = ...

def dbg(val: Any = ...) -> Any: ...

class Nprint:
    def __init__(self, file_name: Any = ...) -> None: ...
    def __call__(self, *args: Any, **kw: Any) -> None: ...
    def set_max_print(self, i: int) -> None: ...
    def fp(self, mode: str = ...) -> Any: ...

nprint = ...
nprintf = ...

def check_namespace_char(ch: Any) -> bool: ...
def check_anchorname_char(ch: Any) -> bool: ...
def version_tnf(t1: Any, t2: Any = ...) -> Any:
    """
    return True if ruamel.yaml version_info < t1, None if t2 is specified and bigger else False
    """
    ...

class MutableSliceableSequence(collections.abc.MutableSequence):
    __slots__ = ...
    def __getitem__(self, index: Any) -> Any: ...
    def __setitem__(self, index: Any, value: Any) -> None: ...
    def __delitem__(self, index: Any) -> None: ...
    @abstractmethod
    def __getsingleitem__(self, index: Any) -> Any: ...
    @abstractmethod
    def __setsingleitem__(self, index: Any, value: Any) -> None: ...
    @abstractmethod
    def __delsingleitem__(self, index: Any) -> None: ...
