From 3907b365daedb97d4eb15700652fa07f65a8a938 Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Sun, 17 Sep 2023 12:23:13 +0200 Subject: [PATCH 01/15] Add seaborn stubs --- pyrightconfig.stricter.json | 1 + stubs/seaborn/@tests/stubtest_allowlist.txt | 4 + stubs/seaborn/METADATA.toml | 6 + stubs/seaborn/seaborn/__init__.pyi | 13 + stubs/seaborn/seaborn/_core/__init__.pyi | 0 stubs/seaborn/seaborn/_core/data.pyi | 13 + stubs/seaborn/seaborn/_core/exceptions.pyi | 1 + stubs/seaborn/seaborn/_core/groupby.pyi | 10 + stubs/seaborn/seaborn/_core/moves.pyi | 44 ++++ stubs/seaborn/seaborn/_core/plot.pyi | 84 +++++++ stubs/seaborn/seaborn/_core/properties.pyi | 98 ++++++++ stubs/seaborn/seaborn/_core/rules.pyi | 15 ++ stubs/seaborn/seaborn/_core/scales.pyi | 100 ++++++++ stubs/seaborn/seaborn/_core/subplots.pyi | 19 ++ stubs/seaborn/seaborn/_core/typing.pyi | 24 ++ stubs/seaborn/seaborn/_marks/__init__.pyi | 0 stubs/seaborn/seaborn/_marks/area.pyi | 28 +++ stubs/seaborn/seaborn/_marks/bar.pyi | 31 +++ stubs/seaborn/seaborn/_marks/base.pyi | 38 +++ stubs/seaborn/seaborn/_marks/dot.pyi | 39 +++ stubs/seaborn/seaborn/_marks/line.pyi | 42 ++++ stubs/seaborn/seaborn/_marks/text.pyi | 14 ++ stubs/seaborn/seaborn/_stats/__init__.pyi | 0 stubs/seaborn/seaborn/_stats/aggregation.pyi | 19 ++ stubs/seaborn/seaborn/_stats/base.pyi | 11 + stubs/seaborn/seaborn/_stats/counting.pyi | 19 ++ stubs/seaborn/seaborn/_stats/density.pyi | 16 ++ stubs/seaborn/seaborn/_stats/order.pyi | 8 + stubs/seaborn/seaborn/_stats/regression.pyi | 10 + stubs/seaborn/seaborn/algorithms.pyi | 14 ++ stubs/seaborn/seaborn/axisgrid.pyi | 234 +++++++++++++++++ stubs/seaborn/seaborn/categorical.pyi | 249 +++++++++++++++++++ stubs/seaborn/seaborn/cm.pyi | 15 ++ stubs/seaborn/seaborn/colors/__init__.pyi | 2 + stubs/seaborn/seaborn/colors/crayons.pyi | 1 + stubs/seaborn/seaborn/colors/xkcd_rgb.pyi | 1 + stubs/seaborn/seaborn/distributions.pyi | 157 ++++++++++++ stubs/seaborn/seaborn/external/__init__.pyi | 0 stubs/seaborn/seaborn/external/appdirs.pyi | 9 + stubs/seaborn/seaborn/external/docscrape.pyi | 69 +++++ stubs/seaborn/seaborn/external/husl.pyi | 42 ++++ stubs/seaborn/seaborn/external/kde.pyi | 25 ++ stubs/seaborn/seaborn/external/version.pyi | 45 ++++ stubs/seaborn/seaborn/matrix.pyi | 179 +++++++++++++ stubs/seaborn/seaborn/miscplot.pyi | 8 + stubs/seaborn/seaborn/objects.pyi | 21 ++ stubs/seaborn/seaborn/palettes.pyi | 82 ++++++ stubs/seaborn/seaborn/rcmod.pyi | 66 +++++ stubs/seaborn/seaborn/regression.pyi | 105 ++++++++ stubs/seaborn/seaborn/relational.pyi | 93 +++++++ stubs/seaborn/seaborn/utils.pyi | 65 +++++ stubs/seaborn/seaborn/widgets.pyi | 50 ++++ 52 files changed, 2239 insertions(+) create mode 100644 stubs/seaborn/@tests/stubtest_allowlist.txt create mode 100644 stubs/seaborn/METADATA.toml create mode 100644 stubs/seaborn/seaborn/__init__.pyi create mode 100644 stubs/seaborn/seaborn/_core/__init__.pyi create mode 100644 stubs/seaborn/seaborn/_core/data.pyi create mode 100644 stubs/seaborn/seaborn/_core/exceptions.pyi create mode 100644 stubs/seaborn/seaborn/_core/groupby.pyi create mode 100644 stubs/seaborn/seaborn/_core/moves.pyi create mode 100644 stubs/seaborn/seaborn/_core/plot.pyi create mode 100644 stubs/seaborn/seaborn/_core/properties.pyi create mode 100644 stubs/seaborn/seaborn/_core/rules.pyi create mode 100644 stubs/seaborn/seaborn/_core/scales.pyi create mode 100644 stubs/seaborn/seaborn/_core/subplots.pyi create mode 100644 stubs/seaborn/seaborn/_core/typing.pyi create mode 100644 stubs/seaborn/seaborn/_marks/__init__.pyi create mode 100644 stubs/seaborn/seaborn/_marks/area.pyi create mode 100644 stubs/seaborn/seaborn/_marks/bar.pyi create mode 100644 stubs/seaborn/seaborn/_marks/base.pyi create mode 100644 stubs/seaborn/seaborn/_marks/dot.pyi create mode 100644 stubs/seaborn/seaborn/_marks/line.pyi create mode 100644 stubs/seaborn/seaborn/_marks/text.pyi create mode 100644 stubs/seaborn/seaborn/_stats/__init__.pyi create mode 100644 stubs/seaborn/seaborn/_stats/aggregation.pyi create mode 100644 stubs/seaborn/seaborn/_stats/base.pyi create mode 100644 stubs/seaborn/seaborn/_stats/counting.pyi create mode 100644 stubs/seaborn/seaborn/_stats/density.pyi create mode 100644 stubs/seaborn/seaborn/_stats/order.pyi create mode 100644 stubs/seaborn/seaborn/_stats/regression.pyi create mode 100644 stubs/seaborn/seaborn/algorithms.pyi create mode 100644 stubs/seaborn/seaborn/axisgrid.pyi create mode 100644 stubs/seaborn/seaborn/categorical.pyi create mode 100644 stubs/seaborn/seaborn/cm.pyi create mode 100644 stubs/seaborn/seaborn/colors/__init__.pyi create mode 100644 stubs/seaborn/seaborn/colors/crayons.pyi create mode 100644 stubs/seaborn/seaborn/colors/xkcd_rgb.pyi create mode 100644 stubs/seaborn/seaborn/distributions.pyi create mode 100644 stubs/seaborn/seaborn/external/__init__.pyi create mode 100644 stubs/seaborn/seaborn/external/appdirs.pyi create mode 100644 stubs/seaborn/seaborn/external/docscrape.pyi create mode 100644 stubs/seaborn/seaborn/external/husl.pyi create mode 100644 stubs/seaborn/seaborn/external/kde.pyi create mode 100644 stubs/seaborn/seaborn/external/version.pyi create mode 100644 stubs/seaborn/seaborn/matrix.pyi create mode 100644 stubs/seaborn/seaborn/miscplot.pyi create mode 100644 stubs/seaborn/seaborn/objects.pyi create mode 100644 stubs/seaborn/seaborn/palettes.pyi create mode 100644 stubs/seaborn/seaborn/rcmod.pyi create mode 100644 stubs/seaborn/seaborn/regression.pyi create mode 100644 stubs/seaborn/seaborn/relational.pyi create mode 100644 stubs/seaborn/seaborn/utils.pyi create mode 100644 stubs/seaborn/seaborn/widgets.pyi diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index d26c3764d717..4618c1efea84 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -69,6 +69,7 @@ "stubs/redis", "stubs/requests", "stubs/requests-oauthlib", + "stubs/seaborn", "stubs/setuptools", "stubs/stripe", "stubs/tqdm", diff --git a/stubs/seaborn/@tests/stubtest_allowlist.txt b/stubs/seaborn/@tests/stubtest_allowlist.txt new file mode 100644 index 000000000000..092ff1751402 --- /dev/null +++ b/stubs/seaborn/@tests/stubtest_allowlist.txt @@ -0,0 +1,4 @@ +seaborn._core.scales.(Pipeline|TransFuncs) # aliases defined in `if TYPE_CHECKING` block +seaborn.*.__match_args__ # https://github.com/python/mypy/issues/15748 +seaborn.external.docscrape.ClassDoc.__init__ # stubtest doesn't like ABC class as default value +seaborn.external.docscrape.NumpyDocString.__str__ # weird signature diff --git a/stubs/seaborn/METADATA.toml b/stubs/seaborn/METADATA.toml new file mode 100644 index 000000000000..5a5519ee7bfd --- /dev/null +++ b/stubs/seaborn/METADATA.toml @@ -0,0 +1,6 @@ +version = "0.12.*" +# Requires a version of numpy and matplotlib with a `py.typed` file +requires = ["matplotlib>=3.8", "numpy>=1.20", "pandas-stubs"] + +[tool.stubtest] +ignore_missing_stub = false diff --git a/stubs/seaborn/seaborn/__init__.pyi b/stubs/seaborn/seaborn/__init__.pyi new file mode 100644 index 000000000000..f8a92d1d6515 --- /dev/null +++ b/stubs/seaborn/seaborn/__init__.pyi @@ -0,0 +1,13 @@ +from . import cm as cm +from .axisgrid import * +from .categorical import * +from .colors import crayons as crayons, xkcd_rgb as xkcd_rgb +from .distributions import * +from .matrix import * +from .miscplot import * +from .palettes import * +from .rcmod import * +from .regression import * +from .relational import * +from .utils import * +from .widgets import * diff --git a/stubs/seaborn/seaborn/_core/__init__.pyi b/stubs/seaborn/seaborn/_core/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/seaborn/seaborn/_core/data.pyi b/stubs/seaborn/seaborn/_core/data.pyi new file mode 100644 index 000000000000..9e1802fcd379 --- /dev/null +++ b/stubs/seaborn/seaborn/_core/data.pyi @@ -0,0 +1,13 @@ +from pandas import DataFrame +from seaborn._core.typing import DataSource, VariableSpec + +class PlotData: + frame: DataFrame + frames: dict[tuple[str, str], DataFrame] + names: dict[str, str | None] + ids: dict[str, str | int] + source_data: DataSource + source_vars: dict[str, VariableSpec] + def __init__(self, data: DataSource, variables: dict[str, VariableSpec]) -> None: ... + def __contains__(self, key: str) -> bool: ... + def join(self, data: DataSource, variables: dict[str, VariableSpec] | None) -> PlotData: ... diff --git a/stubs/seaborn/seaborn/_core/exceptions.pyi b/stubs/seaborn/seaborn/_core/exceptions.pyi new file mode 100644 index 000000000000..c453083b113f --- /dev/null +++ b/stubs/seaborn/seaborn/_core/exceptions.pyi @@ -0,0 +1 @@ +class PlotSpecError(RuntimeError): ... diff --git a/stubs/seaborn/seaborn/_core/groupby.pyi b/stubs/seaborn/seaborn/_core/groupby.pyi new file mode 100644 index 000000000000..bfbe4c469097 --- /dev/null +++ b/stubs/seaborn/seaborn/_core/groupby.pyi @@ -0,0 +1,10 @@ +from _typeshed import Incomplete +from collections.abc import Callable + +from pandas import DataFrame + +class GroupBy: + order: dict[str, list[Incomplete] | None] + def __init__(self, order: list[str] | dict[str, list[Incomplete] | None]) -> None: ... + def agg(self, data: DataFrame, *args, **kwargs) -> DataFrame: ... + def apply(self, data: DataFrame, func: Callable[..., DataFrame], *args, **kwargs) -> DataFrame: ... diff --git a/stubs/seaborn/seaborn/_core/moves.pyi b/stubs/seaborn/seaborn/_core/moves.pyi new file mode 100644 index 000000000000..ed3f7f5e439a --- /dev/null +++ b/stubs/seaborn/seaborn/_core/moves.pyi @@ -0,0 +1,44 @@ +from _typeshed import Incomplete +from collections.abc import Callable +from dataclasses import dataclass +from typing import ClassVar + +from pandas import DataFrame +from seaborn._core.groupby import GroupBy +from seaborn._core.scales import Scale +from seaborn._core.typing import Default + +default: Default + +@dataclass +class Move: + group_by_orient: ClassVar[bool] + def __call__(self, data: DataFrame, groupby: GroupBy, orient: str, scales: dict[str, Scale]) -> DataFrame: ... + +@dataclass +class Jitter(Move): + width: float | Default = ... + x: float = 0 + y: float = 0 + seed: int | None = None + +@dataclass +class Dodge(Move): + empty: str = "keep" + gap: float = 0 + by: list[str] | None = None + +@dataclass +class Stack(Move): ... + +@dataclass +class Shift(Move): + x: float = 0 + y: float = 0 + +@dataclass +class Norm(Move): + func: Callable[..., Incomplete] | str = "max" + where: str | None = None + by: list[str] | None = None + percent: bool = False diff --git a/stubs/seaborn/seaborn/_core/plot.pyi b/stubs/seaborn/seaborn/_core/plot.pyi new file mode 100644 index 000000000000..da9cd7700db1 --- /dev/null +++ b/stubs/seaborn/seaborn/_core/plot.pyi @@ -0,0 +1,84 @@ +import inspect +import os +from _typeshed import Incomplete +from collections.abc import Callable, Generator +from contextlib import contextmanager +from typing import IO, Any, NoReturn, TypeVar +from typing_extensions import TypedDict + +from matplotlib.axes import Axes +from matplotlib.figure import Figure, SubFigure +from seaborn._core.data import PlotData +from seaborn._core.moves import Move +from seaborn._core.scales import Scale +from seaborn._core.typing import DataSource, Default, OrderSpec, VariableSpec, VariableSpecList +from seaborn._marks.base import Mark +from seaborn._stats.base import Stat + +_ClsT = TypeVar("_ClsT", bound=type[Any]) + +default: Default + +class Layer(TypedDict, total=False): + mark: Mark + stat: Stat | None + move: Move | list[Move] | None + data: PlotData + source: DataSource + vars: dict[str, VariableSpec] + orient: str + legend: bool + +class FacetSpec(TypedDict, total=False): + variables: dict[str, VariableSpec] + structure: dict[str, list[str]] + wrap: int | None + +class PairSpec(TypedDict, total=False): + variables: dict[str, VariableSpec] + structure: dict[str, list[str]] + cross: bool + wrap: int | None + +@contextmanager +def theme_context(params: dict[str, Any]) -> Generator[None, None, None]: ... +def build_plot_signature(cls: _ClsT) -> _ClsT: ... # -> _ClsT & "__signature__ protocol" +@build_plot_signature +class Plot: + __signature__: inspect.Signature + def __init__(self, *args: DataSource | VariableSpec, data: DataSource = None, **variables: VariableSpec) -> None: ... + def __add__(self, other) -> NoReturn: ... + def on(self, target: Axes | SubFigure | Figure) -> Plot: ... + def add( + self, + mark: Mark, + *transforms: Stat | Move, + orient: str | None = None, + legend: bool = True, + data: DataSource = None, + **variables: VariableSpec, + ) -> Plot: ... + def pair( + self, x: VariableSpecList = None, y: VariableSpecList = None, wrap: int | None = None, cross: bool = True + ) -> Plot: ... + def facet( + self, + col: VariableSpec = None, + row: VariableSpec = None, + order: OrderSpec | dict[str, OrderSpec] = None, + wrap: int | None = None, + ) -> Plot: ... + def scale(self, **scales: Scale) -> Plot: ... + def share(self, **shares: bool | str) -> Plot: ... + def limit(self, **limits: tuple[Any, Any]) -> Plot: ... + def label(self, *, title: Incomplete | None = None, **variables: str | Callable[[str], str]) -> Plot: ... + def layout(self, *, size: tuple[float, float] | Default = ..., engine: str | None | Default = ...) -> Plot: ... + def theme(self, *args: dict[str, Any]) -> Plot: ... + def save(self, loc: str | os.PathLike[Any] | IO[Any], **kwargs) -> Plot: ... + def show(self, **kwargs) -> None: ... + def plot(self, pyplot: bool = False) -> Plotter: ... + +class Plotter: + def __init__(self, pyplot: bool, theme: dict[str, Any]) -> None: ... + def save(self, loc: str | os.PathLike[Any] | IO[Any], **kwargs) -> Plotter: ... + def show(self, **kwargs) -> None: ... diff --git a/stubs/seaborn/seaborn/_core/properties.pyi b/stubs/seaborn/seaborn/_core/properties.pyi new file mode 100644 index 000000000000..20cbe28fa0e0 --- /dev/null +++ b/stubs/seaborn/seaborn/_core/properties.pyi @@ -0,0 +1,98 @@ +from _typeshed import Incomplete +from collections.abc import Callable +from typing import Any +from typing_extensions import TypeAlias + +from matplotlib.markers import MarkerStyle +from matplotlib.path import Path +from numpy.typing import ArrayLike +from pandas import Series +from seaborn._core.scales import Scale + +RGBTuple: TypeAlias = tuple[float, float, float] +RGBATuple: TypeAlias = tuple[float, float, float, float] +ColorSpec: TypeAlias = RGBTuple | RGBATuple | str +DashPattern: TypeAlias = tuple[float, ...] +DashPatternWithOffset: TypeAlias = tuple[float, DashPattern | None] +MarkerPattern: TypeAlias = float | str | tuple[int, int, float] | list[tuple[float, float]] | Path | MarkerStyle +Mapping: TypeAlias = Callable[[ArrayLike], ArrayLike] + +class Property: + legend: bool + normed: bool + variable: Incomplete + def __init__(self, variable: str | None = None) -> None: ... + def default_scale(self, data: Series[Any]) -> Scale: ... + def infer_scale(self, arg: Any, data: Series[Any]) -> Scale: ... + def get_mapping(self, scale: Scale, data: Series[Any]) -> Mapping: ... + def standardize(self, val: Any) -> Any: ... + +class Coordinate(Property): + legend: bool + normed: bool + +class IntervalProperty(Property): + legend: bool + normed: bool + @property + def default_range(self) -> tuple[float, float]: ... + def infer_scale(self, arg: Any, data: Series[Any]) -> Scale: ... + def get_mapping(self, scale: Scale, data: Series[Any]) -> Mapping: ... + +class PointSize(IntervalProperty): ... + +class LineWidth(IntervalProperty): + @property + def default_range(self) -> tuple[float, float]: ... + +class EdgeWidth(IntervalProperty): + @property + def default_range(self) -> tuple[float, float]: ... + +class Stroke(IntervalProperty): ... +class Alpha(IntervalProperty): ... +class Offset(IntervalProperty): ... + +class FontSize(IntervalProperty): + @property + def default_range(self) -> tuple[float, float]: ... + +class ObjectProperty(Property): + legend: bool + normed: bool + null_value: Any + def default_scale(self, data: Series[Any]) -> Scale: ... + def infer_scale(self, arg: Any, data: Series[Any]) -> Scale: ... + def get_mapping(self, scale: Scale, data: Series[Any]) -> Mapping: ... + +class Marker(ObjectProperty): + null_value: Incomplete + def standardize(self, val: MarkerPattern) -> MarkerStyle: ... + +class LineStyle(ObjectProperty): + null_value: str + def standardize(self, val: str | DashPattern) -> DashPatternWithOffset: ... + +class TextAlignment(ObjectProperty): + legend: bool + +class HorizontalAlignment(TextAlignment): ... +class VerticalAlignment(TextAlignment): ... + +class Color(Property): + legend: bool + normed: bool + def standardize(self, val: ColorSpec) -> RGBTuple | RGBATuple: ... + def infer_scale(self, arg: Any, data: Series[Any]) -> Scale: ... + def get_mapping(self, scale: Scale, data: Series[Any]) -> Mapping: ... + +class Fill(Property): + legend: bool + normed: bool + def default_scale(self, data: Series[Any]) -> Scale: ... + def infer_scale(self, arg: Any, data: Series[Any]) -> Scale: ... + def standardize(self, val: Any) -> bool: ... + def get_mapping(self, scale: Scale, data: Series[Any]) -> Mapping: ... + +PROPERTY_CLASSES: dict[str, type[Property]] +PROPERTIES: dict[str, Property] diff --git a/stubs/seaborn/seaborn/_core/rules.pyi b/stubs/seaborn/seaborn/_core/rules.pyi new file mode 100644 index 000000000000..69512abb0787 --- /dev/null +++ b/stubs/seaborn/seaborn/_core/rules.pyi @@ -0,0 +1,15 @@ +from collections import UserString +from typing import Any +from typing_extensions import Literal + +from pandas import Series + +class VarType(UserString): + allowed: tuple[str, ...] + def __init__(self, data: str) -> None: ... + def __eq__(self, other: str) -> bool: ... # type: ignore[override] + +def variable_type( + vector: Series[Any], boolean_type: Literal["numeric", "categorical", "boolean"] = "numeric", strict_boolean: bool = False +) -> VarType: ... +def categorical_order(vector: Series[Any], order: list[Any] | None = None) -> list[Any]: ... diff --git a/stubs/seaborn/seaborn/_core/scales.pyi b/stubs/seaborn/seaborn/_core/scales.pyi new file mode 100644 index 000000000000..b5729b9ed344 --- /dev/null +++ b/stubs/seaborn/seaborn/_core/scales.pyi @@ -0,0 +1,100 @@ +from _typeshed import Incomplete +from collections.abc import Callable, Sequence +from dataclasses import dataclass +from typing import Any, ClassVar +from typing_extensions import Self, TypeAlias + +from matplotlib.axis import Ticker +from matplotlib.scale import ScaleBase +from matplotlib.ticker import Formatter, Locator +from matplotlib.units import ConversionInterface +from numpy.typing import ArrayLike, NDArray +from pandas import Series +from seaborn._core.typing import Default + +TransFuncs: TypeAlias = tuple[Callable[[ArrayLike], ArrayLike], Callable[[ArrayLike], ArrayLike]] +Pipeline: TypeAlias = Sequence[Callable[[Any], Any] | None] + +class Scale: + values: tuple[Incomplete] | str | list[Incomplete] | dict[Incomplete, Incomplete] | None + def __post_init__(self) -> None: ... + def tick(self) -> Self: ... + def label(self) -> Self: ... + def __call__(self, data: Series[Any]) -> ArrayLike: ... + +@dataclass +class Boolean(Scale): + values: tuple[Incomplete] | list[Incomplete] | dict[Incomplete, Incomplete] | None = None + def tick(self, locator: Locator | None = None) -> Self: ... # type: ignore[override] + def label(self, formatter: Formatter | None = None) -> Self: ... # type: ignore[override] + +@dataclass +class Nominal(Scale): + values: tuple[Incomplete] | str | list[Incomplete] | dict[Incomplete, Incomplete] | None = None + order: list[Incomplete] | None = None + def tick(self, locator: Locator | None = None) -> Self: ... # type: ignore[override] + def label(self, formatter: Formatter | None = None) -> Self: ... # type: ignore[override] + +@dataclass +class Ordinal(Scale): ... + +@dataclass +class Discrete(Scale): ... + +@dataclass +class ContinuousBase(Scale): + values: tuple[Incomplete] | str | None = None + norm: tuple[Incomplete] | None = None + +@dataclass +class Continuous(ContinuousBase): + values: tuple[Incomplete] | str | None = None + trans: str | TransFuncs | None = None + def tick( # type: ignore[override] + self, + locator: Locator | None = None, + *, + at: Sequence[float] | None = None, + upto: int | None = None, + count: int | None = None, + every: float | None = None, + between: tuple[float, float] | None = None, + minor: int | None = None, + ) -> Self: ... + def label( # type: ignore[override] + self, + formatter: Formatter | None = None, + *, + like: str | Callable[[float], str] | None = None, + base: int | None | Default = ..., + unit: str | None = None, + ) -> Self: ... + +@dataclass +class Temporal(ContinuousBase): + trans: ClassVar[Incomplete] # not sure it is a classvar but the runtime has no annotation so it is not a dataclass field + def tick(self, locator: Locator | None = None, *, upto: int | None = None) -> Self: ... # type: ignore[override] + def label(self, formatter: Formatter | None = None, *, concise: bool = False) -> Self: ... # type: ignore[override] + +class PseudoAxis: + axis_name: str + converter: ConversionInterface | None + units: Incomplete | None + scale: ScaleBase + major: Ticker + minor: Ticker + def __init__(self, scale: ScaleBase) -> None: ... + def set_view_interval(self, vmin: float, vmax: float) -> None: ... + def get_view_interval(self) -> tuple[float, float]: ... + def set_data_interval(self, vmin: float, vmax: float) -> None: ... + def get_data_interval(self) -> tuple[float, float]: ... + def get_tick_space(self) -> int: ... + def set_major_locator(self, locator: Locator) -> None: ... + def set_major_formatter(self, formatter: Formatter) -> None: ... + def set_minor_locator(self, locator: Locator) -> None: ... + def set_minor_formatter(self, formatter: Formatter) -> None: ... + def set_units(self, units: Incomplete) -> None: ... + def update_units(self, x: Incomplete) -> None: ... + def convert_units(self, x: Incomplete) -> Incomplete: ... + def get_scale(self) -> ScaleBase: ... + def get_majorticklocs(self) -> NDArray[Incomplete]: ... diff --git a/stubs/seaborn/seaborn/_core/subplots.pyi b/stubs/seaborn/seaborn/_core/subplots.pyi new file mode 100644 index 000000000000..593e0f5cb2e2 --- /dev/null +++ b/stubs/seaborn/seaborn/_core/subplots.pyi @@ -0,0 +1,19 @@ +from collections.abc import Generator +from typing import Any + +from matplotlib.axes import Axes +from matplotlib.figure import Figure, SubFigure +from seaborn._core.plot import FacetSpec, PairSpec + +class Subplots: + subplot_spec: dict[str, Any] + def __init__(self, subplot_spec: dict[str, Any], facet_spec: FacetSpec, pair_spec: PairSpec) -> None: ... + def init_figure( + self, + pair_spec: PairSpec, + pyplot: bool = False, + figure_kws: dict[str, Any] | None = None, + target: Axes | Figure | SubFigure | None = None, + ) -> Figure: ... + def __iter__(self) -> Generator[dict[str, Any], None, None]: ... + def __len__(self) -> int: ... diff --git a/stubs/seaborn/seaborn/_core/typing.pyi b/stubs/seaborn/seaborn/_core/typing.pyi new file mode 100644 index 000000000000..45671301f0d5 --- /dev/null +++ b/stubs/seaborn/seaborn/_core/typing.pyi @@ -0,0 +1,24 @@ +from _typeshed import Incomplete +from collections.abc import Hashable, Iterable, Mapping +from datetime import date, datetime, timedelta +from typing import Any +from typing_extensions import TypeAlias + +from matplotlib.colors import Colormap, Normalize +from numpy import ndarray +from pandas import DataFrame, Index, Series, Timedelta, Timestamp + +ColumnName: TypeAlias = str | bytes | date | datetime | timedelta | bool | complex | Timestamp | Timedelta +Vector: TypeAlias = Series[Any] | Index[Any] | ndarray[Any, Any] +VariableSpec: TypeAlias = ColumnName | Vector | None +VariableSpecList: TypeAlias = list[VariableSpec] | Index[Any] | None +DataSource: TypeAlias = DataFrame | Mapping[Hashable, Vector] | None +OrderSpec: TypeAlias = Iterable[str] | None +NormSpec: TypeAlias = tuple[float | None, float | None] | Normalize | None +PaletteSpec: TypeAlias = str | list[Incomplete] | dict[Incomplete, Incomplete] | Colormap | None +DiscreteValueSpec: TypeAlias = dict[Incomplete, Incomplete] | list[Incomplete] | None +ContinuousValueSpec: TypeAlias = tuple[float, float] | list[float] | dict[Any, float] | None + +class Default: ... + +default: Default diff --git a/stubs/seaborn/seaborn/_marks/__init__.pyi b/stubs/seaborn/seaborn/_marks/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/seaborn/seaborn/_marks/area.pyi b/stubs/seaborn/seaborn/_marks/area.pyi new file mode 100644 index 000000000000..04cca8781ee7 --- /dev/null +++ b/stubs/seaborn/seaborn/_marks/area.pyi @@ -0,0 +1,28 @@ +from dataclasses import dataclass + +from seaborn._marks.base import MappableBool, MappableColor, MappableFloat, MappableStyle, Mark, document_properties + +class AreaBase: ... + +@document_properties +@dataclass +class Area(AreaBase, Mark): + color: MappableColor = ... + alpha: MappableFloat = ... + fill: MappableBool = ... + edgecolor: MappableColor = ... + edgealpha: MappableFloat = ... + edgewidth: MappableFloat = ... + edgestyle: MappableStyle = ... + baseline: MappableFloat = ... + +@document_properties +@dataclass +class Band(AreaBase, Mark): + color: MappableColor = ... + alpha: MappableFloat = ... + fill: MappableBool = ... + edgecolor: MappableColor = ... + edgealpha: MappableFloat = ... + edgewidth: MappableFloat = ... + edgestyle: MappableFloat = ... diff --git a/stubs/seaborn/seaborn/_marks/bar.pyi b/stubs/seaborn/seaborn/_marks/bar.pyi new file mode 100644 index 000000000000..5cee9ad83af8 --- /dev/null +++ b/stubs/seaborn/seaborn/_marks/bar.pyi @@ -0,0 +1,31 @@ +from dataclasses import dataclass + +from seaborn._marks.base import MappableBool, MappableColor, MappableFloat, MappableStyle, Mark, document_properties + +class BarBase(Mark): ... + +@document_properties +@dataclass +class Bar(BarBase): + color: MappableColor = ... + alpha: MappableFloat = ... + fill: MappableBool = ... + edgecolor: MappableColor = ... + edgealpha: MappableFloat = ... + edgewidth: MappableFloat = ... + edgestyle: MappableStyle = ... + width: MappableFloat = ... + baseline: MappableFloat = ... + +@document_properties +@dataclass +class Bars(BarBase): + color: MappableColor = ... + alpha: MappableFloat = ... + fill: MappableBool = ... + edgecolor: MappableColor = ... + edgealpha: MappableFloat = ... + edgewidth: MappableFloat = ... + edgestyle: MappableStyle = ... + width: MappableFloat = ... + baseline: MappableFloat = ... diff --git a/stubs/seaborn/seaborn/_marks/base.pyi b/stubs/seaborn/seaborn/_marks/base.pyi new file mode 100644 index 000000000000..a1d029ff7547 --- /dev/null +++ b/stubs/seaborn/seaborn/_marks/base.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete +from dataclasses import dataclass +from typing import Any, TypeVar +from typing_extensions import TypeAlias + +from numpy.typing import NDArray +from pandas import DataFrame +from seaborn._core.properties import DashPattern, DashPatternWithOffset, RGBATuple +from seaborn._core.scales import Scale + +_MarkT = TypeVar("_MarkT", bound=type[Mark]) + +class Mappable: + def __init__( + self, val: Any = None, depend: str | None = None, rc: str | None = None, auto: bool = False, grouping: bool = True + ) -> None: ... + @property + def depend(self) -> Any: ... # -> str | None + @property + def grouping(self) -> bool: ... + @property + def default(self) -> Any: ... + +MappableBool: TypeAlias = bool | Mappable +MappableString: TypeAlias = str | Mappable +MappableFloat: TypeAlias = float | Mappable +MappableColor: TypeAlias = str | tuple[Incomplete, ...] | Mappable +MappableStyle: TypeAlias = str | DashPattern | DashPatternWithOffset | Mappable + +@dataclass +class Mark: + artist_kws: dict[str, Any] = ... + +def resolve_properties(mark: Mark, data: DataFrame, scales: dict[str, Scale]) -> dict[str, Any]: ... +def resolve_color( + mark: Mark, data: DataFrame | dict[str, Any], prefix: str = "", scales: dict[str, Scale] | None = None +) -> RGBATuple | NDArray[Incomplete]: ... +def document_properties(mark: _MarkT) -> _MarkT: ... diff --git a/stubs/seaborn/seaborn/_marks/dot.pyi b/stubs/seaborn/seaborn/_marks/dot.pyi new file mode 100644 index 000000000000..6b5a0428a3de --- /dev/null +++ b/stubs/seaborn/seaborn/_marks/dot.pyi @@ -0,0 +1,39 @@ +from dataclasses import dataclass + +from seaborn._marks.base import ( + MappableBool, + MappableColor, + MappableFloat, + MappableString, + MappableStyle, + Mark, + document_properties, +) + +class DotBase(Mark): ... + +@document_properties +@dataclass +class Dot(DotBase): + marker: MappableString = ... + pointsize: MappableFloat = ... + stroke: MappableFloat = ... + color: MappableColor = ... + alpha: MappableFloat = ... + fill: MappableBool = ... + edgecolor: MappableColor = ... + edgealpha: MappableFloat = ... + edgewidth: MappableFloat = ... + edgestyle: MappableStyle = ... + +@document_properties +@dataclass +class Dots(DotBase): + marker: MappableString = ... + pointsize: MappableFloat = ... + stroke: MappableFloat = ... + color: MappableColor = ... + alpha: MappableFloat = ... + fill: MappableBool = ... + fillcolor: MappableColor = ... + fillalpha: MappableFloat = ... diff --git a/stubs/seaborn/seaborn/_marks/line.pyi b/stubs/seaborn/seaborn/_marks/line.pyi new file mode 100644 index 000000000000..71594380a7f7 --- /dev/null +++ b/stubs/seaborn/seaborn/_marks/line.pyi @@ -0,0 +1,42 @@ +from dataclasses import dataclass + +from seaborn._marks.base import MappableColor, MappableFloat, MappableString, Mark, document_properties + +@document_properties +@dataclass +class Path(Mark): + color: MappableColor = ... + alpha: MappableFloat = ... + linewidth: MappableFloat = ... + linestyle: MappableString = ... + marker: MappableString = ... + pointsize: MappableFloat = ... + fillcolor: MappableColor = ... + edgecolor: MappableColor = ... + edgewidth: MappableFloat = ... + +@document_properties +@dataclass +class Line(Path): ... + +@document_properties +@dataclass +class Paths(Mark): + color: MappableColor = ... + alpha: MappableFloat = ... + linewidth: MappableFloat = ... + linestyle: MappableString = ... + def __post_init__(self) -> None: ... + +@document_properties +@dataclass +class Lines(Paths): ... + +@document_properties +@dataclass +class Range(Paths): ... + +@document_properties +@dataclass +class Dash(Paths): + width: MappableFloat = ... diff --git a/stubs/seaborn/seaborn/_marks/text.pyi b/stubs/seaborn/seaborn/_marks/text.pyi new file mode 100644 index 000000000000..a8c72fe0cdcc --- /dev/null +++ b/stubs/seaborn/seaborn/_marks/text.pyi @@ -0,0 +1,14 @@ +from dataclasses import dataclass + +from seaborn._marks.base import MappableColor, MappableFloat, MappableString, Mark, document_properties + +@document_properties +@dataclass +class Text(Mark): + text: MappableString = ... + color: MappableColor = ... + alpha: MappableFloat = ... + fontsize: MappableFloat = ... + halign: MappableString = ... + valign: MappableString = ... + offset: MappableFloat = ... diff --git a/stubs/seaborn/seaborn/_stats/__init__.pyi b/stubs/seaborn/seaborn/_stats/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/seaborn/seaborn/_stats/aggregation.pyi b/stubs/seaborn/seaborn/_stats/aggregation.pyi new file mode 100644 index 000000000000..d14b8e67388b --- /dev/null +++ b/stubs/seaborn/seaborn/_stats/aggregation.pyi @@ -0,0 +1,19 @@ +from collections.abc import Callable +from dataclasses import dataclass + +from seaborn._core.typing import Vector +from seaborn._stats.base import Stat + +@dataclass +class Agg(Stat): + func: str | Callable[[Vector], float] = "mean" + +@dataclass +class Est(Stat): + func: str | Callable[[Vector], float] = "mean" + errorbar: str | tuple[str, float] = ... # ("ci", 95) # pytype parse error + n_boot: int = 1000 + seed: int | None = None + +@dataclass +class Rolling(Stat): ... diff --git a/stubs/seaborn/seaborn/_stats/base.pyi b/stubs/seaborn/seaborn/_stats/base.pyi new file mode 100644 index 000000000000..7f3184b4e72b --- /dev/null +++ b/stubs/seaborn/seaborn/_stats/base.pyi @@ -0,0 +1,11 @@ +from dataclasses import dataclass +from typing import ClassVar + +from pandas import DataFrame +from seaborn._core.groupby import GroupBy +from seaborn._core.scales import Scale + +@dataclass +class Stat: + group_by_orient: ClassVar[bool] + def __call__(self, data: DataFrame, groupby: GroupBy, orient: str, scales: dict[str, Scale]) -> DataFrame: ... diff --git a/stubs/seaborn/seaborn/_stats/counting.pyi b/stubs/seaborn/seaborn/_stats/counting.pyi new file mode 100644 index 000000000000..b6283af97cdd --- /dev/null +++ b/stubs/seaborn/seaborn/_stats/counting.pyi @@ -0,0 +1,19 @@ +from dataclasses import dataclass + +from numpy.typing import ArrayLike +from seaborn._stats.base import Stat + +@dataclass +class Count(Stat): ... + +@dataclass +class Hist(Stat): + stat: str = "count" + bins: str | int | ArrayLike = "auto" + binwidth: float | None = None + binrange: tuple[float, float] | None = None + common_norm: bool | list[str] = True + common_bins: bool | list[str] = True + cumulative: bool = False + discrete: bool = False + def __post_init__(self) -> None: ... diff --git a/stubs/seaborn/seaborn/_stats/density.pyi b/stubs/seaborn/seaborn/_stats/density.pyi new file mode 100644 index 000000000000..7e8d12e30e01 --- /dev/null +++ b/stubs/seaborn/seaborn/_stats/density.pyi @@ -0,0 +1,16 @@ +from collections.abc import Callable +from dataclasses import dataclass + +from seaborn._stats.base import Stat +from seaborn.external.kde import gaussian_kde + +@dataclass +class KDE(Stat): + bw_adjust: float = 1 + bw_method: str | float | Callable[[gaussian_kde], float] = "scott" + common_norm: bool | list[str] = True + common_grid: bool | list[str] = True + gridsize: int | None = 200 + cut: float = 3 + cumulative: bool = False + def __post_init__(self) -> None: ... diff --git a/stubs/seaborn/seaborn/_stats/order.pyi b/stubs/seaborn/seaborn/_stats/order.pyi new file mode 100644 index 000000000000..8950dc411d36 --- /dev/null +++ b/stubs/seaborn/seaborn/_stats/order.pyi @@ -0,0 +1,8 @@ +from dataclasses import dataclass + +from seaborn._stats.base import Stat + +@dataclass +class Perc(Stat): + k: int | list[float] = 5 + method: str = "linear" diff --git a/stubs/seaborn/seaborn/_stats/regression.pyi b/stubs/seaborn/seaborn/_stats/regression.pyi new file mode 100644 index 000000000000..4746cca2618b --- /dev/null +++ b/stubs/seaborn/seaborn/_stats/regression.pyi @@ -0,0 +1,10 @@ +from dataclasses import dataclass + +from seaborn._stats.base import Stat + +@dataclass +class PolyFit(Stat): + order: int = 2 + gridsize: int = 100 + +class OLSFit(Stat): ... diff --git a/stubs/seaborn/seaborn/algorithms.pyi b/stubs/seaborn/seaborn/algorithms.pyi new file mode 100644 index 000000000000..e73df5b42921 --- /dev/null +++ b/stubs/seaborn/seaborn/algorithms.pyi @@ -0,0 +1,14 @@ +from collections.abc import Callable +from typing import Any + +import numpy as np +from numpy.typing import ArrayLike, NDArray + +def bootstrap( + *args: ArrayLike, + n_boot: int = 10000, + func: str | Callable[..., Any] = "mean", + axis: int | None = None, + units: ArrayLike | None = None, + seed: int | np.random.Generator | np.random.RandomState | None = None, +) -> NDArray[Any]: ... diff --git a/stubs/seaborn/seaborn/axisgrid.pyi b/stubs/seaborn/seaborn/axisgrid.pyi new file mode 100644 index 000000000000..816a1399afbe --- /dev/null +++ b/stubs/seaborn/seaborn/axisgrid.pyi @@ -0,0 +1,234 @@ +from _typeshed import Incomplete +from collections.abc import Callable, Generator, Iterable, Mapping +from typing import Any, TypeVar +from typing_extensions import Concatenate, Literal, ParamSpec, Self + +from matplotlib.artist import Artist +from matplotlib.axes import Axes +from matplotlib.figure import Figure +from matplotlib.legend import Legend +from matplotlib.text import Text +from numpy.typing import NDArray +from pandas import DataFrame, Series + +__all__ = ["FacetGrid", "PairGrid", "JointGrid", "pairplot", "jointplot"] + +_P = ParamSpec("_P") +_R = TypeVar("_R") + +class _BaseGrid: + def set(self, **kwargs: Any) -> Self: ... + @property + def fig(self) -> Figure: ... + @property + def figure(self) -> Figure: ... + def apply(self, func: Callable[Concatenate[Self, _P], object], *args: _P.args, **kwargs: _P.kwargs) -> Self: ... + def pipe(self, func: Callable[Concatenate[Self, _P], _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: ... + def savefig( + self, *args: Incomplete, **kwargs: Incomplete + ) -> None: ... # *arg and **kwargs are passed to `matplotlib.figure.Figure.savefig` + +class Grid(_BaseGrid): + def __init__(self) -> None: ... + def tight_layout( + self, *args: Incomplete, **kwargs: Incomplete + ) -> Self: ... # *arg and **kwargs are passed to `matplotlib.figure.Figure.tight_layout` + def add_legend( + self, + legend_data: Mapping[str | tuple[Incomplete, str], Artist] | None = None, + title: str | None = None, + label_order: list[str] | None = None, + adjust_subtitles: bool = False, + **kwargs: Incomplete, # **kwargs are passed to `matplotlib.figure.Figure.legend` + ) -> Self: ... + @property + def legend(self) -> Legend | None: ... + def tick_params( + self, axis: Literal["x", "y", "both"] = "both", **kwargs: Incomplete + ) -> Self: ... # **kwargs are passed to `matplotlib.axes.Axes.tick_params` + +class FacetGrid(Grid): + data: DataFrame + row_names: list[Any] + col_names: list[Any] + hue_names: list[Any] | None + hue_kws: dict[str, Any] + def __init__( + self, + data: DataFrame, + *, + row: str | None = None, + col: str | None = None, + hue: str | None = None, + col_wrap: int | None = None, + sharex: bool | Literal["col", "row"] = True, + sharey: bool | Literal["col", "row"] = True, + height: float = 3, + aspect: float = 1, + palette: Incomplete | None = None, + row_order: Iterable[Any] | None = None, + col_order: Iterable[Any] | None = None, + hue_order: Iterable[Any] | None = None, + hue_kws: dict[str, Any] | None = None, + dropna: bool = False, + legend_out: bool = True, + despine: bool = True, + margin_titles: bool = False, + xlim: tuple[float, float] | None = None, + ylim: tuple[float, float] | None = None, + subplot_kws: dict[str, Any] | None = None, + gridspec_kws: dict[str, Any] | None = None, + ) -> None: ... + def facet_data(self) -> Generator[tuple[tuple[int, int, int], DataFrame], None, None]: ... + def map(self, func: Callable[..., object], *args: str, **kwargs: Any) -> Self: ... + def map_dataframe(self, func: Callable[..., object], *args: str, **kwargs: Any) -> Self: ... + def facet_axis(self, row_i: int, col_j: int, modify_state: bool = True) -> Axes: ... + def despine(self, **kwargs: Incomplete) -> Self: ... # **kwargs are passed to `seaborn.utils.despine` + def set_axis_labels( + self, x_var: str | None = None, y_var: str | None = None, clear_inner: bool = True, **kwargs: Any + ) -> Self: ... + def set_xlabels(self, label: str | None = None, clear_inner: bool = True, **kwargs: Any) -> Self: ... + def set_ylabels(self, label: str | None = None, clear_inner: bool = True, **kwargs: Any) -> Self: ... + def set_xticklabels(self, labels: Iterable[str | Text] | None = None, step: int | None = None, **kwargs: Any) -> Self: ... + def set_yticklabels(self, labels: Iterable[str | Text] | None = None, **kwargs: Any) -> Self: ... + def set_titles( + self, template: str | None = None, row_template: str | None = None, col_template: str | None = None, **kwargs: Any + ) -> Self: ... + def refline( + self, + *, + x: float | None = None, + y: float | None = None, + color: str | tuple[float, float, float] = ".5", + linestyle: str = "--", + **line_kws: Any, + ) -> Self: ... + @property + def axes(self) -> NDArray[Incomplete]: ... # array of `Axes` + @property + def ax(self) -> Axes: ... + @property + def axes_dict(self) -> dict[Any, Axes]: ... + +class PairGrid(Grid): + x_vars: list[str] + y_vars: list[str] + square_grid: bool + axes: NDArray[Incomplete] # two-dimensional array of `Axes` + data: DataFrame + diag_sharey: bool + diag_vars: NDArray[Incomplete] | None # array of `str` + diag_axes: NDArray[Incomplete] | None # array of `Axes` + hue_names: list[str] + hue_vals: Series[Incomplete] + hue_kws: dict[str, Any] + palette: Incomplete + def __init__( + self, + data: DataFrame, + *, + hue: str | None = None, + vars: Iterable[str] | None = None, + x_vars: Iterable[str] | None = None, + y_vars: Iterable[str] | None = None, + hue_order: Iterable[str] | None = None, + palette: Incomplete | None = None, + hue_kws: dict[str, Any] | None = None, + corner: bool = False, + diag_sharey: bool = True, + height: float = 2.5, + aspect: float = 1, + layout_pad: float = 0.5, + despine: bool = True, + dropna: bool = False, + ) -> None: ... + def map(self, func: Callable[..., object], **kwargs: Any) -> Self: ... + def map_lower(self, func: Callable[..., object], **kwargs: Any) -> Self: ... + def map_upper(self, func: Callable[..., object], **kwargs: Any) -> Self: ... + def map_offdiag(self, func: Callable[..., object], **kwargs: Any) -> Self: ... + def map_diag(self, func: Callable[..., object], **kwargs: Any) -> Self: ... + +class JointGrid(_BaseGrid): + ax_joint: Axes + ax_marg_x: Axes + ax_marg_y: Axes + x: Series[Incomplete] + y: Series[Incomplete] + hue: Series[Incomplete] + def __init__( + self, + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + height: float = 6, + ratio: float = 5, + space: float = 0.2, + palette: Incomplete | None = None, + hue_order: Iterable[str] | None = None, + hue_norm: Incomplete | None = None, + dropna: bool = False, + xlim: Incomplete | None = None, + ylim: Incomplete | None = None, + marginal_ticks: bool = False, + ) -> None: ... + def plot(self, joint_func: Callable[..., object], marginal_func: Callable[..., object], **kwargs: Any) -> Self: ... + def plot_joint(self, func: Callable[..., object], **kwargs: Any) -> Self: ... + def plot_marginals(self, func: Callable[..., object], **kwargs: Any) -> Self: ... + def refline( + self, + *, + x: float | None = None, + y: float | None = None, + joint: bool = True, + marginal: bool = True, + color: str | tuple[float, float, float] = ".5", + linestyle: str = "--", + **line_kws: Any, + ) -> Self: ... + def set_axis_labels(self, xlabel: str = "", ylabel: str = "", **kwargs: Any) -> Self: ... + +def pairplot( + data: DataFrame, + *, + hue: str | None = None, + hue_order: Iterable[str] | None = None, + palette: Incomplete | None = None, + vars: Iterable[str] | None = None, + x_vars: Iterable[str] | None = None, + y_vars: Iterable[str] | None = None, + kind: Literal["scatter", "kde", "hist", "reg"] = "scatter", + diag_kind: Literal["auto", "hist", "kde"] | None = "auto", + markers: Incomplete | None = None, + height: float = 2.5, + aspect: float = 1, + corner: bool = False, + dropna: bool = False, + plot_kws: dict[str, Any] | None = None, + diag_kws: dict[str, Any] | None = None, + grid_kws: dict[str, Any] | None = None, + size: float | None = None, +) -> PairGrid: ... +def jointplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + kind: Literal["scatter", "kde", "hist", "hex", "reg", "resid"] = "scatter", + height: float = 6, + ratio: float = 5, + space: float = 0.2, + dropna: bool = False, + xlim: Incomplete | None = None, + ylim: Incomplete | None = None, + color: str | tuple[float, float, float] | None = None, + palette: Incomplete | None = None, + hue_order: Iterable[str] | None = None, + hue_norm: Incomplete | None = None, + marginal_ticks: bool = False, + joint_kws: dict[str, Any] | None = None, + marginal_kws: dict[str, Any] | None = None, + **kwargs: Any, +) -> JointGrid: ... diff --git a/stubs/seaborn/seaborn/categorical.pyi b/stubs/seaborn/seaborn/categorical.pyi new file mode 100644 index 000000000000..be6d4d03e7e8 --- /dev/null +++ b/stubs/seaborn/seaborn/categorical.pyi @@ -0,0 +1,249 @@ +from _typeshed import Incomplete +from collections.abc import Callable, Iterable +from typing import Any, TypeVar +from typing_extensions import Literal + +import numpy as np +from matplotlib.axes import Axes +from matplotlib.collections import PathCollection +from numpy.typing import NDArray +from seaborn.axisgrid import FacetGrid + +__all__ = ["catplot", "stripplot", "swarmplot", "boxplot", "violinplot", "boxenplot", "pointplot", "barplot", "countplot"] + +_T = TypeVar("_T") + +def boxplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + order: Incomplete | None = None, + hue_order: Incomplete | None = None, + orient: Incomplete | None = None, + color: Incomplete | None = None, + palette: Incomplete | None = None, + saturation: float = 0.75, + width: float = 0.8, + dodge: bool = True, + fliersize: float = 5, + linewidth: Incomplete | None = None, + whis: float = 1.5, + ax: Axes | None = None, + **kwargs, +) -> Axes: ... +def violinplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + order: Incomplete | None = None, + hue_order: Incomplete | None = None, + bw: str = "scott", + cut: int = 2, + scale: str = "area", + scale_hue: bool = True, + gridsize: int = 100, + width: float = 0.8, + inner: str = "box", + split: bool = False, + dodge: bool = True, + orient: Incomplete | None = None, + linewidth: Incomplete | None = None, + color: Incomplete | None = None, + palette: Incomplete | None = None, + saturation: float = 0.75, + ax: Axes | None = None, + **kwargs, +) -> Axes: ... +def boxenplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + order: Incomplete | None = None, + hue_order: Incomplete | None = None, + orient: Incomplete | None = None, + color: Incomplete | None = None, + palette: Incomplete | None = None, + saturation: float = 0.75, + width: float = 0.8, + dodge: bool = True, + k_depth: str = "tukey", + linewidth: Incomplete | None = None, + scale: str = "exponential", + outlier_prop: float = 0.007, + trust_alpha: float = 0.05, + showfliers: bool = True, + ax: Axes | None = None, + box_kws: Incomplete | None = None, + flier_kws: Incomplete | None = None, + line_kws: Incomplete | None = None, +) -> Axes: ... +def stripplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + order: Incomplete | None = None, + hue_order: Incomplete | None = None, + jitter: bool = True, + dodge: bool = False, + orient: Incomplete | None = None, + color: Incomplete | None = None, + palette: Incomplete | None = None, + size: float = 5, + edgecolor: str = "gray", + linewidth: float = 0, + hue_norm: Incomplete | None = None, + native_scale: bool = False, + formatter: Incomplete | None = None, + legend: str = "auto", + ax: Axes | None = None, + **kwargs, +) -> Axes: ... +def swarmplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + order: Incomplete | None = None, + hue_order: Incomplete | None = None, + dodge: bool = False, + orient: Incomplete | None = None, + color: Incomplete | None = None, + palette: Incomplete | None = None, + size: float = 5, + edgecolor: str = "gray", + linewidth: float = 0, + hue_norm: Incomplete | None = None, + native_scale: bool = False, + formatter: Incomplete | None = None, + legend: str = "auto", + warn_thresh: float = 0.05, + ax: Axes | None = None, + **kwargs, +) -> Axes: ... +def barplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + order: Iterable[str] | None = None, + hue_order: Iterable[str] | None = None, + estimator: str | Callable[..., Incomplete] = "mean", + errorbar: str | tuple[str, float] | Callable[[Iterable[float]], tuple[float, float]] | None = ("ci", 95), + n_boot: int = 1000, + units: Incomplete | None = None, + seed: int | np.random.Generator | np.random.RandomState | None = None, + orient: Incomplete | None = None, + color: Incomplete | None = None, + palette: Incomplete | None = None, + saturation: float = 0.75, + width: float = 0.8, + errcolor: Incomplete = ".26", + errwidth: float | None = None, + capsize: float | None = None, + dodge: bool = True, + ci: str = "deprecated", + ax: Axes | None = None, + **kwargs: Any, +) -> Axes: ... +def pointplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + order: Incomplete | None = None, + hue_order: Incomplete | None = None, + estimator: str | Callable[..., Incomplete] = "mean", + errorbar: str | tuple[str, float] | Callable[[Iterable[float]], tuple[float, float]] | None = ("ci", 95), + n_boot: int = 1000, + units: Incomplete | None = None, + seed: int | np.random.Generator | np.random.RandomState | None = None, + markers: str = "o", + linestyles: str = "-", + dodge: bool = False, + join: bool = True, + scale: float = 1, + orient: Incomplete | None = None, + color: Incomplete | None = None, + palette: Incomplete | None = None, + errwidth: Incomplete | None = None, + ci: str = "deprecated", + capsize: Incomplete | None = None, + label: Incomplete | None = None, + ax: Axes | None = None, +) -> Axes: ... +def countplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + order: Incomplete | None = None, + hue_order: Incomplete | None = None, + orient: Incomplete | None = None, + color: Incomplete | None = None, + palette: Incomplete | None = None, + saturation: float = 0.75, + width: float = 0.8, + dodge: bool = True, + ax: Axes | None = None, + **kwargs, +) -> Axes: ... +def catplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + row: Incomplete | None = None, + col: Incomplete | None = None, + col_wrap: int | None = None, + estimator: str | Callable[..., Incomplete] = "mean", + errorbar: str | tuple[str, float] | Callable[[Iterable[float]], tuple[float, float]] | None = ("ci", 95), + n_boot: int = 1000, + units: Incomplete | None = None, + seed: int | np.random.Generator | np.random.RandomState | None = None, + order: Iterable[str] | None = None, + hue_order: Iterable[str] | None = None, + row_order: Iterable[str] | None = None, + col_order: Iterable[str] | None = None, + height: float = 5, + aspect: float = 1, + kind: str = "strip", + native_scale: bool = False, + formatter: Callable[..., str] | None = None, + orient: Literal["v", "h"] | None = None, + color: Incomplete | None = None, + palette: Incomplete | None = None, + hue_norm: Incomplete | None = None, + legend: str | bool = "auto", + legend_out: bool = True, + sharex: bool = True, + sharey: bool = True, + margin_titles: bool = False, + facet_kws: dict[str, Any] | None = None, + ci: str = "deprecated", + **kwargs, +) -> FacetGrid: ... + +class Beeswarm: + orient: Literal["v", "h"] + width: float + warn_thresh: float + def __init__(self, orient: str = "v", width: float = 0.8, warn_thresh: float = 0.05) -> None: ... + def __call__(self, points: PathCollection, center: float) -> None: ... + def beeswarm(self, orig_xyr) -> NDArray[np.float64]: ... + def could_overlap(self, xyr_i, swarm) -> NDArray[np.float64]: ... + def position_candidates(self, xyr_i, neighbors) -> NDArray[np.float64]: ... + def first_non_overlapping_candidate(self, candidates, neighbors) -> Incomplete: ... + def add_gutters(self, points: _T, center: float, log_scale: bool = False) -> _T: ... diff --git a/stubs/seaborn/seaborn/cm.pyi b/stubs/seaborn/seaborn/cm.pyi new file mode 100644 index 000000000000..85c912b97d2d --- /dev/null +++ b/stubs/seaborn/seaborn/cm.pyi @@ -0,0 +1,15 @@ +from matplotlib.colors import ListedColormap + +# generated +rocket: ListedColormap +mako: ListedColormap +icefire: ListedColormap +vlag: ListedColormap +flare: ListedColormap +crest: ListedColormap +rocket_r: ListedColormap +mako_r: ListedColormap +icefire_r: ListedColormap +vlag_r: ListedColormap +flare_r: ListedColormap +crest_r: ListedColormap diff --git a/stubs/seaborn/seaborn/colors/__init__.pyi b/stubs/seaborn/seaborn/colors/__init__.pyi new file mode 100644 index 000000000000..f2f1b9731393 --- /dev/null +++ b/stubs/seaborn/seaborn/colors/__init__.pyi @@ -0,0 +1,2 @@ +from .crayons import crayons as crayons +from .xkcd_rgb import xkcd_rgb as xkcd_rgb diff --git a/stubs/seaborn/seaborn/colors/crayons.pyi b/stubs/seaborn/seaborn/colors/crayons.pyi new file mode 100644 index 000000000000..c0479d29f98f --- /dev/null +++ b/stubs/seaborn/seaborn/colors/crayons.pyi @@ -0,0 +1 @@ +crayons: dict[str, str] diff --git a/stubs/seaborn/seaborn/colors/xkcd_rgb.pyi b/stubs/seaborn/seaborn/colors/xkcd_rgb.pyi new file mode 100644 index 000000000000..0ac3abc8087c --- /dev/null +++ b/stubs/seaborn/seaborn/colors/xkcd_rgb.pyi @@ -0,0 +1 @@ +xkcd_rgb: dict[str, str] diff --git a/stubs/seaborn/seaborn/distributions.pyi b/stubs/seaborn/seaborn/distributions.pyi new file mode 100644 index 000000000000..f78b384a5b68 --- /dev/null +++ b/stubs/seaborn/seaborn/distributions.pyi @@ -0,0 +1,157 @@ +from _typeshed import Incomplete +from collections.abc import Iterable +from typing import Any +from typing_extensions import Literal + +from matplotlib.axes import Axes + +from .axisgrid import FacetGrid + +__all__ = ["displot", "histplot", "kdeplot", "ecdfplot", "rugplot", "distplot"] + +def histplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + weights: Incomplete | None = None, + stat: str = "count", + bins: Incomplete = "auto", + binwidth: float | tuple[float, float] | None = None, + binrange: Incomplete | None = None, + discrete: bool | None = None, + cumulative: bool = False, + common_bins: bool = True, + common_norm: bool = True, + multiple: Literal["layer", "dodge", "stack", "fill"] = "layer", + element: Literal["bars", "step", "poly"] = "bars", + fill: bool = True, + shrink: float = 1, + kde: bool = False, + kde_kws: dict[str, Any] | None = None, + line_kws: dict[str, Any] | None = None, + thresh: float | None = 0, + pthresh: float | None = None, + pmax: float | None = None, + cbar: bool = False, + cbar_ax: Axes | None = None, + cbar_kws: dict[str, Any] | None = None, + palette: Incomplete | None = None, + hue_order: Iterable[str] | None = None, + hue_norm: Incomplete | None = None, + color: Incomplete | None = None, + log_scale: bool | float | tuple[bool | float, bool | float] | None = None, + legend: bool = True, + ax: Axes | None = None, + **kwargs: Any, +) -> Axes: ... +def kdeplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + weights: Incomplete | None = None, + palette: Incomplete | None = None, + hue_order: Iterable[str] | None = None, + hue_norm: Incomplete | None = None, + color: Incomplete | None = None, + fill: bool | None = None, + multiple: Literal["layer", "stack", "fill"] = "layer", + common_norm: bool = True, + common_grid: bool = False, + cumulative: bool = False, + bw_method: str = "scott", + bw_adjust: float = 1, + warn_singular: bool = True, + log_scale: bool | float | tuple[bool | float, bool | float] | None = None, + levels: int | Iterable[int] = 10, + thresh: float = 0.05, + gridsize: int = 200, + cut: float = 3, + clip: Incomplete | None = None, + legend: bool = True, + cbar: bool = False, + cbar_ax: Axes | None = None, + cbar_kws: dict[str, Any] | None = None, + ax: Axes | None = None, + **kwargs: Any, +) -> Axes: ... +def ecdfplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + weights: Incomplete | None = None, + stat: Literal["proportion", "count"] = "proportion", + complementary: bool = False, + palette: Incomplete | None = None, + hue_order: Iterable[str] | None = None, + hue_norm: Incomplete | None = None, + log_scale: bool | float | tuple[bool | float, bool | float] | None = None, + legend: bool = True, + ax: Axes | None = None, + **kwargs: Any, +) -> Axes: ... +def rugplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + height: float = 0.025, + expand_margins: bool = True, + palette: Incomplete | None = None, + hue_order: Iterable[str] | None = None, + hue_norm: Incomplete | None = None, + legend: bool = True, + ax: Axes | None = None, + **kwargs: Any, +) -> Axes: ... +def displot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + row: Incomplete | None = None, + col: Incomplete | None = None, + weights: Incomplete | None = None, + kind: Literal["hist", "kde", "ecdf"] = "hist", + rug: bool = False, + rug_kws: dict[str, Any] | None = None, + log_scale: bool | float | tuple[bool | float, bool | float] | None = None, + legend: bool = True, + palette: Incomplete | None = None, + hue_order: Iterable[str] | None = None, + hue_norm: Incomplete | None = None, + color: Incomplete | None = None, + col_wrap: int | None = None, + row_order: Iterable[str] | None = None, + col_order: Iterable[str] | None = None, + height: float = 5, + aspect: float = 1, + facet_kws: dict[str, Any] | None = None, + **kwargs: Any, +) -> FacetGrid: ... +def distplot( # deprecated + a: Incomplete | None = None, + bins: Incomplete | None = None, + hist: bool = True, + kde: bool = True, + rug: bool = False, + fit: Incomplete | None = None, + hist_kws: dict[str, Any] | None = None, + kde_kws: dict[str, Any] | None = None, + rug_kws: dict[str, Any] | None = None, + fit_kws: dict[str, Any] | None = None, + color: Incomplete | None = None, + vertical: bool = False, + norm_hist: bool = False, + axlabel: str | Literal[False] | None = None, + label: Incomplete | None = None, + ax: Axes | None = None, + x: Incomplete | None = None, +) -> Axes: ... diff --git a/stubs/seaborn/seaborn/external/__init__.pyi b/stubs/seaborn/seaborn/external/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/seaborn/seaborn/external/appdirs.pyi b/stubs/seaborn/seaborn/external/appdirs.pyi new file mode 100644 index 000000000000..982d29189197 --- /dev/null +++ b/stubs/seaborn/seaborn/external/appdirs.pyi @@ -0,0 +1,9 @@ +from typing_extensions import Literal + +__version__: str +__version_info__: tuple[int, int, int] +system: str + +def user_cache_dir( + appname: str | None = None, appauthor: Literal[False] | str | None = None, version: str | None = None, opinion: bool = True +) -> str: ... diff --git a/stubs/seaborn/seaborn/external/docscrape.pyi b/stubs/seaborn/seaborn/external/docscrape.pyi new file mode 100644 index 000000000000..f8f936e35ea6 --- /dev/null +++ b/stubs/seaborn/seaborn/external/docscrape.pyi @@ -0,0 +1,69 @@ +from _typeshed import Incomplete, Unused +from collections.abc import Callable, Iterable, Iterator, Mapping, MutableSequence +from typing import Any, ClassVar, NamedTuple, TypeVar, overload +from typing_extensions import SupportsIndex + +_S = TypeVar("_S", bound=MutableSequence[str]) + +def strip_blank_lines(l: _S) -> _S: ... + +class Reader: + def __init__(self, data: str | list[str]) -> None: ... + @overload + def __getitem__(self, n: slice) -> list[str]: ... + @overload + def __getitem__(self, n: SupportsIndex) -> str: ... + def reset(self) -> None: ... + def read(self) -> str: ... + def seek_next_non_empty_line(self) -> None: ... + def eof(self) -> bool: ... + def read_to_condition(self, condition_func: Callable[[str], bool]) -> list[str]: ... + def read_to_next_empty_line(self) -> list[str]: ... + def read_to_next_unindented_line(self) -> list[str]: ... + def peek(self, n: int = 0) -> str: ... + def is_empty(self) -> bool: ... + +class ParseError(Exception): ... + +class Parameter(NamedTuple): + name: str + type: str + desc: list[str] + +class NumpyDocString(Mapping[str, Any]): + sections: ClassVar[dict[str, Any]] + def __init__(self, docstring: str, config: Unused = {}) -> None: ... + def __getitem__(self, key: str) -> Any: ... + def __setitem__(self, key: str, val: Any) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + empty_description: str + +def indent(str: str | None, indent: int = 4) -> str: ... +def dedent_lines(lines: Iterable[str]) -> list[str]: ... +def header(text: str, style: str = "-") -> str: ... + +class FunctionDoc(NumpyDocString): + def __init__(self, func, role: str = "func", doc: str | None = None, config: Unused = {}) -> None: ... + def get_func(self) -> tuple[Incomplete, str]: ... + +class ClassDoc(NumpyDocString): + extra_public_methods: list[str] + show_inherited_members: bool + @overload + def __init__( + self, cls: None, doc: str, modulename: str = "", func_doc: type[FunctionDoc] = ..., config: Mapping[str, Any] = {} + ) -> None: ... + @overload + def __init__( + self, + cls: type, + doc: str | None = None, + modulename: str = "", + func_doc: type[FunctionDoc] = ..., + config: Mapping[str, Any] = {}, + ) -> None: ... + @property + def methods(self) -> list[str]: ... + @property + def properties(self) -> list[str]: ... diff --git a/stubs/seaborn/seaborn/external/husl.pyi b/stubs/seaborn/seaborn/external/husl.pyi new file mode 100644 index 000000000000..bafd9a7d0910 --- /dev/null +++ b/stubs/seaborn/seaborn/external/husl.pyi @@ -0,0 +1,42 @@ +from collections.abc import Iterable + +m: list[list[float]] +m_inv: list[list[float]] +refX: float +refY: float +refZ: float +refU: float +refV: float +lab_e: float +lab_k: float + +def husl_to_rgb(h: float, s: float, l: float) -> list[float]: ... +def husl_to_hex(h: float, s: float, l: float) -> str: ... +def rgb_to_husl(r: float, g: float, b: float) -> list[float]: ... +def hex_to_husl(hex: str) -> list[float]: ... +def huslp_to_rgb(h: float, s: float, l: float) -> list[float]: ... +def huslp_to_hex(h: float, s: float, l: float) -> str: ... +def rgb_to_huslp(r: float, g: float, b: float) -> list[float]: ... +def hex_to_huslp(hex: str) -> list[float]: ... +def lch_to_rgb(l: float, c: float, h: float) -> list[float]: ... +def rgb_to_lch(r: float, g: float, b: float) -> list[float]: ... +def max_chroma(L: float, H: float) -> float: ... +def max_chroma_pastel(L: float) -> float: ... +def dot_product(a: float, b: float) -> float: ... +def f(t: float) -> float: ... +def f_inv(t: float) -> float: ... +def from_linear(c: float) -> float: ... +def to_linear(c: float) -> float: ... +def rgb_prepare(triple: Iterable[float]) -> list[int]: ... +def hex_to_rgb(hex: str) -> list[float]: ... +def rgb_to_hex(triple: Iterable[float]) -> str: ... +def xyz_to_rgb(triple: Iterable[float]) -> list[float]: ... +def rgb_to_xyz(triple: Iterable[float]) -> list[float]: ... +def xyz_to_luv(triple: Iterable[float]) -> list[float]: ... +def luv_to_xyz(triple: Iterable[float]) -> list[float]: ... +def luv_to_lch(triple: Iterable[float]) -> list[float]: ... +def lch_to_luv(triple: Iterable[float]) -> list[float]: ... +def husl_to_lch(triple: Iterable[float]) -> list[float]: ... +def lch_to_husl(triple: Iterable[float]) -> list[float]: ... +def huslp_to_lch(triple: Iterable[float]) -> list[float]: ... +def lch_to_huslp(triple: Iterable[float]) -> list[float]: ... diff --git a/stubs/seaborn/seaborn/external/kde.pyi b/stubs/seaborn/seaborn/external/kde.pyi new file mode 100644 index 000000000000..92d622779f81 --- /dev/null +++ b/stubs/seaborn/seaborn/external/kde.pyi @@ -0,0 +1,25 @@ +from collections.abc import Callable +from typing_extensions import Literal, TypeAlias + +import numpy as np +from numpy.typing import ArrayLike, NDArray + +__all__ = ["gaussian_kde"] + +_Scalar: TypeAlias = np.generic | bool | int | float | complex | bytes | memoryview # see np.isscalar +_BwMethodType: TypeAlias = Literal["scott", "silverman"] | Callable[[gaussian_kde], object] | _Scalar | None + +class gaussian_kde: + dataset: NDArray[np.float64] + def __init__(self, dataset: ArrayLike, bw_method: _BwMethodType = None, weights: ArrayLike | None = None) -> None: ... + def evaluate(self, points: ArrayLike) -> NDArray[np.float64]: ... + __call__ = evaluate + def scotts_factor(self) -> float: ... + def silverman_factor(self) -> float: ... + covariance_factor = scotts_factor + def set_bandwidth(self, bw_method: _BwMethodType = None) -> None: ... + def pdf(self, x: ArrayLike) -> NDArray[np.float64]: ... + @property + def weights(self) -> NDArray[np.float64]: ... + @property + def neff(self) -> NDArray[np.float64]: ... diff --git a/stubs/seaborn/seaborn/external/version.pyi b/stubs/seaborn/seaborn/external/version.pyi new file mode 100644 index 000000000000..fb9d9b3b11a3 --- /dev/null +++ b/stubs/seaborn/seaborn/external/version.pyi @@ -0,0 +1,45 @@ +__all__ = ["Version", "InvalidVersion", "VERSION_PATTERN"] + +class InvalidVersion(ValueError): ... + +class _BaseVersion: + def __hash__(self) -> int: ... + def __lt__(self, other: _BaseVersion) -> bool: ... + def __le__(self, other: _BaseVersion) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def __ge__(self, other: _BaseVersion) -> bool: ... + def __gt__(self, other: _BaseVersion) -> bool: ... + def __ne__(self, other: object) -> bool: ... + +VERSION_PATTERN: str + +class Version(_BaseVersion): + def __init__(self, version: str) -> None: ... + @property + def epoch(self) -> int: ... + @property + def release(self) -> tuple[int, ...]: ... + @property + def pre(self) -> tuple[str, int] | None: ... + @property + def post(self) -> int | None: ... + @property + def dev(self) -> int | None: ... + @property + def local(self) -> str | None: ... + @property + def public(self) -> str: ... + @property + def base_version(self) -> str: ... + @property + def is_prerelease(self) -> bool: ... + @property + def is_postrelease(self) -> bool: ... + @property + def is_devrelease(self) -> bool: ... + @property + def major(self) -> int: ... + @property + def minor(self) -> int: ... + @property + def micro(self) -> int: ... diff --git a/stubs/seaborn/seaborn/matrix.pyi b/stubs/seaborn/seaborn/matrix.pyi new file mode 100644 index 000000000000..5250967466ac --- /dev/null +++ b/stubs/seaborn/seaborn/matrix.pyi @@ -0,0 +1,179 @@ +from _typeshed import Incomplete +from collections.abc import Mapping, Sequence +from typing_extensions import Literal, Self + +import numpy as np +from matplotlib.axes import Axes +from matplotlib.colors import Colormap, ListedColormap +from matplotlib.gridspec import GridSpec +from matplotlib.typing import ColorType +from numpy.typing import ArrayLike, NDArray +from pandas import DataFrame + +from .axisgrid import Grid + +__all__ = ["heatmap", "clustermap"] + +def heatmap( + data: Incomplete, + *, + vmin: float | None = None, + vmax: float | None = None, + cmap: str | list[ColorType] | Colormap | None = None, + center: float | None = None, + robust: bool = False, + annot: bool | ArrayLike | None = None, + fmt: str = ".2g", + annot_kws: dict[str, Incomplete] | None = None, + linewidths: float = 0, + linecolor: ColorType = "white", + cbar: bool = True, + cbar_kws: dict[str, Incomplete] | None = None, + cbar_ax: Axes | None = None, + square: bool = False, + xticklabels: Literal["auto"] | bool | int | Sequence[str] = "auto", + yticklabels: Literal["auto"] | bool | int | Sequence[str] = "auto", + mask: NDArray[np.bool_] | DataFrame | None = None, + ax: Axes | None = None, + **kwargs: Incomplete, +) -> Axes: ... + +class _DendrogramPlotter: + axis: int + array: NDArray[Incomplete] + data: DataFrame + shape: tuple[int, int] + metric: str + method: str + label: bool + rotate: bool + linkage: NDArray[Incomplete] + dendrogram: dict[str, list[Incomplete]] + xticks: list[float] | NDArray[Incomplete] + yticks: list[float] | NDArray[Incomplete] + xticklabels: list[str] + yticklabels: list[str] + ylabel: str + xlabel: str + dependent_coord: list[list[float]] + independent_coord: list[list[float]] + def __init__( + self, data: DataFrame, linkage: NDArray[Incomplete] | None, metric: str, method: str, axis: int, label: bool, rotate: bool + ) -> None: ... + @property + def calculated_linkage(self) -> NDArray[Incomplete]: ... + def calculate_dendrogram(self) -> dict[str, list[Incomplete]]: ... + @property + def reordered_ind(self) -> list[int]: ... + def plot(self, ax: Axes, tree_kws: dict[str, Incomplete]) -> Self: ... + +def dendrogram( + data: DataFrame, + *, + linkage: NDArray[Incomplete] | None = None, + axis: int = 1, + label: bool = True, + metric: str = "euclidean", + method: str = "average", + rotate: bool = False, + tree_kws: dict[str, Incomplete] | None = None, + ax: Axes | None = None, +) -> _DendrogramPlotter: ... + +class ClusterGrid(Grid): + data: DataFrame + data2d: DataFrame + mask: DataFrame + row_colors: Incomplete + row_color_labels: Incomplete + col_colors: Incomplete + col_color_labels: Incomplete + gs: GridSpec + ax_row_dendrogram: Axes + ax_col_dendrogram: Axes + ax_row_colors: Axes | None + ax_col_colors: Axes | None + ax_heatmap: Axes + ax_cbar: Axes | None + cax: Axes | None + cbar_pos: Incomplete + dendrogram_row: _DendrogramPlotter | None + dendrogram_col: _DendrogramPlotter | None + def __init__( + self, + data: Incomplete, + pivot_kws: Mapping[str, Incomplete] | None = None, + z_score: int | None = None, + standard_scale: int | None = None, + figsize: tuple[float, float] | None = None, + row_colors: Incomplete | None = None, + col_colors: Incomplete | None = None, + mask: NDArray[np.bool_] | DataFrame | None = None, + dendrogram_ratio: float | tuple[float, float] | None = None, + colors_ratio: float | tuple[float, float] | None = None, + cbar_pos: tuple[float, float, float, float] | None = None, + ) -> None: ... + def format_data( + self, + data: DataFrame, + pivot_kws: Mapping[str, Incomplete] | None, + z_score: int | None = None, + standard_scale: int | None = None, + ) -> DataFrame: ... + @staticmethod + def z_score(data2d: DataFrame, axis: int = 1) -> DataFrame: ... + @staticmethod + def standard_scale(data2d: DataFrame, axis: int = 1) -> DataFrame: ... + def dim_ratios(self, colors: Incomplete, dendrogram_ratio: float, colors_ratio: float) -> list[float]: ... + @staticmethod + def color_list_to_matrix_and_cmap( + colors: Sequence[ColorType], ind: list[int], axis: int = 0 + ) -> tuple[NDArray[np.int_], ListedColormap]: ... + def plot_dendrograms( + self, + row_cluster: bool, + col_cluster: bool, + metric: str, + method: str, + row_linkage: NDArray[Incomplete] | None, + col_linkage: NDArray[Incomplete] | None, + tree_kws: dict[str, Incomplete] | None, + ) -> None: ... + def plot_colors(self, xind: Incomplete, yind: Incomplete, **kws: Incomplete) -> None: ... + def plot_matrix(self, colorbar_kws: dict[str, Incomplete], xind: Incomplete, yind: Incomplete, **kws: Incomplete) -> None: ... + def plot( + self, + metric: str, + method: str, + colorbar_kws: dict[str, Incomplete] | None, + row_cluster: bool, + col_cluster: bool, + row_linkage: NDArray[Incomplete] | None, + col_linkage: NDArray[Incomplete] | None, + tree_kws: dict[str, Incomplete] | None, + **kws: Incomplete, + ) -> Self: ... + +def clustermap( + data: Incomplete, + *, + pivot_kws: dict[str, Incomplete] | None = None, + method: str = "average", + metric: str = "euclidean", + z_score: int | None = None, + standard_scale: int | None = None, + figsize: tuple[float, float] | None = (10, 10), + cbar_kws: dict[str, Incomplete] | None = None, + row_cluster: bool = True, + col_cluster: bool = True, + row_linkage: NDArray[Incomplete] | None = None, + col_linkage: NDArray[Incomplete] | None = None, + row_colors: Incomplete | None = None, + col_colors: Incomplete | None = None, + mask: NDArray[np.bool_] | DataFrame | None = None, + dendrogram_ratio: float | tuple[float, float] = 0.2, + colors_ratio: float | tuple[float, float] = 0.03, + cbar_pos: tuple[float, float, float, float] | None = (0.02, 0.8, 0.05, 0.18), + tree_kws: dict[str, Incomplete] | None = None, + **kwargs: Incomplete, +) -> ClusterGrid: ... diff --git a/stubs/seaborn/seaborn/miscplot.pyi b/stubs/seaborn/seaborn/miscplot.pyi new file mode 100644 index 000000000000..7ec684217655 --- /dev/null +++ b/stubs/seaborn/seaborn/miscplot.pyi @@ -0,0 +1,8 @@ +from collections.abc import Sequence + +from matplotlib.typing import ColorType + +__all__ = ["palplot", "dogplot"] + +def palplot(pal: Sequence[ColorType], size: int = 1) -> None: ... +def dogplot(*_, **__) -> None: ... diff --git a/stubs/seaborn/seaborn/objects.pyi b/stubs/seaborn/seaborn/objects.pyi new file mode 100644 index 000000000000..4f757e0bba32 --- /dev/null +++ b/stubs/seaborn/seaborn/objects.pyi @@ -0,0 +1,21 @@ +from seaborn._core.moves import Dodge as Dodge, Jitter as Jitter, Move as Move, Norm as Norm, Shift as Shift, Stack as Stack +from seaborn._core.plot import Plot as Plot +from seaborn._core.scales import ( + Boolean as Boolean, + Continuous as Continuous, + Nominal as Nominal, + Scale as Scale, + Temporal as Temporal, +) +from seaborn._marks.area import Area as Area, Band as Band +from seaborn._marks.bar import Bar as Bar, Bars as Bars +from seaborn._marks.base import Mark as Mark +from seaborn._marks.dot import Dot as Dot, Dots as Dots +from seaborn._marks.line import Dash as Dash, Line as Line, Lines as Lines, Path as Path, Paths as Paths, Range as Range +from seaborn._marks.text import Text as Text +from seaborn._stats.aggregation import Agg as Agg, Est as Est +from seaborn._stats.base import Stat as Stat +from seaborn._stats.counting import Count as Count, Hist as Hist +from seaborn._stats.density import KDE as KDE +from seaborn._stats.order import Perc as Perc +from seaborn._stats.regression import PolyFit as PolyFit diff --git a/stubs/seaborn/seaborn/palettes.pyi b/stubs/seaborn/seaborn/palettes.pyi new file mode 100644 index 000000000000..0206a98c166f --- /dev/null +++ b/stubs/seaborn/seaborn/palettes.pyi @@ -0,0 +1,82 @@ +from collections.abc import Iterable, Sequence +from typing import TypeVar +from typing_extensions import Literal, Self + +from matplotlib.colors import Colormap, LinearSegmentedColormap, ListedColormap +from matplotlib.typing import ColorType + +__all__ = [ + "color_palette", + "hls_palette", + "husl_palette", + "mpl_palette", + "dark_palette", + "light_palette", + "diverging_palette", + "blend_palette", + "xkcd_palette", + "crayon_palette", + "cubehelix_palette", + "set_color_codes", +] + +_T = TypeVar("_T") + +SEABORN_PALETTES: dict[str, list[str]] +MPL_QUAL_PALS: dict[str, int] +QUAL_PALETTE_SIZES: dict[str, int] +QUAL_PALETTES: list[str] + +class _ColorPalette(list[_T]): + def __enter__(self) -> Self: ... + def __exit__(self, *args: object) -> None: ... + def as_hex(self) -> _ColorPalette[str]: ... + +def color_palette( + palette: str | Sequence[str | tuple[float, float, float]] | None = None, + n_colors: int | None = None, + desat: float | None = None, + as_cmap: bool = False, +) -> _ColorPalette[tuple[float, float, float]] | Colormap | list[str]: ... +def hls_palette( + n_colors: int = 6, h: float = 0.01, l: float = 0.6, s: float = 0.65, as_cmap: bool = False +) -> _ColorPalette[tuple[float, float, float]] | ListedColormap: ... +def husl_palette( + n_colors: int = 6, h: float = 0.01, s: float = 0.9, l: float = 0.65, as_cmap: bool = False +) -> _ColorPalette[tuple[float, float, float]] | ListedColormap: ... +def mpl_palette( + name: str, n_colors: int = 6, as_cmap: bool = False +) -> _ColorPalette[tuple[float, float, float]] | LinearSegmentedColormap: ... +def dark_palette( + color: ColorType, n_colors: int = 6, reverse: bool = False, as_cmap: bool = False, input: str = "rgb" +) -> _ColorPalette[tuple[float, float, float]] | LinearSegmentedColormap: ... +def light_palette( + color: ColorType, n_colors: int = 6, reverse: bool = False, as_cmap: bool = False, input: str = "rgb" +) -> _ColorPalette[tuple[float, float, float]] | LinearSegmentedColormap: ... +def diverging_palette( + h_neg: float, + h_pos: float, + s: float = 75, + l: float = 50, + sep: int = 1, + n: int = 6, + center: Literal["light", "dark"] = "light", + as_cmap: bool = False, +) -> _ColorPalette[tuple[float, float, float]] | LinearSegmentedColormap: ... +def blend_palette( + colors: Iterable[ColorType], n_colors: int = 6, as_cmap: bool = False, input: str = "rgb" +) -> _ColorPalette[tuple[float, float, float]] | LinearSegmentedColormap: ... +def xkcd_palette(colors: Iterable[str]) -> _ColorPalette[tuple[float, float, float]]: ... +def crayon_palette(colors: Iterable[str]) -> _ColorPalette[tuple[float, float, float]]: ... +def cubehelix_palette( + n_colors: int = 6, + start: float = 0, + rot: float = 0.4, + gamma: float = 1.0, + hue: float = 0.8, + light: float = 0.85, + dark: float = 0.15, + reverse: bool = False, + as_cmap: bool = False, +) -> _ColorPalette[tuple[float, float, float]] | ListedColormap: ... +def set_color_codes(palette: str = "deep") -> None: ... diff --git a/stubs/seaborn/seaborn/rcmod.pyi b/stubs/seaborn/seaborn/rcmod.pyi new file mode 100644 index 000000000000..709170d45840 --- /dev/null +++ b/stubs/seaborn/seaborn/rcmod.pyi @@ -0,0 +1,66 @@ +from _typeshed import Incomplete +from collections.abc import Callable +from typing import Any, TypeVar +from typing_extensions import Literal + +__all__ = [ + "set_theme", + "set", + "reset_defaults", + "reset_orig", + "axes_style", + "set_style", + "plotting_context", + "set_context", + "set_palette", +] + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") +_F = TypeVar("_F", bound=Callable[..., Any]) + +def set_theme( + context: Literal["paper", "notebook", "talk", "poster"] | dict[str, Any] = "notebook", + style: Literal["white", "dark", "whitegrid", "darkgrid", "ticks"] | dict[str, Any] = "darkgrid", + palette: Incomplete = "deep", + font: str = "sans-serif", + font_scale: float = 1, + color_codes: bool = True, + rc: dict[str, Any] | None = None, +) -> None: ... + +# def set(*args, **kwargs) -> None: ... # deprecated alias for set_theme +set = set_theme + +def reset_defaults() -> None: ... +def reset_orig() -> None: ... +def axes_style( + style: Literal["white", "dark", "whitegrid", "darkgrid", "ticks"] | dict[str, Any] | None = None, + rc: dict[str, Any] | None = None, +) -> _AxesStyle[str, Any]: ... +def set_style( + style: Literal["white", "dark", "whitegrid", "darkgrid", "ticks"] | dict[str, Any] | None = None, + rc: dict[str, Any] | None = None, +) -> None: ... +def plotting_context( + context: Literal["paper", "notebook", "talk", "poster"] | dict[str, Any] | None = None, + font_scale: float = 1, + rc: dict[str, Any] | None = None, +) -> _PlottingContext[str, Any]: ... +def set_context( + context: Literal["paper", "notebook", "talk", "poster"] | dict[str, Any] | None = None, + font_scale: float = 1, + rc: dict[str, Any] | None = None, +) -> None: ... + +class _RCAesthetics(dict[_KT, _VT]): + def __enter__(self) -> None: ... + def __exit__(self, exc_type, exc_value, exc_tb) -> None: ... + def __call__(self, func: _F) -> _F: ... + +class _AxesStyle(_RCAesthetics[_KT, _VT]): ... +class _PlottingContext(_RCAesthetics[_KT, _VT]): ... + +def set_palette( + palette: Incomplete, n_colors: int | None = None, desat: float | None = None, color_codes: bool = False +) -> None: ... diff --git a/stubs/seaborn/seaborn/regression.pyi b/stubs/seaborn/seaborn/regression.pyi new file mode 100644 index 000000000000..0497e4da85e9 --- /dev/null +++ b/stubs/seaborn/seaborn/regression.pyi @@ -0,0 +1,105 @@ +from _typeshed import Incomplete +from collections.abc import Iterable +from typing import Any +from typing_extensions import Literal + +import numpy as np +import pandas as pd +from matplotlib.axes import Axes + +from .axisgrid import FacetGrid + +__all__ = ["lmplot", "regplot", "residplot"] + +def lmplot( + data: Incomplete | None = None, + *, + x: str | None = None, + y: str | None = None, + hue: str | None = None, + col: str | None = None, + row: str | None = None, + palette: Incomplete | None = None, + col_wrap: int | None = None, + height: float = 5, + aspect: float = 1, + markers: str = "o", + sharex: bool | Literal["col", "row"] | None = None, + sharey: bool | Literal["col", "row"] | None = None, + hue_order: Iterable[str] | None = None, + col_order: Iterable[str] | None = None, + row_order: Iterable[str] | None = None, + legend: bool = True, + legend_out: Incomplete | None = None, + x_estimator: Incomplete | None = None, + x_bins: Incomplete | None = None, + x_ci: Literal["ci", "sd"] | int | None = "ci", + scatter: bool = True, + fit_reg: bool = True, + ci: int | None = 95, + n_boot: int = 1000, + units: str | None = None, + seed: int | np.random.Generator | np.random.RandomState | None = None, + order: int = 1, + logistic: bool = False, + lowess: bool = False, + robust: bool = False, + logx: bool = False, + x_partial: str | None = None, + y_partial: str | None = None, + truncate: bool = True, + x_jitter: float | None = None, + y_jitter: float | None = None, + scatter_kws: dict[str, Any] | None = None, + line_kws: dict[str, Any] | None = None, + facet_kws: dict[str, Any] | None = None, +) -> FacetGrid: ... +def regplot( + data: pd.DataFrame | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + x_estimator: Incomplete | None = None, + x_bins: Incomplete | None = None, + x_ci: Literal["ci", "sd"] | int | None = "ci", + scatter: bool = True, + fit_reg: bool = True, + ci: int | None = 95, + n_boot: int = 1000, + units: str | None = None, + seed: int | np.random.Generator | np.random.RandomState | None = None, + order: int = 1, + logistic: bool = False, + lowess: bool = False, + robust: bool = False, + logx: bool = False, + x_partial: str | None = None, + y_partial: str | None = None, + truncate: bool = True, + dropna: bool = True, + x_jitter: float | None = None, + y_jitter: float | None = None, + label: str | None = None, + color: Incomplete | None = None, + marker: str = "o", + scatter_kws: dict[str, Any] | None = None, + line_kws: dict[str, Any] | None = None, + ax: Axes | None = None, +) -> Axes: ... +def residplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + x_partial: Incomplete | None = None, + y_partial: Incomplete | None = None, + lowess: bool = False, + order: int = 1, + robust: bool = False, + dropna: bool = True, + label: str | None = None, + color: Incomplete | None = None, + scatter_kws: dict[str, Any] | None = None, + line_kws: dict[str, Any] | None = None, + ax: Axes | None = None, +) -> Axes: ... diff --git a/stubs/seaborn/seaborn/relational.pyi b/stubs/seaborn/seaborn/relational.pyi new file mode 100644 index 000000000000..dc25dd9fe543 --- /dev/null +++ b/stubs/seaborn/seaborn/relational.pyi @@ -0,0 +1,93 @@ +from _typeshed import Incomplete +from collections.abc import Callable, Iterable +from typing import Any +from typing_extensions import Literal + +import numpy as np +from matplotlib.axes import Axes + +from .axisgrid import FacetGrid + +__all__ = ["relplot", "scatterplot", "lineplot"] + +def lineplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + size: Incomplete | None = None, + style: Incomplete | None = None, + units: Incomplete | None = None, + palette: Incomplete | None = None, + hue_order: Iterable[Any] | None = None, + hue_norm: Incomplete | None = None, + sizes: list[float] | dict[str, float] | tuple[float, float] | None = None, + size_order: Iterable[Any] | None = None, + size_norm: Incomplete | None = None, + dashes: bool | list[Incomplete] | dict[str, Incomplete] = True, + markers: Incomplete | None = None, + style_order: Iterable[Any] | None = None, + estimator: str | Callable[..., Incomplete] | None = "mean", + errorbar: str | tuple[str, float] | Callable[[Iterable[float]], tuple[float, float]] | None = ("ci", 95), + n_boot: int = 1000, + seed: int | np.random.Generator | np.random.RandomState | None = None, + orient: Literal["x", "y"] = "x", + sort: bool = True, + err_style: Literal["band", "bars"] = "band", + err_kws: dict[str, Any] | None = None, + legend: Literal["auto", "brief", "full"] | bool = "auto", + ci: str | int | None = "deprecated", # deprecated + ax: Axes | None = None, + **kwargs: Any, +) -> Axes: ... +def scatterplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + size: Incomplete | None = None, + style: Incomplete | None = None, + palette: Incomplete | None = None, + hue_order: Iterable[Any] | None = None, + hue_norm: Incomplete | None = None, + sizes: list[float] | dict[str, float] | tuple[float, float] | None = None, + size_order: Iterable[Any] | None = None, + size_norm: Incomplete | None = None, + markers: Incomplete = True, + style_order: Iterable[Any] | None = None, + legend: Literal["auto", "brief", "full"] | bool = "auto", + ax: Axes | None = None, + **kwargs: Any, +) -> Axes: ... +def relplot( + data: Incomplete | None = None, + *, + x: Incomplete | None = None, + y: Incomplete | None = None, + hue: Incomplete | None = None, + size: Incomplete | None = None, + style: Incomplete | None = None, + units: Incomplete | None = None, + row: Incomplete | None = None, + col: Incomplete | None = None, + col_wrap: int | None = None, + row_order: Iterable[Any] | None = None, + col_order: Iterable[Any] | None = None, + palette: Incomplete | None = None, + hue_order: Iterable[Any] | None = None, + hue_norm: Incomplete | None = None, + sizes: list[float] | dict[str, float] | tuple[float, float] | None = None, + size_order: Iterable[Any] | None = None, + size_norm: Incomplete | None = None, + markers: Incomplete | None = None, + dashes: Incomplete | None = None, + style_order: Iterable[Any] | None = None, + legend: Literal["auto", "brief", "full"] | bool = "auto", + kind: Literal["scatter", "line"] = "scatter", + height: float = 5, + aspect: float = 1, + facet_kws: dict[str, Any] | None = None, + **kwargs: Any, +) -> FacetGrid: ... diff --git a/stubs/seaborn/seaborn/utils.pyi b/stubs/seaborn/seaborn/utils.pyi new file mode 100644 index 000000000000..8dd3729401ae --- /dev/null +++ b/stubs/seaborn/seaborn/utils.pyi @@ -0,0 +1,65 @@ +from _typeshed import Incomplete, SupportsGetItem +from collections.abc import Iterable, Mapping, Sequence +from typing import Any, TypeVar, overload + +import numpy as np +from matplotlib.axes import Axes +from matplotlib.figure import Figure +from matplotlib.legend import Legend +from matplotlib.text import Text +from matplotlib.ticker import Locator +from matplotlib.typing import ColorType +from numpy.typing import ArrayLike, NDArray +from pandas import DataFrame +from seaborn.axisgrid import Grid + +__all__ = [ + "desaturate", + "saturate", + "set_hls_values", + "move_legend", + "despine", + "get_dataset_names", + "get_data_home", + "load_dataset", +] + +_VectorT = TypeVar("_VectorT", bound=SupportsGetItem[Any, Any]) + +def ci_to_errsize(cis: ArrayLike, heights: ArrayLike) -> NDArray[np.float64]: ... +def desaturate(color: ColorType, prop: float) -> tuple[float, float, float]: ... +def saturate(color: ColorType) -> tuple[float, float, float]: ... +def set_hls_values( + color: ColorType, h: float | None = None, l: float | None = None, s: float | None = None +) -> tuple[float, float, float]: ... +def axlabel(xlabel: str, ylabel: str, **kwargs: Any) -> None: ... # deprecated +def remove_na(vector: _VectorT) -> _VectorT: ... +def get_color_cycle() -> list[str]: ... +def despine( + fig: Figure | None = None, + ax: Axes | None = None, + top: bool = True, + right: bool = True, + left: bool = False, + bottom: bool = False, + offset: int | Mapping[str, int] | None = None, + trim: bool = False, +) -> None: ... +def move_legend(obj: Grid | Axes | Figure, loc: str | int, **kwargs: Any) -> None: ... +def ci(a: ArrayLike, which: float | ArrayLike = 95, axis: int | tuple[int, ...] | None = None) -> Incomplete: ... +def get_dataset_names() -> list[str]: ... +def get_data_home(data_home: str | None = None) -> str: ... +def load_dataset(name: str, cache: bool = True, data_home: str | None = None, **kws: Any) -> DataFrame: ... +def axis_ticklabels_overlap(labels: Iterable[Text]) -> bool: ... +def axes_ticklabels_overlap(ax: Axes) -> tuple[bool, bool]: ... +def locator_to_legend_entries( + locator: Locator, limits: Iterable[float], dtype: Incomplete +) -> tuple[list[Incomplete], list[str]]: ... +@overload +def relative_luminance(color: ColorType) -> float: ... # type: ignore[misc] +@overload +def relative_luminance(color: Sequence[ColorType]) -> NDArray[np.float64]: ... +@overload +def relative_luminance(color: ColorType | Sequence[ColorType] | ArrayLike) -> float | NDArray[np.float64]: ... +def to_utf8(obj: object) -> str: ... +def adjust_legend_subtitles(legend: Legend) -> None: ... # not public API diff --git a/stubs/seaborn/seaborn/widgets.pyi b/stubs/seaborn/seaborn/widgets.pyi new file mode 100644 index 000000000000..4a60cf540dc3 --- /dev/null +++ b/stubs/seaborn/seaborn/widgets.pyi @@ -0,0 +1,50 @@ +from _typeshed import Incomplete +from typing import overload +from typing_extensions import Literal + +from matplotlib.colors import LinearSegmentedColormap + +__all__ = [ + "choose_colorbrewer_palette", + "choose_cubehelix_palette", + "choose_dark_palette", + "choose_light_palette", + "choose_diverging_palette", +] + +@overload +def choose_colorbrewer_palette( + data_type: Literal["sequential", "diverging", "qualitative"], as_cmap: Literal[True] +) -> LinearSegmentedColormap: ... +@overload +def choose_colorbrewer_palette( + data_type: Literal["sequential", "diverging", "qualitative"], as_cmap: Literal[False] = False +) -> list[Incomplete]: ... +@overload +def choose_colorbrewer_palette( + data_type: Literal["sequential", "diverging", "qualitative"], as_cmap: bool = False +) -> LinearSegmentedColormap | list[Incomplete]: ... +@overload +def choose_dark_palette(input: str = "husl", *, as_cmap: Literal[True]) -> LinearSegmentedColormap: ... +@overload +def choose_dark_palette(input: str = "husl", as_cmap: Literal[False] = False) -> list[Incomplete]: ... +@overload +def choose_dark_palette(input: str = "husl", as_cmap: bool = False) -> LinearSegmentedColormap | list[Incomplete]: ... +@overload +def choose_light_palette(input: str = "husl", *, as_cmap: Literal[True]) -> LinearSegmentedColormap: ... +@overload +def choose_light_palette(input: str = "husl", as_cmap: Literal[False] = False) -> list[Incomplete]: ... +@overload +def choose_light_palette(input: str = "husl", as_cmap: bool = False) -> LinearSegmentedColormap | list[Incomplete]: ... +@overload +def choose_diverging_palette(as_cmap: Literal[True]) -> LinearSegmentedColormap: ... +@overload +def choose_diverging_palette(as_cmap: Literal[False] = False) -> list[Incomplete]: ... +@overload +def choose_diverging_palette(as_cmap: bool = False) -> LinearSegmentedColormap | list[Incomplete]: ... +@overload +def choose_cubehelix_palette(as_cmap: Literal[True]) -> LinearSegmentedColormap: ... +@overload +def choose_cubehelix_palette(as_cmap: Literal[False] = False) -> list[Incomplete]: ... +@overload +def choose_cubehelix_palette(as_cmap: bool = False) -> LinearSegmentedColormap | list[Incomplete]: ... From bef89da3d5c2e38022f1cd0cfc2d33e55d189f9a Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Sun, 17 Sep 2023 13:23:16 +0200 Subject: [PATCH 02/15] Special case pandas-stubs in pytype test Co-authored-by: Alex Waygood --- tests/pytype_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/pytype_test.py b/tests/pytype_test.py index 66f66166e14c..9666ae876381 100755 --- a/tests/pytype_test.py +++ b/tests/pytype_test.py @@ -150,6 +150,8 @@ def find_stubs_in_paths(paths: Sequence[str]) -> list[str]: def _get_pkgs_associated_with_requirement(req_name: str) -> list[str]: + if req_name == "pandas-stubs": + return ["pandas"] dist = importlib.metadata.distribution(req_name) toplevel_txt_contents = dist.read_text("top_level.txt") if toplevel_txt_contents is not None: From ddf2f7d7540bd20623bb068d2751687b4b47c564 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 21 Sep 2023 22:40:52 +0100 Subject: [PATCH 03/15] revert special-casing in `pytype_test.py`, now unnecessary --- tests/pytype_test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/pytype_test.py b/tests/pytype_test.py index 7ebaa390d0ee..af7dedade51f 100755 --- a/tests/pytype_test.py +++ b/tests/pytype_test.py @@ -150,8 +150,6 @@ def find_stubs_in_paths(paths: Sequence[str]) -> list[str]: def _get_pkgs_associated_with_requirement(req_name: str) -> list[str]: - if req_name == "pandas-stubs": - return ["pandas"] dist = importlib.metadata.distribution(req_name) toplevel_txt_contents = dist.read_text("top_level.txt") if toplevel_txt_contents is None: From fa7cab9629b935cc8f91f1c632c1e243099c269e Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Sat, 23 Sep 2023 10:51:53 +0200 Subject: [PATCH 04/15] More improvements --- stubs/seaborn/seaborn/axisgrid.pyi | 41 +++++---- stubs/seaborn/seaborn/categorical.pyi | 67 +++++++------- stubs/seaborn/seaborn/distributions.pyi | 24 ++--- stubs/seaborn/seaborn/palettes.pyi | 115 +++++++++++++++++++----- stubs/seaborn/seaborn/rcmod.pyi | 9 +- stubs/seaborn/seaborn/regression.pyi | 9 +- stubs/seaborn/seaborn/relational.pyi | 12 ++- stubs/seaborn/seaborn/utils.pyi | 5 +- stubs/seaborn/seaborn/widgets.pyi | 23 ++--- 9 files changed, 190 insertions(+), 115 deletions(-) diff --git a/stubs/seaborn/seaborn/axisgrid.pyi b/stubs/seaborn/seaborn/axisgrid.pyi index 816a1399afbe..6a5aa250eef3 100644 --- a/stubs/seaborn/seaborn/axisgrid.pyi +++ b/stubs/seaborn/seaborn/axisgrid.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -from collections.abc import Callable, Generator, Iterable, Mapping +from collections.abc import Callable, Generator, Iterable, Mapping, Sequence from typing import Any, TypeVar from typing_extensions import Concatenate, Literal, ParamSpec, Self @@ -8,8 +8,10 @@ from matplotlib.axes import Axes from matplotlib.figure import Figure from matplotlib.legend import Legend from matplotlib.text import Text +from matplotlib.typing import ColorType from numpy.typing import NDArray from pandas import DataFrame, Series +from seaborn.palettes import _RGBColorPalette __all__ = ["FacetGrid", "PairGrid", "JointGrid", "pairplot", "jointplot"] @@ -65,7 +67,7 @@ class FacetGrid(Grid): sharey: bool | Literal["col", "row"] = True, height: float = 3, aspect: float = 1, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, row_order: Iterable[Any] | None = None, col_order: Iterable[Any] | None = None, hue_order: Iterable[Any] | None = None, @@ -83,7 +85,18 @@ class FacetGrid(Grid): def map(self, func: Callable[..., object], *args: str, **kwargs: Any) -> Self: ... def map_dataframe(self, func: Callable[..., object], *args: str, **kwargs: Any) -> Self: ... def facet_axis(self, row_i: int, col_j: int, modify_state: bool = True) -> Axes: ... - def despine(self, **kwargs: Incomplete) -> Self: ... # **kwargs are passed to `seaborn.utils.despine` + def despine( + self, + *, + fig: Figure | None = None, + ax: Axes | None = None, + top: bool = True, + right: bool = True, + left: bool = False, + bottom: bool = False, + offset: int | Mapping[str, int] | None = None, + trim: bool = False, + ) -> Self: ... def set_axis_labels( self, x_var: str | None = None, y_var: str | None = None, clear_inner: bool = True, **kwargs: Any ) -> Self: ... @@ -95,13 +108,7 @@ class FacetGrid(Grid): self, template: str | None = None, row_template: str | None = None, col_template: str | None = None, **kwargs: Any ) -> Self: ... def refline( - self, - *, - x: float | None = None, - y: float | None = None, - color: str | tuple[float, float, float] = ".5", - linestyle: str = "--", - **line_kws: Any, + self, *, x: float | None = None, y: float | None = None, color: ColorType = ".5", linestyle: str = "--", **line_kws: Any ) -> Self: ... @property def axes(self) -> NDArray[Incomplete]: ... # array of `Axes` @@ -122,7 +129,7 @@ class PairGrid(Grid): hue_names: list[str] hue_vals: Series[Incomplete] hue_kws: dict[str, Any] - palette: Incomplete + palette: _RGBColorPalette def __init__( self, data: DataFrame, @@ -132,7 +139,7 @@ class PairGrid(Grid): x_vars: Iterable[str] | None = None, y_vars: Iterable[str] | None = None, hue_order: Iterable[str] | None = None, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, hue_kws: dict[str, Any] | None = None, corner: bool = False, diag_sharey: bool = True, @@ -165,7 +172,7 @@ class JointGrid(_BaseGrid): height: float = 6, ratio: float = 5, space: float = 0.2, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, dropna: bool = False, @@ -183,7 +190,7 @@ class JointGrid(_BaseGrid): y: float | None = None, joint: bool = True, marginal: bool = True, - color: str | tuple[float, float, float] = ".5", + color: ColorType = ".5", linestyle: str = "--", **line_kws: Any, ) -> Self: ... @@ -194,7 +201,7 @@ def pairplot( *, hue: str | None = None, hue_order: Iterable[str] | None = None, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, vars: Iterable[str] | None = None, x_vars: Iterable[str] | None = None, y_vars: Iterable[str] | None = None, @@ -223,8 +230,8 @@ def jointplot( dropna: bool = False, xlim: Incomplete | None = None, ylim: Incomplete | None = None, - color: str | tuple[float, float, float] | None = None, - palette: Incomplete | None = None, + color: ColorType | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, marginal_ticks: bool = False, diff --git a/stubs/seaborn/seaborn/categorical.pyi b/stubs/seaborn/seaborn/categorical.pyi index be6d4d03e7e8..dfcbc034daa6 100644 --- a/stubs/seaborn/seaborn/categorical.pyi +++ b/stubs/seaborn/seaborn/categorical.pyi @@ -1,11 +1,12 @@ from _typeshed import Incomplete -from collections.abc import Callable, Iterable +from collections.abc import Callable, Iterable, Sequence from typing import Any, TypeVar from typing_extensions import Literal import numpy as np from matplotlib.axes import Axes from matplotlib.collections import PathCollection +from matplotlib.typing import ColorType from numpy.typing import NDArray from seaborn.axisgrid import FacetGrid @@ -21,9 +22,9 @@ def boxplot( hue: Incomplete | None = None, order: Incomplete | None = None, hue_order: Incomplete | None = None, - orient: Incomplete | None = None, - color: Incomplete | None = None, - palette: Incomplete | None = None, + orient: Literal["v", "h"] | None = None, + color: ColorType | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, saturation: float = 0.75, width: float = 0.8, dodge: bool = True, @@ -50,10 +51,10 @@ def violinplot( inner: str = "box", split: bool = False, dodge: bool = True, - orient: Incomplete | None = None, + orient: Literal["v", "h"] | None = None, linewidth: Incomplete | None = None, - color: Incomplete | None = None, - palette: Incomplete | None = None, + color: ColorType | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, saturation: float = 0.75, ax: Axes | None = None, **kwargs, @@ -66,9 +67,9 @@ def boxenplot( hue: Incomplete | None = None, order: Incomplete | None = None, hue_order: Incomplete | None = None, - orient: Incomplete | None = None, - color: Incomplete | None = None, - palette: Incomplete | None = None, + orient: Literal["v", "h"] | None = None, + color: ColorType | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, saturation: float = 0.75, width: float = 0.8, dodge: bool = True, @@ -79,9 +80,9 @@ def boxenplot( trust_alpha: float = 0.05, showfliers: bool = True, ax: Axes | None = None, - box_kws: Incomplete | None = None, - flier_kws: Incomplete | None = None, - line_kws: Incomplete | None = None, + box_kws: dict[str, Any] | None = None, + flier_kws: dict[str, Any] | None = None, + line_kws: dict[str, Any] | None = None, ) -> Axes: ... def stripplot( data: Incomplete | None = None, @@ -93,11 +94,11 @@ def stripplot( hue_order: Incomplete | None = None, jitter: bool = True, dodge: bool = False, - orient: Incomplete | None = None, - color: Incomplete | None = None, - palette: Incomplete | None = None, + orient: Literal["v", "h"] | None = None, + color: ColorType | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, size: float = 5, - edgecolor: str = "gray", + edgecolor: ColorType = "gray", linewidth: float = 0, hue_norm: Incomplete | None = None, native_scale: bool = False, @@ -115,11 +116,11 @@ def swarmplot( order: Incomplete | None = None, hue_order: Incomplete | None = None, dodge: bool = False, - orient: Incomplete | None = None, - color: Incomplete | None = None, - palette: Incomplete | None = None, + orient: Literal["v", "h"] | None = None, + color: ColorType | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, size: float = 5, - edgecolor: str = "gray", + edgecolor: ColorType = "gray", linewidth: float = 0, hue_norm: Incomplete | None = None, native_scale: bool = False, @@ -142,12 +143,12 @@ def barplot( n_boot: int = 1000, units: Incomplete | None = None, seed: int | np.random.Generator | np.random.RandomState | None = None, - orient: Incomplete | None = None, - color: Incomplete | None = None, - palette: Incomplete | None = None, + orient: Literal["v", "h"] | None = None, + color: ColorType | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, saturation: float = 0.75, width: float = 0.8, - errcolor: Incomplete = ".26", + errcolor: ColorType = ".26", errwidth: float | None = None, capsize: float | None = None, dodge: bool = True, @@ -173,9 +174,9 @@ def pointplot( dodge: bool = False, join: bool = True, scale: float = 1, - orient: Incomplete | None = None, - color: Incomplete | None = None, - palette: Incomplete | None = None, + orient: Literal["v", "h"] | None = None, + color: ColorType | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, errwidth: Incomplete | None = None, ci: str = "deprecated", capsize: Incomplete | None = None, @@ -190,9 +191,9 @@ def countplot( hue: Incomplete | None = None, order: Incomplete | None = None, hue_order: Incomplete | None = None, - orient: Incomplete | None = None, - color: Incomplete | None = None, - palette: Incomplete | None = None, + orient: Literal["v", "h"] | None = None, + color: ColorType | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, saturation: float = 0.75, width: float = 0.8, dodge: bool = True, @@ -223,8 +224,8 @@ def catplot( native_scale: bool = False, formatter: Callable[..., str] | None = None, orient: Literal["v", "h"] | None = None, - color: Incomplete | None = None, - palette: Incomplete | None = None, + color: ColorType | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, hue_norm: Incomplete | None = None, legend: str | bool = "auto", legend_out: bool = True, diff --git a/stubs/seaborn/seaborn/distributions.pyi b/stubs/seaborn/seaborn/distributions.pyi index f78b384a5b68..c36cf7ee2fa9 100644 --- a/stubs/seaborn/seaborn/distributions.pyi +++ b/stubs/seaborn/seaborn/distributions.pyi @@ -1,14 +1,18 @@ from _typeshed import Incomplete -from collections.abc import Iterable +from collections.abc import Iterable, Sequence from typing import Any from typing_extensions import Literal from matplotlib.axes import Axes +from matplotlib.typing import ColorType from .axisgrid import FacetGrid __all__ = ["displot", "histplot", "kdeplot", "ecdfplot", "rugplot", "distplot"] +# The docs of these functions say that the palette argument accepts `matplotlib.colors.Colormap` +# as well but it doesn't + def histplot( data: Incomplete | None = None, *, @@ -37,10 +41,10 @@ def histplot( cbar: bool = False, cbar_ax: Axes | None = None, cbar_kws: dict[str, Any] | None = None, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, - color: Incomplete | None = None, + color: ColorType | None = None, log_scale: bool | float | tuple[bool | float, bool | float] | None = None, legend: bool = True, ax: Axes | None = None, @@ -53,10 +57,10 @@ def kdeplot( y: Incomplete | None = None, hue: Incomplete | None = None, weights: Incomplete | None = None, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, - color: Incomplete | None = None, + color: ColorType | None = None, fill: bool | None = None, multiple: Literal["layer", "stack", "fill"] = "layer", common_norm: bool = True, @@ -87,7 +91,7 @@ def ecdfplot( weights: Incomplete | None = None, stat: Literal["proportion", "count"] = "proportion", complementary: bool = False, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, log_scale: bool | float | tuple[bool | float, bool | float] | None = None, @@ -103,7 +107,7 @@ def rugplot( hue: Incomplete | None = None, height: float = 0.025, expand_margins: bool = True, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, legend: bool = True, @@ -124,10 +128,10 @@ def displot( rug_kws: dict[str, Any] | None = None, log_scale: bool | float | tuple[bool | float, bool | float] | None = None, legend: bool = True, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, - color: Incomplete | None = None, + color: ColorType | None = None, col_wrap: int | None = None, row_order: Iterable[str] | None = None, col_order: Iterable[str] | None = None, @@ -147,7 +151,7 @@ def distplot( # deprecated kde_kws: dict[str, Any] | None = None, rug_kws: dict[str, Any] | None = None, fit_kws: dict[str, Any] | None = None, - color: Incomplete | None = None, + color: ColorType | None = None, vertical: bool = False, norm_hist: bool = False, axlabel: str | Literal[False] | None = None, diff --git a/stubs/seaborn/seaborn/palettes.pyi b/stubs/seaborn/seaborn/palettes.pyi index 0206a98c166f..1a25d7649d7a 100644 --- a/stubs/seaborn/seaborn/palettes.pyi +++ b/stubs/seaborn/seaborn/palettes.pyi @@ -1,6 +1,6 @@ from collections.abc import Iterable, Sequence -from typing import TypeVar -from typing_extensions import Literal, Self +from typing import TypeVar, overload +from typing_extensions import Literal, Self, TypeAlias from matplotlib.colors import Colormap, LinearSegmentedColormap, ListedColormap from matplotlib.typing import ColorType @@ -32,27 +32,63 @@ class _ColorPalette(list[_T]): def __exit__(self, *args: object) -> None: ... def as_hex(self) -> _ColorPalette[str]: ... +_RGBColorPalette: TypeAlias = _ColorPalette[tuple[float, float, float]] +_SeabornPaletteName: TypeAlias = Literal[ + "deep", "deep6", "muted", "muted6", "pastel", "pastel6", "bright", "bright6", "dark", "dark6", "colorblind", "colorblind6" +] + +@overload +def color_palette( # type: ignore[misc] + palette: _SeabornPaletteName | None = None, n_colors: int | None = None, desat: float | None = None, *, as_cmap: Literal[True] +) -> list[str]: ... # this might be a bug in seaborn because we expect the return type to be a Colormap instance +@overload def color_palette( - palette: str | Sequence[str | tuple[float, float, float]] | None = None, + palette: str | Sequence[ColorType], n_colors: int | None = None, desat: float | None = None, *, as_cmap: Literal[True] +) -> Colormap: ... +@overload +def color_palette( + palette: str | Sequence[ColorType] | None = None, n_colors: int | None = None, desat: float | None = None, - as_cmap: bool = False, -) -> _ColorPalette[tuple[float, float, float]] | Colormap | list[str]: ... + as_cmap: Literal[False] = False, +) -> _RGBColorPalette: ... +@overload +def hls_palette( + n_colors: int = 6, h: float = 0.01, l: float = 0.6, s: float = 0.65, *, as_cmap: Literal[True] +) -> ListedColormap: ... +@overload def hls_palette( - n_colors: int = 6, h: float = 0.01, l: float = 0.6, s: float = 0.65, as_cmap: bool = False -) -> _ColorPalette[tuple[float, float, float]] | ListedColormap: ... + n_colors: int = 6, h: float = 0.01, l: float = 0.6, s: float = 0.65, as_cmap: Literal[False] = False +) -> _RGBColorPalette: ... +@overload def husl_palette( - n_colors: int = 6, h: float = 0.01, s: float = 0.9, l: float = 0.65, as_cmap: bool = False -) -> _ColorPalette[tuple[float, float, float]] | ListedColormap: ... -def mpl_palette( - name: str, n_colors: int = 6, as_cmap: bool = False -) -> _ColorPalette[tuple[float, float, float]] | LinearSegmentedColormap: ... + n_colors: int = 6, h: float = 0.01, s: float = 0.9, l: float = 0.65, *, as_cmap: Literal[True] +) -> ListedColormap: ... +@overload +def husl_palette( + n_colors: int = 6, h: float = 0.01, s: float = 0.9, l: float = 0.65, as_cmap: Literal[False] = False +) -> _RGBColorPalette: ... +@overload +def mpl_palette(name: str, n_colors: int = 6, *, as_cmap: Literal[True]) -> LinearSegmentedColormap: ... +@overload +def mpl_palette(name: str, n_colors: int = 6, as_cmap: Literal[False] = False) -> _RGBColorPalette: ... +@overload +def dark_palette( + color: ColorType, n_colors: int = 6, reverse: bool = False, *, as_cmap: Literal[True], input: str = "rgb" +) -> LinearSegmentedColormap: ... +@overload def dark_palette( - color: ColorType, n_colors: int = 6, reverse: bool = False, as_cmap: bool = False, input: str = "rgb" -) -> _ColorPalette[tuple[float, float, float]] | LinearSegmentedColormap: ... + color: ColorType, n_colors: int = 6, reverse: bool = False, as_cmap: Literal[False] = False, input: str = "rgb" +) -> _RGBColorPalette: ... +@overload +def light_palette( + color: ColorType, n_colors: int = 6, reverse: bool = False, *, as_cmap: Literal[True], input: str = "rgb" +) -> LinearSegmentedColormap: ... +@overload def light_palette( - color: ColorType, n_colors: int = 6, reverse: bool = False, as_cmap: bool = False, input: str = "rgb" -) -> _ColorPalette[tuple[float, float, float]] | LinearSegmentedColormap: ... + color: ColorType, n_colors: int = 6, reverse: bool = False, as_cmap: Literal[False] = False, input: str = "rgb" +) -> _RGBColorPalette: ... +@overload def diverging_palette( h_neg: float, h_pos: float, @@ -61,13 +97,44 @@ def diverging_palette( sep: int = 1, n: int = 6, center: Literal["light", "dark"] = "light", - as_cmap: bool = False, -) -> _ColorPalette[tuple[float, float, float]] | LinearSegmentedColormap: ... + *, + as_cmap: Literal[True], +) -> LinearSegmentedColormap: ... +@overload +def diverging_palette( + h_neg: float, + h_pos: float, + s: float = 75, + l: float = 50, + sep: int = 1, + n: int = 6, + center: Literal["light", "dark"] = "light", + as_cmap: Literal[False] = False, +) -> _RGBColorPalette: ... +@overload +def blend_palette( + colors: Iterable[ColorType], n_colors: int = 6, *, as_cmap: Literal[True], input: str = "rgb" +) -> LinearSegmentedColormap: ... +@overload def blend_palette( - colors: Iterable[ColorType], n_colors: int = 6, as_cmap: bool = False, input: str = "rgb" -) -> _ColorPalette[tuple[float, float, float]] | LinearSegmentedColormap: ... -def xkcd_palette(colors: Iterable[str]) -> _ColorPalette[tuple[float, float, float]]: ... -def crayon_palette(colors: Iterable[str]) -> _ColorPalette[tuple[float, float, float]]: ... + colors: Iterable[ColorType], n_colors: int = 6, as_cmap: Literal[False] = False, input: str = "rgb" +) -> _RGBColorPalette: ... +def xkcd_palette(colors: Iterable[str]) -> _RGBColorPalette: ... +def crayon_palette(colors: Iterable[str]) -> _RGBColorPalette: ... +@overload +def cubehelix_palette( + n_colors: int = 6, + start: float = 0, + rot: float = 0.4, + gamma: float = 1.0, + hue: float = 0.8, + light: float = 0.85, + dark: float = 0.15, + reverse: bool = False, + *, + as_cmap: Literal[True], +) -> ListedColormap: ... +@overload def cubehelix_palette( n_colors: int = 6, start: float = 0, @@ -77,6 +144,6 @@ def cubehelix_palette( light: float = 0.85, dark: float = 0.15, reverse: bool = False, - as_cmap: bool = False, -) -> _ColorPalette[tuple[float, float, float]] | ListedColormap: ... + as_cmap: Literal[False] = False, +) -> _RGBColorPalette: ... def set_color_codes(palette: str = "deep") -> None: ... diff --git a/stubs/seaborn/seaborn/rcmod.pyi b/stubs/seaborn/seaborn/rcmod.pyi index 709170d45840..3cecf9497686 100644 --- a/stubs/seaborn/seaborn/rcmod.pyi +++ b/stubs/seaborn/seaborn/rcmod.pyi @@ -1,8 +1,9 @@ -from _typeshed import Incomplete -from collections.abc import Callable +from collections.abc import Callable, Sequence from typing import Any, TypeVar from typing_extensions import Literal +from matplotlib.typing import ColorType + __all__ = [ "set_theme", "set", @@ -22,7 +23,7 @@ _F = TypeVar("_F", bound=Callable[..., Any]) def set_theme( context: Literal["paper", "notebook", "talk", "poster"] | dict[str, Any] = "notebook", style: Literal["white", "dark", "whitegrid", "darkgrid", "ticks"] | dict[str, Any] = "darkgrid", - palette: Incomplete = "deep", + palette: str | Sequence[ColorType] | None = "deep", font: str = "sans-serif", font_scale: float = 1, color_codes: bool = True, @@ -62,5 +63,5 @@ class _AxesStyle(_RCAesthetics[_KT, _VT]): ... class _PlottingContext(_RCAesthetics[_KT, _VT]): ... def set_palette( - palette: Incomplete, n_colors: int | None = None, desat: float | None = None, color_codes: bool = False + palette: str | Sequence[ColorType] | None, n_colors: int | None = None, desat: float | None = None, color_codes: bool = False ) -> None: ... diff --git a/stubs/seaborn/seaborn/regression.pyi b/stubs/seaborn/seaborn/regression.pyi index 0497e4da85e9..b2c51d34dd2b 100644 --- a/stubs/seaborn/seaborn/regression.pyi +++ b/stubs/seaborn/seaborn/regression.pyi @@ -1,11 +1,12 @@ from _typeshed import Incomplete -from collections.abc import Iterable +from collections.abc import Iterable, Sequence from typing import Any from typing_extensions import Literal import numpy as np import pandas as pd from matplotlib.axes import Axes +from matplotlib.typing import ColorType from .axisgrid import FacetGrid @@ -19,7 +20,7 @@ def lmplot( hue: str | None = None, col: str | None = None, row: str | None = None, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, col_wrap: int | None = None, height: float = 5, aspect: float = 1, @@ -80,7 +81,7 @@ def regplot( x_jitter: float | None = None, y_jitter: float | None = None, label: str | None = None, - color: Incomplete | None = None, + color: ColorType | None = None, marker: str = "o", scatter_kws: dict[str, Any] | None = None, line_kws: dict[str, Any] | None = None, @@ -98,7 +99,7 @@ def residplot( robust: bool = False, dropna: bool = True, label: str | None = None, - color: Incomplete | None = None, + color: ColorType | None = None, scatter_kws: dict[str, Any] | None = None, line_kws: dict[str, Any] | None = None, ax: Axes | None = None, diff --git a/stubs/seaborn/seaborn/relational.pyi b/stubs/seaborn/seaborn/relational.pyi index dc25dd9fe543..a03db9738e94 100644 --- a/stubs/seaborn/seaborn/relational.pyi +++ b/stubs/seaborn/seaborn/relational.pyi @@ -1,15 +1,19 @@ from _typeshed import Incomplete -from collections.abc import Callable, Iterable +from collections.abc import Callable, Iterable, Sequence from typing import Any from typing_extensions import Literal import numpy as np from matplotlib.axes import Axes +from matplotlib.typing import ColorType from .axisgrid import FacetGrid __all__ = ["relplot", "scatterplot", "lineplot"] +# The docs of these functions say that the palette argument accepts `matplotlib.colors.Colormap` +# as well but it doesn't + def lineplot( data: Incomplete | None = None, *, @@ -19,7 +23,7 @@ def lineplot( size: Incomplete | None = None, style: Incomplete | None = None, units: Incomplete | None = None, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, hue_order: Iterable[Any] | None = None, hue_norm: Incomplete | None = None, sizes: list[float] | dict[str, float] | tuple[float, float] | None = None, @@ -49,7 +53,7 @@ def scatterplot( hue: Incomplete | None = None, size: Incomplete | None = None, style: Incomplete | None = None, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, hue_order: Iterable[Any] | None = None, hue_norm: Incomplete | None = None, sizes: list[float] | dict[str, float] | tuple[float, float] | None = None, @@ -75,7 +79,7 @@ def relplot( col_wrap: int | None = None, row_order: Iterable[Any] | None = None, col_order: Iterable[Any] | None = None, - palette: Incomplete | None = None, + palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, hue_order: Iterable[Any] | None = None, hue_norm: Incomplete | None = None, sizes: list[float] | dict[str, float] | tuple[float, float] | None = None, diff --git a/stubs/seaborn/seaborn/utils.pyi b/stubs/seaborn/seaborn/utils.pyi index 8dd3729401ae..217186722dbb 100644 --- a/stubs/seaborn/seaborn/utils.pyi +++ b/stubs/seaborn/seaborn/utils.pyi @@ -1,6 +1,7 @@ from _typeshed import Incomplete, SupportsGetItem from collections.abc import Iterable, Mapping, Sequence from typing import Any, TypeVar, overload +from typing_extensions import SupportsIndex import numpy as np from matplotlib.axes import Axes @@ -46,7 +47,9 @@ def despine( trim: bool = False, ) -> None: ... def move_legend(obj: Grid | Axes | Figure, loc: str | int, **kwargs: Any) -> None: ... -def ci(a: ArrayLike, which: float | ArrayLike = 95, axis: int | tuple[int, ...] | None = None) -> Incomplete: ... +def ci( + a: float | ArrayLike, which: float | ArrayLike = 95, axis: SupportsIndex | Sequence[SupportsIndex] | None = None +) -> NDArray[np.float64]: ... def get_dataset_names() -> list[str]: ... def get_data_home(data_home: str | None = None) -> str: ... def load_dataset(name: str, cache: bool = True, data_home: str | None = None, **kws: Any) -> DataFrame: ... diff --git a/stubs/seaborn/seaborn/widgets.pyi b/stubs/seaborn/seaborn/widgets.pyi index 4a60cf540dc3..d9e1214e08da 100644 --- a/stubs/seaborn/seaborn/widgets.pyi +++ b/stubs/seaborn/seaborn/widgets.pyi @@ -1,4 +1,3 @@ -from _typeshed import Incomplete from typing import overload from typing_extensions import Literal @@ -19,32 +18,20 @@ def choose_colorbrewer_palette( @overload def choose_colorbrewer_palette( data_type: Literal["sequential", "diverging", "qualitative"], as_cmap: Literal[False] = False -) -> list[Incomplete]: ... -@overload -def choose_colorbrewer_palette( - data_type: Literal["sequential", "diverging", "qualitative"], as_cmap: bool = False -) -> LinearSegmentedColormap | list[Incomplete]: ... +) -> list[tuple[float, float, float]]: ... @overload def choose_dark_palette(input: str = "husl", *, as_cmap: Literal[True]) -> LinearSegmentedColormap: ... @overload -def choose_dark_palette(input: str = "husl", as_cmap: Literal[False] = False) -> list[Incomplete]: ... -@overload -def choose_dark_palette(input: str = "husl", as_cmap: bool = False) -> LinearSegmentedColormap | list[Incomplete]: ... +def choose_dark_palette(input: str = "husl", as_cmap: Literal[False] = False) -> list[tuple[float, float, float]]: ... @overload def choose_light_palette(input: str = "husl", *, as_cmap: Literal[True]) -> LinearSegmentedColormap: ... @overload -def choose_light_palette(input: str = "husl", as_cmap: Literal[False] = False) -> list[Incomplete]: ... -@overload -def choose_light_palette(input: str = "husl", as_cmap: bool = False) -> LinearSegmentedColormap | list[Incomplete]: ... +def choose_light_palette(input: str = "husl", as_cmap: Literal[False] = False) -> list[tuple[float, float, float]]: ... @overload def choose_diverging_palette(as_cmap: Literal[True]) -> LinearSegmentedColormap: ... @overload -def choose_diverging_palette(as_cmap: Literal[False] = False) -> list[Incomplete]: ... -@overload -def choose_diverging_palette(as_cmap: bool = False) -> LinearSegmentedColormap | list[Incomplete]: ... +def choose_diverging_palette(as_cmap: Literal[False] = False) -> list[tuple[float, float, float]]: ... @overload def choose_cubehelix_palette(as_cmap: Literal[True]) -> LinearSegmentedColormap: ... @overload -def choose_cubehelix_palette(as_cmap: Literal[False] = False) -> list[Incomplete]: ... -@overload -def choose_cubehelix_palette(as_cmap: bool = False) -> LinearSegmentedColormap | list[Incomplete]: ... +def choose_cubehelix_palette(as_cmap: Literal[False] = False) -> list[tuple[float, float, float]]: ... From 5fa2f99e46235c4d135b2e755c3cff54ebfce64a Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sun, 24 Sep 2023 18:56:14 +0100 Subject: [PATCH 05/15] Add `requires_python` --- stubs/seaborn/METADATA.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stubs/seaborn/METADATA.toml b/stubs/seaborn/METADATA.toml index 5a5519ee7bfd..160e3777f74c 100644 --- a/stubs/seaborn/METADATA.toml +++ b/stubs/seaborn/METADATA.toml @@ -1,6 +1,8 @@ version = "0.12.*" # Requires a version of numpy and matplotlib with a `py.typed` file requires = ["matplotlib>=3.8", "numpy>=1.20", "pandas-stubs"] +# matplotlib>=3.8 requires Python >=3.9 +requires_python = ">=3.9" [tool.stubtest] ignore_missing_stub = false From 445c38cfe7fc36cff3cccbd67a1d38f5181f20af Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Sun, 8 Oct 2023 11:15:11 +0200 Subject: [PATCH 06/15] Update to v0.13 --- stubs/seaborn/METADATA.toml | 2 +- stubs/seaborn/seaborn/_core/data.pyi | 13 ++ stubs/seaborn/seaborn/_core/plot.pyi | 29 +++- stubs/seaborn/seaborn/_core/scales.pyi | 12 +- stubs/seaborn/seaborn/_core/typing.pyi | 8 +- stubs/seaborn/seaborn/algorithms.pyi | 5 +- stubs/seaborn/seaborn/axisgrid.pyi | 18 +- stubs/seaborn/seaborn/categorical.pyi | 221 ++++++++++++++---------- stubs/seaborn/seaborn/distributions.pyi | 21 +-- stubs/seaborn/seaborn/regression.pyi | 10 +- stubs/seaborn/seaborn/relational.pyi | 33 ++-- stubs/seaborn/seaborn/utils.pyi | 17 +- 12 files changed, 243 insertions(+), 146 deletions(-) diff --git a/stubs/seaborn/METADATA.toml b/stubs/seaborn/METADATA.toml index 160e3777f74c..fee5a3bfc872 100644 --- a/stubs/seaborn/METADATA.toml +++ b/stubs/seaborn/METADATA.toml @@ -1,4 +1,4 @@ -version = "0.12.*" +version = "0.13.*" # Requires a version of numpy and matplotlib with a `py.typed` file requires = ["matplotlib>=3.8", "numpy>=1.20", "pandas-stubs"] # matplotlib>=3.8 requires Python >=3.9 diff --git a/stubs/seaborn/seaborn/_core/data.pyi b/stubs/seaborn/seaborn/_core/data.pyi index 9e1802fcd379..e607d5846f10 100644 --- a/stubs/seaborn/seaborn/_core/data.pyi +++ b/stubs/seaborn/seaborn/_core/data.pyi @@ -1,6 +1,13 @@ +from _typeshed import Incomplete +from collections.abc import Mapping +from typing import TypeVar, overload + from pandas import DataFrame +from pandas.core.interchange.dataframe_protocol import DataFrame as DataFrameProtocol from seaborn._core.typing import DataSource, VariableSpec +_T = TypeVar("_T", Mapping[Incomplete, Incomplete], None) + class PlotData: frame: DataFrame frames: dict[tuple[str, str], DataFrame] @@ -11,3 +18,9 @@ class PlotData: def __init__(self, data: DataSource, variables: dict[str, VariableSpec]) -> None: ... def __contains__(self, key: str) -> bool: ... def join(self, data: DataSource, variables: dict[str, VariableSpec] | None) -> PlotData: ... + +@overload +def handle_data_source(data: _T) -> _T: ... +@overload +def handle_data_source(data: DataFrameProtocol) -> DataFrame: ... +def convert_dataframe_to_pandas(data: object) -> DataFrame: ... diff --git a/stubs/seaborn/seaborn/_core/plot.pyi b/stubs/seaborn/seaborn/_core/plot.pyi index da9cd7700db1..18981477d5e9 100644 --- a/stubs/seaborn/seaborn/_core/plot.pyi +++ b/stubs/seaborn/seaborn/_core/plot.pyi @@ -1,11 +1,12 @@ import inspect import os -from _typeshed import Incomplete +from _typeshed import Incomplete, SupportsKeysAndGetItem from collections.abc import Callable, Generator from contextlib import contextmanager from typing import IO, Any, NoReturn, TypeVar -from typing_extensions import TypedDict +from typing_extensions import Literal, TypedDict +import matplotlib as mpl from matplotlib.axes import Axes from matplotlib.figure import Figure, SubFigure from seaborn._core.data import PlotData @@ -28,6 +29,7 @@ class Layer(TypedDict, total=False): vars: dict[str, VariableSpec] orient: str legend: bool + label: str | None class FacetSpec(TypedDict, total=False): variables: dict[str, VariableSpec] @@ -43,9 +45,29 @@ class PairSpec(TypedDict, total=False): @contextmanager def theme_context(params: dict[str, Any]) -> Generator[None, None, None]: ... def build_plot_signature(cls: _ClsT) -> _ClsT: ... # -> _ClsT & "__signature__ protocol" + +class ThemeConfig(mpl.RcParams): + THEME_GROUPS: list[str] + def __init__(self) -> None: ... + def reset(self) -> None: ... + def update(self, __other: SupportsKeysAndGetItem[Incomplete, Incomplete] | None = None, **kwds: Incomplete) -> None: ... # type: ignore[override] + +class DisplayConfig(TypedDict): + format: Literal["png", "svg"] + scaling: float + hidpi: bool + +class PlotConfig: + def __init__(self) -> None: ... + @property + def theme(self) -> dict[str, Any]: ... + @property + def display(self) -> DisplayConfig: ... + @build_plot_signature class Plot: __signature__: inspect.Signature + config: PlotConfig def __init__(self, *args: DataSource | VariableSpec, data: DataSource = None, **variables: VariableSpec) -> None: ... def __add__(self, other) -> NoReturn: ... def on(self, target: Axes | SubFigure | Figure) -> Plot: ... @@ -55,6 +77,7 @@ class Plot: *transforms: Stat | Move, orient: str | None = None, legend: bool = True, + label: str | None = None, data: DataSource = None, **variables: VariableSpec, ) -> Plot: ... @@ -71,7 +94,7 @@ class Plot: def scale(self, **scales: Scale) -> Plot: ... def share(self, **shares: bool | str) -> Plot: ... def limit(self, **limits: tuple[Any, Any]) -> Plot: ... - def label(self, *, title: Incomplete | None = None, **variables: str | Callable[[str], str]) -> Plot: ... + def label(self, *, title: str | None = None, legend: str | None = None, **variables: str | Callable[[str], str]) -> Plot: ... def layout(self, *, size: tuple[float, float] | Default = ..., engine: str | None | Default = ...) -> Plot: ... def theme(self, *args: dict[str, Any]) -> Plot: ... def save(self, loc: str | os.PathLike[Any] | IO[Any], **kwargs) -> Plot: ... diff --git a/stubs/seaborn/seaborn/_core/scales.pyi b/stubs/seaborn/seaborn/_core/scales.pyi index b5729b9ed344..7147ac5a1ff1 100644 --- a/stubs/seaborn/seaborn/_core/scales.pyi +++ b/stubs/seaborn/seaborn/_core/scales.pyi @@ -16,7 +16,7 @@ TransFuncs: TypeAlias = tuple[Callable[[ArrayLike], ArrayLike], Callable[[ArrayL Pipeline: TypeAlias = Sequence[Callable[[Any], Any] | None] class Scale: - values: tuple[Incomplete] | str | list[Incomplete] | dict[Incomplete, Incomplete] | None + values: tuple[Incomplete, ...] | str | list[Incomplete] | dict[Incomplete, Incomplete] | None def __post_init__(self) -> None: ... def tick(self) -> Self: ... def label(self) -> Self: ... @@ -24,13 +24,13 @@ class Scale: @dataclass class Boolean(Scale): - values: tuple[Incomplete] | list[Incomplete] | dict[Incomplete, Incomplete] | None = None + values: tuple[Incomplete, ...] | list[Incomplete] | dict[Incomplete, Incomplete] | None = None def tick(self, locator: Locator | None = None) -> Self: ... # type: ignore[override] def label(self, formatter: Formatter | None = None) -> Self: ... # type: ignore[override] @dataclass class Nominal(Scale): - values: tuple[Incomplete] | str | list[Incomplete] | dict[Incomplete, Incomplete] | None = None + values: tuple[Incomplete, ...] | str | list[Incomplete] | dict[Incomplete, Incomplete] | None = None order: list[Incomplete] | None = None def tick(self, locator: Locator | None = None) -> Self: ... # type: ignore[override] def label(self, formatter: Formatter | None = None) -> Self: ... # type: ignore[override] @@ -43,12 +43,12 @@ class Discrete(Scale): ... @dataclass class ContinuousBase(Scale): - values: tuple[Incomplete] | str | None = None - norm: tuple[Incomplete] | None = None + values: tuple[Incomplete, ...] | str | None = None + norm: tuple[Incomplete, ...] | None = None @dataclass class Continuous(ContinuousBase): - values: tuple[Incomplete] | str | None = None + values: tuple[Incomplete, ...] | str | None = None trans: str | TransFuncs | None = None def tick( # type: ignore[override] self, diff --git a/stubs/seaborn/seaborn/_core/typing.pyi b/stubs/seaborn/seaborn/_core/typing.pyi index 45671301f0d5..3e3404b806ca 100644 --- a/stubs/seaborn/seaborn/_core/typing.pyi +++ b/stubs/seaborn/seaborn/_core/typing.pyi @@ -1,18 +1,18 @@ from _typeshed import Incomplete -from collections.abc import Hashable, Iterable, Mapping +from collections.abc import Iterable from datetime import date, datetime, timedelta from typing import Any from typing_extensions import TypeAlias from matplotlib.colors import Colormap, Normalize from numpy import ndarray -from pandas import DataFrame, Index, Series, Timedelta, Timestamp +from pandas import Index, Series, Timedelta, Timestamp ColumnName: TypeAlias = str | bytes | date | datetime | timedelta | bool | complex | Timestamp | Timedelta Vector: TypeAlias = Series[Any] | Index[Any] | ndarray[Any, Any] VariableSpec: TypeAlias = ColumnName | Vector | None VariableSpecList: TypeAlias = list[VariableSpec] | Index[Any] | None -DataSource: TypeAlias = DataFrame | Mapping[Hashable, Vector] | None +DataSource: TypeAlias = Incomplete OrderSpec: TypeAlias = Iterable[str] | None NormSpec: TypeAlias = tuple[float | None, float | None] | Normalize | None PaletteSpec: TypeAlias = str | list[Incomplete] | dict[Incomplete, Incomplete] | Colormap | None @@ -20,5 +20,7 @@ DiscreteValueSpec: TypeAlias = dict[Incomplete, Incomplete] | list[Incomplete] | ContinuousValueSpec: TypeAlias = tuple[float, float] | list[float] | dict[Any, float] | None class Default: ... +class Deprecated: ... default: Default +deprecated: Deprecated diff --git a/stubs/seaborn/seaborn/algorithms.pyi b/stubs/seaborn/seaborn/algorithms.pyi index e73df5b42921..8e431a39f308 100644 --- a/stubs/seaborn/seaborn/algorithms.pyi +++ b/stubs/seaborn/seaborn/algorithms.pyi @@ -1,14 +1,15 @@ from collections.abc import Callable from typing import Any -import numpy as np from numpy.typing import ArrayLike, NDArray +from .utils import _Seed + def bootstrap( *args: ArrayLike, n_boot: int = 10000, func: str | Callable[..., Any] = "mean", axis: int | None = None, units: ArrayLike | None = None, - seed: int | np.random.Generator | np.random.RandomState | None = None, + seed: _Seed | None = None, ) -> NDArray[Any]: ... diff --git a/stubs/seaborn/seaborn/axisgrid.pyi b/stubs/seaborn/seaborn/axisgrid.pyi index 6a5aa250eef3..75b48d58aa60 100644 --- a/stubs/seaborn/seaborn/axisgrid.pyi +++ b/stubs/seaborn/seaborn/axisgrid.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -from collections.abc import Callable, Generator, Iterable, Mapping, Sequence +from collections.abc import Callable, Generator, Iterable, Mapping from typing import Any, TypeVar from typing_extensions import Concatenate, Literal, ParamSpec, Self @@ -11,7 +11,9 @@ from matplotlib.text import Text from matplotlib.typing import ColorType from numpy.typing import NDArray from pandas import DataFrame, Series -from seaborn.palettes import _RGBColorPalette + +from .palettes import _RGBColorPalette +from .utils import _Palette __all__ = ["FacetGrid", "PairGrid", "JointGrid", "pairplot", "jointplot"] @@ -19,7 +21,7 @@ _P = ParamSpec("_P") _R = TypeVar("_R") class _BaseGrid: - def set(self, **kwargs: Any) -> Self: ... + def set(self, **kwargs: Incomplete) -> Self: ... # **kwargs are passed to `matplotlib.axes.Axes.set` @property def fig(self) -> Figure: ... @property @@ -67,7 +69,7 @@ class FacetGrid(Grid): sharey: bool | Literal["col", "row"] = True, height: float = 3, aspect: float = 1, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, row_order: Iterable[Any] | None = None, col_order: Iterable[Any] | None = None, hue_order: Iterable[Any] | None = None, @@ -139,7 +141,7 @@ class PairGrid(Grid): x_vars: Iterable[str] | None = None, y_vars: Iterable[str] | None = None, hue_order: Iterable[str] | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, hue_kws: dict[str, Any] | None = None, corner: bool = False, diag_sharey: bool = True, @@ -172,7 +174,7 @@ class JointGrid(_BaseGrid): height: float = 6, ratio: float = 5, space: float = 0.2, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, dropna: bool = False, @@ -201,7 +203,7 @@ def pairplot( *, hue: str | None = None, hue_order: Iterable[str] | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, vars: Iterable[str] | None = None, x_vars: Iterable[str] | None = None, y_vars: Iterable[str] | None = None, @@ -231,7 +233,7 @@ def jointplot( xlim: Incomplete | None = None, ylim: Incomplete | None = None, color: ColorType | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, marginal_ticks: bool = False, diff --git a/stubs/seaborn/seaborn/categorical.pyi b/stubs/seaborn/seaborn/categorical.pyi index dfcbc034daa6..cb97071feba1 100644 --- a/stubs/seaborn/seaborn/categorical.pyi +++ b/stubs/seaborn/seaborn/categorical.pyi @@ -1,18 +1,16 @@ from _typeshed import Incomplete -from collections.abc import Callable, Iterable, Sequence -from typing import Any, TypeVar +from collections.abc import Callable, Iterable +from typing import Any from typing_extensions import Literal -import numpy as np from matplotlib.axes import Axes -from matplotlib.collections import PathCollection from matplotlib.typing import ColorType -from numpy.typing import NDArray -from seaborn.axisgrid import FacetGrid -__all__ = ["catplot", "stripplot", "swarmplot", "boxplot", "violinplot", "boxenplot", "pointplot", "barplot", "countplot"] +from ._core.typing import Default +from .axisgrid import FacetGrid +from .utils import _ErrorBar, _Estimator, _Legend, _LogScale, _Palette, _Seed -_T = TypeVar("_T") +__all__ = ["catplot", "stripplot", "swarmplot", "boxplot", "violinplot", "boxenplot", "pointplot", "barplot", "countplot"] def boxplot( data: Incomplete | None = None, @@ -22,16 +20,24 @@ def boxplot( hue: Incomplete | None = None, order: Incomplete | None = None, hue_order: Incomplete | None = None, - orient: Literal["v", "h"] | None = None, + orient: Literal["v", "h", "x", "h"] | None = None, color: ColorType | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, saturation: float = 0.75, + fill: bool = True, + dodge: bool | Literal["auto"] = "auto", width: float = 0.8, - dodge: bool = True, - fliersize: float = 5, - linewidth: Incomplete | None = None, + gap: float = 0, whis: float = 1.5, + linecolor: ColorType = "auto", + linewidth: float | None = None, + fliersize: float | None = None, ax: Axes | None = None, + hue_norm: Incomplete | None = None, + native_scale: bool = False, + log_scale: _LogScale | None = None, + formatter: Callable[..., str] | None = None, + legend: _Legend = "auto", **kwargs, ) -> Axes: ... def violinplot( @@ -42,20 +48,33 @@ def violinplot( hue: Incomplete | None = None, order: Incomplete | None = None, hue_order: Incomplete | None = None, - bw: str = "scott", - cut: int = 2, - scale: str = "area", - scale_hue: bool = True, - gridsize: int = 100, - width: float = 0.8, - inner: str = "box", - split: bool = False, - dodge: bool = True, - orient: Literal["v", "h"] | None = None, - linewidth: Incomplete | None = None, + orient: Literal["v", "h", "x", "h"] | None = None, color: ColorType | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, saturation: float = 0.75, + fill: bool = True, + inner: str = "box", + split: bool = False, + width: float = 0.8, + dodge: bool | Literal["auto"] = "auto", + gap: float = 0, + linewidth: float | None = None, + linecolor: ColorType = "auto", + cut: float = 2, + gridsize: int = 100, + bw_method: str | float = "scott", + bw_adjust: float = 1, + density_norm: Literal["area", "count", "width"] = "area", + common_norm: bool | None = False, + hue_norm: Incomplete | None = None, + formatter: Callable[..., str] | None = None, + log_scale: _LogScale | None = None, + native_scale: bool = False, + legend: _Legend = "auto", + scale: Incomplete = ..., # deprecated + scale_hue: Incomplete = ..., # deprecated + bw: Incomplete = ..., # deprecated + inner_kws: dict[str, Any] | None = None, ax: Axes | None = None, **kwargs, ) -> Axes: ... @@ -67,22 +86,31 @@ def boxenplot( hue: Incomplete | None = None, order: Incomplete | None = None, hue_order: Incomplete | None = None, - orient: Literal["v", "h"] | None = None, + orient: Literal["v", "h", "x", "h"] | None = None, color: ColorType | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, saturation: float = 0.75, + fill: bool = True, + dodge: bool | Literal["auto"] = "auto", width: float = 0.8, - dodge: bool = True, - k_depth: str = "tukey", - linewidth: Incomplete | None = None, - scale: str = "exponential", + gap: float = 0, + linewidth: float | None = None, + linecolor: ColorType | None = None, + width_method: Literal["exponential", "linear", "area"] = "exponential", + k_depth: Literal["tukey", "proportion", "trustworthy", "full"] | int = "tukey", outlier_prop: float = 0.007, trust_alpha: float = 0.05, showfliers: bool = True, - ax: Axes | None = None, + hue_norm: Incomplete | None = None, + log_scale: _LogScale | None = None, + native_scale: bool = False, + formatter: Callable[..., str] | None = None, + legend: _Legend = "auto", + scale: Incomplete = ..., # deprecated box_kws: dict[str, Any] | None = None, flier_kws: dict[str, Any] | None = None, line_kws: dict[str, Any] | None = None, + ax: Axes | None = None, ) -> Axes: ... def stripplot( data: Incomplete | None = None, @@ -94,16 +122,17 @@ def stripplot( hue_order: Incomplete | None = None, jitter: bool = True, dodge: bool = False, - orient: Literal["v", "h"] | None = None, + orient: Literal["v", "h", "x", "h"] | None = None, color: ColorType | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, size: float = 5, - edgecolor: ColorType = "gray", + edgecolor: ColorType | Default = ..., linewidth: float = 0, hue_norm: Incomplete | None = None, + log_scale: _LogScale | None = None, native_scale: bool = False, - formatter: Incomplete | None = None, - legend: str = "auto", + formatter: Callable[..., str] | None = None, + legend: _Legend = "auto", ax: Axes | None = None, **kwargs, ) -> Axes: ... @@ -116,16 +145,17 @@ def swarmplot( order: Incomplete | None = None, hue_order: Incomplete | None = None, dodge: bool = False, - orient: Literal["v", "h"] | None = None, + orient: Literal["v", "h", "x", "h"] | None = None, color: ColorType | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, size: float = 5, - edgecolor: ColorType = "gray", + edgecolor: ColorType | None = None, linewidth: float = 0, hue_norm: Incomplete | None = None, + log_scale: _LogScale | None = None, native_scale: bool = False, - formatter: Incomplete | None = None, - legend: str = "auto", + formatter: Callable[..., str] | None = None, + legend: _Legend = "auto", warn_thresh: float = 0.05, ax: Axes | None = None, **kwargs, @@ -138,21 +168,29 @@ def barplot( hue: Incomplete | None = None, order: Iterable[str] | None = None, hue_order: Iterable[str] | None = None, - estimator: str | Callable[..., Incomplete] = "mean", - errorbar: str | tuple[str, float] | Callable[[Iterable[float]], tuple[float, float]] | None = ("ci", 95), + estimator: _Estimator = "mean", + errorbar: _ErrorBar | None = ("ci", 95), n_boot: int = 1000, units: Incomplete | None = None, - seed: int | np.random.Generator | np.random.RandomState | None = None, - orient: Literal["v", "h"] | None = None, + seed: _Seed | None = None, + orient: Literal["v", "h", "x", "h"] | None = None, color: ColorType | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, saturation: float = 0.75, + fill: bool = True, + hue_norm: Incomplete | None = None, width: float = 0.8, - errcolor: ColorType = ".26", - errwidth: float | None = None, - capsize: float | None = None, - dodge: bool = True, - ci: str = "deprecated", + dodge: bool | Literal["auto"] = "auto", + gap: float = 0, + log_scale: _LogScale | None = None, + native_scale: bool = False, + formatter: Callable[..., str] | None = None, + legend: _Legend = "auto", + capsize: float = 0, + err_kws: dict[str, Any] | None = None, + ci: Incomplete = ..., # deprecated + errcolor: Incomplete = ..., # deprecated + errwidth: Incomplete = ..., # deprecated ax: Axes | None = None, **kwargs: Any, ) -> Axes: ... @@ -164,24 +202,30 @@ def pointplot( hue: Incomplete | None = None, order: Incomplete | None = None, hue_order: Incomplete | None = None, - estimator: str | Callable[..., Incomplete] = "mean", - errorbar: str | tuple[str, float] | Callable[[Iterable[float]], tuple[float, float]] | None = ("ci", 95), + estimator: _Estimator = "mean", + errorbar: _ErrorBar | None = ("ci", 95), n_boot: int = 1000, units: Incomplete | None = None, - seed: int | np.random.Generator | np.random.RandomState | None = None, - markers: str = "o", - linestyles: str = "-", - dodge: bool = False, - join: bool = True, - scale: float = 1, - orient: Literal["v", "h"] | None = None, + seed: _Seed | None = None, color: ColorType | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, - errwidth: Incomplete | None = None, - ci: str = "deprecated", - capsize: Incomplete | None = None, - label: Incomplete | None = None, + palette: _Palette | None = None, + hue_norm: Incomplete | None = None, + markers: str | Incomplete = ..., # string or list of strings + linestyles: str | Incomplete = ..., # string or list of strings + dodge: bool = False, + log_scale: _LogScale | None = None, + native_scale: bool = False, + orient: Literal["v", "h", "x", "h"] | None = None, + capsize: float = 0, + formatter: Callable[..., str] | None = None, + legend: _Legend = "auto", + err_kws: dict[str, Any] | None = None, + ci: Incomplete = ..., # deprecated + errwidth: Incomplete = ..., # deprecated + join: Incomplete = ..., # deprecated + scale: Incomplete = ..., # deprecated ax: Axes | None = None, + **kwargs, ) -> Axes: ... def countplot( data: Incomplete | None = None, @@ -191,12 +235,20 @@ def countplot( hue: Incomplete | None = None, order: Incomplete | None = None, hue_order: Incomplete | None = None, - orient: Literal["v", "h"] | None = None, + orient: Literal["v", "h", "x", "h"] | None = None, color: ColorType | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, saturation: float = 0.75, + fill: bool = True, + hue_norm: Incomplete | None = None, + stat: Literal["count", "percent", "proportion", "probability"] = "count", width: float = 0.8, - dodge: bool = True, + dodge: bool | Literal["auto"] = "auto", + gap: float = 0, + log_scale: _LogScale | None = None, + native_scale: bool = False, + formatter: Callable[..., str] | None = None, + legend: _Legend = "auto", ax: Axes | None = None, **kwargs, ) -> Axes: ... @@ -208,43 +260,32 @@ def catplot( hue: Incomplete | None = None, row: Incomplete | None = None, col: Incomplete | None = None, - col_wrap: int | None = None, - estimator: str | Callable[..., Incomplete] = "mean", - errorbar: str | tuple[str, float] | Callable[[Iterable[float]], tuple[float, float]] | None = ("ci", 95), + kind: Literal["strip", "swarm", "box", "violin", "boxen", "point", "bar", "count"] = "strip", + estimator: _Estimator = "mean", + errorbar: _ErrorBar | None = ("ci", 95), n_boot: int = 1000, units: Incomplete | None = None, - seed: int | np.random.Generator | np.random.RandomState | None = None, + seed: _Seed | None = None, order: Iterable[str] | None = None, hue_order: Iterable[str] | None = None, row_order: Iterable[str] | None = None, col_order: Iterable[str] | None = None, + col_wrap: int | None = None, height: float = 5, aspect: float = 1, - kind: str = "strip", + log_scale: _LogScale | None = None, native_scale: bool = False, formatter: Callable[..., str] | None = None, - orient: Literal["v", "h"] | None = None, + orient: Literal["v", "h", "x", "h"] | None = None, color: ColorType | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, hue_norm: Incomplete | None = None, - legend: str | bool = "auto", + legend: _Legend = "auto", legend_out: bool = True, sharex: bool = True, sharey: bool = True, margin_titles: bool = False, facet_kws: dict[str, Any] | None = None, - ci: str = "deprecated", + ci: Incomplete = ..., # deprecated **kwargs, ) -> FacetGrid: ... - -class Beeswarm: - orient: Literal["v", "h"] - width: float - warn_thresh: float - def __init__(self, orient: str = "v", width: float = 0.8, warn_thresh: float = 0.05) -> None: ... - def __call__(self, points: PathCollection, center: float) -> None: ... - def beeswarm(self, orig_xyr) -> NDArray[np.float64]: ... - def could_overlap(self, xyr_i, swarm) -> NDArray[np.float64]: ... - def position_candidates(self, xyr_i, neighbors) -> NDArray[np.float64]: ... - def first_non_overlapping_candidate(self, candidates, neighbors) -> Incomplete: ... - def add_gutters(self, points: _T, center: float, log_scale: bool = False) -> _T: ... diff --git a/stubs/seaborn/seaborn/distributions.pyi b/stubs/seaborn/seaborn/distributions.pyi index c36cf7ee2fa9..9eee64620176 100644 --- a/stubs/seaborn/seaborn/distributions.pyi +++ b/stubs/seaborn/seaborn/distributions.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -from collections.abc import Iterable, Sequence +from collections.abc import Iterable from typing import Any from typing_extensions import Literal @@ -7,6 +7,7 @@ from matplotlib.axes import Axes from matplotlib.typing import ColorType from .axisgrid import FacetGrid +from .utils import _LogScale, _Palette __all__ = ["displot", "histplot", "kdeplot", "ecdfplot", "rugplot", "distplot"] @@ -41,11 +42,11 @@ def histplot( cbar: bool = False, cbar_ax: Axes | None = None, cbar_kws: dict[str, Any] | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, color: ColorType | None = None, - log_scale: bool | float | tuple[bool | float, bool | float] | None = None, + log_scale: _LogScale | None = None, legend: bool = True, ax: Axes | None = None, **kwargs: Any, @@ -57,7 +58,7 @@ def kdeplot( y: Incomplete | None = None, hue: Incomplete | None = None, weights: Incomplete | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, color: ColorType | None = None, @@ -69,7 +70,7 @@ def kdeplot( bw_method: str = "scott", bw_adjust: float = 1, warn_singular: bool = True, - log_scale: bool | float | tuple[bool | float, bool | float] | None = None, + log_scale: _LogScale | None = None, levels: int | Iterable[int] = 10, thresh: float = 0.05, gridsize: int = 200, @@ -91,10 +92,10 @@ def ecdfplot( weights: Incomplete | None = None, stat: Literal["proportion", "count"] = "proportion", complementary: bool = False, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, - log_scale: bool | float | tuple[bool | float, bool | float] | None = None, + log_scale: _LogScale | None = None, legend: bool = True, ax: Axes | None = None, **kwargs: Any, @@ -107,7 +108,7 @@ def rugplot( hue: Incomplete | None = None, height: float = 0.025, expand_margins: bool = True, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, legend: bool = True, @@ -126,9 +127,9 @@ def displot( kind: Literal["hist", "kde", "ecdf"] = "hist", rug: bool = False, rug_kws: dict[str, Any] | None = None, - log_scale: bool | float | tuple[bool | float, bool | float] | None = None, + log_scale: _LogScale | None = None, legend: bool = True, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, color: ColorType | None = None, diff --git a/stubs/seaborn/seaborn/regression.pyi b/stubs/seaborn/seaborn/regression.pyi index b2c51d34dd2b..8b8eb9f1335e 100644 --- a/stubs/seaborn/seaborn/regression.pyi +++ b/stubs/seaborn/seaborn/regression.pyi @@ -1,14 +1,14 @@ from _typeshed import Incomplete -from collections.abc import Iterable, Sequence +from collections.abc import Iterable from typing import Any from typing_extensions import Literal -import numpy as np import pandas as pd from matplotlib.axes import Axes from matplotlib.typing import ColorType from .axisgrid import FacetGrid +from .utils import _Palette, _Seed __all__ = ["lmplot", "regplot", "residplot"] @@ -20,7 +20,7 @@ def lmplot( hue: str | None = None, col: str | None = None, row: str | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, col_wrap: int | None = None, height: float = 5, aspect: float = 1, @@ -40,7 +40,7 @@ def lmplot( ci: int | None = 95, n_boot: int = 1000, units: str | None = None, - seed: int | np.random.Generator | np.random.RandomState | None = None, + seed: _Seed | None = None, order: int = 1, logistic: bool = False, lowess: bool = False, @@ -68,7 +68,7 @@ def regplot( ci: int | None = 95, n_boot: int = 1000, units: str | None = None, - seed: int | np.random.Generator | np.random.RandomState | None = None, + seed: _Seed | None = None, order: int = 1, logistic: bool = False, lowess: bool = False, diff --git a/stubs/seaborn/seaborn/relational.pyi b/stubs/seaborn/seaborn/relational.pyi index a03db9738e94..32ed657d482a 100644 --- a/stubs/seaborn/seaborn/relational.pyi +++ b/stubs/seaborn/seaborn/relational.pyi @@ -1,16 +1,17 @@ from _typeshed import Incomplete -from collections.abc import Callable, Iterable, Sequence +from collections.abc import Iterable from typing import Any -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias -import numpy as np from matplotlib.axes import Axes -from matplotlib.typing import ColorType from .axisgrid import FacetGrid +from .utils import _ErrorBar, _Estimator, _Legend, _Palette, _Seed __all__ = ["relplot", "scatterplot", "lineplot"] +_Sizes: TypeAlias = list[float] | dict[str, float] | tuple[float, float] + # The docs of these functions say that the palette argument accepts `matplotlib.colors.Colormap` # as well but it doesn't @@ -23,24 +24,24 @@ def lineplot( size: Incomplete | None = None, style: Incomplete | None = None, units: Incomplete | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, hue_order: Iterable[Any] | None = None, hue_norm: Incomplete | None = None, - sizes: list[float] | dict[str, float] | tuple[float, float] | None = None, + sizes: _Sizes | None = None, size_order: Iterable[Any] | None = None, size_norm: Incomplete | None = None, dashes: bool | list[Incomplete] | dict[str, Incomplete] = True, markers: Incomplete | None = None, style_order: Iterable[Any] | None = None, - estimator: str | Callable[..., Incomplete] | None = "mean", - errorbar: str | tuple[str, float] | Callable[[Iterable[float]], tuple[float, float]] | None = ("ci", 95), + estimator: _Estimator | None = "mean", + errorbar: _ErrorBar | None = ("ci", 95), n_boot: int = 1000, - seed: int | np.random.Generator | np.random.RandomState | None = None, + seed: _Seed | None = None, orient: Literal["x", "y"] = "x", sort: bool = True, err_style: Literal["band", "bars"] = "band", err_kws: dict[str, Any] | None = None, - legend: Literal["auto", "brief", "full"] | bool = "auto", + legend: _Legend = "auto", ci: str | int | None = "deprecated", # deprecated ax: Axes | None = None, **kwargs: Any, @@ -53,15 +54,15 @@ def scatterplot( hue: Incomplete | None = None, size: Incomplete | None = None, style: Incomplete | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, hue_order: Iterable[Any] | None = None, hue_norm: Incomplete | None = None, - sizes: list[float] | dict[str, float] | tuple[float, float] | None = None, + sizes: _Sizes | None = None, size_order: Iterable[Any] | None = None, size_norm: Incomplete | None = None, markers: Incomplete = True, style_order: Iterable[Any] | None = None, - legend: Literal["auto", "brief", "full"] | bool = "auto", + legend: _Legend = "auto", ax: Axes | None = None, **kwargs: Any, ) -> Axes: ... @@ -79,16 +80,16 @@ def relplot( col_wrap: int | None = None, row_order: Iterable[Any] | None = None, col_order: Iterable[Any] | None = None, - palette: str | Sequence[ColorType] | dict[Incomplete, ColorType] | None = None, + palette: _Palette | None = None, hue_order: Iterable[Any] | None = None, hue_norm: Incomplete | None = None, - sizes: list[float] | dict[str, float] | tuple[float, float] | None = None, + sizes: _Sizes | None = None, size_order: Iterable[Any] | None = None, size_norm: Incomplete | None = None, markers: Incomplete | None = None, dashes: Incomplete | None = None, style_order: Iterable[Any] | None = None, - legend: Literal["auto", "brief", "full"] | bool = "auto", + legend: _Legend = "auto", kind: Literal["scatter", "line"] = "scatter", height: float = 5, aspect: float = 1, diff --git a/stubs/seaborn/seaborn/utils.pyi b/stubs/seaborn/seaborn/utils.pyi index 217186722dbb..bb6378522c3c 100644 --- a/stubs/seaborn/seaborn/utils.pyi +++ b/stubs/seaborn/seaborn/utils.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete, SupportsGetItem -from collections.abc import Iterable, Mapping, Sequence +from collections.abc import Callable, Iterable, Mapping, Sequence from typing import Any, TypeVar, overload -from typing_extensions import SupportsIndex +from typing_extensions import Literal, SupportsIndex, TypeAlias import numpy as np from matplotlib.axes import Axes @@ -27,6 +27,17 @@ __all__ = [ _VectorT = TypeVar("_VectorT", bound=SupportsGetItem[Any, Any]) +# Type aliases used heavily throughout seaborn +_ErrorBar: TypeAlias = str | tuple[str, float] | Callable[[Iterable[float]], tuple[float, float]] # noqa: Y047 +_Estimator: TypeAlias = str | Callable[..., Incomplete] # noqa: Y047 +_Legend: TypeAlias = Literal["auto", "brief", "full"] | bool # noqa: Y047 +_LogScale: TypeAlias = bool | float | tuple[bool | float, bool | float] # noqa: Y047 +_Palette: TypeAlias = str | Sequence[ColorType] | dict[Incomplete, ColorType] # noqa: Y047 +_Seed: TypeAlias = int | np.random.Generator | np.random.RandomState # noqa: Y047 + +DATASET_SOURCE: str +DATASET_NAMES_URL: str + def ci_to_errsize(cis: ArrayLike, heights: ArrayLike) -> NDArray[np.float64]: ... def desaturate(color: ColorType, prop: float) -> tuple[float, float, float]: ... def saturate(color: ColorType) -> tuple[float, float, float]: ... @@ -36,6 +47,8 @@ def set_hls_values( def axlabel(xlabel: str, ylabel: str, **kwargs: Any) -> None: ... # deprecated def remove_na(vector: _VectorT) -> _VectorT: ... def get_color_cycle() -> list[str]: ... + +# Please modify `seaborn.axisgrid.FacetGrid.despine` when modifying despine here. def despine( fig: Figure | None = None, ax: Axes | None = None, From f2402079133c2427d0f254ff186916e3db6cfdd8 Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Sun, 8 Oct 2023 11:26:33 +0200 Subject: [PATCH 07/15] Now without type ignores --- stubs/seaborn/seaborn/_core/scales.pyi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/stubs/seaborn/seaborn/_core/scales.pyi b/stubs/seaborn/seaborn/_core/scales.pyi index 7147ac5a1ff1..62a15cb9a095 100644 --- a/stubs/seaborn/seaborn/_core/scales.pyi +++ b/stubs/seaborn/seaborn/_core/scales.pyi @@ -25,15 +25,15 @@ class Scale: @dataclass class Boolean(Scale): values: tuple[Incomplete, ...] | list[Incomplete] | dict[Incomplete, Incomplete] | None = None - def tick(self, locator: Locator | None = None) -> Self: ... # type: ignore[override] - def label(self, formatter: Formatter | None = None) -> Self: ... # type: ignore[override] + def tick(self, locator: Locator | None = None) -> Self: ... + def label(self, formatter: Formatter | None = None) -> Self: ... @dataclass class Nominal(Scale): values: tuple[Incomplete, ...] | str | list[Incomplete] | dict[Incomplete, Incomplete] | None = None order: list[Incomplete] | None = None - def tick(self, locator: Locator | None = None) -> Self: ... # type: ignore[override] - def label(self, formatter: Formatter | None = None) -> Self: ... # type: ignore[override] + def tick(self, locator: Locator | None = None) -> Self: ... + def label(self, formatter: Formatter | None = None) -> Self: ... @dataclass class Ordinal(Scale): ... @@ -50,7 +50,7 @@ class ContinuousBase(Scale): class Continuous(ContinuousBase): values: tuple[Incomplete, ...] | str | None = None trans: str | TransFuncs | None = None - def tick( # type: ignore[override] + def tick( self, locator: Locator | None = None, *, @@ -61,7 +61,7 @@ class Continuous(ContinuousBase): between: tuple[float, float] | None = None, minor: int | None = None, ) -> Self: ... - def label( # type: ignore[override] + def label( self, formatter: Formatter | None = None, *, @@ -73,8 +73,8 @@ class Continuous(ContinuousBase): @dataclass class Temporal(ContinuousBase): trans: ClassVar[Incomplete] # not sure it is a classvar but the runtime has no annotation so it is not a dataclass field - def tick(self, locator: Locator | None = None, *, upto: int | None = None) -> Self: ... # type: ignore[override] - def label(self, formatter: Formatter | None = None, *, concise: bool = False) -> Self: ... # type: ignore[override] + def tick(self, locator: Locator | None = None, *, upto: int | None = None) -> Self: ... + def label(self, formatter: Formatter | None = None, *, concise: bool = False) -> Self: ... class PseudoAxis: axis_name: str From 2f97d1f8e029f274035a26a80ecd1a40d530c85a Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Sun, 8 Oct 2023 11:46:01 +0200 Subject: [PATCH 08/15] typo --- stubs/seaborn/seaborn/categorical.pyi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/stubs/seaborn/seaborn/categorical.pyi b/stubs/seaborn/seaborn/categorical.pyi index cb97071feba1..a6299f2b7ee0 100644 --- a/stubs/seaborn/seaborn/categorical.pyi +++ b/stubs/seaborn/seaborn/categorical.pyi @@ -20,7 +20,7 @@ def boxplot( hue: Incomplete | None = None, order: Incomplete | None = None, hue_order: Incomplete | None = None, - orient: Literal["v", "h", "x", "h"] | None = None, + orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, saturation: float = 0.75, @@ -48,7 +48,7 @@ def violinplot( hue: Incomplete | None = None, order: Incomplete | None = None, hue_order: Incomplete | None = None, - orient: Literal["v", "h", "x", "h"] | None = None, + orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, saturation: float = 0.75, @@ -86,7 +86,7 @@ def boxenplot( hue: Incomplete | None = None, order: Incomplete | None = None, hue_order: Incomplete | None = None, - orient: Literal["v", "h", "x", "h"] | None = None, + orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, saturation: float = 0.75, @@ -122,7 +122,7 @@ def stripplot( hue_order: Incomplete | None = None, jitter: bool = True, dodge: bool = False, - orient: Literal["v", "h", "x", "h"] | None = None, + orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, size: float = 5, @@ -145,7 +145,7 @@ def swarmplot( order: Incomplete | None = None, hue_order: Incomplete | None = None, dodge: bool = False, - orient: Literal["v", "h", "x", "h"] | None = None, + orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, size: float = 5, @@ -173,7 +173,7 @@ def barplot( n_boot: int = 1000, units: Incomplete | None = None, seed: _Seed | None = None, - orient: Literal["v", "h", "x", "h"] | None = None, + orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, saturation: float = 0.75, @@ -215,7 +215,7 @@ def pointplot( dodge: bool = False, log_scale: _LogScale | None = None, native_scale: bool = False, - orient: Literal["v", "h", "x", "h"] | None = None, + orient: Literal["v", "h", "x", "y"] | None = None, capsize: float = 0, formatter: Callable[..., str] | None = None, legend: _Legend = "auto", @@ -235,7 +235,7 @@ def countplot( hue: Incomplete | None = None, order: Incomplete | None = None, hue_order: Incomplete | None = None, - orient: Literal["v", "h", "x", "h"] | None = None, + orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, saturation: float = 0.75, @@ -276,7 +276,7 @@ def catplot( log_scale: _LogScale | None = None, native_scale: bool = False, formatter: Callable[..., str] | None = None, - orient: Literal["v", "h", "x", "h"] | None = None, + orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, hue_norm: Incomplete | None = None, From e8e11e97cf0f95aea7687bc16d91cc7f6aaa27b3 Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Fri, 13 Oct 2023 22:38:24 +0200 Subject: [PATCH 09/15] CR and more precise formatter annotation --- stubs/seaborn/seaborn/_stats/regression.pyi | 1 + stubs/seaborn/seaborn/algorithms.pyi | 1 + stubs/seaborn/seaborn/axisgrid.pyi | 10 +++---- stubs/seaborn/seaborn/categorical.pyi | 33 +++++++++++---------- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/stubs/seaborn/seaborn/_stats/regression.pyi b/stubs/seaborn/seaborn/_stats/regression.pyi index 4746cca2618b..c5f9fcf25170 100644 --- a/stubs/seaborn/seaborn/_stats/regression.pyi +++ b/stubs/seaborn/seaborn/_stats/regression.pyi @@ -7,4 +7,5 @@ class PolyFit(Stat): order: int = 2 gridsize: int = 100 +@dataclass class OLSFit(Stat): ... diff --git a/stubs/seaborn/seaborn/algorithms.pyi b/stubs/seaborn/seaborn/algorithms.pyi index 8e431a39f308..e8d9a2b6ddcf 100644 --- a/stubs/seaborn/seaborn/algorithms.pyi +++ b/stubs/seaborn/seaborn/algorithms.pyi @@ -12,4 +12,5 @@ def bootstrap( axis: int | None = None, units: ArrayLike | None = None, seed: _Seed | None = None, + random_seed: _Seed | None = None, # deprecated ) -> NDArray[Any]: ... diff --git a/stubs/seaborn/seaborn/axisgrid.pyi b/stubs/seaborn/seaborn/axisgrid.pyi index 75b48d58aa60..44130deb962a 100644 --- a/stubs/seaborn/seaborn/axisgrid.pyi +++ b/stubs/seaborn/seaborn/axisgrid.pyi @@ -30,16 +30,16 @@ class _BaseGrid: def pipe(self, func: Callable[Concatenate[Self, _P], _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: ... def savefig( self, *args: Incomplete, **kwargs: Incomplete - ) -> None: ... # *arg and **kwargs are passed to `matplotlib.figure.Figure.savefig` + ) -> None: ... # *args and **kwargs are passed to `matplotlib.figure.Figure.savefig` class Grid(_BaseGrid): def __init__(self) -> None: ... def tight_layout( self, *args: Incomplete, **kwargs: Incomplete - ) -> Self: ... # *arg and **kwargs are passed to `matplotlib.figure.Figure.tight_layout` + ) -> Self: ... # *args and **kwargs are passed to `matplotlib.figure.Figure.tight_layout` def add_legend( self, - legend_data: Mapping[str | tuple[Incomplete, str], Artist] | None = None, + legend_data: Mapping[Any, Artist] | None = None, # cannot use precise key type because of invariant Mapping keys title: str | None = None, label_order: list[str] | None = None, adjust_subtitles: bool = False, @@ -207,7 +207,7 @@ def pairplot( vars: Iterable[str] | None = None, x_vars: Iterable[str] | None = None, y_vars: Iterable[str] | None = None, - kind: Literal["scatter", "kde", "hist", "reg"] = "scatter", + kind: str = "scatter", # ideally Literal["scatter", "kde", "hist", "reg"] but it is checked with startswith diag_kind: Literal["auto", "hist", "kde"] | None = "auto", markers: Incomplete | None = None, height: float = 2.5, @@ -217,7 +217,7 @@ def pairplot( plot_kws: dict[str, Any] | None = None, diag_kws: dict[str, Any] | None = None, grid_kws: dict[str, Any] | None = None, - size: float | None = None, + size: float | None = None, # deprecated ) -> PairGrid: ... def jointplot( data: Incomplete | None = None, diff --git a/stubs/seaborn/seaborn/categorical.pyi b/stubs/seaborn/seaborn/categorical.pyi index a6299f2b7ee0..c94695c553f3 100644 --- a/stubs/seaborn/seaborn/categorical.pyi +++ b/stubs/seaborn/seaborn/categorical.pyi @@ -36,9 +36,9 @@ def boxplot( hue_norm: Incomplete | None = None, native_scale: bool = False, log_scale: _LogScale | None = None, - formatter: Callable[..., str] | None = None, + formatter: Callable[[Any], str] | None = None, legend: _Legend = "auto", - **kwargs, + **kwargs: Any, ) -> Axes: ... def violinplot( data: Incomplete | None = None, @@ -67,7 +67,7 @@ def violinplot( density_norm: Literal["area", "count", "width"] = "area", common_norm: bool | None = False, hue_norm: Incomplete | None = None, - formatter: Callable[..., str] | None = None, + formatter: Callable[[Any], str] | None = None, log_scale: _LogScale | None = None, native_scale: bool = False, legend: _Legend = "auto", @@ -76,7 +76,7 @@ def violinplot( bw: Incomplete = ..., # deprecated inner_kws: dict[str, Any] | None = None, ax: Axes | None = None, - **kwargs, + **kwargs: Any, ) -> Axes: ... def boxenplot( data: Incomplete | None = None, @@ -104,13 +104,14 @@ def boxenplot( hue_norm: Incomplete | None = None, log_scale: _LogScale | None = None, native_scale: bool = False, - formatter: Callable[..., str] | None = None, + formatter: Callable[[Any], str] | None = None, legend: _Legend = "auto", scale: Incomplete = ..., # deprecated box_kws: dict[str, Any] | None = None, flier_kws: dict[str, Any] | None = None, line_kws: dict[str, Any] | None = None, ax: Axes | None = None, + **kwargs: Any, ) -> Axes: ... def stripplot( data: Incomplete | None = None, @@ -131,10 +132,10 @@ def stripplot( hue_norm: Incomplete | None = None, log_scale: _LogScale | None = None, native_scale: bool = False, - formatter: Callable[..., str] | None = None, + formatter: Callable[[Any], str] | None = None, legend: _Legend = "auto", ax: Axes | None = None, - **kwargs, + **kwargs: Any, ) -> Axes: ... def swarmplot( data: Incomplete | None = None, @@ -154,11 +155,11 @@ def swarmplot( hue_norm: Incomplete | None = None, log_scale: _LogScale | None = None, native_scale: bool = False, - formatter: Callable[..., str] | None = None, + formatter: Callable[[Any], str] | None = None, legend: _Legend = "auto", warn_thresh: float = 0.05, ax: Axes | None = None, - **kwargs, + **kwargs: Any, ) -> Axes: ... def barplot( data: Incomplete | None = None, @@ -184,7 +185,7 @@ def barplot( gap: float = 0, log_scale: _LogScale | None = None, native_scale: bool = False, - formatter: Callable[..., str] | None = None, + formatter: Callable[[Any], str] | None = None, legend: _Legend = "auto", capsize: float = 0, err_kws: dict[str, Any] | None = None, @@ -217,7 +218,7 @@ def pointplot( native_scale: bool = False, orient: Literal["v", "h", "x", "y"] | None = None, capsize: float = 0, - formatter: Callable[..., str] | None = None, + formatter: Callable[[Any], str] | None = None, legend: _Legend = "auto", err_kws: dict[str, Any] | None = None, ci: Incomplete = ..., # deprecated @@ -225,7 +226,7 @@ def pointplot( join: Incomplete = ..., # deprecated scale: Incomplete = ..., # deprecated ax: Axes | None = None, - **kwargs, + **kwargs: Any, ) -> Axes: ... def countplot( data: Incomplete | None = None, @@ -247,10 +248,10 @@ def countplot( gap: float = 0, log_scale: _LogScale | None = None, native_scale: bool = False, - formatter: Callable[..., str] | None = None, + formatter: Callable[[Any], str] | None = None, legend: _Legend = "auto", ax: Axes | None = None, - **kwargs, + **kwargs: Any, ) -> Axes: ... def catplot( data: Incomplete | None = None, @@ -275,7 +276,7 @@ def catplot( aspect: float = 1, log_scale: _LogScale | None = None, native_scale: bool = False, - formatter: Callable[..., str] | None = None, + formatter: Callable[[Any], str] | None = None, orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, @@ -287,5 +288,5 @@ def catplot( margin_titles: bool = False, facet_kws: dict[str, Any] | None = None, ci: Incomplete = ..., # deprecated - **kwargs, + **kwargs: Any, ) -> FacetGrid: ... From eaa9b59364d34b90bbb2f524c9d3abc0f03a5222 Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Fri, 13 Oct 2023 22:51:54 +0200 Subject: [PATCH 10/15] Fix palette types following seaborn discussion --- stubs/seaborn/seaborn/axisgrid.pyi | 5 +++-- stubs/seaborn/seaborn/distributions.pyi | 14 ++++++-------- stubs/seaborn/seaborn/relational.pyi | 10 ++++------ 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/stubs/seaborn/seaborn/axisgrid.pyi b/stubs/seaborn/seaborn/axisgrid.pyi index 44130deb962a..7289756e33e5 100644 --- a/stubs/seaborn/seaborn/axisgrid.pyi +++ b/stubs/seaborn/seaborn/axisgrid.pyi @@ -5,6 +5,7 @@ from typing_extensions import Concatenate, Literal, ParamSpec, Self from matplotlib.artist import Artist from matplotlib.axes import Axes +from matplotlib.colors import Colormap from matplotlib.figure import Figure from matplotlib.legend import Legend from matplotlib.text import Text @@ -174,7 +175,7 @@ class JointGrid(_BaseGrid): height: float = 6, ratio: float = 5, space: float = 0.2, - palette: _Palette | None = None, + palette: _Palette | Colormap | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, dropna: bool = False, @@ -233,7 +234,7 @@ def jointplot( xlim: Incomplete | None = None, ylim: Incomplete | None = None, color: ColorType | None = None, - palette: _Palette | None = None, + palette: _Palette | Colormap | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, marginal_ticks: bool = False, diff --git a/stubs/seaborn/seaborn/distributions.pyi b/stubs/seaborn/seaborn/distributions.pyi index 9eee64620176..207c97a19c26 100644 --- a/stubs/seaborn/seaborn/distributions.pyi +++ b/stubs/seaborn/seaborn/distributions.pyi @@ -4,6 +4,7 @@ from typing import Any from typing_extensions import Literal from matplotlib.axes import Axes +from matplotlib.colors import Colormap from matplotlib.typing import ColorType from .axisgrid import FacetGrid @@ -11,9 +12,6 @@ from .utils import _LogScale, _Palette __all__ = ["displot", "histplot", "kdeplot", "ecdfplot", "rugplot", "distplot"] -# The docs of these functions say that the palette argument accepts `matplotlib.colors.Colormap` -# as well but it doesn't - def histplot( data: Incomplete | None = None, *, @@ -42,7 +40,7 @@ def histplot( cbar: bool = False, cbar_ax: Axes | None = None, cbar_kws: dict[str, Any] | None = None, - palette: _Palette | None = None, + palette: _Palette | Colormap | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, color: ColorType | None = None, @@ -58,7 +56,7 @@ def kdeplot( y: Incomplete | None = None, hue: Incomplete | None = None, weights: Incomplete | None = None, - palette: _Palette | None = None, + palette: _Palette | Colormap | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, color: ColorType | None = None, @@ -92,7 +90,7 @@ def ecdfplot( weights: Incomplete | None = None, stat: Literal["proportion", "count"] = "proportion", complementary: bool = False, - palette: _Palette | None = None, + palette: _Palette | Colormap | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, log_scale: _LogScale | None = None, @@ -108,7 +106,7 @@ def rugplot( hue: Incomplete | None = None, height: float = 0.025, expand_margins: bool = True, - palette: _Palette | None = None, + palette: _Palette | Colormap | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, legend: bool = True, @@ -129,7 +127,7 @@ def displot( rug_kws: dict[str, Any] | None = None, log_scale: _LogScale | None = None, legend: bool = True, - palette: _Palette | None = None, + palette: _Palette | Colormap | None = None, hue_order: Iterable[str] | None = None, hue_norm: Incomplete | None = None, color: ColorType | None = None, diff --git a/stubs/seaborn/seaborn/relational.pyi b/stubs/seaborn/seaborn/relational.pyi index 32ed657d482a..4cb846eb2a38 100644 --- a/stubs/seaborn/seaborn/relational.pyi +++ b/stubs/seaborn/seaborn/relational.pyi @@ -4,6 +4,7 @@ from typing import Any from typing_extensions import Literal, TypeAlias from matplotlib.axes import Axes +from matplotlib.colors import Colormap from .axisgrid import FacetGrid from .utils import _ErrorBar, _Estimator, _Legend, _Palette, _Seed @@ -12,9 +13,6 @@ __all__ = ["relplot", "scatterplot", "lineplot"] _Sizes: TypeAlias = list[float] | dict[str, float] | tuple[float, float] -# The docs of these functions say that the palette argument accepts `matplotlib.colors.Colormap` -# as well but it doesn't - def lineplot( data: Incomplete | None = None, *, @@ -24,7 +22,7 @@ def lineplot( size: Incomplete | None = None, style: Incomplete | None = None, units: Incomplete | None = None, - palette: _Palette | None = None, + palette: _Palette | Colormap | None = None, hue_order: Iterable[Any] | None = None, hue_norm: Incomplete | None = None, sizes: _Sizes | None = None, @@ -54,7 +52,7 @@ def scatterplot( hue: Incomplete | None = None, size: Incomplete | None = None, style: Incomplete | None = None, - palette: _Palette | None = None, + palette: _Palette | Colormap | None = None, hue_order: Iterable[Any] | None = None, hue_norm: Incomplete | None = None, sizes: _Sizes | None = None, @@ -80,7 +78,7 @@ def relplot( col_wrap: int | None = None, row_order: Iterable[Any] | None = None, col_order: Iterable[Any] | None = None, - palette: _Palette | None = None, + palette: _Palette | Colormap | None = None, hue_order: Iterable[Any] | None = None, hue_norm: Incomplete | None = None, sizes: _Sizes | None = None, From 9bba1f7681c797f0b5b0a6e37ea5275617fec66b Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Fri, 13 Oct 2023 23:03:56 +0200 Subject: [PATCH 11/15] wrong kind --- stubs/seaborn/seaborn/axisgrid.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/seaborn/seaborn/axisgrid.pyi b/stubs/seaborn/seaborn/axisgrid.pyi index 7289756e33e5..518bf910f210 100644 --- a/stubs/seaborn/seaborn/axisgrid.pyi +++ b/stubs/seaborn/seaborn/axisgrid.pyi @@ -208,7 +208,7 @@ def pairplot( vars: Iterable[str] | None = None, x_vars: Iterable[str] | None = None, y_vars: Iterable[str] | None = None, - kind: str = "scatter", # ideally Literal["scatter", "kde", "hist", "reg"] but it is checked with startswith + kind: Literal["scatter", "kde", "hist", "reg"] = "scatter", diag_kind: Literal["auto", "hist", "kde"] | None = "auto", markers: Incomplete | None = None, height: float = 2.5, @@ -226,7 +226,7 @@ def jointplot( x: Incomplete | None = None, y: Incomplete | None = None, hue: Incomplete | None = None, - kind: Literal["scatter", "kde", "hist", "hex", "reg", "resid"] = "scatter", + kind: str = "scatter", # ideally Literal["scatter", "kde", "hist", "hex", "reg", "resid"] but it is checked with startswith height: float = 6, ratio: float = 5, space: float = 0.2, From 720a108ce3997c00d9bb052300645525023a8211 Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Sat, 28 Oct 2023 10:33:18 +0200 Subject: [PATCH 12/15] Address CR --- stubs/seaborn/seaborn/axisgrid.pyi | 8 ++++---- stubs/seaborn/seaborn/external/husl.pyi | 2 +- stubs/seaborn/seaborn/palettes.pyi | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stubs/seaborn/seaborn/axisgrid.pyi b/stubs/seaborn/seaborn/axisgrid.pyi index 518bf910f210..7685a1f83707 100644 --- a/stubs/seaborn/seaborn/axisgrid.pyi +++ b/stubs/seaborn/seaborn/axisgrid.pyi @@ -139,8 +139,8 @@ class PairGrid(Grid): *, hue: str | None = None, vars: Iterable[str] | None = None, - x_vars: Iterable[str] | None = None, - y_vars: Iterable[str] | None = None, + x_vars: Iterable[str] | str | None = None, + y_vars: Iterable[str] | str | None = None, hue_order: Iterable[str] | None = None, palette: _Palette | None = None, hue_kws: dict[str, Any] | None = None, @@ -206,8 +206,8 @@ def pairplot( hue_order: Iterable[str] | None = None, palette: _Palette | None = None, vars: Iterable[str] | None = None, - x_vars: Iterable[str] | None = None, - y_vars: Iterable[str] | None = None, + x_vars: Iterable[str] | str | None = None, + y_vars: Iterable[str] | str | None = None, kind: Literal["scatter", "kde", "hist", "reg"] = "scatter", diag_kind: Literal["auto", "hist", "kde"] | None = "auto", markers: Incomplete | None = None, diff --git a/stubs/seaborn/seaborn/external/husl.pyi b/stubs/seaborn/seaborn/external/husl.pyi index bafd9a7d0910..f76e09c84764 100644 --- a/stubs/seaborn/seaborn/external/husl.pyi +++ b/stubs/seaborn/seaborn/external/husl.pyi @@ -22,7 +22,7 @@ def lch_to_rgb(l: float, c: float, h: float) -> list[float]: ... def rgb_to_lch(r: float, g: float, b: float) -> list[float]: ... def max_chroma(L: float, H: float) -> float: ... def max_chroma_pastel(L: float) -> float: ... -def dot_product(a: float, b: float) -> float: ... +def dot_product(a: Iterable[float], b: Iterable[float]) -> float: ... def f(t: float) -> float: ... def f_inv(t: float) -> float: ... def from_linear(c: float) -> float: ... diff --git a/stubs/seaborn/seaborn/palettes.pyi b/stubs/seaborn/seaborn/palettes.pyi index 1a25d7649d7a..1bb1dfe57d38 100644 --- a/stubs/seaborn/seaborn/palettes.pyi +++ b/stubs/seaborn/seaborn/palettes.pyi @@ -20,14 +20,14 @@ __all__ = [ "set_color_codes", ] -_T = TypeVar("_T") +_ColorT = TypeVar("_ColorT", bound=ColorType) SEABORN_PALETTES: dict[str, list[str]] MPL_QUAL_PALS: dict[str, int] QUAL_PALETTE_SIZES: dict[str, int] QUAL_PALETTES: list[str] -class _ColorPalette(list[_T]): +class _ColorPalette(list[_ColorT]): def __enter__(self) -> Self: ... def __exit__(self, *args: object) -> None: ... def as_hex(self) -> _ColorPalette[str]: ... From e1581a72b9e488d46d3b6cfb1dbd43c4ed67e980 Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Sat, 28 Oct 2023 10:38:29 +0200 Subject: [PATCH 13/15] Remove stubtest entry due to bug fixed in new mypy --- stubs/seaborn/@tests/stubtest_allowlist.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/stubs/seaborn/@tests/stubtest_allowlist.txt b/stubs/seaborn/@tests/stubtest_allowlist.txt index 092ff1751402..02bf781f5775 100644 --- a/stubs/seaborn/@tests/stubtest_allowlist.txt +++ b/stubs/seaborn/@tests/stubtest_allowlist.txt @@ -1,4 +1,3 @@ seaborn._core.scales.(Pipeline|TransFuncs) # aliases defined in `if TYPE_CHECKING` block -seaborn.*.__match_args__ # https://github.com/python/mypy/issues/15748 seaborn.external.docscrape.ClassDoc.__init__ # stubtest doesn't like ABC class as default value seaborn.external.docscrape.NumpyDocString.__str__ # weird signature From f088656a576402b9c72a466980b63f709023439b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 28 Oct 2023 08:39:49 +0000 Subject: [PATCH 14/15] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/protobuf/google/protobuf/any_pb2.pyi | 3 ++- stubs/protobuf/google/protobuf/api_pb2.pyi | 3 ++- stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi | 5 +++-- stubs/protobuf/google/protobuf/descriptor_pb2.pyi | 5 +++-- stubs/protobuf/google/protobuf/duration_pb2.pyi | 3 ++- stubs/protobuf/google/protobuf/empty_pb2.pyi | 3 ++- stubs/protobuf/google/protobuf/field_mask_pb2.pyi | 3 ++- stubs/protobuf/google/protobuf/source_context_pb2.pyi | 3 ++- stubs/protobuf/google/protobuf/struct_pb2.pyi | 5 +++-- stubs/protobuf/google/protobuf/timestamp_pb2.pyi | 3 ++- stubs/protobuf/google/protobuf/type_pb2.pyi | 5 +++-- stubs/protobuf/google/protobuf/wrappers_pb2.pyi | 3 ++- stubs/s2clientprotocol/s2clientprotocol/common_pb2.pyi | 5 +++-- stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi | 5 +++-- stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi | 5 +++-- stubs/s2clientprotocol/s2clientprotocol/error_pb2.pyi | 5 +++-- stubs/s2clientprotocol/s2clientprotocol/query_pb2.pyi | 3 ++- stubs/s2clientprotocol/s2clientprotocol/raw_pb2.pyi | 5 +++-- stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi | 5 +++-- stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi | 5 +++-- stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi | 5 +++-- stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi | 5 +++-- .../tensorflow/compiler/xla/autotune_results_pb2.pyi | 3 ++- .../tensorflow/compiler/xla/service/hlo_pb2.pyi | 5 +++-- .../tensorflow/compiler/xla/service/metrics_pb2.pyi | 5 +++-- .../tensorflow/tensorflow/compiler/xla/xla_data_pb2.pyi | 5 +++-- .../core/example/example_parser_configuration_pb2.pyi | 3 ++- stubs/tensorflow/tensorflow/core/example/example_pb2.pyi | 3 ++- stubs/tensorflow/tensorflow/core/example/feature_pb2.pyi | 3 ++- .../core/framework/allocation_description_pb2.pyi | 3 ++- .../tensorflow/tensorflow/core/framework/api_def_pb2.pyi | 5 +++-- .../tensorflow/core/framework/attr_value_pb2.pyi | 3 ++- .../tensorflow/core/framework/cost_graph_pb2.pyi | 3 ++- .../tensorflow/core/framework/dataset_metadata_pb2.pyi | 3 ++- .../tensorflow/core/framework/dataset_options_pb2.pyi | 5 +++-- .../tensorflow/tensorflow/core/framework/dataset_pb2.pyi | 3 ++- .../tensorflow/core/framework/device_attributes_pb2.pyi | 3 ++- .../tensorflow/core/framework/full_type_pb2.pyi | 5 +++-- .../tensorflow/core/framework/function_pb2.pyi | 3 ++- stubs/tensorflow/tensorflow/core/framework/graph_pb2.pyi | 3 ++- .../core/framework/graph_transfer_info_pb2.pyi | 5 +++-- .../tensorflow/core/framework/kernel_def_pb2.pyi | 3 ++- .../tensorflow/core/framework/log_memory_pb2.pyi | 3 ++- stubs/tensorflow/tensorflow/core/framework/model_pb2.pyi | 5 +++-- .../tensorflow/core/framework/node_def_pb2.pyi | 3 ++- .../tensorflow/tensorflow/core/framework/op_def_pb2.pyi | 3 ++- .../core/framework/optimized_function_graph_pb2.pyi | 3 ++- .../tensorflow/core/framework/reader_base_pb2.pyi | 3 ++- .../tensorflow/core/framework/resource_handle_pb2.pyi | 3 ++- .../tensorflow/core/framework/step_stats_pb2.pyi | 3 ++- .../tensorflow/tensorflow/core/framework/summary_pb2.pyi | 9 ++++----- .../tensorflow/core/framework/tensor_description_pb2.pyi | 3 ++- .../tensorflow/tensorflow/core/framework/tensor_pb2.pyi | 3 ++- .../tensorflow/core/framework/tensor_shape_pb2.pyi | 3 ++- .../tensorflow/core/framework/tensor_slice_pb2.pyi | 3 ++- stubs/tensorflow/tensorflow/core/framework/types_pb2.pyi | 5 +++-- .../tensorflow/core/framework/variable_pb2.pyi | 5 +++-- .../tensorflow/core/framework/versions_pb2.pyi | 3 ++- .../tensorflow/tensorflow/core/protobuf/cluster_pb2.pyi | 3 ++- .../core/protobuf/composite_tensor_variant_pb2.pyi | 3 ++- stubs/tensorflow/tensorflow/core/protobuf/config_pb2.pyi | 5 +++-- .../tensorflow/core/protobuf/control_flow_pb2.pyi | 3 ++- .../tensorflow/core/protobuf/coordination_config_pb2.pyi | 3 ++- .../core/protobuf/core_platform_payloads_pb2.pyi | 5 +++-- .../tensorflow/core/protobuf/data_service_pb2.pyi | 5 +++-- .../tensorflow/core/protobuf/debug_event_pb2.pyi | 5 +++-- stubs/tensorflow/tensorflow/core/protobuf/debug_pb2.pyi | 3 ++- .../tensorflow/core/protobuf/device_filters_pb2.pyi | 3 ++- .../tensorflow/core/protobuf/device_properties_pb2.pyi | 3 ++- .../core/protobuf/distributed_runtime_payloads_pb2.pyi | 3 ++- .../tensorflow/core/protobuf/error_codes_pb2.pyi | 2 +- .../tensorflow/core/protobuf/fingerprint_pb2.pyi | 3 ++- .../tensorflow/core/protobuf/graph_debug_info_pb2.pyi | 3 ++- .../tensorflow/core/protobuf/meta_graph_pb2.pyi | 3 ++- .../tensorflow/core/protobuf/named_tensor_pb2.pyi | 3 ++- .../tensorflow/core/protobuf/queue_runner_pb2.pyi | 3 ++- .../core/protobuf/remote_tensor_handle_pb2.pyi | 3 ++- .../tensorflow/core/protobuf/rewriter_config_pb2.pyi | 5 +++-- .../tensorflow/core/protobuf/rpc_options_pb2.pyi | 4 +--- .../tensorflow/core/protobuf/saved_model_pb2.pyi | 3 ++- .../tensorflow/core/protobuf/saved_object_graph_pb2.pyi | 5 +++-- stubs/tensorflow/tensorflow/core/protobuf/saver_pb2.pyi | 5 +++-- .../tensorflow/core/protobuf/service_config_pb2.pyi | 3 ++- .../tensorflow/tensorflow/core/protobuf/snapshot_pb2.pyi | 3 ++- stubs/tensorflow/tensorflow/core/protobuf/struct_pb2.pyi | 5 +++-- .../tensorflow/core/protobuf/tensor_bundle_pb2.pyi | 5 +++-- .../tensorflow/core/protobuf/tensorflow_server_pb2.pyi | 3 ++- .../core/protobuf/tpu/compilation_result_pb2.pyi | 5 +++-- .../tensorflow/core/protobuf/tpu/dynamic_padding_pb2.pyi | 3 ++- .../core/protobuf/tpu/optimization_parameters_pb2.pyi | 5 +++-- .../tensorflow/core/protobuf/tpu/topology_pb2.pyi | 5 +++-- .../protobuf/tpu/tpu_embedding_configuration_pb2.pyi | 5 +++-- .../core/protobuf/trackable_object_graph_pb2.pyi | 3 ++- .../tensorflow/core/protobuf/transport_options_pb2.pyi | 3 ++- .../tensorflow/core/protobuf/verifier_config_pb2.pyi | 5 +++-- stubs/tensorflow/tensorflow/core/util/event_pb2.pyi | 5 +++-- .../tensorflow/core/util/memmapped_file_system_pb2.pyi | 3 ++- .../tensorflow/core/util/saved_tensor_slice_pb2.pyi | 3 ++- stubs/tensorflow/tensorflow/core/util/test_log_pb2.pyi | 2 +- .../python/keras/protobuf/projector_config_pb2.pyi | 3 ++- .../python/keras/protobuf/saved_metadata_pb2.pyi | 3 ++- .../tensorflow/python/keras/protobuf/versions_pb2.pyi | 3 ++- .../tensorflow/tsl/protobuf/autotuning_pb2.pyi | 5 +++-- .../tensorflow/tsl/protobuf/bfc_memory_map_pb2.pyi | 3 ++- .../tensorflow/tsl/protobuf/coordination_config_pb2.pyi | 3 ++- .../tensorflow/tsl/protobuf/coordination_service_pb2.pyi | 5 +++-- .../tsl/protobuf/distributed_runtime_payloads_pb2.pyi | 3 ++- stubs/tensorflow/tensorflow/tsl/protobuf/dnn_pb2.pyi | 5 +++-- .../tensorflow/tsl/protobuf/error_codes_pb2.pyi | 5 +++-- .../tensorflow/tensorflow/tsl/protobuf/histogram_pb2.pyi | 3 ++- .../tensorflow/tsl/protobuf/rpc_options_pb2.pyi | 3 ++- .../tensorflow/tensorflow/tsl/protobuf/test_log_pb2.pyi | 5 +++-- 112 files changed, 266 insertions(+), 161 deletions(-) diff --git a/stubs/protobuf/google/protobuf/any_pb2.pyi b/stubs/protobuf/google/protobuf/any_pb2.pyi index 398a9abadb2c..1a9040cd5cfc 100644 --- a/stubs/protobuf/google/protobuf/any_pb2.pyi +++ b/stubs/protobuf/google/protobuf/any_pb2.pyi @@ -32,10 +32,11 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.internal.well_known_types import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/api_pb2.pyi b/stubs/protobuf/google/protobuf/api_pb2.pyi index 4cedb0da9211..f4365a0e4dff 100644 --- a/stubs/protobuf/google/protobuf/api_pb2.pyi +++ b/stubs/protobuf/google/protobuf/api_pb2.pyi @@ -33,12 +33,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import google.protobuf.source_context_pb2 import google.protobuf.type_pb2 -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi b/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi index a2e15b129f9c..0c7ed03c2a00 100644 --- a/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi +++ b/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi @@ -19,13 +19,14 @@ flag "--${NAME}_out" is passed to protoc. """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.descriptor_pb2 import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi index bda40e15e110..53257ff489d8 100644 --- a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +++ b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi @@ -11,12 +11,13 @@ without any other information (e.g. without reading its imports). """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/duration_pb2.pyi b/stubs/protobuf/google/protobuf/duration_pb2.pyi index d8f7931a71e7..681097d80e34 100644 --- a/stubs/protobuf/google/protobuf/duration_pb2.pyi +++ b/stubs/protobuf/google/protobuf/duration_pb2.pyi @@ -32,10 +32,11 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.internal.well_known_types import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/empty_pb2.pyi b/stubs/protobuf/google/protobuf/empty_pb2.pyi index 22ef26b7d1e7..2f1c614527bf 100644 --- a/stubs/protobuf/google/protobuf/empty_pb2.pyi +++ b/stubs/protobuf/google/protobuf/empty_pb2.pyi @@ -31,9 +31,10 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/field_mask_pb2.pyi b/stubs/protobuf/google/protobuf/field_mask_pb2.pyi index 1721c1bc6234..07012bab5bca 100644 --- a/stubs/protobuf/google/protobuf/field_mask_pb2.pyi +++ b/stubs/protobuf/google/protobuf/field_mask_pb2.pyi @@ -33,11 +33,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.well_known_types import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/source_context_pb2.pyi b/stubs/protobuf/google/protobuf/source_context_pb2.pyi index cb4fb572eadc..e11d903038f6 100644 --- a/stubs/protobuf/google/protobuf/source_context_pb2.pyi +++ b/stubs/protobuf/google/protobuf/source_context_pb2.pyi @@ -32,9 +32,10 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/struct_pb2.pyi b/stubs/protobuf/google/protobuf/struct_pb2.pyi index bf2771ec0d5d..b3716e5bab46 100644 --- a/stubs/protobuf/google/protobuf/struct_pb2.pyi +++ b/stubs/protobuf/google/protobuf/struct_pb2.pyi @@ -33,13 +33,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.internal.well_known_types import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/timestamp_pb2.pyi b/stubs/protobuf/google/protobuf/timestamp_pb2.pyi index b8f5b636e752..f5bfbc594c92 100644 --- a/stubs/protobuf/google/protobuf/timestamp_pb2.pyi +++ b/stubs/protobuf/google/protobuf/timestamp_pb2.pyi @@ -32,10 +32,11 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.internal.well_known_types import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/type_pb2.pyi b/stubs/protobuf/google/protobuf/type_pb2.pyi index c66cd631176f..dca4537bd447 100644 --- a/stubs/protobuf/google/protobuf/type_pb2.pyi +++ b/stubs/protobuf/google/protobuf/type_pb2.pyi @@ -33,14 +33,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import collections.abc +import sys +import typing + import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import google.protobuf.source_context_pb2 -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/wrappers_pb2.pyi b/stubs/protobuf/google/protobuf/wrappers_pb2.pyi index 201b9258a751..9cc4a3e8fedb 100644 --- a/stubs/protobuf/google/protobuf/wrappers_pb2.pyi +++ b/stubs/protobuf/google/protobuf/wrappers_pb2.pyi @@ -12,9 +12,10 @@ These wrappers have no meaningful use within a map or a oneof since individual entries of a map or fields of a oneof can already detect presence. """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/common_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/common_pb2.pyi index 36e5f70c985b..cd8d993c12ae 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/common_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/common_pb2.pyi @@ -3,11 +3,12 @@ isort:skip_file """ import builtins +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi index d53937df29b2..e9f840a88032 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi @@ -4,13 +4,14 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import s2clientprotocol.common_pb2 -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi index 5f605f93068f..39c19873b48c 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi @@ -4,13 +4,14 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import s2clientprotocol.common_pb2 -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/error_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/error_pb2.pyi index dce11d14ba85..9839a004052d 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/error_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/error_pb2.pyi @@ -3,11 +3,12 @@ isort:skip_file """ import builtins -import google.protobuf.descriptor -import google.protobuf.internal.enum_type_wrapper import sys import typing +import google.protobuf.descriptor +import google.protobuf.internal.enum_type_wrapper + if sys.version_info >= (3, 10): import typing as typing_extensions else: diff --git a/stubs/s2clientprotocol/s2clientprotocol/query_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/query_pb2.pyi index 2077427a14b6..e954e46118e1 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/query_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/query_pb2.pyi @@ -4,12 +4,13 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import s2clientprotocol.common_pb2 import s2clientprotocol.error_pb2 -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/raw_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/raw_pb2.pyi index 9a0c9aea4f47..3afb3e820a42 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/raw_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/raw_pb2.pyi @@ -4,13 +4,14 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import s2clientprotocol.common_pb2 -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi index c3b879600e48..c4ad8fee6be4 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi @@ -4,6 +4,9 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper @@ -17,8 +20,6 @@ import s2clientprotocol.raw_pb2 import s2clientprotocol.score_pb2 import s2clientprotocol.spatial_pb2 import s2clientprotocol.ui_pb2 -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi index a1c5360f371f..6ccd3359cc04 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi @@ -3,11 +3,12 @@ isort:skip_file """ import builtins +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi index 5105e79a6db0..d76fbf1f1331 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi @@ -4,13 +4,14 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import s2clientprotocol.common_pb2 -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi index 480c4960360b..c0499b585dfe 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi @@ -4,12 +4,13 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/compiler/xla/autotune_results_pb2.pyi b/stubs/tensorflow/tensorflow/compiler/xla/autotune_results_pb2.pyi index d90b18cd68c1..1f107829d73a 100644 --- a/stubs/tensorflow/tensorflow/compiler/xla/autotune_results_pb2.pyi +++ b/stubs/tensorflow/tensorflow/compiler/xla/autotune_results_pb2.pyi @@ -18,10 +18,11 @@ limitations under the License. """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.tsl.protobuf.autotuning_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/compiler/xla/service/hlo_pb2.pyi b/stubs/tensorflow/tensorflow/compiler/xla/service/hlo_pb2.pyi index 46fa77106238..d3454c8ba0b9 100644 --- a/stubs/tensorflow/tensorflow/compiler/xla/service/hlo_pb2.pyi +++ b/stubs/tensorflow/tensorflow/compiler/xla/service/hlo_pb2.pyi @@ -16,13 +16,14 @@ protos as JSON, which includes the field names in the serialization. """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.compiler.xla.xla_data_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/compiler/xla/service/metrics_pb2.pyi b/stubs/tensorflow/tensorflow/compiler/xla/service/metrics_pb2.pyi index f39a6bd921d6..39993f67771b 100644 --- a/stubs/tensorflow/tensorflow/compiler/xla/service/metrics_pb2.pyi +++ b/stubs/tensorflow/tensorflow/compiler/xla/service/metrics_pb2.pyi @@ -3,13 +3,14 @@ isort:skip_file """ import builtins +import sys +import typing + import google.protobuf.descriptor import google.protobuf.duration_pb2 import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import google.protobuf.timestamp_pb2 -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/compiler/xla/xla_data_pb2.pyi b/stubs/tensorflow/tensorflow/compiler/xla/xla_data_pb2.pyi index f4e34a285982..a283b93afb07 100644 --- a/stubs/tensorflow/tensorflow/compiler/xla/xla_data_pb2.pyi +++ b/stubs/tensorflow/tensorflow/compiler/xla/xla_data_pb2.pyi @@ -18,12 +18,13 @@ limitations under the License. """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/example/example_parser_configuration_pb2.pyi b/stubs/tensorflow/tensorflow/core/example/example_parser_configuration_pb2.pyi index 52e42c6a3fc2..7b24d84e01e1 100644 --- a/stubs/tensorflow/tensorflow/core/example/example_parser_configuration_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/example/example_parser_configuration_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file Protocol messages for describing the configuration of the ExampleParserOp.""" import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/example/example_pb2.pyi b/stubs/tensorflow/tensorflow/core/example/example_pb2.pyi index 4fb6132fdf08..cd4bcd511a7e 100644 --- a/stubs/tensorflow/tensorflow/core/example/example_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/example/example_pb2.pyi @@ -5,9 +5,10 @@ Protocol messages for describing input data Examples for machine learning model training or inference. """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys import tensorflow.core.example.feature_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/example/feature_pb2.pyi b/stubs/tensorflow/tensorflow/core/example/feature_pb2.pyi index 1739ce2aef40..42bfb4d4f9f0 100644 --- a/stubs/tensorflow/tensorflow/core/example/feature_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/example/feature_pb2.pyi @@ -57,10 +57,11 @@ Example Features for a movie recommendation application: """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/allocation_description_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/allocation_description_pb2.pyi index b53507ce6064..e1d5638202f1 100644 --- a/stubs/tensorflow/tensorflow/core/framework/allocation_description_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/allocation_description_pb2.pyi @@ -3,9 +3,10 @@ isort:skip_file """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/api_def_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/api_def_pb2.pyi index 6ca86a438448..b2f1a514a69e 100644 --- a/stubs/tensorflow/tensorflow/core/framework/api_def_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/api_def_pb2.pyi @@ -6,13 +6,14 @@ overrides for client language op code generators. """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.core.framework.attr_value_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/attr_value_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/attr_value_pb2.pyi index 5e148bb273df..11566fd7fb19 100644 --- a/stubs/tensorflow/tensorflow/core/framework/attr_value_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/attr_value_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/cost_graph_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/cost_graph_pb2.pyi index 69f4580d5c6f..1aa0b7a153a3 100644 --- a/stubs/tensorflow/tensorflow/core/framework/cost_graph_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/cost_graph_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/dataset_metadata_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/dataset_metadata_pb2.pyi index 5ab21cfac43b..ff792ea47c46 100644 --- a/stubs/tensorflow/tensorflow/core/framework/dataset_metadata_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/dataset_metadata_pb2.pyi @@ -3,9 +3,10 @@ isort:skip_file """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/dataset_options_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/dataset_options_pb2.pyi index 651c02975047..d31d1d267f9e 100644 --- a/stubs/tensorflow/tensorflow/core/framework/dataset_options_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/dataset_options_pb2.pyi @@ -3,12 +3,13 @@ isort:skip_file """ import builtins +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.core.framework.model_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/dataset_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/dataset_pb2.pyi index 432d6f4f57a5..b2e987481ccf 100644 --- a/stubs/tensorflow/tensorflow/core/framework/dataset_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/dataset_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/device_attributes_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/device_attributes_pb2.pyi index 116157d43832..4b1dbd3d3ffa 100644 --- a/stubs/tensorflow/tensorflow/core/framework/device_attributes_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/device_attributes_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/full_type_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/full_type_pb2.pyi index b41f5f4da2fc..0c5e1e9d955a 100644 --- a/stubs/tensorflow/tensorflow/core/framework/full_type_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/full_type_pb2.pyi @@ -4,12 +4,13 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/function_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/function_pb2.pyi index 266ceef3c17b..4f920a308aa4 100644 --- a/stubs/tensorflow/tensorflow/core/framework/function_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/function_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.attr_value_pb2 import tensorflow.core.framework.node_def_pb2 import tensorflow.core.framework.op_def_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/graph_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/graph_pb2.pyi index e58eab70eafd..9ff82c9d8cff 100644 --- a/stubs/tensorflow/tensorflow/core/framework/graph_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/graph_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.function_pb2 import tensorflow.core.framework.node_def_pb2 import tensorflow.core.framework.versions_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/graph_transfer_info_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/graph_transfer_info_pb2.pyi index 908dddd1fe8b..88b587cf2434 100644 --- a/stubs/tensorflow/tensorflow/core/framework/graph_transfer_info_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/graph_transfer_info_pb2.pyi @@ -4,13 +4,14 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.core.framework.types_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/kernel_def_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/kernel_def_pb2.pyi index d3b04135d493..53c54aab27da 100644 --- a/stubs/tensorflow/tensorflow/core/framework/kernel_def_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/kernel_def_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.attr_value_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/framework/log_memory_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/log_memory_pb2.pyi index 45e50508459a..d3c6f0dd8261 100644 --- a/stubs/tensorflow/tensorflow/core/framework/log_memory_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/log_memory_pb2.pyi @@ -3,9 +3,10 @@ isort:skip_file """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys import tensorflow.core.framework.tensor_description_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/framework/model_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/model_pb2.pyi index 97cdf1f276b1..8c4fdf2af8e0 100644 --- a/stubs/tensorflow/tensorflow/core/framework/model_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/model_pb2.pyi @@ -4,12 +4,13 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/node_def_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/node_def_pb2.pyi index e146faecf898..8e8b352b7837 100644 --- a/stubs/tensorflow/tensorflow/core/framework/node_def_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/node_def_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.attr_value_pb2 import tensorflow.core.framework.full_type_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/op_def_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/op_def_pb2.pyi index acee7309c540..0e384331dd90 100644 --- a/stubs/tensorflow/tensorflow/core/framework/op_def_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/op_def_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.attr_value_pb2 import tensorflow.core.framework.full_type_pb2 import tensorflow.core.framework.resource_handle_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/optimized_function_graph_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/optimized_function_graph_pb2.pyi index a9097c746f44..8709c3987750 100644 --- a/stubs/tensorflow/tensorflow/core/framework/optimized_function_graph_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/optimized_function_graph_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.graph_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/reader_base_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/reader_base_pb2.pyi index 2e06dfa7766a..3f395b4570c0 100644 --- a/stubs/tensorflow/tensorflow/core/framework/reader_base_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/reader_base_pb2.pyi @@ -3,9 +3,10 @@ isort:skip_file """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/resource_handle_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/resource_handle_pb2.pyi index cda284bf2e89..d92b2f765265 100644 --- a/stubs/tensorflow/tensorflow/core/framework/resource_handle_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/resource_handle_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/step_stats_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/step_stats_pb2.pyi index 23f790f0d378..8261e5730ea2 100644 --- a/stubs/tensorflow/tensorflow/core/framework/step_stats_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/step_stats_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.allocation_description_pb2 import tensorflow.core.framework.tensor_description_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/summary_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/summary_pb2.pyi index a6ffc8512dfc..609abbe28650 100644 --- a/stubs/tensorflow/tensorflow/core/framework/summary_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/summary_pb2.pyi @@ -4,22 +4,21 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.tsl.protobuf.histogram_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions else: import typing_extensions -from tensorflow.tsl.protobuf.histogram_pb2 import ( - HistogramProto as HistogramProto, -) +from tensorflow.tsl.protobuf.histogram_pb2 import HistogramProto as HistogramProto DESCRIPTOR: google.protobuf.descriptor.FileDescriptor diff --git a/stubs/tensorflow/tensorflow/core/framework/tensor_description_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/tensor_description_pb2.pyi index 3fadbcb2475a..f6c348b8a14b 100644 --- a/stubs/tensorflow/tensorflow/core/framework/tensor_description_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/tensor_description_pb2.pyi @@ -3,9 +3,10 @@ isort:skip_file """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys import tensorflow.core.framework.allocation_description_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/tensor_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/tensor_pb2.pyi index 43f84a36134f..393b94d909f6 100644 --- a/stubs/tensorflow/tensorflow/core/framework/tensor_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/tensor_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.resource_handle_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/tensor_shape_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/tensor_shape_pb2.pyi index cf0219ed9324..37a6a5279201 100644 --- a/stubs/tensorflow/tensorflow/core/framework/tensor_shape_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/tensor_shape_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file Protocol buffer representing the shape of tensors.""" import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/tensor_slice_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/tensor_slice_pb2.pyi index 17391655c559..cfc3e361d699 100644 --- a/stubs/tensorflow/tensorflow/core/framework/tensor_slice_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/tensor_slice_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file Protocol buffer representing slices of a tensor""" import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/types_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/types_pb2.pyi index 48bc3ca55ec2..9f4d4fea804f 100644 --- a/stubs/tensorflow/tensorflow/core/framework/types_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/types_pb2.pyi @@ -3,11 +3,12 @@ isort:skip_file """ import builtins +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/variable_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/variable_pb2.pyi index 4dbea275cbf7..2c7796d2f573 100644 --- a/stubs/tensorflow/tensorflow/core/framework/variable_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/variable_pb2.pyi @@ -4,12 +4,13 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/versions_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/versions_pb2.pyi index 571754ba5f3f..4df61f398301 100644 --- a/stubs/tensorflow/tensorflow/core/framework/versions_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/versions_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/cluster_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/cluster_pb2.pyi index a53a7d5f0415..e9f986e3a24e 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/cluster_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/cluster_pb2.pyi @@ -18,10 +18,11 @@ limitations under the License. """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/composite_tensor_variant_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/composite_tensor_variant_pb2.pyi index 3cdfcd186540..eb143db57da9 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/composite_tensor_variant_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/composite_tensor_variant_pb2.pyi @@ -3,9 +3,10 @@ isort:skip_file """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys import tensorflow.core.protobuf.struct_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/protobuf/config_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/config_pb2.pyi index 9a145bf28a70..d45828cd305c 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/config_pb2.pyi @@ -4,11 +4,13 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.core.framework.cost_graph_pb2 import tensorflow.core.framework.graph_pb2 import tensorflow.core.framework.step_stats_pb2 @@ -17,7 +19,6 @@ import tensorflow.core.protobuf.debug_pb2 import tensorflow.core.protobuf.rewriter_config_pb2 import tensorflow.tsl.protobuf.coordination_config_pb2 import tensorflow.tsl.protobuf.rpc_options_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/control_flow_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/control_flow_pb2.pyi index 47f05d32b600..cb0fd3576554 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/control_flow_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/control_flow_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/coordination_config_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/coordination_config_pb2.pyi index 43efe80f355f..fcd757622079 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/coordination_config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/coordination_config_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/core_platform_payloads_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/core_platform_payloads_pb2.pyi index 496d0096f81a..f06c008c37ba 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/core_platform_payloads_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/core_platform_payloads_pb2.pyi @@ -3,11 +3,12 @@ isort:skip_file """ import builtins +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/data_service_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/data_service_pb2.pyi index 6924223b44ab..151a3d18ec47 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/data_service_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/data_service_pb2.pyi @@ -3,11 +3,12 @@ isort:skip_file """ import builtins +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/debug_event_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/debug_event_pb2.pyi index fec65984da15..89570d7cef77 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/debug_event_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/debug_event_pb2.pyi @@ -4,14 +4,15 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.protobuf.graph_debug_info_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/debug_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/debug_pb2.pyi index f7779853a347..106a26b01072 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/debug_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/debug_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/device_filters_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/device_filters_pb2.pyi index d00378cd471c..e26f3a083842 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/device_filters_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/device_filters_pb2.pyi @@ -18,10 +18,11 @@ limitations under the License. """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/device_properties_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/device_properties_pb2.pyi index 366f318856ae..b3ec2632a7a8 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/device_properties_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/device_properties_pb2.pyi @@ -18,10 +18,11 @@ limitations under the License. """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/distributed_runtime_payloads_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/distributed_runtime_payloads_pb2.pyi index 3f2acfcf24bc..ed8dd9ae681e 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/distributed_runtime_payloads_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/distributed_runtime_payloads_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/error_codes_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/error_codes_pb2.pyi index 447469dda71b..093797947d01 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/error_codes_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/error_codes_pb2.pyi @@ -11,7 +11,6 @@ from tensorflow.tsl.protobuf.error_codes_pb2 import ( ABORTED as ABORTED, ALREADY_EXISTS as ALREADY_EXISTS, CANCELLED as CANCELLED, - Code as Code, DATA_LOSS as DATA_LOSS, DEADLINE_EXCEEDED as DEADLINE_EXCEEDED, DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_ as DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_, @@ -27,6 +26,7 @@ from tensorflow.tsl.protobuf.error_codes_pb2 import ( UNAVAILABLE as UNAVAILABLE, UNIMPLEMENTED as UNIMPLEMENTED, UNKNOWN as UNKNOWN, + Code as Code, ) DESCRIPTOR: google.protobuf.descriptor.FileDescriptor diff --git a/stubs/tensorflow/tensorflow/core/protobuf/fingerprint_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/fingerprint_pb2.pyi index bda6e036b957..be397855b80c 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/fingerprint_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/fingerprint_pb2.pyi @@ -3,9 +3,10 @@ isort:skip_file """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys import tensorflow.core.framework.versions_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/protobuf/graph_debug_info_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/graph_debug_info_pb2.pyi index e2298201ddb1..ae0527450348 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/graph_debug_info_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/graph_debug_info_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/meta_graph_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/meta_graph_pb2.pyi index 18fd35693c00..0506fc7a8b1a 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/meta_graph_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/meta_graph_pb2.pyi @@ -4,11 +4,12 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.graph_pb2 import tensorflow.core.framework.op_def_pb2 import tensorflow.core.framework.tensor_shape_pb2 diff --git a/stubs/tensorflow/tensorflow/core/protobuf/named_tensor_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/named_tensor_pb2.pyi index 419e650c8ccb..b45f134db7f6 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/named_tensor_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/named_tensor_pb2.pyi @@ -3,9 +3,10 @@ isort:skip_file """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys import tensorflow.core.framework.tensor_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/protobuf/queue_runner_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/queue_runner_pb2.pyi index 332144151ce1..59d932074fc1 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/queue_runner_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/queue_runner_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.tsl.protobuf.error_codes_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/protobuf/remote_tensor_handle_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/remote_tensor_handle_pb2.pyi index a2bff6d62edd..55607e50b4a8 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/remote_tensor_handle_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/remote_tensor_handle_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/protobuf/rewriter_config_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/rewriter_config_pb2.pyi index 9338ba89180c..9bf638aa42bd 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/rewriter_config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/rewriter_config_pb2.pyi @@ -4,14 +4,15 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.core.framework.attr_value_pb2 import tensorflow.core.protobuf.verifier_config_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/rpc_options_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/rpc_options_pb2.pyi index 462a1076bd8e..f81919a4fc42 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/rpc_options_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/rpc_options_pb2.pyi @@ -3,8 +3,6 @@ isort:skip_file """ import google.protobuf.descriptor -from tensorflow.tsl.protobuf.rpc_options_pb2 import ( - RPCOptions as RPCOptions, -) +from tensorflow.tsl.protobuf.rpc_options_pb2 import RPCOptions as RPCOptions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor diff --git a/stubs/tensorflow/tensorflow/core/protobuf/saved_model_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/saved_model_pb2.pyi index 0c412101c5aa..7c32f95070fd 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/saved_model_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/saved_model_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.protobuf.meta_graph_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/protobuf/saved_object_graph_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/saved_object_graph_pb2.pyi index 15adf4ec318d..c74ca7cedfde 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/saved_object_graph_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/saved_object_graph_pb2.pyi @@ -4,19 +4,20 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 import tensorflow.core.framework.variable_pb2 import tensorflow.core.framework.versions_pb2 import tensorflow.core.protobuf.struct_pb2 import tensorflow.core.protobuf.trackable_object_graph_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/saver_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/saver_pb2.pyi index 7f91d63a9162..a5acf0bec8f1 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/saver_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/saver_pb2.pyi @@ -3,11 +3,12 @@ isort:skip_file """ import builtins +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/service_config_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/service_config_pb2.pyi index d8db4cbe077b..99465a6b94ef 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/service_config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/service_config_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.protobuf.data_service_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/protobuf/snapshot_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/snapshot_pb2.pyi index f9198cc248de..7db51bb8518b 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/snapshot_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/snapshot_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/protobuf/struct_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/struct_pb2.pyi index e8341d120292..9321d8378630 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/struct_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/struct_pb2.pyi @@ -4,15 +4,16 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tensor_bundle_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tensor_bundle_pb2.pyi index cbb1e71ffaea..a55ef36b3c49 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tensor_bundle_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tensor_bundle_pb2.pyi @@ -4,16 +4,17 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.tensor_slice_pb2 import tensorflow.core.framework.types_pb2 import tensorflow.core.framework.versions_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tensorflow_server_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tensorflow_server_pb2.pyi index 624e4a471043..781baf8375ad 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tensorflow_server_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tensorflow_server_pb2.pyi @@ -17,9 +17,10 @@ limitations under the License. ============================================================================== """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys import tensorflow.core.protobuf.cluster_pb2 import tensorflow.core.protobuf.config_pb2 import tensorflow.core.protobuf.device_filters_pb2 diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tpu/compilation_result_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tpu/compilation_result_pb2.pyi index a4f60a5be39f..639d1049656b 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tpu/compilation_result_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tpu/compilation_result_pb2.pyi @@ -4,14 +4,15 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.compiler.xla.service.hlo_pb2 import tensorflow.tsl.protobuf.error_codes_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tpu/dynamic_padding_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tpu/dynamic_padding_pb2.pyi index 5b1d1c7f4b12..b296008931f0 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tpu/dynamic_padding_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tpu/dynamic_padding_pb2.pyi @@ -3,9 +3,10 @@ isort:skip_file """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tpu/optimization_parameters_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tpu/optimization_parameters_pb2.pyi index 2bfa1b94e563..c9b6adebc541 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tpu/optimization_parameters_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tpu/optimization_parameters_pb2.pyi @@ -3,13 +3,14 @@ isort:skip_file """ import builtins +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import google.protobuf.wrappers_pb2 -import sys import tensorflow.compiler.xla.service.hlo_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tpu/topology_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tpu/topology_pb2.pyi index 2c88cfeab08f..be5e58a28d5d 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tpu/topology_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tpu/topology_pb2.pyi @@ -4,12 +4,13 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tpu/tpu_embedding_configuration_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tpu/tpu_embedding_configuration_pb2.pyi index bc80fce661a2..2568ba183172 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tpu/tpu_embedding_configuration_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tpu/tpu_embedding_configuration_pb2.pyi @@ -4,13 +4,14 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.core.protobuf.tpu.optimization_parameters_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/trackable_object_graph_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/trackable_object_graph_pb2.pyi index 1c944e6abd63..0c65575824a4 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/trackable_object_graph_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/trackable_object_graph_pb2.pyi @@ -4,11 +4,12 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import google.protobuf.wrappers_pb2 -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/transport_options_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/transport_options_pb2.pyi index 41c87481905f..53c27a86ecc0 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/transport_options_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/transport_options_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/verifier_config_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/verifier_config_pb2.pyi index 4f1ce5c9cc84..4be67334c55f 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/verifier_config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/verifier_config_pb2.pyi @@ -3,11 +3,12 @@ isort:skip_file """ import builtins +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/util/event_pb2.pyi b/stubs/tensorflow/tensorflow/core/util/event_pb2.pyi index 113f2cf5c80d..7cfa8385cd48 100644 --- a/stubs/tensorflow/tensorflow/core/util/event_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/util/event_pb2.pyi @@ -4,13 +4,14 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.core.framework.summary_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/util/memmapped_file_system_pb2.pyi b/stubs/tensorflow/tensorflow/core/util/memmapped_file_system_pb2.pyi index f04d62e218ea..0da3ecbf492a 100644 --- a/stubs/tensorflow/tensorflow/core/util/memmapped_file_system_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/util/memmapped_file_system_pb2.pyi @@ -18,10 +18,11 @@ limitations under the License. """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/util/saved_tensor_slice_pb2.pyi b/stubs/tensorflow/tensorflow/core/util/saved_tensor_slice_pb2.pyi index 370e8043f1aa..597ddc5fa4bc 100644 --- a/stubs/tensorflow/tensorflow/core/util/saved_tensor_slice_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/util/saved_tensor_slice_pb2.pyi @@ -17,10 +17,11 @@ debugging and manual examination. """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.tensor_slice_pb2 diff --git a/stubs/tensorflow/tensorflow/core/util/test_log_pb2.pyi b/stubs/tensorflow/tensorflow/core/util/test_log_pb2.pyi index 264cfa51e395..c58568965d3c 100644 --- a/stubs/tensorflow/tensorflow/core/util/test_log_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/util/test_log_pb2.pyi @@ -8,8 +8,8 @@ from tensorflow.tsl.protobuf.test_log_pb2 import ( BenchmarkEntries as BenchmarkEntries, BenchmarkEntry as BenchmarkEntry, BuildConfiguration as BuildConfiguration, - CPUInfo as CPUInfo, CommitId as CommitId, + CPUInfo as CPUInfo, EntryValue as EntryValue, GPUInfo as GPUInfo, MachineConfiguration as MachineConfiguration, diff --git a/stubs/tensorflow/tensorflow/python/keras/protobuf/projector_config_pb2.pyi b/stubs/tensorflow/tensorflow/python/keras/protobuf/projector_config_pb2.pyi index 6383058a7c9e..dadeda2aa5e5 100644 --- a/stubs/tensorflow/tensorflow/python/keras/protobuf/projector_config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/python/keras/protobuf/projector_config_pb2.pyi @@ -7,10 +7,11 @@ https://github.com/tensorflow/tensorboard/blob/master/tensorboard/plugins/projec """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/python/keras/protobuf/saved_metadata_pb2.pyi b/stubs/tensorflow/tensorflow/python/keras/protobuf/saved_metadata_pb2.pyi index 7c793df6b426..f42202cf8ff3 100644 --- a/stubs/tensorflow/tensorflow/python/keras/protobuf/saved_metadata_pb2.pyi +++ b/stubs/tensorflow/tensorflow/python/keras/protobuf/saved_metadata_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file Protobuf containing the metadata for each Keras object saved in a SavedModel.""" import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys import tensorflow.python.keras.protobuf.versions_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/python/keras/protobuf/versions_pb2.pyi b/stubs/tensorflow/tensorflow/python/keras/protobuf/versions_pb2.pyi index 94240448ecca..dd5c21cbcc4c 100644 --- a/stubs/tensorflow/tensorflow/python/keras/protobuf/versions_pb2.pyi +++ b/stubs/tensorflow/tensorflow/python/keras/protobuf/versions_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/autotuning_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/autotuning_pb2.pyi index 23fd55c3454f..38ee640d0923 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/autotuning_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/autotuning_pb2.pyi @@ -9,15 +9,16 @@ tremendous statistical, testing, and debugging value. """ import builtins import collections.abc +import sys +import typing + import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.duration_pb2 import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys import tensorflow.tsl.protobuf.dnn_pb2 -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/bfc_memory_map_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/bfc_memory_map_pb2.pyi index 413a1bd35dc2..a24cd0932392 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/bfc_memory_map_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/bfc_memory_map_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_config_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_config_pb2.pyi index 43efe80f355f..fcd757622079 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_config_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_service_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_service_pb2.pyi index 82a36f2e3379..7165c7199683 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_service_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_service_pb2.pyi @@ -4,13 +4,14 @@ isort:skip_file """ import builtins import collections.abc +import sys +import typing + import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/distributed_runtime_payloads_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/distributed_runtime_payloads_pb2.pyi index 3f2acfcf24bc..ed8dd9ae681e 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/distributed_runtime_payloads_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/distributed_runtime_payloads_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/dnn_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/dnn_pb2.pyi index c01a06d3e3b4..34faf347349c 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/dnn_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/dnn_pb2.pyi @@ -4,13 +4,14 @@ isort:skip_file LINT: LEGACY_NAMES""" import builtins import collections.abc +import sys +import typing + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import google.protobuf.wrappers_pb2 -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/error_codes_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/error_codes_pb2.pyi index 0ac76cd89e9a..0aa45efaf8cc 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/error_codes_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/error_codes_pb2.pyi @@ -5,11 +5,12 @@ TODO(b/247876220): Change package and java_package once we figure out how to migrate. """ import builtins -import google.protobuf.descriptor -import google.protobuf.internal.enum_type_wrapper import sys import typing +import google.protobuf.descriptor +import google.protobuf.internal.enum_type_wrapper + if sys.version_info >= (3, 10): import typing as typing_extensions else: diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/histogram_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/histogram_pb2.pyi index 71beb87eeccb..69ee0c2277e1 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/histogram_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/histogram_pb2.pyi @@ -4,10 +4,11 @@ isort:skip_file """ import builtins import collections.abc +import sys + import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/rpc_options_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/rpc_options_pb2.pyi index 0a54a3807d5b..62370eb9cc1d 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/rpc_options_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/rpc_options_pb2.pyi @@ -3,9 +3,10 @@ isort:skip_file """ import builtins +import sys + import google.protobuf.descriptor import google.protobuf.message -import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/test_log_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/test_log_pb2.pyi index a04bdc198824..48b4f7a5b43c 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/test_log_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/test_log_pb2.pyi @@ -4,14 +4,15 @@ isort:skip_file Protocol messages for describing the results of benchmarks and unit tests.""" import builtins import collections.abc +import sys +import typing + import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import google.protobuf.wrappers_pb2 -import sys -import typing if sys.version_info >= (3, 10): import typing as typing_extensions From 5bab6f11bee578cf277bed5c50d415578d9dd69b Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sat, 28 Oct 2023 12:33:10 +0100 Subject: [PATCH 15/15] Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks" This reverts commit f088656a576402b9c72a466980b63f709023439b. --- stubs/protobuf/google/protobuf/any_pb2.pyi | 3 +-- stubs/protobuf/google/protobuf/api_pb2.pyi | 3 +-- stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi | 5 ++--- stubs/protobuf/google/protobuf/descriptor_pb2.pyi | 5 ++--- stubs/protobuf/google/protobuf/duration_pb2.pyi | 3 +-- stubs/protobuf/google/protobuf/empty_pb2.pyi | 3 +-- stubs/protobuf/google/protobuf/field_mask_pb2.pyi | 3 +-- stubs/protobuf/google/protobuf/source_context_pb2.pyi | 3 +-- stubs/protobuf/google/protobuf/struct_pb2.pyi | 5 ++--- stubs/protobuf/google/protobuf/timestamp_pb2.pyi | 3 +-- stubs/protobuf/google/protobuf/type_pb2.pyi | 5 ++--- stubs/protobuf/google/protobuf/wrappers_pb2.pyi | 3 +-- stubs/s2clientprotocol/s2clientprotocol/common_pb2.pyi | 5 ++--- stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi | 5 ++--- stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi | 5 ++--- stubs/s2clientprotocol/s2clientprotocol/error_pb2.pyi | 5 ++--- stubs/s2clientprotocol/s2clientprotocol/query_pb2.pyi | 3 +-- stubs/s2clientprotocol/s2clientprotocol/raw_pb2.pyi | 5 ++--- stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi | 5 ++--- stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi | 5 ++--- stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi | 5 ++--- stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi | 5 ++--- .../tensorflow/compiler/xla/autotune_results_pb2.pyi | 3 +-- .../tensorflow/compiler/xla/service/hlo_pb2.pyi | 5 ++--- .../tensorflow/compiler/xla/service/metrics_pb2.pyi | 5 ++--- .../tensorflow/tensorflow/compiler/xla/xla_data_pb2.pyi | 5 ++--- .../core/example/example_parser_configuration_pb2.pyi | 3 +-- stubs/tensorflow/tensorflow/core/example/example_pb2.pyi | 3 +-- stubs/tensorflow/tensorflow/core/example/feature_pb2.pyi | 3 +-- .../core/framework/allocation_description_pb2.pyi | 3 +-- .../tensorflow/tensorflow/core/framework/api_def_pb2.pyi | 5 ++--- .../tensorflow/core/framework/attr_value_pb2.pyi | 3 +-- .../tensorflow/core/framework/cost_graph_pb2.pyi | 3 +-- .../tensorflow/core/framework/dataset_metadata_pb2.pyi | 3 +-- .../tensorflow/core/framework/dataset_options_pb2.pyi | 5 ++--- .../tensorflow/tensorflow/core/framework/dataset_pb2.pyi | 3 +-- .../tensorflow/core/framework/device_attributes_pb2.pyi | 3 +-- .../tensorflow/core/framework/full_type_pb2.pyi | 5 ++--- .../tensorflow/core/framework/function_pb2.pyi | 3 +-- stubs/tensorflow/tensorflow/core/framework/graph_pb2.pyi | 3 +-- .../core/framework/graph_transfer_info_pb2.pyi | 5 ++--- .../tensorflow/core/framework/kernel_def_pb2.pyi | 3 +-- .../tensorflow/core/framework/log_memory_pb2.pyi | 3 +-- stubs/tensorflow/tensorflow/core/framework/model_pb2.pyi | 5 ++--- .../tensorflow/core/framework/node_def_pb2.pyi | 3 +-- .../tensorflow/tensorflow/core/framework/op_def_pb2.pyi | 3 +-- .../core/framework/optimized_function_graph_pb2.pyi | 3 +-- .../tensorflow/core/framework/reader_base_pb2.pyi | 3 +-- .../tensorflow/core/framework/resource_handle_pb2.pyi | 3 +-- .../tensorflow/core/framework/step_stats_pb2.pyi | 3 +-- .../tensorflow/tensorflow/core/framework/summary_pb2.pyi | 9 +++++---- .../tensorflow/core/framework/tensor_description_pb2.pyi | 3 +-- .../tensorflow/tensorflow/core/framework/tensor_pb2.pyi | 3 +-- .../tensorflow/core/framework/tensor_shape_pb2.pyi | 3 +-- .../tensorflow/core/framework/tensor_slice_pb2.pyi | 3 +-- stubs/tensorflow/tensorflow/core/framework/types_pb2.pyi | 5 ++--- .../tensorflow/core/framework/variable_pb2.pyi | 5 ++--- .../tensorflow/core/framework/versions_pb2.pyi | 3 +-- .../tensorflow/tensorflow/core/protobuf/cluster_pb2.pyi | 3 +-- .../core/protobuf/composite_tensor_variant_pb2.pyi | 3 +-- stubs/tensorflow/tensorflow/core/protobuf/config_pb2.pyi | 5 ++--- .../tensorflow/core/protobuf/control_flow_pb2.pyi | 3 +-- .../tensorflow/core/protobuf/coordination_config_pb2.pyi | 3 +-- .../core/protobuf/core_platform_payloads_pb2.pyi | 5 ++--- .../tensorflow/core/protobuf/data_service_pb2.pyi | 5 ++--- .../tensorflow/core/protobuf/debug_event_pb2.pyi | 5 ++--- stubs/tensorflow/tensorflow/core/protobuf/debug_pb2.pyi | 3 +-- .../tensorflow/core/protobuf/device_filters_pb2.pyi | 3 +-- .../tensorflow/core/protobuf/device_properties_pb2.pyi | 3 +-- .../core/protobuf/distributed_runtime_payloads_pb2.pyi | 3 +-- .../tensorflow/core/protobuf/error_codes_pb2.pyi | 2 +- .../tensorflow/core/protobuf/fingerprint_pb2.pyi | 3 +-- .../tensorflow/core/protobuf/graph_debug_info_pb2.pyi | 3 +-- .../tensorflow/core/protobuf/meta_graph_pb2.pyi | 3 +-- .../tensorflow/core/protobuf/named_tensor_pb2.pyi | 3 +-- .../tensorflow/core/protobuf/queue_runner_pb2.pyi | 3 +-- .../core/protobuf/remote_tensor_handle_pb2.pyi | 3 +-- .../tensorflow/core/protobuf/rewriter_config_pb2.pyi | 5 ++--- .../tensorflow/core/protobuf/rpc_options_pb2.pyi | 4 +++- .../tensorflow/core/protobuf/saved_model_pb2.pyi | 3 +-- .../tensorflow/core/protobuf/saved_object_graph_pb2.pyi | 5 ++--- stubs/tensorflow/tensorflow/core/protobuf/saver_pb2.pyi | 5 ++--- .../tensorflow/core/protobuf/service_config_pb2.pyi | 3 +-- .../tensorflow/tensorflow/core/protobuf/snapshot_pb2.pyi | 3 +-- stubs/tensorflow/tensorflow/core/protobuf/struct_pb2.pyi | 5 ++--- .../tensorflow/core/protobuf/tensor_bundle_pb2.pyi | 5 ++--- .../tensorflow/core/protobuf/tensorflow_server_pb2.pyi | 3 +-- .../core/protobuf/tpu/compilation_result_pb2.pyi | 5 ++--- .../tensorflow/core/protobuf/tpu/dynamic_padding_pb2.pyi | 3 +-- .../core/protobuf/tpu/optimization_parameters_pb2.pyi | 5 ++--- .../tensorflow/core/protobuf/tpu/topology_pb2.pyi | 5 ++--- .../protobuf/tpu/tpu_embedding_configuration_pb2.pyi | 5 ++--- .../core/protobuf/trackable_object_graph_pb2.pyi | 3 +-- .../tensorflow/core/protobuf/transport_options_pb2.pyi | 3 +-- .../tensorflow/core/protobuf/verifier_config_pb2.pyi | 5 ++--- stubs/tensorflow/tensorflow/core/util/event_pb2.pyi | 5 ++--- .../tensorflow/core/util/memmapped_file_system_pb2.pyi | 3 +-- .../tensorflow/core/util/saved_tensor_slice_pb2.pyi | 3 +-- stubs/tensorflow/tensorflow/core/util/test_log_pb2.pyi | 2 +- .../python/keras/protobuf/projector_config_pb2.pyi | 3 +-- .../python/keras/protobuf/saved_metadata_pb2.pyi | 3 +-- .../tensorflow/python/keras/protobuf/versions_pb2.pyi | 3 +-- .../tensorflow/tsl/protobuf/autotuning_pb2.pyi | 5 ++--- .../tensorflow/tsl/protobuf/bfc_memory_map_pb2.pyi | 3 +-- .../tensorflow/tsl/protobuf/coordination_config_pb2.pyi | 3 +-- .../tensorflow/tsl/protobuf/coordination_service_pb2.pyi | 5 ++--- .../tsl/protobuf/distributed_runtime_payloads_pb2.pyi | 3 +-- stubs/tensorflow/tensorflow/tsl/protobuf/dnn_pb2.pyi | 5 ++--- .../tensorflow/tsl/protobuf/error_codes_pb2.pyi | 5 ++--- .../tensorflow/tensorflow/tsl/protobuf/histogram_pb2.pyi | 3 +-- .../tensorflow/tsl/protobuf/rpc_options_pb2.pyi | 3 +-- .../tensorflow/tensorflow/tsl/protobuf/test_log_pb2.pyi | 5 ++--- 112 files changed, 161 insertions(+), 266 deletions(-) diff --git a/stubs/protobuf/google/protobuf/any_pb2.pyi b/stubs/protobuf/google/protobuf/any_pb2.pyi index 1a9040cd5cfc..398a9abadb2c 100644 --- a/stubs/protobuf/google/protobuf/any_pb2.pyi +++ b/stubs/protobuf/google/protobuf/any_pb2.pyi @@ -32,11 +32,10 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.internal.well_known_types import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/api_pb2.pyi b/stubs/protobuf/google/protobuf/api_pb2.pyi index f4365a0e4dff..4cedb0da9211 100644 --- a/stubs/protobuf/google/protobuf/api_pb2.pyi +++ b/stubs/protobuf/google/protobuf/api_pb2.pyi @@ -33,13 +33,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import google.protobuf.source_context_pb2 import google.protobuf.type_pb2 +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi b/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi index 0c7ed03c2a00..a2e15b129f9c 100644 --- a/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi +++ b/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi @@ -19,14 +19,13 @@ flag "--${NAME}_out" is passed to protoc. """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.descriptor_pb2 import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi index 53257ff489d8..bda40e15e110 100644 --- a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +++ b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi @@ -11,13 +11,12 @@ without any other information (e.g. without reading its imports). """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/duration_pb2.pyi b/stubs/protobuf/google/protobuf/duration_pb2.pyi index 681097d80e34..d8f7931a71e7 100644 --- a/stubs/protobuf/google/protobuf/duration_pb2.pyi +++ b/stubs/protobuf/google/protobuf/duration_pb2.pyi @@ -32,11 +32,10 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.internal.well_known_types import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/empty_pb2.pyi b/stubs/protobuf/google/protobuf/empty_pb2.pyi index 2f1c614527bf..22ef26b7d1e7 100644 --- a/stubs/protobuf/google/protobuf/empty_pb2.pyi +++ b/stubs/protobuf/google/protobuf/empty_pb2.pyi @@ -31,10 +31,9 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/field_mask_pb2.pyi b/stubs/protobuf/google/protobuf/field_mask_pb2.pyi index 07012bab5bca..1721c1bc6234 100644 --- a/stubs/protobuf/google/protobuf/field_mask_pb2.pyi +++ b/stubs/protobuf/google/protobuf/field_mask_pb2.pyi @@ -33,12 +33,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.well_known_types import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/source_context_pb2.pyi b/stubs/protobuf/google/protobuf/source_context_pb2.pyi index e11d903038f6..cb4fb572eadc 100644 --- a/stubs/protobuf/google/protobuf/source_context_pb2.pyi +++ b/stubs/protobuf/google/protobuf/source_context_pb2.pyi @@ -32,10 +32,9 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/struct_pb2.pyi b/stubs/protobuf/google/protobuf/struct_pb2.pyi index b3716e5bab46..bf2771ec0d5d 100644 --- a/stubs/protobuf/google/protobuf/struct_pb2.pyi +++ b/stubs/protobuf/google/protobuf/struct_pb2.pyi @@ -33,14 +33,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.internal.well_known_types import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/timestamp_pb2.pyi b/stubs/protobuf/google/protobuf/timestamp_pb2.pyi index f5bfbc594c92..b8f5b636e752 100644 --- a/stubs/protobuf/google/protobuf/timestamp_pb2.pyi +++ b/stubs/protobuf/google/protobuf/timestamp_pb2.pyi @@ -32,11 +32,10 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.internal.well_known_types import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/type_pb2.pyi b/stubs/protobuf/google/protobuf/type_pb2.pyi index dca4537bd447..c66cd631176f 100644 --- a/stubs/protobuf/google/protobuf/type_pb2.pyi +++ b/stubs/protobuf/google/protobuf/type_pb2.pyi @@ -33,15 +33,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import collections.abc -import sys -import typing - import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import google.protobuf.source_context_pb2 +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/protobuf/google/protobuf/wrappers_pb2.pyi b/stubs/protobuf/google/protobuf/wrappers_pb2.pyi index 9cc4a3e8fedb..201b9258a751 100644 --- a/stubs/protobuf/google/protobuf/wrappers_pb2.pyi +++ b/stubs/protobuf/google/protobuf/wrappers_pb2.pyi @@ -12,10 +12,9 @@ These wrappers have no meaningful use within a map or a oneof since individual entries of a map or fields of a oneof can already detect presence. """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/common_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/common_pb2.pyi index cd8d993c12ae..36e5f70c985b 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/common_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/common_pb2.pyi @@ -3,12 +3,11 @@ isort:skip_file """ import builtins -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi index e9f840a88032..d53937df29b2 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi @@ -4,14 +4,13 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import s2clientprotocol.common_pb2 +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi index 39c19873b48c..5f605f93068f 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi @@ -4,14 +4,13 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import s2clientprotocol.common_pb2 +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/error_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/error_pb2.pyi index 9839a004052d..dce11d14ba85 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/error_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/error_pb2.pyi @@ -3,11 +3,10 @@ isort:skip_file """ import builtins -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/query_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/query_pb2.pyi index e954e46118e1..2077427a14b6 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/query_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/query_pb2.pyi @@ -4,13 +4,12 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import s2clientprotocol.common_pb2 import s2clientprotocol.error_pb2 +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/raw_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/raw_pb2.pyi index 3afb3e820a42..9a0c9aea4f47 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/raw_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/raw_pb2.pyi @@ -4,14 +4,13 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import s2clientprotocol.common_pb2 +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi index c4ad8fee6be4..c3b879600e48 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi @@ -4,9 +4,6 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper @@ -20,6 +17,8 @@ import s2clientprotocol.raw_pb2 import s2clientprotocol.score_pb2 import s2clientprotocol.spatial_pb2 import s2clientprotocol.ui_pb2 +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi index 6ccd3359cc04..a1c5360f371f 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi @@ -3,12 +3,11 @@ isort:skip_file """ import builtins -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi index d76fbf1f1331..5105e79a6db0 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi @@ -4,14 +4,13 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import s2clientprotocol.common_pb2 +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi index c0499b585dfe..480c4960360b 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi @@ -4,13 +4,12 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/compiler/xla/autotune_results_pb2.pyi b/stubs/tensorflow/tensorflow/compiler/xla/autotune_results_pb2.pyi index 1f107829d73a..d90b18cd68c1 100644 --- a/stubs/tensorflow/tensorflow/compiler/xla/autotune_results_pb2.pyi +++ b/stubs/tensorflow/tensorflow/compiler/xla/autotune_results_pb2.pyi @@ -18,11 +18,10 @@ limitations under the License. """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.tsl.protobuf.autotuning_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/compiler/xla/service/hlo_pb2.pyi b/stubs/tensorflow/tensorflow/compiler/xla/service/hlo_pb2.pyi index d3454c8ba0b9..46fa77106238 100644 --- a/stubs/tensorflow/tensorflow/compiler/xla/service/hlo_pb2.pyi +++ b/stubs/tensorflow/tensorflow/compiler/xla/service/hlo_pb2.pyi @@ -16,14 +16,13 @@ protos as JSON, which includes the field names in the serialization. """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.compiler.xla.xla_data_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/compiler/xla/service/metrics_pb2.pyi b/stubs/tensorflow/tensorflow/compiler/xla/service/metrics_pb2.pyi index 39993f67771b..f39a6bd921d6 100644 --- a/stubs/tensorflow/tensorflow/compiler/xla/service/metrics_pb2.pyi +++ b/stubs/tensorflow/tensorflow/compiler/xla/service/metrics_pb2.pyi @@ -3,14 +3,13 @@ isort:skip_file """ import builtins -import sys -import typing - import google.protobuf.descriptor import google.protobuf.duration_pb2 import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import google.protobuf.timestamp_pb2 +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/compiler/xla/xla_data_pb2.pyi b/stubs/tensorflow/tensorflow/compiler/xla/xla_data_pb2.pyi index a283b93afb07..f4e34a285982 100644 --- a/stubs/tensorflow/tensorflow/compiler/xla/xla_data_pb2.pyi +++ b/stubs/tensorflow/tensorflow/compiler/xla/xla_data_pb2.pyi @@ -18,13 +18,12 @@ limitations under the License. """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/example/example_parser_configuration_pb2.pyi b/stubs/tensorflow/tensorflow/core/example/example_parser_configuration_pb2.pyi index 7b24d84e01e1..52e42c6a3fc2 100644 --- a/stubs/tensorflow/tensorflow/core/example/example_parser_configuration_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/example/example_parser_configuration_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file Protocol messages for describing the configuration of the ExampleParserOp.""" import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/example/example_pb2.pyi b/stubs/tensorflow/tensorflow/core/example/example_pb2.pyi index cd4bcd511a7e..4fb6132fdf08 100644 --- a/stubs/tensorflow/tensorflow/core/example/example_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/example/example_pb2.pyi @@ -5,10 +5,9 @@ Protocol messages for describing input data Examples for machine learning model training or inference. """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys import tensorflow.core.example.feature_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/example/feature_pb2.pyi b/stubs/tensorflow/tensorflow/core/example/feature_pb2.pyi index 42bfb4d4f9f0..1739ce2aef40 100644 --- a/stubs/tensorflow/tensorflow/core/example/feature_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/example/feature_pb2.pyi @@ -57,11 +57,10 @@ Example Features for a movie recommendation application: """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/allocation_description_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/allocation_description_pb2.pyi index e1d5638202f1..b53507ce6064 100644 --- a/stubs/tensorflow/tensorflow/core/framework/allocation_description_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/allocation_description_pb2.pyi @@ -3,10 +3,9 @@ isort:skip_file """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/api_def_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/api_def_pb2.pyi index b2f1a514a69e..6ca86a438448 100644 --- a/stubs/tensorflow/tensorflow/core/framework/api_def_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/api_def_pb2.pyi @@ -6,14 +6,13 @@ overrides for client language op code generators. """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.core.framework.attr_value_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/attr_value_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/attr_value_pb2.pyi index 11566fd7fb19..5e148bb273df 100644 --- a/stubs/tensorflow/tensorflow/core/framework/attr_value_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/attr_value_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/cost_graph_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/cost_graph_pb2.pyi index 1aa0b7a153a3..69f4580d5c6f 100644 --- a/stubs/tensorflow/tensorflow/core/framework/cost_graph_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/cost_graph_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/dataset_metadata_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/dataset_metadata_pb2.pyi index ff792ea47c46..5ab21cfac43b 100644 --- a/stubs/tensorflow/tensorflow/core/framework/dataset_metadata_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/dataset_metadata_pb2.pyi @@ -3,10 +3,9 @@ isort:skip_file """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/dataset_options_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/dataset_options_pb2.pyi index d31d1d267f9e..651c02975047 100644 --- a/stubs/tensorflow/tensorflow/core/framework/dataset_options_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/dataset_options_pb2.pyi @@ -3,13 +3,12 @@ isort:skip_file """ import builtins -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.core.framework.model_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/dataset_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/dataset_pb2.pyi index b2e987481ccf..432d6f4f57a5 100644 --- a/stubs/tensorflow/tensorflow/core/framework/dataset_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/dataset_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/device_attributes_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/device_attributes_pb2.pyi index 4b1dbd3d3ffa..116157d43832 100644 --- a/stubs/tensorflow/tensorflow/core/framework/device_attributes_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/device_attributes_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/full_type_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/full_type_pb2.pyi index 0c5e1e9d955a..b41f5f4da2fc 100644 --- a/stubs/tensorflow/tensorflow/core/framework/full_type_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/full_type_pb2.pyi @@ -4,13 +4,12 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/function_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/function_pb2.pyi index 4f920a308aa4..266ceef3c17b 100644 --- a/stubs/tensorflow/tensorflow/core/framework/function_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/function_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.attr_value_pb2 import tensorflow.core.framework.node_def_pb2 import tensorflow.core.framework.op_def_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/graph_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/graph_pb2.pyi index 9ff82c9d8cff..e58eab70eafd 100644 --- a/stubs/tensorflow/tensorflow/core/framework/graph_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/graph_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.function_pb2 import tensorflow.core.framework.node_def_pb2 import tensorflow.core.framework.versions_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/graph_transfer_info_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/graph_transfer_info_pb2.pyi index 88b587cf2434..908dddd1fe8b 100644 --- a/stubs/tensorflow/tensorflow/core/framework/graph_transfer_info_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/graph_transfer_info_pb2.pyi @@ -4,14 +4,13 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.core.framework.types_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/kernel_def_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/kernel_def_pb2.pyi index 53c54aab27da..d3b04135d493 100644 --- a/stubs/tensorflow/tensorflow/core/framework/kernel_def_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/kernel_def_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.attr_value_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/framework/log_memory_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/log_memory_pb2.pyi index d3c6f0dd8261..45e50508459a 100644 --- a/stubs/tensorflow/tensorflow/core/framework/log_memory_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/log_memory_pb2.pyi @@ -3,10 +3,9 @@ isort:skip_file """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys import tensorflow.core.framework.tensor_description_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/framework/model_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/model_pb2.pyi index 8c4fdf2af8e0..97cdf1f276b1 100644 --- a/stubs/tensorflow/tensorflow/core/framework/model_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/model_pb2.pyi @@ -4,13 +4,12 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/node_def_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/node_def_pb2.pyi index 8e8b352b7837..e146faecf898 100644 --- a/stubs/tensorflow/tensorflow/core/framework/node_def_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/node_def_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.attr_value_pb2 import tensorflow.core.framework.full_type_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/op_def_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/op_def_pb2.pyi index 0e384331dd90..acee7309c540 100644 --- a/stubs/tensorflow/tensorflow/core/framework/op_def_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/op_def_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.attr_value_pb2 import tensorflow.core.framework.full_type_pb2 import tensorflow.core.framework.resource_handle_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/optimized_function_graph_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/optimized_function_graph_pb2.pyi index 8709c3987750..a9097c746f44 100644 --- a/stubs/tensorflow/tensorflow/core/framework/optimized_function_graph_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/optimized_function_graph_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.graph_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/reader_base_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/reader_base_pb2.pyi index 3f395b4570c0..2e06dfa7766a 100644 --- a/stubs/tensorflow/tensorflow/core/framework/reader_base_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/reader_base_pb2.pyi @@ -3,10 +3,9 @@ isort:skip_file """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/resource_handle_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/resource_handle_pb2.pyi index d92b2f765265..cda284bf2e89 100644 --- a/stubs/tensorflow/tensorflow/core/framework/resource_handle_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/resource_handle_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/step_stats_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/step_stats_pb2.pyi index 8261e5730ea2..23f790f0d378 100644 --- a/stubs/tensorflow/tensorflow/core/framework/step_stats_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/step_stats_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.allocation_description_pb2 import tensorflow.core.framework.tensor_description_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/summary_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/summary_pb2.pyi index 609abbe28650..a6ffc8512dfc 100644 --- a/stubs/tensorflow/tensorflow/core/framework/summary_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/summary_pb2.pyi @@ -4,21 +4,22 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.tsl.protobuf.histogram_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions else: import typing_extensions -from tensorflow.tsl.protobuf.histogram_pb2 import HistogramProto as HistogramProto +from tensorflow.tsl.protobuf.histogram_pb2 import ( + HistogramProto as HistogramProto, +) DESCRIPTOR: google.protobuf.descriptor.FileDescriptor diff --git a/stubs/tensorflow/tensorflow/core/framework/tensor_description_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/tensor_description_pb2.pyi index f6c348b8a14b..3fadbcb2475a 100644 --- a/stubs/tensorflow/tensorflow/core/framework/tensor_description_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/tensor_description_pb2.pyi @@ -3,10 +3,9 @@ isort:skip_file """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys import tensorflow.core.framework.allocation_description_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/tensor_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/tensor_pb2.pyi index 393b94d909f6..43f84a36134f 100644 --- a/stubs/tensorflow/tensorflow/core/framework/tensor_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/tensor_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.resource_handle_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/framework/tensor_shape_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/tensor_shape_pb2.pyi index 37a6a5279201..cf0219ed9324 100644 --- a/stubs/tensorflow/tensorflow/core/framework/tensor_shape_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/tensor_shape_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file Protocol buffer representing the shape of tensors.""" import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/tensor_slice_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/tensor_slice_pb2.pyi index cfc3e361d699..17391655c559 100644 --- a/stubs/tensorflow/tensorflow/core/framework/tensor_slice_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/tensor_slice_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file Protocol buffer representing slices of a tensor""" import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/types_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/types_pb2.pyi index 9f4d4fea804f..48bc3ca55ec2 100644 --- a/stubs/tensorflow/tensorflow/core/framework/types_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/types_pb2.pyi @@ -3,12 +3,11 @@ isort:skip_file """ import builtins -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/variable_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/variable_pb2.pyi index 2c7796d2f573..4dbea275cbf7 100644 --- a/stubs/tensorflow/tensorflow/core/framework/variable_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/variable_pb2.pyi @@ -4,13 +4,12 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/framework/versions_pb2.pyi b/stubs/tensorflow/tensorflow/core/framework/versions_pb2.pyi index 4df61f398301..571754ba5f3f 100644 --- a/stubs/tensorflow/tensorflow/core/framework/versions_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/framework/versions_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/cluster_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/cluster_pb2.pyi index e9f986e3a24e..a53a7d5f0415 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/cluster_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/cluster_pb2.pyi @@ -18,11 +18,10 @@ limitations under the License. """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/composite_tensor_variant_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/composite_tensor_variant_pb2.pyi index eb143db57da9..3cdfcd186540 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/composite_tensor_variant_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/composite_tensor_variant_pb2.pyi @@ -3,10 +3,9 @@ isort:skip_file """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys import tensorflow.core.protobuf.struct_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/protobuf/config_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/config_pb2.pyi index d45828cd305c..9a145bf28a70 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/config_pb2.pyi @@ -4,13 +4,11 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.core.framework.cost_graph_pb2 import tensorflow.core.framework.graph_pb2 import tensorflow.core.framework.step_stats_pb2 @@ -19,6 +17,7 @@ import tensorflow.core.protobuf.debug_pb2 import tensorflow.core.protobuf.rewriter_config_pb2 import tensorflow.tsl.protobuf.coordination_config_pb2 import tensorflow.tsl.protobuf.rpc_options_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/control_flow_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/control_flow_pb2.pyi index cb0fd3576554..47f05d32b600 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/control_flow_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/control_flow_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/coordination_config_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/coordination_config_pb2.pyi index fcd757622079..43efe80f355f 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/coordination_config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/coordination_config_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/core_platform_payloads_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/core_platform_payloads_pb2.pyi index f06c008c37ba..496d0096f81a 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/core_platform_payloads_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/core_platform_payloads_pb2.pyi @@ -3,12 +3,11 @@ isort:skip_file """ import builtins -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/data_service_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/data_service_pb2.pyi index 151a3d18ec47..6924223b44ab 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/data_service_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/data_service_pb2.pyi @@ -3,12 +3,11 @@ isort:skip_file """ import builtins -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/debug_event_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/debug_event_pb2.pyi index 89570d7cef77..fec65984da15 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/debug_event_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/debug_event_pb2.pyi @@ -4,15 +4,14 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.protobuf.graph_debug_info_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/debug_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/debug_pb2.pyi index 106a26b01072..f7779853a347 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/debug_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/debug_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/device_filters_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/device_filters_pb2.pyi index e26f3a083842..d00378cd471c 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/device_filters_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/device_filters_pb2.pyi @@ -18,11 +18,10 @@ limitations under the License. """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/device_properties_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/device_properties_pb2.pyi index b3ec2632a7a8..366f318856ae 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/device_properties_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/device_properties_pb2.pyi @@ -18,11 +18,10 @@ limitations under the License. """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/distributed_runtime_payloads_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/distributed_runtime_payloads_pb2.pyi index ed8dd9ae681e..3f2acfcf24bc 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/distributed_runtime_payloads_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/distributed_runtime_payloads_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/error_codes_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/error_codes_pb2.pyi index 093797947d01..447469dda71b 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/error_codes_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/error_codes_pb2.pyi @@ -11,6 +11,7 @@ from tensorflow.tsl.protobuf.error_codes_pb2 import ( ABORTED as ABORTED, ALREADY_EXISTS as ALREADY_EXISTS, CANCELLED as CANCELLED, + Code as Code, DATA_LOSS as DATA_LOSS, DEADLINE_EXCEEDED as DEADLINE_EXCEEDED, DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_ as DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_, @@ -26,7 +27,6 @@ from tensorflow.tsl.protobuf.error_codes_pb2 import ( UNAVAILABLE as UNAVAILABLE, UNIMPLEMENTED as UNIMPLEMENTED, UNKNOWN as UNKNOWN, - Code as Code, ) DESCRIPTOR: google.protobuf.descriptor.FileDescriptor diff --git a/stubs/tensorflow/tensorflow/core/protobuf/fingerprint_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/fingerprint_pb2.pyi index be397855b80c..bda6e036b957 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/fingerprint_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/fingerprint_pb2.pyi @@ -3,10 +3,9 @@ isort:skip_file """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys import tensorflow.core.framework.versions_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/protobuf/graph_debug_info_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/graph_debug_info_pb2.pyi index ae0527450348..e2298201ddb1 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/graph_debug_info_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/graph_debug_info_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/meta_graph_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/meta_graph_pb2.pyi index 0506fc7a8b1a..18fd35693c00 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/meta_graph_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/meta_graph_pb2.pyi @@ -4,12 +4,11 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.graph_pb2 import tensorflow.core.framework.op_def_pb2 import tensorflow.core.framework.tensor_shape_pb2 diff --git a/stubs/tensorflow/tensorflow/core/protobuf/named_tensor_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/named_tensor_pb2.pyi index b45f134db7f6..419e650c8ccb 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/named_tensor_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/named_tensor_pb2.pyi @@ -3,10 +3,9 @@ isort:skip_file """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys import tensorflow.core.framework.tensor_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/protobuf/queue_runner_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/queue_runner_pb2.pyi index 59d932074fc1..332144151ce1 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/queue_runner_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/queue_runner_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.tsl.protobuf.error_codes_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/protobuf/remote_tensor_handle_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/remote_tensor_handle_pb2.pyi index 55607e50b4a8..a2bff6d62edd 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/remote_tensor_handle_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/remote_tensor_handle_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/protobuf/rewriter_config_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/rewriter_config_pb2.pyi index 9bf638aa42bd..9338ba89180c 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/rewriter_config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/rewriter_config_pb2.pyi @@ -4,15 +4,14 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.core.framework.attr_value_pb2 import tensorflow.core.protobuf.verifier_config_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/rpc_options_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/rpc_options_pb2.pyi index f81919a4fc42..462a1076bd8e 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/rpc_options_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/rpc_options_pb2.pyi @@ -3,6 +3,8 @@ isort:skip_file """ import google.protobuf.descriptor -from tensorflow.tsl.protobuf.rpc_options_pb2 import RPCOptions as RPCOptions +from tensorflow.tsl.protobuf.rpc_options_pb2 import ( + RPCOptions as RPCOptions, +) DESCRIPTOR: google.protobuf.descriptor.FileDescriptor diff --git a/stubs/tensorflow/tensorflow/core/protobuf/saved_model_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/saved_model_pb2.pyi index 7c32f95070fd..0c412101c5aa 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/saved_model_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/saved_model_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.protobuf.meta_graph_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/protobuf/saved_object_graph_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/saved_object_graph_pb2.pyi index c74ca7cedfde..15adf4ec318d 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/saved_object_graph_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/saved_object_graph_pb2.pyi @@ -4,20 +4,19 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 import tensorflow.core.framework.variable_pb2 import tensorflow.core.framework.versions_pb2 import tensorflow.core.protobuf.struct_pb2 import tensorflow.core.protobuf.trackable_object_graph_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/saver_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/saver_pb2.pyi index a5acf0bec8f1..7f91d63a9162 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/saver_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/saver_pb2.pyi @@ -3,12 +3,11 @@ isort:skip_file """ import builtins -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/service_config_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/service_config_pb2.pyi index 99465a6b94ef..d8db4cbe077b 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/service_config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/service_config_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.protobuf.data_service_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/core/protobuf/snapshot_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/snapshot_pb2.pyi index 7db51bb8518b..f9198cc248de 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/snapshot_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/snapshot_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 diff --git a/stubs/tensorflow/tensorflow/core/protobuf/struct_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/struct_pb2.pyi index 9321d8378630..e8341d120292 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/struct_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/struct_pb2.pyi @@ -4,16 +4,15 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.types_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tensor_bundle_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tensor_bundle_pb2.pyi index a55ef36b3c49..cbb1e71ffaea 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tensor_bundle_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tensor_bundle_pb2.pyi @@ -4,17 +4,16 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.tensor_slice_pb2 import tensorflow.core.framework.types_pb2 import tensorflow.core.framework.versions_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tensorflow_server_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tensorflow_server_pb2.pyi index 781baf8375ad..624e4a471043 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tensorflow_server_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tensorflow_server_pb2.pyi @@ -17,10 +17,9 @@ limitations under the License. ============================================================================== """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys import tensorflow.core.protobuf.cluster_pb2 import tensorflow.core.protobuf.config_pb2 import tensorflow.core.protobuf.device_filters_pb2 diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tpu/compilation_result_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tpu/compilation_result_pb2.pyi index 639d1049656b..a4f60a5be39f 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tpu/compilation_result_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tpu/compilation_result_pb2.pyi @@ -4,15 +4,14 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.compiler.xla.service.hlo_pb2 import tensorflow.tsl.protobuf.error_codes_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tpu/dynamic_padding_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tpu/dynamic_padding_pb2.pyi index b296008931f0..5b1d1c7f4b12 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tpu/dynamic_padding_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tpu/dynamic_padding_pb2.pyi @@ -3,10 +3,9 @@ isort:skip_file """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tpu/optimization_parameters_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tpu/optimization_parameters_pb2.pyi index c9b6adebc541..2bfa1b94e563 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tpu/optimization_parameters_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tpu/optimization_parameters_pb2.pyi @@ -3,14 +3,13 @@ isort:skip_file """ import builtins -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import google.protobuf.wrappers_pb2 +import sys import tensorflow.compiler.xla.service.hlo_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tpu/topology_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tpu/topology_pb2.pyi index be5e58a28d5d..2c88cfeab08f 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tpu/topology_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tpu/topology_pb2.pyi @@ -4,13 +4,12 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/tpu/tpu_embedding_configuration_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/tpu/tpu_embedding_configuration_pb2.pyi index 2568ba183172..bc80fce661a2 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/tpu/tpu_embedding_configuration_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/tpu/tpu_embedding_configuration_pb2.pyi @@ -4,14 +4,13 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.core.protobuf.tpu.optimization_parameters_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/trackable_object_graph_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/trackable_object_graph_pb2.pyi index 0c65575824a4..1c944e6abd63 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/trackable_object_graph_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/trackable_object_graph_pb2.pyi @@ -4,12 +4,11 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import google.protobuf.wrappers_pb2 +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/transport_options_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/transport_options_pb2.pyi index 53c27a86ecc0..41c87481905f 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/transport_options_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/transport_options_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/protobuf/verifier_config_pb2.pyi b/stubs/tensorflow/tensorflow/core/protobuf/verifier_config_pb2.pyi index 4be67334c55f..4f1ce5c9cc84 100644 --- a/stubs/tensorflow/tensorflow/core/protobuf/verifier_config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/protobuf/verifier_config_pb2.pyi @@ -3,12 +3,11 @@ isort:skip_file """ import builtins -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/util/event_pb2.pyi b/stubs/tensorflow/tensorflow/core/util/event_pb2.pyi index 7cfa8385cd48..113f2cf5c80d 100644 --- a/stubs/tensorflow/tensorflow/core/util/event_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/util/event_pb2.pyi @@ -4,14 +4,13 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.core.framework.summary_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/util/memmapped_file_system_pb2.pyi b/stubs/tensorflow/tensorflow/core/util/memmapped_file_system_pb2.pyi index 0da3ecbf492a..f04d62e218ea 100644 --- a/stubs/tensorflow/tensorflow/core/util/memmapped_file_system_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/util/memmapped_file_system_pb2.pyi @@ -18,11 +18,10 @@ limitations under the License. """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/core/util/saved_tensor_slice_pb2.pyi b/stubs/tensorflow/tensorflow/core/util/saved_tensor_slice_pb2.pyi index 597ddc5fa4bc..370e8043f1aa 100644 --- a/stubs/tensorflow/tensorflow/core/util/saved_tensor_slice_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/util/saved_tensor_slice_pb2.pyi @@ -17,11 +17,10 @@ debugging and manual examination. """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.core.framework.tensor_pb2 import tensorflow.core.framework.tensor_shape_pb2 import tensorflow.core.framework.tensor_slice_pb2 diff --git a/stubs/tensorflow/tensorflow/core/util/test_log_pb2.pyi b/stubs/tensorflow/tensorflow/core/util/test_log_pb2.pyi index c58568965d3c..264cfa51e395 100644 --- a/stubs/tensorflow/tensorflow/core/util/test_log_pb2.pyi +++ b/stubs/tensorflow/tensorflow/core/util/test_log_pb2.pyi @@ -8,8 +8,8 @@ from tensorflow.tsl.protobuf.test_log_pb2 import ( BenchmarkEntries as BenchmarkEntries, BenchmarkEntry as BenchmarkEntry, BuildConfiguration as BuildConfiguration, - CommitId as CommitId, CPUInfo as CPUInfo, + CommitId as CommitId, EntryValue as EntryValue, GPUInfo as GPUInfo, MachineConfiguration as MachineConfiguration, diff --git a/stubs/tensorflow/tensorflow/python/keras/protobuf/projector_config_pb2.pyi b/stubs/tensorflow/tensorflow/python/keras/protobuf/projector_config_pb2.pyi index dadeda2aa5e5..6383058a7c9e 100644 --- a/stubs/tensorflow/tensorflow/python/keras/protobuf/projector_config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/python/keras/protobuf/projector_config_pb2.pyi @@ -7,11 +7,10 @@ https://github.com/tensorflow/tensorboard/blob/master/tensorboard/plugins/projec """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/python/keras/protobuf/saved_metadata_pb2.pyi b/stubs/tensorflow/tensorflow/python/keras/protobuf/saved_metadata_pb2.pyi index f42202cf8ff3..7c793df6b426 100644 --- a/stubs/tensorflow/tensorflow/python/keras/protobuf/saved_metadata_pb2.pyi +++ b/stubs/tensorflow/tensorflow/python/keras/protobuf/saved_metadata_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file Protobuf containing the metadata for each Keras object saved in a SavedModel.""" import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys import tensorflow.python.keras.protobuf.versions_pb2 if sys.version_info >= (3, 8): diff --git a/stubs/tensorflow/tensorflow/python/keras/protobuf/versions_pb2.pyi b/stubs/tensorflow/tensorflow/python/keras/protobuf/versions_pb2.pyi index dd5c21cbcc4c..94240448ecca 100644 --- a/stubs/tensorflow/tensorflow/python/keras/protobuf/versions_pb2.pyi +++ b/stubs/tensorflow/tensorflow/python/keras/protobuf/versions_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/autotuning_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/autotuning_pb2.pyi index 38ee640d0923..23fd55c3454f 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/autotuning_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/autotuning_pb2.pyi @@ -9,16 +9,15 @@ tremendous statistical, testing, and debugging value. """ import builtins import collections.abc -import sys -import typing - import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.duration_pb2 import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import tensorflow.tsl.protobuf.dnn_pb2 +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/bfc_memory_map_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/bfc_memory_map_pb2.pyi index a24cd0932392..413a1bd35dc2 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/bfc_memory_map_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/bfc_memory_map_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_config_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_config_pb2.pyi index fcd757622079..43efe80f355f 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_config_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_config_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_service_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_service_pb2.pyi index 7165c7199683..82a36f2e3379 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_service_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/coordination_service_pb2.pyi @@ -4,14 +4,13 @@ isort:skip_file """ import builtins import collections.abc -import sys -import typing - import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/distributed_runtime_payloads_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/distributed_runtime_payloads_pb2.pyi index ed8dd9ae681e..3f2acfcf24bc 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/distributed_runtime_payloads_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/distributed_runtime_payloads_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/dnn_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/dnn_pb2.pyi index 34faf347349c..c01a06d3e3b4 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/dnn_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/dnn_pb2.pyi @@ -4,14 +4,13 @@ isort:skip_file LINT: LEGACY_NAMES""" import builtins import collections.abc -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import google.protobuf.wrappers_pb2 +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/error_codes_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/error_codes_pb2.pyi index 0aa45efaf8cc..0ac76cd89e9a 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/error_codes_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/error_codes_pb2.pyi @@ -5,11 +5,10 @@ TODO(b/247876220): Change package and java_package once we figure out how to migrate. """ import builtins -import sys -import typing - import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/histogram_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/histogram_pb2.pyi index 69ee0c2277e1..71beb87eeccb 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/histogram_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/histogram_pb2.pyi @@ -4,11 +4,10 @@ isort:skip_file """ import builtins import collections.abc -import sys - import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/rpc_options_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/rpc_options_pb2.pyi index 62370eb9cc1d..0a54a3807d5b 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/rpc_options_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/rpc_options_pb2.pyi @@ -3,10 +3,9 @@ isort:skip_file """ import builtins -import sys - import google.protobuf.descriptor import google.protobuf.message +import sys if sys.version_info >= (3, 8): import typing as typing_extensions diff --git a/stubs/tensorflow/tensorflow/tsl/protobuf/test_log_pb2.pyi b/stubs/tensorflow/tensorflow/tsl/protobuf/test_log_pb2.pyi index 48b4f7a5b43c..a04bdc198824 100644 --- a/stubs/tensorflow/tensorflow/tsl/protobuf/test_log_pb2.pyi +++ b/stubs/tensorflow/tensorflow/tsl/protobuf/test_log_pb2.pyi @@ -4,15 +4,14 @@ isort:skip_file Protocol messages for describing the results of benchmarks and unit tests.""" import builtins import collections.abc -import sys -import typing - import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import google.protobuf.wrappers_pb2 +import sys +import typing if sys.version_info >= (3, 10): import typing as typing_extensions