Babel stubs (#5775)

Basic stubs made with stubgen & manual fixes. Also, reorder 
pyrightconfig.stricter.json, I didn't realise it was mostly ordered 
when I added to it previously.
This commit is contained in:
Vanessa Ung
2021-07-14 18:24:19 +10:00
committed by GitHub
parent 4765978f6c
commit 607aa37ee9
26 changed files with 989 additions and 5 deletions

View File

@@ -24,10 +24,12 @@
"stdlib/tkinter",
"stdlib/xml/dom",
"stdlib/xml/sax",
"stubs/babel",
"stubs/backports",
"stubs/backports_abc",
"stubs/bleach",
"stubs/boto",
"stubs/beautifulsoup4",
"stubs/caldav",
"stubs/commonmark",
"stubs/cryptography",
@@ -37,6 +39,7 @@
"stubs/httplib2",
"stubs/Jinja2",
"stubs/Markdown",
"stubs/oauthlib",
"stubs/Pillow",
"stubs/paramiko",
"stubs/protobuf",
@@ -48,13 +51,11 @@
"stubs/redis",
"stubs/requests",
"stubs/simplejson",
"stubs/slumber",
"stubs/stripe",
"stubs/vobject",
"stubs/waitress",
"stubs/Werkzeug",
"stubs/beautifulsoup4",
"stubs/slumber",
"stubs/oauthlib",
"stubs/stripe"
"stubs/Werkzeug"
],
"typeCheckingMode": "basic",
"strictListInference": true,

View File

@@ -0,0 +1 @@
version = "2.9"

View File

@@ -0,0 +1,8 @@
from babel.core import (
Locale as Locale,
UnknownLocaleError as UnknownLocaleError,
default_locale as default_locale,
get_locale_identifier as get_locale_identifier,
negotiate_locale as negotiate_locale,
parse_locale as parse_locale,
)

View File

@@ -0,0 +1,19 @@
from typing import Any
PY2: Any
text_type = str
string_types: Any
integer_types: Any
text_to_native: Any
unichr = chr
iterkeys: Any
itervalues: Any
iteritems: Any
izip = zip
imap = map
range_type = range
cmp: Any
array_tobytes: Any
number_types: Any
def force_text(s, encoding: str = ..., errors: str = ...): ...

110
stubs/babel/babel/core.pyi Normal file
View File

@@ -0,0 +1,110 @@
from typing import Any
class UnknownLocaleError(Exception):
identifier: Any
def __init__(self, identifier) -> None: ...
class Locale:
language: Any
territory: Any
script: Any
variant: Any
def __init__(self, language, territory: Any | None = ..., script: Any | None = ..., variant: Any | None = ...) -> None: ...
@classmethod
def default(cls, category: Any | None = ..., aliases=...): ...
@classmethod
def negotiate(cls, preferred, available, sep: str = ..., aliases=...): ...
@classmethod
def parse(cls, identifier, sep: str = ..., resolve_likely_subtags: bool = ...): ...
def __eq__(self, other): ...
def __ne__(self, other): ...
def __hash__(self): ...
def get_display_name(self, locale: Any | None = ...): ...
display_name: Any
def get_language_name(self, locale: Any | None = ...): ...
language_name: Any
def get_territory_name(self, locale: Any | None = ...): ...
territory_name: Any
def get_script_name(self, locale: Any | None = ...): ...
script_name: Any
@property
def english_name(self): ...
@property
def languages(self): ...
@property
def scripts(self): ...
@property
def territories(self): ...
@property
def variants(self): ...
@property
def currencies(self): ...
@property
def currency_symbols(self): ...
@property
def number_symbols(self): ...
@property
def decimal_formats(self): ...
@property
def currency_formats(self): ...
@property
def percent_formats(self): ...
@property
def scientific_formats(self): ...
@property
def periods(self): ...
@property
def day_periods(self): ...
@property
def day_period_rules(self): ...
@property
def days(self): ...
@property
def months(self): ...
@property
def quarters(self): ...
@property
def eras(self): ...
@property
def time_zones(self): ...
@property
def meta_zones(self): ...
@property
def zone_formats(self): ...
@property
def first_week_day(self): ...
@property
def weekend_start(self): ...
@property
def weekend_end(self): ...
@property
def min_week_days(self): ...
@property
def date_formats(self): ...
@property
def time_formats(self): ...
@property
def datetime_formats(self): ...
@property
def datetime_skeletons(self): ...
@property
def interval_formats(self): ...
@property
def plural_form(self): ...
@property
def list_patterns(self): ...
@property
def ordinal_form(self): ...
@property
def measurement_systems(self): ...
@property
def character_order(self): ...
@property
def text_direction(self): ...
@property
def unit_display_names(self): ...
def default_locale(category: Any | None = ..., aliases=...): ...
def negotiate_locale(preferred, available, sep: str = ..., aliases=...): ...
def parse_locale(identifier, sep: str = ...): ...
def get_locale_identifier(tup, sep: str = ...): ...

View File

@@ -0,0 +1,98 @@
from datetime import date, datetime, time
from typing import Any
NO_INHERITANCE_MARKER: str
LC_TIME: Any
date_ = date
datetime_ = datetime
time_ = time
def get_timezone(zone: Any | None = ...): ...
def get_next_timezone_transition(zone: Any | None = ..., dt: Any | None = ...): ...
class TimezoneTransition:
activates: Any
from_tzinfo: Any
to_tzinfo: Any
reference_date: Any
def __init__(self, activates, from_tzinfo, to_tzinfo, reference_date: Any | None = ...) -> None: ...
@property
def from_tz(self): ...
@property
def to_tz(self): ...
@property
def from_offset(self): ...
@property
def to_offset(self): ...
def get_period_names(width: str = ..., context: str = ..., locale=...): ...
def get_day_names(width: str = ..., context: str = ..., locale=...): ...
def get_month_names(width: str = ..., context: str = ..., locale=...): ...
def get_quarter_names(width: str = ..., context: str = ..., locale=...): ...
def get_era_names(width: str = ..., locale=...): ...
def get_date_format(format: str = ..., locale=...): ...
def get_datetime_format(format: str = ..., locale=...): ...
def get_time_format(format: str = ..., locale=...): ...
def get_timezone_gmt(datetime: Any | None = ..., width: str = ..., locale=..., return_z: bool = ...): ...
def get_timezone_location(dt_or_tzinfo: Any | None = ..., locale=..., return_city: bool = ...): ...
def get_timezone_name(
dt_or_tzinfo: Any | None = ...,
width: str = ...,
uncommon: bool = ...,
locale=...,
zone_variant: Any | None = ...,
return_zone: bool = ...,
): ...
def format_date(date: Any | None = ..., format: str = ..., locale=...): ...
def format_datetime(datetime: Any | None = ..., format: str = ..., tzinfo: Any | None = ..., locale=...): ...
def format_time(time: Any | None = ..., format: str = ..., tzinfo: Any | None = ..., locale=...): ...
def format_skeleton(skeleton, datetime: Any | None = ..., tzinfo: Any | None = ..., fuzzy: bool = ..., locale=...): ...
TIMEDELTA_UNITS: Any
def format_timedelta(
delta, granularity: str = ..., threshold: float = ..., add_direction: bool = ..., format: str = ..., locale=...
): ...
def format_interval(start, end, skeleton: Any | None = ..., tzinfo: Any | None = ..., fuzzy: bool = ..., locale=...): ...
def get_period_id(time, tzinfo: Any | None = ..., type: Any | None = ..., locale=...): ...
def parse_date(string, locale=...): ...
def parse_time(string, locale=...): ...
class DateTimePattern:
pattern: Any
format: Any
def __init__(self, pattern, format) -> None: ...
def __unicode__(self): ...
def __mod__(self, other): ...
def apply(self, datetime, locale): ...
class DateTimeFormat:
value: Any
locale: Any
def __init__(self, value, locale) -> None: ...
def __getitem__(self, name): ...
def extract(self, char): ...
def format_era(self, char, num): ...
def format_year(self, char, num): ...
def format_quarter(self, char, num): ...
def format_month(self, char, num): ...
def format_week(self, char, num): ...
def format_weekday(self, char: str = ..., num: int = ...): ...
def format_day_of_year(self, num): ...
def format_day_of_week_in_month(self): ...
def format_period(self, char): ...
def format_frac_seconds(self, num): ...
def format_milliseconds_in_day(self, num): ...
def format_timezone(self, char, num): ...
def format(self, value, length): ...
def get_day_of_year(self, date: Any | None = ...): ...
def get_week_number(self, day_of_period, day_of_week: Any | None = ...): ...
PATTERN_CHARS: Any
PATTERN_CHAR_ORDER: str
def parse_pattern(pattern): ...
def tokenize_pattern(pattern): ...
def untokenize_pattern(tokens): ...
def split_interval_pattern(pattern): ...
def match_skeleton(skeleton, options, allow_different_fields: bool = ...): ...

View File

@@ -0,0 +1,2 @@
def get_official_languages(territory, regional: bool = ..., de_facto: bool = ...): ...
def get_territory_language_info(territory): ...

View File

@@ -0,0 +1,5 @@
from typing import Any
DEFAULT_LOCALE: Any
def format_list(lst, style: str = ..., locale=...): ...

View File

@@ -0,0 +1,24 @@
import collections.abc as _abc
from typing import Any
def normalize_locale(name): ...
def resolve_locale_filename(name): ...
def exists(name): ...
def locale_identifiers(): ...
def load(name, merge_inherited: bool = ...): ...
def merge(dict1, dict2) -> None: ...
class Alias:
keys: Any
def __init__(self, keys) -> None: ...
def resolve(self, data): ...
class LocaleDataDict(_abc.MutableMapping):
base: Any
def __init__(self, data, base: Any | None = ...) -> None: ...
def __len__(self): ...
def __iter__(self): ...
def __getitem__(self, key): ...
def __setitem__(self, key, value) -> None: ...
def __delitem__(self, key) -> None: ...
def copy(self): ...

View File

@@ -0,0 +1,16 @@
from datetime import tzinfo
from typing import Any
STDOFFSET: Any
DSTOFFSET: Any
DSTDIFF: Any
ZERO: Any
class _FallbackLocalTimezone(tzinfo):
def utcoffset(self, dt): ...
def dst(self, dt): ...
def tzname(self, dt): ...
def get_localzone(): ...
LOCALTZ: Any

View File

View File

@@ -0,0 +1,6 @@
from typing import Any
tz_names: Any
def valuestodict(key): ...
def get_localzone_name(): ...

View File

@@ -0,0 +1 @@
from babel.messages.catalog import *

View File

@@ -0,0 +1,105 @@
from typing import Any
class Message:
id: Any
string: Any
locations: Any
flags: Any
auto_comments: Any
user_comments: Any
previous_id: Any
lineno: Any
context: Any
def __init__(
self,
id,
string: str = ...,
locations=...,
flags=...,
auto_comments=...,
user_comments=...,
previous_id=...,
lineno: Any | None = ...,
context: Any | None = ...,
) -> None: ...
def __cmp__(self, other): ...
def __gt__(self, other): ...
def __lt__(self, other): ...
def __ge__(self, other): ...
def __le__(self, other): ...
def __eq__(self, other): ...
def __ne__(self, other): ...
def clone(self): ...
def check(self, catalog: Any | None = ...): ...
@property
def fuzzy(self): ...
@property
def pluralizable(self): ...
@property
def python_format(self): ...
class TranslationError(Exception): ...
class Catalog:
domain: Any
locale: Any
project: Any
version: Any
copyright_holder: Any
msgid_bugs_address: Any
last_translator: Any
language_team: Any
charset: Any
creation_date: Any
revision_date: Any
fuzzy: Any
obsolete: Any
def __init__(
self,
locale: Any | None = ...,
domain: Any | None = ...,
header_comment=...,
project: Any | None = ...,
version: Any | None = ...,
copyright_holder: Any | None = ...,
msgid_bugs_address: Any | None = ...,
creation_date: Any | None = ...,
revision_date: Any | None = ...,
last_translator: Any | None = ...,
language_team: Any | None = ...,
charset: Any | None = ...,
fuzzy: bool = ...,
) -> None: ...
locale_identifier: Any
header_comment: Any
mime_headers: Any
@property
def num_plurals(self): ...
@property
def plural_expr(self): ...
@property
def plural_forms(self): ...
def __contains__(self, id): ...
def __len__(self): ...
def __iter__(self): ...
def __delitem__(self, id) -> None: ...
def __getitem__(self, id): ...
def __setitem__(self, id, message) -> None: ...
def add(
self,
id,
string: Any | None = ...,
locations=...,
flags=...,
auto_comments=...,
user_comments=...,
previous_id=...,
lineno: Any | None = ...,
context: Any | None = ...,
): ...
def check(self) -> None: ...
def get(self, id, context: Any | None = ...): ...
def delete(self, id, context: Any | None = ...) -> None: ...
def update(
self, template, no_fuzzy_matching: bool = ..., update_header_comment: bool = ..., keep_user_comments: bool = ...
) -> None: ...

View File

@@ -0,0 +1,6 @@
from typing import Any
def num_plurals(catalog, message) -> None: ...
def python_format(catalog, message) -> None: ...
checkers: Any

View File

@@ -0,0 +1,28 @@
from typing import Any
GROUP_NAME: str
DEFAULT_KEYWORDS: Any
DEFAULT_MAPPING: Any
empty_msgid_warning: str
def extract_from_dir(
dirname: Any | None = ...,
method_map=...,
options_map: Any | None = ...,
keywords=...,
comment_tags=...,
callback: Any | None = ...,
strip_comment_tags: bool = ...,
) -> None: ...
def check_and_call_extract_file(
filepath, method_map, options_map, callback, keywords, comment_tags, strip_comment_tags, dirpath: Any | None = ...
) -> None: ...
def extract_from_file(
method, filename, keywords=..., comment_tags=..., options: Any | None = ..., strip_comment_tags: bool = ...
): ...
def extract(
method, fileobj, keywords=..., comment_tags=..., options: Any | None = ..., strip_comment_tags: bool = ...
) -> None: ...
def extract_nothing(fileobj, keywords, comment_tags, options): ...
def extract_python(fileobj, keywords, comment_tags, options): ...
def extract_javascript(fileobj, keywords, comment_tags, options) -> None: ...

View File

@@ -0,0 +1,120 @@
import abc
from distutils.cmd import Command as _Command
from typing import Any
po_file_read_mode: Any
def listify_value(arg, split: Any | None = ...): ...
class Command(_Command, metaclass=abc.ABCMeta):
as_args: Any
multiple_value_options: Any
boolean_options: Any
option_aliases: Any
option_choices: Any
log: Any
distribution: Any
verbose: bool
force: Any
help: int
finalized: int
def __init__(self, dist: Any | None = ...) -> None: ...
class compile_catalog(Command):
description: str
user_options: Any
boolean_options: Any
domain: str
directory: Any
input_file: Any
output_file: Any
locale: Any
use_fuzzy: bool
statistics: bool
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self): ...
class extract_messages(Command):
description: str
user_options: Any
boolean_options: Any
as_args: str
multiple_value_options: Any
option_aliases: Any
option_choices: Any
charset: str
keywords: Any
no_default_keywords: bool
mapping_file: Any
no_location: bool
add_location: Any
omit_header: bool
output_file: Any
input_dirs: Any
input_paths: Any
width: Any
no_wrap: bool
sort_output: bool
sort_by_file: bool
msgid_bugs_address: Any
copyright_holder: Any
project: Any
version: Any
add_comments: Any
strip_comments: bool
include_lineno: bool
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def check_message_extractors(dist, name, value) -> None: ...
class init_catalog(Command):
description: str
user_options: Any
boolean_options: Any
output_dir: Any
output_file: Any
input_file: Any
locale: Any
domain: str
no_wrap: bool
width: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
class update_catalog(Command):
description: str
user_options: Any
boolean_options: Any
domain: str
input_file: Any
output_dir: Any
output_file: Any
omit_header: bool
locale: Any
width: Any
no_wrap: bool
ignore_obsolete: bool
init_missing: bool
no_fuzzy_matching: bool
update_header_comment: bool
previous: bool
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
class CommandLineInterface:
usage: str
version: Any
commands: Any
command_classes: Any
log: Any
parser: Any
def run(self, argv: Any | None = ...): ...
def main(): ...
def parse_mapping(fileobj, filename: Any | None = ...): ...
def parse_keywords(strings=...): ...

View File

@@ -0,0 +1,21 @@
from typing import Any, NamedTuple
operators: Any
escapes: Any
name_re: Any
dotted_name_re: Any
division_re: Any
regex_re: Any
line_re: Any
line_join_re: Any
uni_escape_re: Any
class Token(NamedTuple):
type: Any
value: Any
lineno: Any
def get_rules(jsx, dotted, template_string): ...
def indicates_division(token): ...
def unquote_string(string): ...
def tokenize(source, jsx: bool = ..., dotted: bool = ..., template_string: bool = ...) -> None: ...

View File

@@ -0,0 +1,5 @@
LE_MAGIC: int
BE_MAGIC: int
def read_mo(fileobj): ...
def write_mo(fileobj, catalog, use_fuzzy: bool = ...) -> None: ...

View File

@@ -0,0 +1,12 @@
from typing import Any, Tuple
LC_CTYPE: Any
PLURALS: Any
DEFAULT_PLURAL: Any
class _PluralTuple(Tuple[int, str]):
num_plurals: Any
plural_expr: Any
plural_forms: Any
def get_plural(locale=...): ...

View File

@@ -0,0 +1,59 @@
from typing import Any
def unescape(string): ...
def denormalize(string): ...
class PoFileError(Exception):
catalog: Any
line: Any
lineno: Any
def __init__(self, message, catalog, line, lineno) -> None: ...
class _NormalizedString:
def __init__(self, *args) -> None: ...
def append(self, s) -> None: ...
def denormalize(self): ...
def __nonzero__(self): ...
__bool__: Any
def __cmp__(self, other): ...
def __gt__(self, other): ...
def __lt__(self, other): ...
def __ge__(self, other): ...
def __le__(self, other): ...
def __eq__(self, other): ...
def __ne__(self, other): ...
class PoFileParser:
catalog: Any
ignore_obsolete: Any
counter: int
offset: int
abort_invalid: Any
def __init__(self, catalog, ignore_obsolete: bool = ..., abort_invalid: bool = ...) -> None: ...
def parse(self, fileobj) -> None: ...
def read_po(
fileobj,
locale: Any | None = ...,
domain: Any | None = ...,
ignore_obsolete: bool = ...,
charset: Any | None = ...,
abort_invalid: bool = ...,
): ...
WORD_SEP: Any
def escape(string): ...
def normalize(string, prefix: str = ..., width: int = ...): ...
def write_po(
fileobj,
catalog,
width: int = ...,
no_location: bool = ...,
omit_header: bool = ...,
sort_output: bool = ...,
sort_by_file: bool = ...,
ignore_obsolete: bool = ...,
include_previous: bool = ...,
include_lineno: bool = ...,
): ...

View File

@@ -0,0 +1,94 @@
from typing import Any
long = int
LC_NUMERIC: Any
class UnknownCurrencyError(Exception):
identifier: Any
def __init__(self, identifier) -> None: ...
def list_currencies(locale: Any | None = ...): ...
def validate_currency(currency, locale: Any | None = ...) -> None: ...
def is_currency(currency, locale: Any | None = ...): ...
def normalize_currency(currency, locale: Any | None = ...): ...
def get_currency_name(currency, count: Any | None = ..., locale=...): ...
def get_currency_symbol(currency, locale=...): ...
def get_currency_precision(currency): ...
def get_currency_unit_pattern(currency, count: Any | None = ..., locale=...): ...
def get_territory_currencies(
territory,
start_date: Any | None = ...,
end_date: Any | None = ...,
tender: bool = ...,
non_tender: bool = ...,
include_details: bool = ...,
): ...
def get_decimal_symbol(locale=...): ...
def get_plus_sign_symbol(locale=...): ...
def get_minus_sign_symbol(locale=...): ...
def get_exponential_symbol(locale=...): ...
def get_group_symbol(locale=...): ...
def format_number(number, locale=...): ...
def get_decimal_precision(number): ...
def get_decimal_quantum(precision): ...
def format_decimal(
number, format: Any | None = ..., locale=..., decimal_quantization: bool = ..., group_separator: bool = ...
): ...
class UnknownCurrencyFormatError(KeyError): ...
def format_currency(
number,
currency,
format: Any | None = ...,
locale=...,
currency_digits: bool = ...,
format_type: str = ...,
decimal_quantization: bool = ...,
group_separator: bool = ...,
): ...
def format_percent(
number, format: Any | None = ..., locale=..., decimal_quantization: bool = ..., group_separator: bool = ...
): ...
def format_scientific(number, format: Any | None = ..., locale=..., decimal_quantization: bool = ...): ...
class NumberFormatError(ValueError):
suggestions: Any
def __init__(self, message, suggestions: Any | None = ...) -> None: ...
def parse_number(string, locale=...): ...
def parse_decimal(string, locale=..., strict: bool = ...): ...
PREFIX_END: str
NUMBER_TOKEN: str
PREFIX_PATTERN: Any
NUMBER_PATTERN: Any
SUFFIX_PATTERN: str
number_re: Any
def parse_grouping(p): ...
def parse_pattern(pattern): ...
class NumberPattern:
pattern: Any
prefix: Any
suffix: Any
grouping: Any
int_prec: Any
frac_prec: Any
exp_prec: Any
exp_plus: Any
scale: Any
def __init__(self, pattern, prefix, suffix, grouping, int_prec, frac_prec, exp_prec, exp_plus) -> None: ...
def compute_scale(self): ...
def scientific_notation_elements(self, value, locale): ...
def apply(
self,
value,
locale,
currency: Any | None = ...,
currency_digits: bool = ...,
decimal_quantization: bool = ...,
force_frac: Any | None = ...,
group_separator: bool = ...,
): ...

View File

@@ -0,0 +1,95 @@
from typing import Any
def extract_operands(source): ...
class PluralRule:
abstract: Any
def __init__(self, rules) -> None: ...
@classmethod
def parse(cls, rules): ...
@property
def rules(self): ...
tags: Any
def __call__(self, n): ...
def to_javascript(rule): ...
def to_python(rule): ...
def to_gettext(rule): ...
def in_range_list(num, range_list): ...
def within_range_list(num, range_list): ...
def cldr_modulo(a, b): ...
class RuleError(Exception): ...
def tokenize_rule(s): ...
def test_next_token(tokens, type_, value: Any | None = ...): ...
def skip_token(tokens, type_, value: Any | None = ...): ...
def value_node(value): ...
def ident_node(name): ...
def range_list_node(range_list): ...
def negate(rv): ...
class _Parser:
tokens: Any
ast: Any
def __init__(self, string) -> None: ...
def expect(self, type_, value: Any | None = ..., term: Any | None = ...): ...
def condition(self): ...
def and_condition(self): ...
def relation(self): ...
def newfangled_relation(self, left): ...
def range_or_value(self): ...
def range_list(self): ...
def expr(self): ...
def value(self): ...
compile_zero: Any
class _Compiler:
def compile(self, arg): ...
compile_n: Any
compile_i: Any
compile_v: Any
compile_w: Any
compile_f: Any
compile_t: Any
compile_value: Any
compile_and: Any
compile_or: Any
compile_not: Any
compile_mod: Any
compile_is: Any
compile_isnot: Any
def compile_relation(self, method, expr, range_list) -> None: ...
class _PythonCompiler(_Compiler):
compile_and: Any
compile_or: Any
compile_not: Any
compile_mod: Any
def compile_relation(self, method, expr, range_list): ...
class _GettextCompiler(_Compiler):
compile_i: Any
compile_v: Any
compile_w: Any
compile_f: Any
compile_t: Any
def compile_relation(self, method, expr, range_list): ...
class _JavaScriptCompiler(_GettextCompiler):
compile_i: Any
compile_v: Any
compile_w: Any
compile_f: Any
compile_t: Any
def compile_relation(self, method, expr, range_list): ...
class _UnicodeCompiler(_Compiler):
compile_is: Any
compile_isnot: Any
compile_and: Any
compile_or: Any
compile_mod: Any
def compile_not(self, relation): ...
def compile_relation(self, method, expr, range_list, negated: bool = ...): ...

View File

@@ -0,0 +1,91 @@
import gettext
from typing import Any
class Format:
locale: Any
tzinfo: Any
def __init__(self, locale, tzinfo: Any | None = ...) -> None: ...
def date(self, date: Any | None = ..., format: str = ...): ...
def datetime(self, datetime: Any | None = ..., format: str = ...): ...
def time(self, time: Any | None = ..., format: str = ...): ...
def timedelta(self, delta, granularity: str = ..., threshold: float = ..., format: str = ..., add_direction: bool = ...): ...
def number(self, number): ...
def decimal(self, number, format: Any | None = ...): ...
def currency(self, number, currency): ...
def percent(self, number, format: Any | None = ...): ...
def scientific(self, number): ...
class LazyProxy:
def __init__(self, func, *args, **kwargs) -> None: ...
@property
def value(self): ...
def __contains__(self, key): ...
def __nonzero__(self): ...
def __dir__(self): ...
def __iter__(self): ...
def __len__(self): ...
def __unicode__(self): ...
def __add__(self, other): ...
def __radd__(self, other): ...
def __mod__(self, other): ...
def __rmod__(self, other): ...
def __mul__(self, other): ...
def __rmul__(self, other): ...
def __call__(self, *args, **kwargs): ...
def __lt__(self, other): ...
def __le__(self, other): ...
def __eq__(self, other): ...
def __ne__(self, other): ...
def __gt__(self, other): ...
def __ge__(self, other): ...
def __delattr__(self, name) -> None: ...
def __getattr__(self, name): ...
def __setattr__(self, name, value) -> None: ...
def __delitem__(self, key) -> None: ...
def __getitem__(self, key): ...
def __setitem__(self, key, value) -> None: ...
def __copy__(self): ...
def __deepcopy__(self, memo): ...
class NullTranslations(gettext.NullTranslations):
DEFAULT_DOMAIN: Any
plural: Any
files: Any
domain: Any
def __init__(self, fp: Any | None = ...): ...
def dgettext(self, domain, message): ...
def ldgettext(self, domain, message): ...
def udgettext(self, domain, message): ...
dugettext: Any
def dngettext(self, domain, singular, plural, num): ...
def ldngettext(self, domain, singular, plural, num): ...
def udngettext(self, domain, singular, plural, num): ...
dungettext: Any
CONTEXT_ENCODING: str
def pgettext(self, context, message): ...
def lpgettext(self, context, message): ...
def npgettext(self, context, singular, plural, num): ...
def lnpgettext(self, context, singular, plural, num): ...
def upgettext(self, context, message): ...
def unpgettext(self, context, singular, plural, num): ...
def dpgettext(self, domain, context, message): ...
def udpgettext(self, domain, context, message): ...
dupgettext: Any
def ldpgettext(self, domain, context, message): ...
def dnpgettext(self, domain, context, singular, plural, num): ...
def udnpgettext(self, domain, context, singular, plural, num): ...
dunpgettext: Any
def ldnpgettext(self, domain, context, singular, plural, num): ...
ugettext: Any
ungettext: Any
class Translations(NullTranslations, gettext.GNUTranslations):
DEFAULT_DOMAIN: str
domain: Any
def __init__(self, fp: Any | None = ..., domain: Any | None = ...) -> None: ...
ugettext: Any
ungettext: Any
@classmethod
def load(cls, dirname: Any | None = ..., locales: Any | None = ..., domain: Any | None = ...): ...
def add(self, translations, merge: bool = ...): ...
def merge(self, translations): ...

View File

@@ -0,0 +1,16 @@
from typing import Any
class UnknownUnitError(ValueError):
def __init__(self, unit, locale) -> None: ...
def get_unit_name(measurement_unit, length: str = ..., locale=...): ...
def format_unit(value, measurement_unit, length: str = ..., format: Any | None = ..., locale=...): ...
def format_compound_unit(
numerator_value,
numerator_unit: Any | None = ...,
denominator_value: int = ...,
denominator_unit: Any | None = ...,
length: str = ...,
format: Any | None = ...,
locale=...,
): ...

View File

@@ -0,0 +1,41 @@
import collections
import textwrap
from datetime import tzinfo
from typing import Any
from babel import localtime as localtime
missing: Any
def distinct(iterable) -> None: ...
PYTHON_MAGIC_COMMENT_re: Any
def parse_encoding(fp): ...
PYTHON_FUTURE_IMPORT_re: Any
def parse_future_flags(fp, encoding: str = ...): ...
def pathmatch(pattern, filename): ...
class TextWrapper(textwrap.TextWrapper):
wordsep_re: Any
def wraptext(text, width: int = ..., initial_indent: str = ..., subsequent_indent: str = ...): ...
odict = collections.OrderedDict
class FixedOffsetTimezone(tzinfo):
zone: Any
def __init__(self, offset, name: Any | None = ...) -> None: ...
def utcoffset(self, dt): ...
def tzname(self, dt): ...
def dst(self, dt): ...
UTC: Any
LOCALTZ: Any
get_localzone = localtime.get_localzone
STDOFFSET: Any
DSTOFFSET: Any
DSTDIFF: Any
ZERO: Any