mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-12 13:11:42 +08:00
apply black and isort (#4287)
* apply black and isort * move some type ignores
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
# Stubs for statistics
|
||||
|
||||
import sys
|
||||
from decimal import Decimal
|
||||
from fractions import Fraction
|
||||
import sys
|
||||
from typing import Any, Iterable, List, Optional, SupportsFloat, Type, TypeVar, Union, Protocol, Hashable
|
||||
from typing import Any, Hashable, Iterable, List, Optional, Protocol, SupportsFloat, Type, TypeVar, Union
|
||||
|
||||
_T = TypeVar("_T")
|
||||
# Most functions in this module accept homogeneous collections of one of these types
|
||||
_Number = TypeVar('_Number', float, Decimal, Fraction)
|
||||
_Number = TypeVar("_Number", float, Decimal, Fraction)
|
||||
|
||||
# Used in median_high, median_low
|
||||
class _Sortable(Protocol):
|
||||
def __lt__(self, other) -> bool: ...
|
||||
|
||||
_SortableT = TypeVar("_SortableT", bound=_Sortable)
|
||||
|
||||
# Used in mode, multimode
|
||||
@@ -22,20 +23,27 @@ class StatisticsError(ValueError): ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def fmean(data: Iterable[SupportsFloat]) -> float: ...
|
||||
def geometric_mean(data: Iterable[SupportsFloat]) -> float: ...
|
||||
|
||||
def mean(data: Iterable[_Number]) -> _Number: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
def harmonic_mean(data: Iterable[_Number]) -> _Number: ...
|
||||
|
||||
def median(data: Iterable[_Number]) -> _Number: ...
|
||||
def median_low(data: Iterable[_SortableT]) -> _SortableT: ...
|
||||
def median_high(data: Iterable[_SortableT]) -> _SortableT: ...
|
||||
def median_grouped(data: Iterable[_Number], interval: _Number = ...) -> _Number: ...
|
||||
def mode(data: Iterable[_HashableT]) -> _HashableT: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def multimode(data: Iterable[_HashableT]) -> List[_HashableT]: ...
|
||||
|
||||
def pstdev(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ...
|
||||
def pvariance(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def quantiles(data: Iterable[_Number], *, n: int = ..., method: str = ...) -> List[_Number]: ...
|
||||
|
||||
def stdev(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ...
|
||||
def variance(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user