from typing import Iterable, Any, Self
from collections.abc import Callable

class DoublyLinkedList:
    def __init__(self, Iterable: Iterable) -> None: ...
    def append(self, object: Any, forward: bool = True)-> None:
        """Append object to the end of the list. Set forward to false to append to the start."""
        ...
    def clear(self) -> None:
        """Remove all items from the list."""
        ...
    def copy(self) -> DoublyLinkedList:
        """Return a shallow copy of the list."""
        ...
    def count(self, value: Any) -> int:
        """Return number of occurrences of value in the list."""
        ...
    def extend(self, iterable: Iterable, forward: bool = True) -> None:
        """Extend list by appending elements from the iterable. Set forward to false to extend from the start."""
        ...
    def index(self, value: Any, start: int, stop: int) -> int:
        """Return first index of value.  
        Raises ValueError if the value is not present."""
        ...
    def insert(self, object: Any, index: int, forward: bool = True) -> None:
        """Insert object after index. Set forward to false to insert before index."""
        ...
    def pop(self, index: int = -1) -> Any:
        """Remove and return item at index (default last).  
        Raises IndexError if list is empty or index is out of range."""
        ...
    def remove(self, value: Any) -> None:
        """Remove first occurence of value.  
        Raises ValueError if the value is not present."""
        ...
    def reverse(self) -> None:
        """Reverse the order of the list."""
        ...
    def sort(self: DoublyLinkedList, key: Callable, reverse: bool = False) -> None:
        """In-place sort in ascending order, equal objects are not swapped. Key can be applied to values and the list will be sorted based on the result of applying the key. Reverse will reverse the sort order."""
        ...
    def __add__(self, Iterable: Iterable) -> DoublyLinkedList: ...
    def __contains__(self, Any: Any) -> bool: ...
    def __delitem__(self, Any: Any) -> None: ...
    def __getitem__(self, Index: int) -> Any: ...
    def __iadd__(self, Iterable: Iterable) -> Self: ...
    def __len__(self) -> int: ...
    def __setitem__(self, Index: int, Object: Any) -> None: ...
