Spaces:
Running
Running
File size: 1,917 Bytes
9bc5ace |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
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: ...
@overload # type: ignore
def __getitem__(self, key: str) -> int: ...
@overload
def __getitem__(self, key: int) -> tuple[str, int]: ...
@overload
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: ...
@overload
def best_match(self, matches: Iterable[str], default: str) -> str: ...
@overload
def best_match(
self, matches: Iterable[str], default: str | None = None
) -> str | None: ...
@property
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: ...
@property
def accept_html(self) -> bool: ...
@property
def accept_xhtml(self) -> bool: ...
@property
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: ...
|