# namedtuple is special-cased in the type checker; the initializer is ignored.

    # It should return a str to implement Sequence correctly, but it doesn't.
    
    # These methods of deque don't really take slices, but we need to
    # define them as taking a slice to satisfy MutableSequence.
    
    # The Iterable[Tuple[...]] argument type is not actually desirable
    # (the tuples will be added as keys, breaking type safety) but
    # it's included so that the signature is compatible with
    # Dict.update. Not sure if we should use '# type: ignore' instead
    # and omit the type from the union.
    
    def __init__(self, __dict: Optional[Mapping[_KT, _VT]] = ..., **kwargs: _VT) -> None: ...

    def fromkeys(cls: Type[_S], iterable: Iterable[_KT], value: Optional[_VT] = ...) -> _S: ...

    def __init__(self, initlist: Optional[Iterable[_T]] = ...) -> None: ...

    def __getitem__(self, i: slice) -> MutableSequence[_T]: ...

    def __setitem__(self, i: slice, o: Iterable[_T]) -> None: ...

    def __lt__(self, string: Union[str, UserString]) -> bool: ...

    def __le__(self, string: Union[str, UserString]) -> bool: ...

    def __gt__(self, string: Union[str, UserString]) -> bool: ...

    def __ge__(self, string: Union[str, UserString]) -> bool: ...

    def __getitem__(self: _UserStringT, i: Union[int, slice]) -> _UserStringT: ...  # type: ignore

    def __add__(self: _UserStringT, other: object) -> _UserStringT: ...

    def __mul__(self: _UserStringT, n: int) -> _UserStringT: ...

    def __mod__(self: _UserStringT, args: Any) -> _UserStringT: ...

    def center(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ...

    def count(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ...

        def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> bytes: ...

        def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UserStringT: ...

    def endswith(self, suffix: Union[str, Tuple[str, ...]], start: int = ..., end: int = ...) -> bool: ...

    def expandtabs(self: _UserStringT, tabsize: int = ...) -> _UserStringT: ...

    def find(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ...

    def format_map(self, mapping: Mapping[str, Any]) -> str: ...

    def index(self, sub: str, start: int = ..., end: int = ...) -> int: ...

    def ljust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ...

    def lstrip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ...

    def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ...

    def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ...

        def removeprefix(self: _UserStringT, __prefix: Union[str, UserString]) -> _UserStringT: ...

        def removesuffix(self: _UserStringT, __suffix: Union[str, UserString]) -> _UserStringT: ...

        self: _UserStringT, old: Union[str, UserString], new: Union[str, UserString], maxsplit: int = ...

    def rfind(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ...

    def rindex(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ...

    def rjust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ...

    def rpartition(self, sep: str) -> Tuple[str, str, str]: ...

    def rstrip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ...

    def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ...

    def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ...

    def splitlines(self, keepends: bool = ...) -> List[str]: ...

    def startswith(self, prefix: Union[str, Tuple[str, ...]], start: int = ..., end: int = ...) -> bool: ...

    def strip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ...

    def translate(self: _UserStringT, *args: Any) -> _UserStringT: ...

    def zfill(self: _UserStringT, width: int) -> _UserStringT: ...

    def __init__(self, iterable: Iterable[_T] = ..., maxlen: Optional[int] = ...) -> None: ...

    def index(self, x: _T, start: int = ..., stop: int = ...) -> int: ...

    def __getitem__(self, s: slice) -> MutableSequence[_T]: ...

    def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ...

    def __init__(self, __iterable: None = ..., **kwargs: int) -> None: ...

    def __init__(self, __mapping: Mapping[_T, int]) -> None: ...

    def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ...

    def subtract(self, __mapping: Mapping[_T, int]) -> None: ...

    def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ...

    def update(self, __m: Union[Iterable[_T], Iterable[Tuple[_T, int]]], **kwargs: int) -> None: ...

    def update(self, __m: None = ..., **kwargs: int) -> None: ...

    def __or__(self, other: Counter[_T]) -> Counter[_T]: ...  # type: ignore

    def __ior__(self, other: Counter[_T]) -> Counter[_T]: ...  # type: ignore

class _OrderedDictItemsView(ItemsView[_KT, _VT], Reversible[Tuple[_KT, _VT]]):

class _OrderedDictValuesView(ValuesView[_VT], Reversible[_VT]):

class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):

    def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ...

    def move_to_end(self, key: _KT, last: bool = ...) -> None: ...

    def __init__(self, default_factory: Optional[Callable[[], _VT]]) -> None: ...

    def __init__(self, default_factory: Optional[Callable[[], _VT]], **kwargs: _VT) -> None: ...

    def __init__(self, default_factory: Optional[Callable[[], _VT]], map: Mapping[_KT, _VT]) -> None: ...

    def __init__(self, default_factory: Optional[Callable[[], _VT]], map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...

    def __init__(self, default_factory: Optional[Callable[[], _VT]], iterable: Iterable[Tuple[_KT, _VT]]) -> None: ...

        self, default_factory: Optional[Callable[[], _VT]], iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT

    def new_child(self, m: Mapping[_KT, _VT] = ...) -> typing.ChainMap[_KT, _VT]: ...

    def __missing__(self, key: _KT) -> _VT: ...  # undocumented