Spaces:
Running
Running
from collections.abc import Iterable | |
from collections.abc import Iterator | |
from typing import overload | |
from .structures import ImmutableList | |
class Accept(ImmutableList[tuple[str, int]]): | |
provided: bool | |
def __init__( | |
self, values: Accept | Iterable[tuple[str, float]] | None = None | |
) -> None: ... | |
def _specificity(self, value: str) -> tuple[bool, ...]: ... | |
def _value_matches(self, value: str, item: str) -> bool: ... | |
# type: ignore | |
def __getitem__(self, key: str) -> int: ... | |
def __getitem__(self, key: int) -> tuple[str, int]: ... | |
def __getitem__(self, key: slice) -> Iterable[tuple[str, int]]: ... | |
def quality(self, key: str) -> int: ... | |
def __contains__(self, value: str) -> bool: ... # type: ignore | |
def index(self, key: str) -> int: ... # type: ignore | |
def find(self, key: str) -> int: ... | |
def values(self) -> Iterator[str]: ... | |
def to_header(self) -> str: ... | |
def _best_single_match(self, match: str) -> tuple[str, int] | None: ... | |
def best_match(self, matches: Iterable[str], default: str) -> str: ... | |
def best_match( | |
self, matches: Iterable[str], default: str | None = None | |
) -> str | None: ... | |
def best(self) -> str: ... | |
def _normalize_mime(value: str) -> list[str]: ... | |
class MIMEAccept(Accept): | |
def _specificity(self, value: str) -> tuple[bool, ...]: ... | |
def _value_matches(self, value: str, item: str) -> bool: ... | |
def accept_html(self) -> bool: ... | |
def accept_xhtml(self) -> bool: ... | |
def accept_json(self) -> bool: ... | |
def _normalize_lang(value: str) -> list[str]: ... | |
class LanguageAccept(Accept): | |
def _value_matches(self, value: str, item: str) -> bool: ... | |
class CharsetAccept(Accept): | |
def _value_matches(self, value: str, item: str) -> bool: ... | |