from typing import Any, List, Optional, Union

from django import template
from django.contrib.auth.base_user import AbstractBaseUser
from django.contrib.auth.models import AnonymousUser

from rest_framework.request import Request

register: Any
class_re: Any

def highlight_code(parser: Any, token: Any) -> Any: ...

class CodeNode(template.Node):
    style: str = ...
    lang: Any = ...
    nodelist: Any = ...
    def __init__(self, lang: Any, code: Any) -> None: ...
    def render(self, context: Any) -> Any: ...

def with_location(fields: Any, location: Any) -> Any: ...
def form_for_link(link: Any) -> Any: ...
def render_markdown(markdown_text: Any) -> Any: ...
def get_pagination_html(pager: Any) -> Any: ...
def render_form(serializer: Any, template_pack: Optional[Any] = ...) -> Any: ...
def render_field(field: Any, style: Any) -> Any: ...
def optional_login(request: Request) -> Any: ...
def optional_docs_login(request: Request) -> Any: ...
def optional_logout(request: Request, user: Union[AnonymousUser, AbstractBaseUser]) -> Any: ...
def add_query_param(request: Request, key: str, val: Any) -> Any: ...
def as_string(value: Any) -> str: ...
def as_list_of_strings(value: Any) -> List[str]: ...
def add_class(value: Any, css_class: Any) -> Any: ...
def format_value(value: Any) -> Any: ...
def items(value: Any) -> Any: ...
def data(value: Any) -> Any: ...
def schema_links(section: Any, sec_key: Optional[Any] = ...) -> Any: ...
def add_nested_class(value: Any) -> Any: ...

TRAILING_PUNCTUATION: Any
WRAPPING_PUNCTUATION: Any
word_split_re: Any
simple_url_re: Any
simple_url_2_re: Any
simple_email_re: Any

def smart_urlquote_wrapper(matched_url: Any) -> Any: ...
def urlize_quoted_links(
    text: Any, trim_url_limit: Optional[Any] = ..., nofollow: bool = ..., autoescape: bool = ...
) -> Any: ...
def break_long_headers(header: Any) -> Any: ...
