run black over stubs, add checking to travis

This commit is contained in:
Maxim Kurnikov
2018-12-03 18:52:44 +03:00
parent d5bc7d4ab2
commit cf6119bf9b
420 changed files with 2295 additions and 8384 deletions

View File

@@ -1,6 +1,5 @@
from typing import Any, Iterator, List, Optional, Tuple, Union
class ArchiveException(Exception): ...
class UnrecognizedArchiveFormat(ArchiveException): ...
@@ -9,20 +8,14 @@ def extract(path: str, to_path: str = ...) -> None: ...
class Archive:
def __init__(self, file: str) -> None: ...
def __enter__(self) -> Archive: ...
def __exit__(
self, exc_type: None, exc_value: None, traceback: None
) -> None: ...
def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ...
def extract(self, to_path: str = ...) -> None: ...
def list(self) -> None: ...
def close(self) -> None: ...
class BaseArchive:
def split_leading_dir(
self, path: str
) -> Union[List[str], Tuple[str, str]]: ...
def has_leading_dir(
self, paths: Union[Iterator[Any], List[str]]
) -> bool: ...
def split_leading_dir(self, path: str) -> Union[List[str], Tuple[str, str]]: ...
def has_leading_dir(self, paths: Union[Iterator[Any], List[str]]) -> bool: ...
def extract(self) -> None: ...
def list(self) -> None: ...

View File

@@ -17,6 +17,4 @@ def ensure_echo_on() -> None: ...
def reloader_thread() -> None: ...
def restart_with_reloader() -> int: ...
def python_reloader(main_func: Any, args: Any, kwargs: Any) -> None: ...
def main(
main_func: Any, args: Optional[Any] = ..., kwargs: Optional[Any] = ...
) -> None: ...
def main(main_func: Any, args: Optional[Any] = ..., kwargs: Optional[Any] = ...) -> None: ...

View File

@@ -14,13 +14,7 @@ class BaseConverter:
def __init__(self, digits: str, sign: str = ...) -> None: ...
def encode(self, i: int) -> str: ...
def decode(self, s: str) -> int: ...
def convert(
self,
number: Union[int, str],
from_digits: str,
to_digits: str,
sign: str,
) -> Tuple[int, str]: ...
def convert(self, number: Union[int, str], from_digits: str, to_digits: str, sign: str) -> Tuple[int, str]: ...
base2: Any
base16: Any

View File

@@ -11,24 +11,14 @@ def patch_cache_control(response: HttpResponseBase, **kwargs: Any) -> None: ...
def get_max_age(response: HttpResponse) -> Optional[int]: ...
def set_response_etag(response: HttpResponseBase) -> HttpResponseBase: ...
def get_conditional_response(
request: WSGIRequest,
etag: Optional[str] = ...,
last_modified: Optional[int] = ...,
response: Optional[HttpResponse] = ...,
request: WSGIRequest, etag: Optional[str] = ..., last_modified: Optional[int] = ..., response: Optional[HttpResponse] = ...
) -> Optional[HttpResponse]: ...
def patch_response_headers(
response: HttpResponseBase, cache_timeout: float = ...
) -> None: ...
def patch_response_headers(response: HttpResponseBase, cache_timeout: float = ...) -> None: ...
def add_never_cache_headers(response: HttpResponseBase) -> None: ...
def patch_vary_headers(
response: HttpResponseBase, newheaders: Tuple[str]
) -> None: ...
def patch_vary_headers(response: HttpResponseBase, newheaders: Tuple[str]) -> None: ...
def has_vary_header(response: HttpResponse, header_query: str) -> bool: ...
def get_cache_key(
request: WSGIRequest,
key_prefix: Optional[str] = ...,
method: str = ...,
cache: Optional[BaseCache] = ...,
request: WSGIRequest, key_prefix: Optional[str] = ..., method: str = ..., cache: Optional[BaseCache] = ...
) -> Optional[str]: ...
def learn_cache_key(
request: WSGIRequest,

View File

@@ -3,19 +3,9 @@ from typing import Any, Callable, Optional, Union
using_sysrandom: bool
def salted_hmac(
key_salt: str,
value: Union[bytes, str],
secret: Optional[Union[bytes, str]] = ...,
) -> HMAC: ...
def salted_hmac(key_salt: str, value: Union[bytes, str], secret: Optional[Union[bytes, str]] = ...) -> HMAC: ...
def get_random_string(length: int = ..., allowed_chars: str = ...) -> str: ...
def constant_time_compare(
val1: Union[bytes, str], val2: Union[bytes, str]
) -> bool: ...
def constant_time_compare(val1: Union[bytes, str], val2: Union[bytes, str]) -> bool: ...
def pbkdf2(
password: Union[bytes, str],
salt: Union[bytes, str],
iterations: int,
dklen: int = ...,
digest: Optional[Callable] = ...,
password: Union[bytes, str], salt: Union[bytes, str], iterations: int, dklen: int = ..., digest: Optional[Callable] = ...
) -> bytes: ...

View File

@@ -1,7 +1,6 @@
from collections import OrderedDict
from datetime import datetime
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
Union)
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union
from unittest.case import TestCase
from uuid import UUID
@@ -13,29 +12,15 @@ from django.test.testcases import SerializeMixin
from django.test.utils import LoggingCaptureMixin
from django.urls.converters import IntConverter, StringConverter
class OrderedSet:
dict: collections.OrderedDict = ...
def __init__(
self,
iterable: Optional[
Union[
List[Tuple[str, str]],
List[datetime],
List[Combinable],
List[int],
List[str],
List[UUID],
OrderedDict,
]
Union[List[Tuple[str, str]], List[datetime], List[Combinable], List[int], List[str], List[UUID], OrderedDict]
] = ...,
) -> None: ...
def add(
self,
item: Union[
Type[Model], SerializeMixin, LoggingCaptureMixin, int, TestCase
],
) -> None: ...
def add(self, item: Union[Type[Model], SerializeMixin, LoggingCaptureMixin, int, TestCase]) -> None: ...
def remove(self, item: Any) -> None: ...
def discard(self, item: Any) -> None: ...
def __iter__(self): ...
@@ -56,33 +41,17 @@ class MultiValueDict(dict):
Tuple,
] = ...,
) -> None: ...
def __getitem__(
self, key: str
) -> Optional[Union[List[str], UploadedFile, str]]: ...
def __setitem__(
self, key: str, value: Optional[Union[int, str]]
) -> None: ...
def __getitem__(self, key: str) -> Optional[Union[List[str], UploadedFile, str]]: ...
def __setitem__(self, key: str, value: Optional[Union[int, str]]) -> None: ...
def __copy__(self) -> MultiValueDict: ...
def __deepcopy__(self, memo: Any): ...
def get(
self, key: str, default: Optional[Union[int, str]] = ...
) -> Optional[Union[InMemoryUploadedFile, int, str]]: ...
def getlist(
self, key: Optional[Union[Callable, str]], default: Any = ...
) -> Any: ...
def get(self, key: str, default: Optional[Union[int, str]] = ...) -> Optional[Union[InMemoryUploadedFile, int, str]]: ...
def getlist(self, key: Optional[Union[Callable, str]], default: Any = ...) -> Any: ...
def setlist(self, key: Union[Callable, str], list_: List[str]) -> None: ...
def setdefault(self, key: str, default: str = ...) -> str: ...
def setlistdefault(
self, key: Union[Callable, str], default_list: None = ...
) -> Union[
List[
Tuple[
List[Tuple[str, List[str]]], str, Dict[str, str], Dict[Any, Any]
]
],
List[UploadedFile],
List[str],
]: ...
) -> Union[List[Tuple[List[Tuple[str, List[str]]], str, Dict[str, str], Dict[Any, Any]]], List[UploadedFile], List[str]]: ...
def appendlist(
self,
key: Union[Callable, str],
@@ -106,9 +75,7 @@ class MultiValueDict(dict):
class ImmutableList(tuple):
warning: str = ...
def __new__(
cls: Type[ImmutableList], *args: Any, warning: str = ..., **kwargs: Any
) -> ImmutableList: ...
def __new__(cls: Type[ImmutableList], *args: Any, warning: str = ..., **kwargs: Any) -> ImmutableList: ...
def complain(self, *wargs: Any, **kwargs: Any) -> Any: ...
__delitem__: Any = ...
__delslice__: Any = ...
@@ -127,7 +94,5 @@ class ImmutableList(tuple):
class DictWrapper(dict):
func: Callable = ...
prefix: str = ...
def __init__(
self, data: Dict[str, str], func: Callable, prefix: str
) -> None: ...
def __init__(self, data: Dict[str, str], func: Callable, prefix: str) -> None: ...
def __getitem__(self, key: str) -> Optional[Union[int, str]]: ...

View File

@@ -3,7 +3,6 @@ from datetime import datetime as real_datetime
from datetime import time as real_time
from typing import Any, Optional, Union
class date(real_date):
def strftime(self, fmt: str) -> str: ...

View File

@@ -3,7 +3,4 @@ from typing import Any, Optional, Type, Union
from django.contrib.postgres.validators import KeysValidator
from django.core.validators import RegexValidator
def deconstructible(
*args: Any, path: Optional[Any] = ...
) -> Type[Union[KeysValidator, RegexValidator]]: ...
def deconstructible(*args: Any, path: Optional[Any] = ...) -> Type[Union[KeysValidator, RegexValidator]]: ...

View File

@@ -7,37 +7,19 @@ from django.test.testcases import LiveServerTestCase
from django.utils.deprecation import MiddlewareMixin
from django.views.generic.base import TemplateResponseMixin, View
class classonlymethod(classmethod):
def __get__(
self,
instance: Optional[View],
cls: Type[
Union[AccessMixin, SuccessMessageMixin, TemplateResponseMixin, View]
] = ...,
self, instance: Optional[View], cls: Type[Union[AccessMixin, SuccessMessageMixin, TemplateResponseMixin, View]] = ...
) -> Callable: ...
def method_decorator(
decorator: Union[Callable, Set[Callable], Tuple[Callable, Callable]],
name: str = ...,
) -> Callable: ...
def decorator_from_middleware_with_args(
middleware_class: Type[CacheMiddleware]
) -> Callable: ...
def decorator_from_middleware(
middleware_class: Type[MiddlewareMixin]
) -> Callable: ...
def method_decorator(decorator: Union[Callable, Set[Callable], Tuple[Callable, Callable]], name: str = ...) -> Callable: ...
def decorator_from_middleware_with_args(middleware_class: Type[CacheMiddleware]) -> Callable: ...
def decorator_from_middleware(middleware_class: Type[MiddlewareMixin]) -> Callable: ...
def available_attrs(fn: Any): ...
def make_middleware_decorator(
middleware_class: Type[MiddlewareMixin]
) -> Callable: ...
def make_middleware_decorator(middleware_class: Type[MiddlewareMixin]) -> Callable: ...
class classproperty:
fget: Optional[Callable] = ...
def __init__(self, method: Optional[Callable] = ...) -> None: ...
def __get__(
self,
instance: Optional[LiveServerTestCase],
cls: Type[LiveServerTestCase] = ...,
) -> str: ...
def __get__(self, instance: Optional[LiveServerTestCase], cls: Type[LiveServerTestCase] = ...) -> str: ...
def getter(self, method: Callable) -> classproperty: ...

View File

@@ -3,7 +3,6 @@ from typing import Any, Callable, Optional, Type
from django.http.request import HttpRequest
from django.http.response import HttpResponseBase
class RemovedInDjango30Warning(PendingDeprecationWarning): ...
class RemovedInNextVersionWarning(DeprecationWarning): ...
@@ -13,11 +12,7 @@ class warn_about_renamed_method:
new_method_name: str = ...
deprecation_warning: Type[DeprecationWarning] = ...
def __init__(
self,
class_name: str,
old_method_name: str,
new_method_name: str,
deprecation_warning: Type[DeprecationWarning],
self, class_name: str, old_method_name: str, new_method_name: str, deprecation_warning: Type[DeprecationWarning]
) -> None: ...
def __call__(self, f: Callable) -> Callable: ...
@@ -27,9 +22,7 @@ class RenameMethodsBase(type):
class DeprecationInstanceCheck(type):
alternative: str
deprecation_warning: Type[
django.utils.deprecation.RemovedInNextVersionWarning
]
deprecation_warning: Type[django.utils.deprecation.RemovedInNextVersionWarning]
def __instancecheck__(self, instance: Any): ...
class MiddlewareMixin:

View File

@@ -1,7 +1,6 @@
from datetime import timedelta
from typing import Any, Optional
def duration_string(duration: timedelta) -> str: ...
def duration_iso_string(duration: timedelta) -> str: ...
def duration_microseconds(delta: timedelta) -> int: ...

View File

@@ -3,35 +3,19 @@ from typing import Any, Optional, Union
from django.db.models.base import Model
class DjangoUnicodeDecodeError(UnicodeDecodeError):
obj: bytes = ...
def __init__(self, obj: bytes, *args: Any) -> None: ...
python_2_unicode_compatible: Any
def smart_text(
s: Union[Model, int, str],
encoding: str = ...,
strings_only: bool = ...,
errors: str = ...,
) -> str: ...
def smart_text(s: Union[Model, int, str], encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> str: ...
def is_protected_type(obj: Any) -> bool: ...
def force_text(
s: Optional[Union[bytes, Model, int, str]],
encoding: str = ...,
strings_only: bool = ...,
errors: str = ...,
s: Optional[Union[bytes, Model, int, str]], encoding: str = ..., strings_only: bool = ..., errors: str = ...
) -> Optional[Union[int, str]]: ...
def smart_bytes(
s: Union[int, str],
encoding: str = ...,
strings_only: bool = ...,
errors: str = ...,
) -> bytes: ...
def force_bytes(
s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...
) -> Union[bytes, date]: ...
def smart_bytes(s: Union[int, str], encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> bytes: ...
def force_bytes(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> Union[bytes, date]: ...
smart_str = smart_text
force_str = force_text

View File

@@ -5,7 +5,6 @@ from typing import Any, Dict, List, Optional, Tuple, Union
from django.http.response import HttpResponse
from django.utils.xmlutils import SimplerXMLGenerator
def rfc2822_date(date: date) -> str: ...
def rfc3339_date(date: date) -> str: ...
def get_tag_uri(url: str, date: Optional[date]) -> str: ...
@@ -62,15 +61,11 @@ class Enclosure:
length: Union[int, str]
mime_type: str
url: str = ...
def __init__(
self, url: str, length: Union[int, str], mime_type: str
) -> None: ...
def __init__(self, url: str, length: Union[int, str], mime_type: str) -> None: ...
class RssFeed(SyndicationFeed):
content_type: str = ...
def write(
self, outfile: Union[StringIO, HttpResponse], encoding: str
) -> None: ...
def write(self, outfile: Union[StringIO, HttpResponse], encoding: str) -> None: ...
def rss_attributes(self) -> Dict[str, str]: ...
def write_items(self, handler: SimplerXMLGenerator) -> None: ...
def add_root_elements(self, handler: SimplerXMLGenerator) -> None: ...
@@ -78,72 +73,33 @@ class RssFeed(SyndicationFeed):
class RssUserland091Feed(RssFeed):
feed: Dict[str, Optional[Union[List[str], str]]]
items: List[
Dict[str, Optional[Union[List[str], Tuple, datetime.datetime, str]]]
]
items: List[Dict[str, Optional[Union[List[str], Tuple, datetime.datetime, str]]]]
def add_item_elements(
self,
handler: SimplerXMLGenerator,
item: Dict[str, Optional[Union[List[str], Tuple, datetime, str]]],
self, handler: SimplerXMLGenerator, item: Dict[str, Optional[Union[List[str], Tuple, datetime, str]]]
) -> None: ...
class Rss201rev2Feed(RssFeed):
feed: Dict[str, Optional[Union[List[str], Tuple, str]]]
items: Union[
List[Dict[str, Any]],
List[
Dict[
str,
Optional[
Union[
List[django.utils.feedgenerator.Enclosure],
List[str],
datetime.datetime,
str,
]
],
]
],
List[Dict[str, Optional[Union[List[django.utils.feedgenerator.Enclosure], List[str], datetime.datetime, str]]]],
]
def add_item_elements(
self, handler: SimplerXMLGenerator, item: Dict[str, Any]
) -> None: ...
def add_item_elements(self, handler: SimplerXMLGenerator, item: Dict[str, Any]) -> None: ...
class Atom1Feed(SyndicationFeed):
feed: Dict[str, Optional[Union[List[str], Tuple, str]]]
items: Union[
List[
Dict[
str,
Optional[
Union[
List[django.utils.feedgenerator.Enclosure],
List[str],
datetime.datetime,
str,
]
],
]
],
List[
Dict[str, Optional[Union[List[str], Tuple, datetime.datetime, str]]]
],
List[Dict[str, Optional[Union[List[django.utils.feedgenerator.Enclosure], List[str], datetime.datetime, str]]]],
List[Dict[str, Optional[Union[List[str], Tuple, datetime.datetime, str]]]],
]
content_type: str = ...
ns: str = ...
def write(
self, outfile: Union[StringIO, HttpResponse], encoding: str
) -> None: ...
def write(self, outfile: Union[StringIO, HttpResponse], encoding: str) -> None: ...
def root_attributes(self) -> Dict[str, str]: ...
def add_root_elements(self, handler: SimplerXMLGenerator) -> None: ...
def write_items(self, handler: SimplerXMLGenerator) -> None: ...
def add_item_elements(
self,
handler: SimplerXMLGenerator,
item: Dict[
str,
Optional[Union[List[Enclosure], List[str], Tuple, datetime, str]],
],
self, handler: SimplerXMLGenerator, item: Dict[str, Optional[Union[List[Enclosure], List[str], Tuple, datetime, str]]]
) -> None: ...
DefaultFeed = Rss201rev2Feed

View File

@@ -6,28 +6,14 @@ ISO_INPUT_FORMATS: Any
FORMAT_SETTINGS: Any
def reset_format_cache() -> None: ...
def iter_format_modules(
lang: str, format_module_path: Optional[Union[List[str], str]] = ...
) -> Iterator[Any]: ...
def get_format_modules(
lang: Optional[str] = ..., reverse: bool = ...
) -> List[Any]: ...
def get_format(
format_type: str, lang: Optional[str] = ..., use_l10n: Optional[bool] = ...
) -> Union[List[str], int, str]: ...
def iter_format_modules(lang: str, format_module_path: Optional[Union[List[str], str]] = ...) -> Iterator[Any]: ...
def get_format_modules(lang: Optional[str] = ..., reverse: bool = ...) -> List[Any]: ...
def get_format(format_type: str, lang: Optional[str] = ..., use_l10n: Optional[bool] = ...) -> Union[List[str], int, str]: ...
get_format_lazy: Any
def date_format(
value: Union[datetime, str],
format: Optional[str] = ...,
use_l10n: Optional[bool] = ...,
) -> str: ...
def time_format(
value: Union[datetime, str],
format: Optional[str] = ...,
use_l10n: None = ...,
) -> str: ...
def date_format(value: Union[datetime, str], format: Optional[str] = ..., use_l10n: Optional[bool] = ...) -> str: ...
def time_format(value: Union[datetime, str], format: Optional[str] = ..., use_l10n: None = ...) -> str: ...
def number_format(
value: Union[Decimal, float, str],
decimal_pos: Optional[int] = ...,
@@ -35,10 +21,5 @@ def number_format(
force_grouping: bool = ...,
) -> str: ...
def localize(value: Any, use_l10n: Optional[bool] = ...) -> Any: ...
def localize_input(
value: Optional[Union[datetime, Decimal, float, str]],
default: Optional[str] = ...,
) -> Optional[str]: ...
def sanitize_separators(
value: Union[Decimal, int, str]
) -> Union[Decimal, int, str]: ...
def localize_input(value: Optional[Union[datetime, Decimal, float, str]], default: Optional[str] = ...) -> Optional[str]: ...
def sanitize_separators(value: Union[Decimal, int, str]) -> Union[Decimal, int, str]: ...

View File

@@ -2,7 +2,6 @@ from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
from django.db.models.base import Model
def curry(_curried_func: Any, *args: Any, **kwargs: Any): ...
class cached_property:
@@ -52,6 +51,4 @@ class SimpleLazyObject(LazyObject):
def __copy__(self) -> List[int]: ...
def __deepcopy__(self, memo: Dict[Any, Any]) -> List[int]: ...
def partition(
predicate: Callable, values: List[Model]
) -> Tuple[List[Model], List[Model]]: ...
def partition(predicate: Callable, values: List[Model]) -> Tuple[List[Model], List[Model]]: ...

View File

@@ -15,16 +15,10 @@ simple_url_2_re: Any
def escape(text: Optional[Union[Model, FieldFile, int, str]]) -> SafeText: ...
def escapejs(value: str) -> SafeText: ...
def json_script(
value: Union[Dict[str, str], str], element_id: str
) -> SafeText: ...
def json_script(value: Union[Dict[str, str], str], element_id: str) -> SafeText: ...
def conditional_escape(text: Any) -> str: ...
def format_html(format_string: str, *args: Any, **kwargs: Any) -> SafeText: ...
def format_html_join(
sep: str,
format_string: str,
args_generator: Union[Iterator[Any], List[Tuple[str]]],
) -> SafeText: ...
def format_html_join(sep: str, format_string: str, args_generator: Union[Iterator[Any], List[Tuple[str]]]) -> SafeText: ...
def linebreaks(value: str, autoescape: bool = ...) -> str: ...
class MLStripper(HTMLParser):
@@ -38,11 +32,6 @@ class MLStripper(HTMLParser):
def strip_tags(value: str) -> str: ...
def strip_spaces_between_tags(value: str) -> str: ...
def smart_urlquote(url: str) -> str: ...
def urlize(
text: str,
trim_url_limit: Optional[int] = ...,
nofollow: bool = ...,
autoescape: bool = ...,
) -> str: ...
def urlize(text: str, trim_url_limit: Optional[int] = ..., nofollow: bool = ..., autoescape: bool = ...) -> str: ...
def avoid_wrapping(value: str) -> str: ...
def html_safe(klass: Any): ...

View File

@@ -18,27 +18,15 @@ def cookie_date(epoch_seconds: float = ...) -> str: ...
def http_date(epoch_seconds: float = ...) -> str: ...
def parse_http_date(date: str) -> int: ...
def parse_http_date_safe(date: str) -> Optional[int]: ...
def base36_to_int(
s: Union[Dict[int, int], Tuple[int, int, int], float, str]
) -> int: ...
def int_to_base36(
i: Union[Dict[int, int], Tuple[int, int, int], float, str]
) -> str: ...
def base36_to_int(s: Union[Dict[int, int], Tuple[int, int, int], float, str]) -> int: ...
def int_to_base36(i: Union[Dict[int, int], Tuple[int, int, int], float, str]) -> str: ...
def urlsafe_base64_encode(s: bytes) -> bytes: ...
def urlsafe_base64_decode(s: Union[bytes, str]) -> bytes: ...
def parse_etags(etag_str: str) -> List[str]: ...
def quote_etag(etag_str: str) -> str: ...
def is_same_domain(host: str, pattern: str) -> bool: ...
def is_safe_url(
url: Optional[str],
allowed_hosts: Optional[Set[str]],
require_https: bool = ...,
) -> bool: ...
def is_safe_url(url: Optional[str], allowed_hosts: Optional[Set[str]], require_https: bool = ...) -> bool: ...
def limited_parse_qsl(
qs: str,
keep_blank_values: bool = ...,
encoding: str = ...,
errors: str = ...,
fields_limit: Optional[int] = ...,
qs: str, keep_blank_values: bool = ..., encoding: str = ..., errors: str = ..., fields_limit: Optional[int] = ...
) -> List[Tuple[str, str]]: ...
def escape_leading_slashes(url: str) -> str: ...

View File

@@ -1,6 +1,5 @@
from typing import Any, Callable, List, Optional, Tuple
def get_func_args(func: Callable) -> List[str]: ...
def get_func_full_args(func: Callable) -> List[Tuple[str]]: ...
def func_accepts_kwargs(func: Callable) -> bool: ...

View File

@@ -1,7 +1,4 @@
from typing import Any, Optional
def clean_ipv6_address(
ip_str: Any, unpack_ipv4: bool = ..., error_message: Any = ...
): ...
def clean_ipv6_address(ip_str: Any, unpack_ipv4: bool = ..., error_message: Any = ...): ...
def is_valid_ipv6_address(ip_str: str) -> bool: ...

View File

@@ -3,7 +3,6 @@ from typing import Any, List, Optional, Tuple, Union
from django.core.checks.messages import CheckMessage
def is_iterable(
x: Optional[
Union[

View File

@@ -1,15 +1,12 @@
from typing import Any, Dict, Iterator, List, Optional, Tuple
class Tok:
num: int = ...
id: int = ...
name: str = ...
regex: str = ...
next: Optional[str] = ...
def __init__(
self, name: str, regex: str, next: Optional[str] = ...
) -> None: ...
def __init__(self, name: str, regex: str, next: Optional[str] = ...) -> None: ...
def literals(choices: str, prefix: str = ..., suffix: str = ...) -> str: ...

View File

@@ -8,10 +8,7 @@ request_logger: Any
DEFAULT_LOGGING: Any
def configure_logging(
logging_config: str,
logging_settings: Dict[
str, Union[Dict[str, Dict[str, Union[List[str], bool, str]]], int]
],
logging_config: str, logging_settings: Dict[str, Union[Dict[str, Dict[str, Union[List[str], bool, str]]], int]]
) -> None: ...
class AdminEmailHandler(logging.Handler):
@@ -21,13 +18,9 @@ class AdminEmailHandler(logging.Handler):
lock: _thread.RLock
include_html: bool = ...
email_backend: Optional[str] = ...
def __init__(
self, include_html: bool = ..., email_backend: None = ...
) -> None: ...
def __init__(self, include_html: bool = ..., email_backend: None = ...) -> None: ...
def emit(self, record: LogRecord) -> None: ...
def send_mail(
self, subject: str, message: str, *args: Any, **kwargs: Any
) -> None: ...
def send_mail(self, subject: str, message: str, *args: Any, **kwargs: Any) -> None: ...
def connection(self) -> EmailBackend: ...
def format_subject(self, subject: str) -> str: ...

View File

@@ -1,6 +1,5 @@
from typing import Any, Optional
def import_string(dotted_path: str) -> Any: ...
def autodiscover_modules(*args: Any, **kwargs: Any) -> None: ...
def module_has_submodule(package: Any, module_name: str) -> bool: ...

View File

@@ -1,7 +1,6 @@
from decimal import Decimal
from typing import Any, Optional, Tuple, Union
def format(
number: Union[Decimal, float, str],
decimal_sep: str,

View File

@@ -9,12 +9,8 @@ class NonCapture(list): ...
def normalize(pattern: str) -> List[Tuple[str, List[str]]]: ...
def next_char(input_iter: Any) -> None: ...
def walk_to_end(ch: str, input_iter: Iterator[Any]) -> None: ...
def get_quantifier(
ch: str, input_iter: Iterator[Any]
) -> Tuple[int, Optional[str]]: ...
def contains(
source: Union[Group, NonCapture, str], inst: Type[Group]
) -> bool: ...
def get_quantifier(ch: str, input_iter: Iterator[Any]) -> Tuple[int, Optional[str]]: ...
def contains(source: Union[Group, NonCapture, str], inst: Type[Group]) -> bool: ...
def flatten_result(
source: Optional[Union[List[Union[Choice, Group, str]], Group, NonCapture]]
) -> Tuple[List[str], List[List[str]]]: ...

View File

@@ -2,7 +2,6 @@ from typing import Any, Callable, Optional, Union
from django.forms.boundfield import BoundField
class SafeData:
def __html__(self) -> SafeText: ...
@@ -14,6 +13,4 @@ class SafeText(str, SafeData):
SafeString = SafeText
def mark_safe(
s: Union[Callable, BoundField, str]
) -> Union[Callable, BoundField, str]: ...
def mark_safe(s: Union[Callable, BoundField, str]) -> Union[Callable, BoundField, str]: ...

View File

@@ -23,9 +23,7 @@ class _LazyDescr:
class MovedModule(_LazyDescr):
mod: Any = ...
def __init__(
self, name: Any, old: Any, new: Optional[Any] = ...
) -> None: ...
def __init__(self, name: Any, old: Any, new: Optional[Any] = ...) -> None: ...
def __getattr__(self, attr: Any): ...
class _LazyModule(types.ModuleType):
@@ -37,12 +35,7 @@ class MovedAttribute(_LazyDescr):
mod: Any = ...
attr: Any = ...
def __init__(
self,
name: Any,
old_mod: Any,
new_mod: Any,
old_attr: Optional[Any] = ...,
new_attr: Optional[Any] = ...,
self, name: Any, old_mod: Any, new_mod: Any, old_attr: Optional[Any] = ..., new_attr: Optional[Any] = ...
) -> None: ...
class _SixMetaPathImporter:

View File

@@ -6,9 +6,7 @@ background: Any
RESET: str
opt_dict: Any
def colorize(
text: Optional[str] = ..., opts: Union[Tuple, str] = ..., **kwargs: Any
) -> str: ...
def colorize(text: Optional[str] = ..., opts: Union[Tuple, str] = ..., **kwargs: Any) -> str: ...
def make_style(opts: Tuple = ..., **kwargs: Any) -> Callable: ...
NOCOLOR_PALETTE: str
@@ -17,6 +15,4 @@ LIGHT_PALETTE: str
PALETTES: Any
DEFAULT_PALETTE = DARK_PALETTE
def parse_color_setting(
config_string: str
) -> Optional[Dict[str, Dict[str, Union[Tuple[str], str]]]]: ...
def parse_color_setting(config_string: str) -> Optional[Dict[str, Dict[str, Union[Tuple[str], str]]]]: ...

View File

@@ -4,7 +4,6 @@ from django.db.models.base import Model
from django.utils.functional import SimpleLazyObject
from django.utils.safestring import SafeText
def capfirst(x: Optional[str]) -> Optional[str]: ...
re_words: Any
@@ -17,15 +16,9 @@ def wrap(text: str, width: int) -> str: ...
class Truncator(SimpleLazyObject):
def __init__(self, text: Union[Model, str]) -> None: ...
def add_truncation_text(
self, text: str, truncate: Optional[str] = ...
) -> str: ...
def chars(
self, num: int, truncate: Optional[str] = ..., html: bool = ...
) -> str: ...
def words(
self, num: int, truncate: Optional[str] = ..., html: bool = ...
) -> str: ...
def add_truncation_text(self, text: str, truncate: Optional[str] = ...) -> str: ...
def chars(self, num: int, truncate: Optional[str] = ..., html: bool = ...) -> str: ...
def words(self, num: int, truncate: Optional[str] = ..., html: bool = ...) -> str: ...
def get_valid_filename(s: str) -> str: ...
def get_text_list(list_: List[str], last_word: str = ...) -> str: ...

View File

@@ -4,12 +4,5 @@ from typing import Any, Optional
TIME_STRINGS: Any
TIMESINCE_CHUNKS: Any
def timesince(
d: date,
now: Optional[date] = ...,
reversed: bool = ...,
time_strings: None = ...,
) -> str: ...
def timeuntil(
d: date, now: Optional[date] = ..., time_strings: None = ...
) -> str: ...
def timesince(d: date, now: Optional[date] = ..., reversed: bool = ..., time_strings: None = ...) -> str: ...
def timeuntil(d: date, now: Optional[date] = ..., time_strings: None = ...) -> str: ...

View File

@@ -2,11 +2,8 @@ from contextlib import ContextDecorator
from datetime import date, datetime, timedelta, tzinfo
from typing import Any, Optional, Union
class FixedOffset(tzinfo):
def __init__(
self, offset: Optional[float] = ..., name: Optional[str] = ...
) -> None: ...
def __init__(self, offset: Optional[float] = ..., name: Optional[str] = ...) -> None: ...
def utcoffset(self, dt: Union[datetime, str]) -> timedelta: ...
def tzname(self, dt: Optional[Union[datetime, str]]) -> str: ...
def dst(self, dt: datetime) -> timedelta: ...
@@ -26,21 +23,11 @@ class override(ContextDecorator):
def __init__(self, timezone: Optional[Union[FixedOffset, str]]) -> None: ...
old_timezone: Optional[django.utils.timezone.FixedOffset] = ...
def __enter__(self) -> None: ...
def __exit__(
self, exc_type: None, exc_value: None, traceback: None
) -> None: ...
def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ...
def localtime(
value: Optional[datetime] = ..., timezone: Optional[FixedOffset] = ...
) -> datetime: ...
def localtime(value: Optional[datetime] = ..., timezone: Optional[FixedOffset] = ...) -> datetime: ...
def now() -> datetime: ...
def is_aware(value: datetime) -> bool: ...
def is_naive(value: datetime) -> bool: ...
def make_aware(
value: datetime,
timezone: Optional[FixedOffset] = ...,
is_dst: Optional[bool] = ...,
) -> datetime: ...
def make_naive(
value: datetime, timezone: Optional[FixedOffset] = ...
) -> datetime: ...
def make_aware(value: datetime, timezone: Optional[FixedOffset] = ..., is_dst: Optional[bool] = ...) -> datetime: ...
def make_naive(value: datetime, timezone: Optional[FixedOffset] = ...) -> datetime: ...

View File

@@ -47,32 +47,24 @@ def ngettext_lazy(singular: Any, plural: Any, number: Optional[Any] = ...): ...
ungettext_lazy = ngettext_lazy
def npgettext_lazy(
context: Any, singular: Any, plural: Any, number: Optional[Any] = ...
): ...
def npgettext_lazy(context: Any, singular: Any, plural: Any, number: Optional[Any] = ...): ...
def activate(language: str) -> None: ...
def deactivate() -> None: ...
class override(ContextDecorator):
language: Optional[str] = ...
deactivate: bool = ...
def __init__(
self, language: Optional[str], deactivate: bool = ...
) -> None: ...
def __init__(self, language: Optional[str], deactivate: bool = ...) -> None: ...
old_language: Optional[str] = ...
def __enter__(self) -> None: ...
def __exit__(
self, exc_type: None, exc_value: None, traceback: None
) -> None: ...
def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ...
def get_language() -> Optional[str]: ...
def get_language_bidi() -> bool: ...
def check_for_language(lang_code: Optional[str]) -> bool: ...
def to_language(locale: str) -> str: ...
def to_locale(language: str) -> str: ...
def get_language_from_request(
request: WSGIRequest, check_path: bool = ...
) -> str: ...
def get_language_from_request(request: WSGIRequest, check_path: bool = ...) -> str: ...
def templatize(src: str, **kwargs: Any) -> str: ...
def deactivate_all() -> None: ...
def get_language_info(lang_code: str) -> Any: ...

View File

@@ -1,6 +1,5 @@
from typing import Any, Optional
def gettext(message: Any): ...
gettext_noop = gettext
@@ -23,6 +22,4 @@ def get_language_bidi() -> bool: ...
def check_for_language(x: str) -> bool: ...
def get_language_from_request(request: None, check_path: bool = ...) -> str: ...
def get_language_from_path(request: str) -> None: ...
def get_supported_language_variant(
lang_code: str, strict: bool = ...
) -> str: ...
def get_supported_language_variant(lang_code: str, strict: bool = ...) -> str: ...

View File

@@ -15,12 +15,7 @@ def reset_cache(**kwargs: Any) -> None: ...
class DjangoTranslation(gettext_module.GNUTranslations):
domain: str = ...
plural: Callable = ...
def __init__(
self,
language: str,
domain: Optional[str] = ...,
localedirs: Optional[List[str]] = ...,
) -> None: ...
def __init__(self, language: str, domain: Optional[str] = ..., localedirs: Optional[List[str]] = ...) -> None: ...
def merge(self, other: NullTranslations) -> None: ...
def language(self): ...
def to_language(self) -> str: ...
@@ -35,19 +30,13 @@ def catalog(): ...
def gettext(message: str) -> str: ...
def pgettext(context: str, message: str) -> str: ...
def gettext_noop(message: str) -> str: ...
def do_ntranslate(
singular: str, plural: str, number: float, translation_function: str
) -> str: ...
def do_ntranslate(singular: str, plural: str, number: float, translation_function: str) -> str: ...
def ngettext(singular: str, plural: str, number: float) -> str: ...
def npgettext(context: str, singular: str, plural: str, number: int) -> str: ...
def all_locale_paths() -> List[str]: ...
def check_for_language(lang_code: Optional[str]) -> bool: ...
def get_languages() -> OrderedDict: ...
def get_supported_language_variant(
lang_code: Optional[str], strict: bool = ...
) -> str: ...
def get_supported_language_variant(lang_code: Optional[str], strict: bool = ...) -> str: ...
def get_language_from_path(path: str, strict: bool = ...) -> Optional[str]: ...
def get_language_from_request(
request: WSGIRequest, check_path: bool = ...
) -> str: ...
def get_language_from_request(request: WSGIRequest, check_path: bool = ...) -> str: ...
def parse_accept_lang_header(lang_string: str) -> Tuple: ...

View File

@@ -5,12 +5,9 @@ from django.db.models.fields.related_lookups import RelatedLookupMixin
from django.db.models.lookups import BuiltinLookup, FieldGetDbPrepValueMixin
from django.db.models.sql.where import ExtraWhere, NothingNode
class Node:
default: str = ...
children: Union[
List[Tuple[str, int]], List[django.db.models.lookups.Contains]
] = ...
children: Union[List[Tuple[str, int]], List[django.db.models.lookups.Contains]] = ...
connector: str = ...
negated: bool = ...
def __init__(
@@ -33,12 +30,7 @@ class Node:
def __len__(self) -> int: ...
def __bool__(self) -> bool: ...
def __contains__(self, other: Tuple[str, int]) -> bool: ...
def __eq__(
self,
other: Union[
Tuple[str, List[Any]], BuiltinLookup, ExtraWhere, NothingNode, Node
],
) -> bool: ...
def __eq__(self, other: Union[Tuple[str, List[Any]], BuiltinLookup, ExtraWhere, NothingNode, Node]) -> bool: ...
def __hash__(self) -> int: ...
def add(self, data: Any, conn_type: str, squash: bool = ...) -> Any: ...
def negate(self) -> None: ...

View File

@@ -5,13 +5,9 @@ PY37: Any
PY38: Any
PY39: Any
def get_version(
version: Optional[Tuple[int, int, int, str, int]] = ...
) -> str: ...
def get_version(version: Optional[Tuple[int, int, int, str, int]] = ...) -> str: ...
def get_main_version(version: Tuple[int, int, int, str, int] = ...) -> str: ...
def get_complete_version(
version: Optional[Tuple[int, int, int, str, int]] = ...
) -> Tuple[int, int, int, str, int]: ...
def get_complete_version(version: Optional[Tuple[int, int, int, str, int]] = ...) -> Tuple[int, int, int, str, int]: ...
def get_docs_version(version: None = ...) -> str: ...
def get_git_changeset(): ...
def get_version_tuple(version: str) -> Tuple[int, int, int]: ...

View File

@@ -1,15 +1,9 @@
from typing import Any, Dict, Optional
from xml.sax.saxutils import XMLGenerator
class UnserializableContentError(ValueError): ...
class SimplerXMLGenerator(XMLGenerator):
def addQuickElement(
self,
name: str,
contents: Optional[str] = ...,
attrs: Optional[Dict[str, str]] = ...,
) -> None: ...
def addQuickElement(self, name: str, contents: Optional[str] = ..., attrs: Optional[Dict[str, str]] = ...) -> None: ...
def characters(self, content: str) -> None: ...
def startElement(self, name: str, attrs: Dict[str, str]) -> None: ...