from typing import Any, Dict

UNICODE_ASCII_CHARACTER_SET: str
CLIENT_ID_CHARACTER_SET: str
SANITIZE_PATTERN: Any
INVALID_HEX_PATTERN: Any
always_safe: str
log: Any

def quote(s, safe: bytes = ...): ...
def unquote(s): ...
def urlencode(params): ...
def encode_params_utf8(params): ...
def decode_params_utf8(params): ...

urlencoded: Any

def urldecode(query): ...
def extract_params(raw): ...
def generate_nonce(): ...
def generate_timestamp(): ...
def generate_token(length: int = ..., chars=...): ...
def generate_signed_token(private_pem, request): ...
def verify_signed_token(public_pem, token): ...
def generate_client_id(length: int = ..., chars=...): ...
def add_params_to_qs(query, params): ...
def add_params_to_uri(uri, params, fragment: bool = ...): ...
def safe_string_equals(a, b): ...
def to_unicode(data, encoding: str = ...): ...

class CaseInsensitiveDict(Dict[Any, Any]):
    proxy: Any
    def __init__(self, data) -> None: ...
    def __contains__(self, k): ...
    def __delitem__(self, k) -> None: ...
    def __getitem__(self, k): ...
    def get(self, k, default: Any | None = ...): ...
    def __setitem__(self, k, v) -> None: ...
    def update(self, *args, **kwargs) -> None: ...

class Request:
    uri: Any
    http_method: Any
    headers: Any
    body: Any
    decoded_body: Any
    oauth_params: Any
    validator_log: Any
    def __init__(self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ..., encoding: str = ...): ...
    def __getattr__(self, name): ...
    @property
    def uri_query(self): ...
    @property
    def uri_query_params(self): ...
    @property
    def duplicate_params(self): ...
