from collections import UserDict
from types import TracebackType
from typing import Any, Optional, Type

class Cookie(UserDict[str, Any]):
    def __init__(self, statefile: str = ...) -> None: ...
    def __enter__(self) -> Cookie: ...
    def __exit__(
        self,
        exc_type: Optional[Type[BaseException]],
        exc_val: Optional[BaseException],
        exc_tb: Optional[TracebackType],
    ) -> Optional[bool]: ...
    def open(self) -> Cookie: ...
    def close(self) -> None: ...
    def commit(self) -> None: ...
