id
int64
0
190k
prompt
stringlengths
21
13.4M
docstring
stringlengths
1
12k
171,762
import os from typing import Optional from ._password_hasher import ( DEFAULT_HASH_LENGTH, DEFAULT_MEMORY_COST, DEFAULT_PARALLELISM, DEFAULT_RANDOM_SALT_LENGTH, DEFAULT_TIME_COST, ) from ._typing import Literal from .low_level import Type, hash_secret, hash_secret_raw, verify_secret class Type(Enum...
Legacy alias for :func:`verify_secret` with default parameters. .. deprecated:: 16.0.0 Use :class:`argon2.PasswordHasher` for passwords.
171,763
from enum import Enum from typing import Any from _argon2_cffi_bindings import ffi, lib from ._typing import Literal from .exceptions import HashingError, VerificationError, VerifyMismatchError Any = object() The provided code snippet includes necessary dependencies for implementing the `core` function. Write a Pytho...
Direct binding to the ``argon2_ctx`` function. .. warning:: This is a strictly advanced function working on raw C data structures. Both *Argon2*'s and *argon2-cffi*'s higher-level bindings do a lot of sanity checks and housekeeping work that *you* are now responsible for (e.g. clearing buffers). The structure of the *c...
171,764
from __future__ import annotations from collections.abc import Iterable import string from types import MappingProxyType from typing import Any, BinaryIO, NamedTuple from ._re import ( RE_DATETIME, RE_LOCALTIME, RE_NUMBER, match_to_datetime, match_to_localtime, match_to_number, ) from ._types im...
Parse TOML from a binary file object.
171,765
from __future__ import annotations import math def two_factors(n: int) -> tuple[int, int]: """Split an integer into two integer factors. The two factors will be as close as possible to the sqrt of n, and are returned in decreasing order. Worst case returns (n, 1). Args: n (int): The integer to ...
Calculate chunk sizes. Args: chunk_size (int or tuple(int, int), optional): Chunk size in (y, x) directions, or the same size in both directions if only one is specified. chunk_count (int or tuple(int, int), optional): Chunk count in (y, x) directions, or the same count in both irections if only one is specified. total...
171,766
from __future__ import annotations from contourpy._contourpy import FillType, LineType, ZInterp The provided code snippet includes necessary dependencies for implementing the `as_fill_type` function. Write a Python function `def as_fill_type(fill_type: FillType | str) -> FillType` to solve the following problem: Coerc...
Coerce a FillType or string value to a FillType. Args: fill_type (FillType or str): Value to convert. Return: FillType: Converted value.
171,767
from __future__ import annotations from contourpy._contourpy import FillType, LineType, ZInterp The provided code snippet includes necessary dependencies for implementing the `as_line_type` function. Write a Python function `def as_line_type(line_type: LineType | str) -> LineType` to solve the following problem: Coerc...
Coerce a LineType or string value to a LineType. Args: line_type (LineType or str): Value to convert. Return: LineType: Converted value.
171,768
from __future__ import annotations from contourpy._contourpy import FillType, LineType, ZInterp The provided code snippet includes necessary dependencies for implementing the `as_z_interp` function. Write a Python function `def as_z_interp(z_interp: ZInterp | str) -> ZInterp` to solve the following problem: Coerce a Z...
Coerce a ZInterp or string value to a ZInterp. Args: z_interp (ZInterp or str): Value to convert. Return: ZInterp: Converted value.
171,769
from __future__ import annotations from typing import TYPE_CHECKING, Any import numpy as np Any = object() try: import numpy except ImportError: pass The provided code snippet includes necessary dependencies for implementing the `simple` function. Write a Python function `def simple( shape: tuple[int, in...
Return simple test data consisting of the sum of two gaussians. Args: shape (tuple(int, int)): 2D shape of data to return. want_mask (bool, optional): Whether test data should be masked or not, default ``False``. Return: Tuple of 3 arrays: ``x``, ``y``, ``z`` test data, ``z`` will be masked if ``want_mask=True``.
171,770
from __future__ import annotations from typing import TYPE_CHECKING, Any import numpy as np Any = object() try: import numpy except ImportError: pass The provided code snippet includes necessary dependencies for implementing the `random` function. Write a Python function `def random( shape: tuple[int, in...
Return random test data.. Args: shape (tuple(int, int)): 2D shape of data to return. seed (int, optional): Seed for random number generator, default 2187. mask_fraction (float, optional): Fraction of elements to mask, default 0. Return: Tuple of 3 arrays: ``x``, ``y``, ``z`` test data, ``z`` will be masked if ``mask_fr...
171,771
from __future__ import annotations from typing import TYPE_CHECKING, cast import matplotlib.path as mpath import numpy as np from contourpy import FillType, LineType def offsets_to_mpl_codes(offsets: OffsetArray) -> CodeArray: codes = np.full(offsets[-1]-offsets[0], 2, dtype=np.uint8) # LINETO = 2 codes[offset...
null
171,772
from __future__ import annotations from typing import TYPE_CHECKING, cast import matplotlib.path as mpath import numpy as np from contourpy import FillType, LineType if TYPE_CHECKING: from contourpy._contourpy import ( CodeArray, FillReturn, LineReturn, LineReturn_Separate, OffsetArray, ) TYPE_CHECKING...
null
171,773
from __future__ import annotations from typing import TYPE_CHECKING, cast from contourpy import FillType, LineType from contourpy.util.mpl_util import mpl_codes_to_offsets def mpl_codes_to_offsets(codes: CodeArray) -> OffsetArray: offsets = np.nonzero(codes == 1)[0].astype(np.uint32) offsets = np.append(offset...
null
171,774
from __future__ import annotations from typing import TYPE_CHECKING, cast from contourpy import FillType, LineType from contourpy.util.mpl_util import mpl_codes_to_offsets if TYPE_CHECKING: from contourpy._contourpy import ( CoordinateArray, FillReturn, LineReturn, LineReturn_Separate, LineReturn_SeparateCo...
null
171,775
from numbers import Number from functools import partial import math import textwrap import warnings import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.transforms as tx from matplotlib.colors import to_rgba from matplotlib.collections import LineCollection ...
null
171,776
from numbers import Number from functools import partial import math import textwrap import warnings import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.transforms as tx from matplotlib.colors import to_rgba from matplotlib.collections import LineCollection ...
DEPRECATED This function has been deprecated and will be removed in seaborn v0.14.0. It has been replaced by :func:`histplot` and :func:`displot`, two functions with a modern API and many more capabilities. For a guide to updating, please see this notebook: https://gist.github.com/mwaskom/de44147ed2974457ad6372750bbe57...
171,777
from textwrap import dedent from numbers import Number import warnings from colorsys import rgb_to_hls from functools import partial import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.collections import PatchCollection import matplotlib.patches as Patches import matplotlib.pyplot as plt fro...
null
171,778
from textwrap import dedent from numbers import Number import warnings from colorsys import rgb_to_hls from functools import partial import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.collections import PatchCollection import matplotlib.patches as Patches import matplotlib.pyplot as plt fro...
null
171,779
from textwrap import dedent from numbers import Number import warnings from colorsys import rgb_to_hls from functools import partial import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.collections import PatchCollection import matplotlib.patches as Patches import matplotlib.pyplot as plt fro...
null
171,780
from textwrap import dedent from numbers import Number import warnings from colorsys import rgb_to_hls from functools import partial import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.collections import PatchCollection import matplotlib.patches as Patches import matplotlib.pyplot as plt fro...
null
171,781
from textwrap import dedent from numbers import Number import warnings from colorsys import rgb_to_hls from functools import partial import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.collections import PatchCollection import matplotlib.patches as Patches import matplotlib.pyplot as plt fro...
null
171,782
from textwrap import dedent from numbers import Number import warnings from colorsys import rgb_to_hls from functools import partial import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.collections import PatchCollection import matplotlib.patches as Patches import matplotlib.pyplot as plt fro...
null
171,783
from textwrap import dedent from numbers import Number import warnings from colorsys import rgb_to_hls from functools import partial import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.collections import PatchCollection import matplotlib.patches as Patches import matplotlib.pyplot as plt fro...
null
171,784
from textwrap import dedent from numbers import Number import warnings from colorsys import rgb_to_hls from functools import partial import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.collections import PatchCollection import matplotlib.patches as Patches import matplotlib.pyplot as plt fro...
null
171,785
from textwrap import dedent from numbers import Number import warnings from colorsys import rgb_to_hls from functools import partial import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.collections import PatchCollection import matplotlib.patches as Patches import matplotlib.pyplot as plt fro...
null
171,786
from __future__ import annotations import re from copy import copy from collections.abc import Sequence from dataclasses import dataclass from functools import partial from typing import Any, Callable, Tuple, Optional, ClassVar import numpy as np import matplotlib as mpl from matplotlib.ticker import ( Locator, ...
null
171,787
from __future__ import annotations import re from copy import copy from collections.abc import Sequence from dataclasses import dataclass from functools import partial from typing import Any, Callable, Tuple, Optional, ClassVar import numpy as np import matplotlib as mpl from matplotlib.ticker import ( Locator, ...
null
171,788
from __future__ import annotations import re from copy import copy from collections.abc import Sequence from dataclasses import dataclass from functools import partial from typing import Any, Callable, Tuple, Optional, ClassVar import numpy as np import matplotlib as mpl from matplotlib.ticker import ( Locator, ...
null
171,789
from __future__ import annotations import re from copy import copy from collections.abc import Sequence from dataclasses import dataclass from functools import partial from typing import Any, Callable, Tuple, Optional, ClassVar import numpy as np import matplotlib as mpl from matplotlib.ticker import ( Locator, ...
null
171,790
from __future__ import annotations import re from copy import copy from collections.abc import Sequence from dataclasses import dataclass from functools import partial from typing import Any, Callable, Tuple, Optional, ClassVar import numpy as np import matplotlib as mpl from matplotlib.ticker import ( Locator, ...
null
171,791
from __future__ import annotations import re from copy import copy from collections.abc import Sequence from dataclasses import dataclass from functools import partial from typing import Any, Callable, Tuple, Optional, ClassVar import numpy as np import matplotlib as mpl from matplotlib.ticker import ( Locator, ...
null
171,792
from __future__ import annotations import warnings from collections import UserString from numbers import Number from datetime import datetime import numpy as np import pandas as pd from seaborn.external.version import Version from typing import TYPE_CHECKING def variable_type( vector: Series, boolean_type: Lit...
Return a list of unique data values using seaborn's ordering rules. Parameters ---------- vector : Series Vector of "categorical" values order : list Desired order of category levels to override the order determined from the `data` object. Returns ------- order : list Ordered list of category levels not including null ...
171,793
from __future__ import annotations import io import os import re import sys import inspect import itertools import textwrap from contextlib import contextmanager from collections import abc from collections.abc import Callable, Generator from typing import Any, List, Optional, cast from cycler import cycler import pand...
Temporarily modify specifc matplotlib rcParams.
171,794
from __future__ import annotations import io import os import re import sys import inspect import itertools import textwrap from contextlib import contextmanager from collections import abc from collections.abc import Callable, Generator from typing import Any, List, Optional, cast from cycler import cycler import pand...
Decorator function for giving Plot a useful signature. Currently this mostly saves us some duplicated typing, but we would like eventually to have a way of registering new semantic properties, at which point dynamic signature generation would become more important.
171,795
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Convert intervals to error arguments relative to plot heights. Parameters ---------- cis : 2 x n sequence sequence of confidence interval limits heights : n sequence sequence of plot heights Returns ------- errsize : 2 x n array sequence of error size relative to height values in correct format as argument for plt.bar
171,796
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Compute the quantile function of the standard normal distribution. This wrapper exists because we are dropping scipy as a mandatory dependency but statistics.NormalDist was added to the standard library in 3.8.
171,797
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Force draw of a matplotlib figure, accounting for back-compat.
171,798
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Return a fully saturated color with the same hue. Parameters ---------- color : matplotlib color hex, rgb-tuple, or html color name Returns ------- new_color : rgb tuple saturated color code in RGB tuple representation
171,799
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Grab current axis and label it. DEPRECATED: will be removed in a future version.
171,800
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Remove the top and right spines from plot(s). fig : matplotlib figure, optional Figure to despine all axes of, defaults to the current figure. ax : matplotlib axes, optional Specific axes object to despine. Ignored if fig is provided. top, right, left, bottom : boolean, optional If True, remove that spine. offset : int...
171,801
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Recreate a plot's legend at a new location. The name is a slight misnomer. Matplotlib legends do not expose public control over their position parameters. So this function creates a new legend, copying over the data from the original object, which is then removed. Parameters ---------- obj : the object with the plot Th...
171,802
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Load an example dataset from the online repository (requires internet). This function provides quick access to a small number of example datasets that are useful for documenting seaborn or generating reproducible examples for bug reports. It is not necessary for normal usage. Note that some of the datasets have a small...
171,803
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Return booleans for whether the x and y ticklabels on an Axes overlap. Parameters ---------- ax : matplotlib Axes Returns ------- x_overlap, y_overlap : booleans True when the labels on that axis overlap.
171,804
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Return levels and formatted levels for brief numeric legends.
171,805
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Calculate the relative luminance of a color according to W3C standards Parameters ---------- color : matplotlib color or sequence of matplotlib colors Hex code, rgb-tuple, or html color name. Returns ------- luminance : float(s) between 0 and 1
171,806
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Make invisible-handle "subtitles" entries look more like titles. Note: This function is not part of the public API and may be changed or removed.
171,807
import os import re import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_rgb import matplotlib.pyplot as plt from matplotlib.cbook import norma...
Context manager for preventing rc-controlled auto-layout behavior.
171,808
import copy from textwrap import dedent import warnings import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from . import utils from . import algorithms as algo from .axisgrid import FacetGrid, _facet_docs def regplot( data=None, *, x=None, y=None, x_estimator=None, x...
null
171,809
import numbers import numpy as np import warnings def _structured_bootstrap(args, n_boot, units, func, func_kwargs, integers): """Resample units instead of datapoints.""" unique_units = np.unique(units) n_units = len(unique_units) args = [[a[units == unit] for unit in unique_units] for a in args] bo...
Resample one or more arrays with replacement and store aggregate values. Positional arguments are a sequence of arrays to bootstrap along the first axis and pass to a summary function. Keyword arguments: n_boot : int, default=10000 Number of iterations axis : int, default=None Will pass axis to ``func`` as a keyword ar...
171,810
from inspect import signature def signature(obj: Callable[..., Any], *, follow_wrapped: bool = ...) -> Signature: ... The provided code snippet includes necessary dependencies for implementing the `share_init_params_with_map` function. Write a Python function `def share_init_params_with_map(cls)` to solve the followi...
Make cls.map a classmethod with same signature as cls.__init__.
171,811
import warnings import itertools from copy import copy from functools import partial from collections import UserString from collections.abc import Iterable, Sequence, Mapping from numbers import Number from datetime import datetime import numpy as np import pandas as pd import matplotlib as mpl from ._decorators impor...
Determine how the plot should be oriented based on the data. For historical reasons, the convention is to call a plot "horizontally" or "vertically" oriented based on the axis representing its dependent variable. Practically, this is used when determining the axis for numerical aggregation. Parameters ---------- x, y :...
171,812
import warnings import itertools from copy import copy from functools import partial from collections import UserString from collections.abc import Iterable, Sequence, Mapping from numbers import Number from datetime import datetime import numpy as np import pandas as pd import matplotlib as mpl from ._decorators impor...
Build an arbitrarily long list of unique dash styles for lines. Parameters ---------- n : int Number of unique dash specs to generate. Returns ------- dashes : list of strings or tuples Valid arguments for the ``dashes`` parameter on :class:`matplotlib.lines.Line2D`. The first spec is a solid line (``""``), the remaind...
171,813
import warnings import itertools from copy import copy from functools import partial from collections import UserString from collections.abc import Iterable, Sequence, Mapping from numbers import Number from datetime import datetime import numpy as np import pandas as pd import matplotlib as mpl from ._decorators impor...
Build an arbitrarily long list of unique marker styles for points. Parameters ---------- n : int Number of unique marker specs to generate. Returns ------- markers : list of string or tuples Values for defining :class:`matplotlib.markers.MarkerStyle` objects. All markers will be filled.
171,814
import warnings import itertools from copy import copy from functools import partial from collections import UserString from collections.abc import Iterable, Sequence, Mapping from numbers import Number from datetime import datetime import numpy as np import pandas as pd import matplotlib as mpl from ._decorators impor...
Return a list of unique data values. Determine an ordered list of levels in ``values``. Parameters ---------- vector : list, array, Categorical, or Series Vector of "categorical" values order : list-like, optional Desired order of category levels to override the order determined from the ``values`` object. Returns ----...
171,815
import functools import matplotlib as mpl from cycler import cycler from . import palettes The provided code snippet includes necessary dependencies for implementing the `reset_defaults` function. Write a Python function `def reset_defaults()` to solve the following problem: Restore all RC params to default settings. ...
Restore all RC params to default settings.
171,816
import functools import matplotlib as mpl from cycler import cycler from . import palettes The provided code snippet includes necessary dependencies for implementing the `reset_orig` function. Write a Python function `def reset_orig()` to solve the following problem: Restore all RC params to original settings (respect...
Restore all RC params to original settings (respects custom rc).
171,817
import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap try: from ipywidgets import interact, FloatSlider, IntSlider except ImportError: def interact(f): msg = "Interactive palettes require `ipywidgets`, which is not installed." raise ImportError(...
Select a palette from the ColorBrewer set. These palettes are built into matplotlib and can be used by name in many seaborn functions, or by passing the object returned by this function. Parameters ---------- data_type : {'sequential', 'diverging', 'qualitative'} This describes the kind of data you want to visualize. S...
171,818
import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap try: from ipywidgets import interact, FloatSlider, IntSlider except ImportError: def interact(f): msg = "Interactive palettes require `ipywidgets`, which is not installed." raise ImportError(...
Launch an interactive widget to create a dark sequential palette. This corresponds with the :func:`dark_palette` function. This kind of palette is good for data that range between relatively uninteresting low values and interesting high values. Requires IPython 2+ and must be used in the notebook. Parameters ----------...
171,819
import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap try: from ipywidgets import interact, FloatSlider, IntSlider except ImportError: def interact(f): msg = "Interactive palettes require `ipywidgets`, which is not installed." raise ImportError(...
Launch an interactive widget to create a light sequential palette. This corresponds with the :func:`light_palette` function. This kind of palette is good for data that range between relatively uninteresting low values and interesting high values. Requires IPython 2+ and must be used in the notebook. Parameters --------...
171,820
import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap try: from ipywidgets import interact, FloatSlider, IntSlider except ImportError: def interact(f): msg = "Interactive palettes require `ipywidgets`, which is not installed." raise ImportError(...
Launch an interactive widget to choose a diverging color palette. This corresponds with the :func:`diverging_palette` function. This kind of palette is good for data that range between interesting low values and interesting high values with a meaningful midpoint. (For example, change scores relative to some baseline va...
171,821
import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap try: from ipywidgets import interact, FloatSlider, IntSlider except ImportError: def interact(f): msg = "Interactive palettes require `ipywidgets`, which is not installed." raise ImportError(...
Launch an interactive widget to create a sequential cubehelix palette. This corresponds with the :func:`cubehelix_palette` function. This kind of palette is good for data that range between relatively uninteresting low values and interesting high values. The cubehelix system allows the palette to have more hue variance...
171,822
import numpy as np import matplotlib as mpl from seaborn.external.version import Version The provided code snippet includes necessary dependencies for implementing the `MarkerStyle` function. Write a Python function `def MarkerStyle(marker=None, fillstyle=None)` to solve the following problem: Allow MarkerStyle to acc...
Allow MarkerStyle to accept a MarkerStyle object as parameter. Supports matplotlib < 3.3.0 https://github.com/matplotlib/matplotlib/pull/16692
171,823
import numpy as np import matplotlib as mpl from seaborn.external.version import Version The provided code snippet includes necessary dependencies for implementing the `norm_from_scale` function. Write a Python function `def norm_from_scale(scale, norm)` to solve the following problem: Produce a Normalize object given...
Produce a Normalize object given a Scale and min/max domain limits.
171,824
import numpy as np import matplotlib as mpl from seaborn.external.version import Version class Version(_BaseVersion): _regex = re.compile(r"^\s*" + VERSION_PATTERN + r"\s*$", re.VERBOSE | re.IGNORECASE) def __init__(self, version: str) -> None: # Validate the version and parse it into pieces ...
Backwards compatability for creation of independent scales. Matplotlib scales require an Axis object for instantiation on < 3.4. But the axis is not used, aside from extraction of the axis_name in LogScale.
171,825
import numpy as np import matplotlib as mpl from seaborn.external.version import Version class Version(_BaseVersion): _regex = re.compile(r"^\s*" + VERSION_PATTERN + r"\s*$", re.VERBOSE | re.IGNORECASE) def __init__(self, version: str) -> None: # Validate the version and parse it into pieces ...
Handle backwards compatability with setting matplotlib scale.
171,826
import numpy as np import matplotlib as mpl from seaborn.external.version import Version The provided code snippet includes necessary dependencies for implementing the `register_colormap` function. Write a Python function `def register_colormap(name, cmap)` to solve the following problem: Handle changes to matplotlib ...
Handle changes to matplotlib colormap interface in 3.6.
171,827
import numpy as np import matplotlib as mpl from seaborn.external.version import Version The provided code snippet includes necessary dependencies for implementing the `set_layout_engine` function. Write a Python function `def set_layout_engine(fig, engine)` to solve the following problem: Handle changes to auto layou...
Handle changes to auto layout engine interface in 3.6
171,828
import numpy as np import matplotlib as mpl from seaborn.external.version import Version class Version(_BaseVersion): _regex = re.compile(r"^\s*" + VERSION_PATTERN + r"\s*$", re.VERBOSE | re.IGNORECASE) def __init__(self, version: str) -> None: # Validate the version and parse it into pieces ...
Handle changes to post-hoc axis sharing.
171,829
from __future__ import annotations from dataclasses import dataclass, fields, field import textwrap from typing import Any, Callable, Union from collections.abc import Generator import numpy as np import pandas as pd import matplotlib as mpl from numpy import ndarray from pandas import DataFrame from matplotlib.artist ...
null
171,830
from __future__ import annotations from dataclasses import dataclass, fields, field import textwrap from typing import Any, Callable, Union from collections.abc import Generator import numpy as np import pandas as pd import matplotlib as mpl from numpy import ndarray from pandas import DataFrame from matplotlib.artist ...
Obtain a default, specified, or mapped value for a color feature. This method exists separately to support the relationship between a color and its corresponding alpha. We want to respect alpha values that are passed in specified (or mapped) color values but also make use of a separate `alpha` variable, which can be ma...
171,831
from __future__ import annotations from dataclasses import dataclass, fields, field import textwrap from typing import Any, Callable, Union from collections.abc import Generator import numpy as np import pandas as pd import matplotlib as mpl from numpy import ndarray from pandas import DataFrame from matplotlib.artist ...
null
171,832
import warnings import matplotlib as mpl from matplotlib.collections import LineCollection import matplotlib.pyplot as plt from matplotlib import gridspec import numpy as np import pandas as pd from . import cm from .axisgrid import Grid from ._compat import get_colormap from .utils import ( despine, axis_tickl...
Convert a pandas index or multiindex to an axis label.
171,833
import warnings import matplotlib as mpl from matplotlib.collections import LineCollection import matplotlib.pyplot as plt from matplotlib import gridspec import numpy as np import pandas as pd from . import cm from .axisgrid import Grid from ._compat import get_colormap from .utils import ( despine, axis_tickl...
Convert a pandas index or multiindex into ticklabels.
171,834
import warnings import matplotlib as mpl from matplotlib.collections import LineCollection import matplotlib.pyplot as plt from matplotlib import gridspec import numpy as np import pandas as pd from . import cm from .axisgrid import Grid from ._compat import get_colormap from .utils import ( despine, axis_tickl...
Convert either a list of colors or nested lists of colors to RGB.
171,835
import warnings import matplotlib as mpl from matplotlib.collections import LineCollection import matplotlib.pyplot as plt from matplotlib import gridspec import numpy as np import pandas as pd from . import cm from .axisgrid import Grid from ._compat import get_colormap from .utils import ( despine, axis_tickl...
Ensure that data and mask are compatible and add missing values. Values will be plotted for cells where ``mask`` is ``False``. ``data`` is expected to be a DataFrame; ``mask`` can be an array or a DataFrame.
171,836
import warnings import matplotlib as mpl from matplotlib.collections import LineCollection import matplotlib.pyplot as plt from matplotlib import gridspec import numpy as np import pandas as pd from . import cm from .axisgrid import Grid from ._compat import get_colormap from .utils import ( despine, axis_tickl...
Plot rectangular data as a color-encoded matrix. This is an Axes-level function and will draw the heatmap into the currently-active Axes if none is provided to the ``ax`` argument. Part of this Axes space will be taken and used to plot a colormap, unless ``cbar`` is False or a separate Axes is provided to ``cbar_ax``. ...
171,837
import warnings import matplotlib as mpl from matplotlib.collections import LineCollection import matplotlib.pyplot as plt from matplotlib import gridspec import numpy as np import pandas as pd from . import cm from .axisgrid import Grid from ._compat import get_colormap from .utils import ( despine, axis_tickl...
Draw a tree diagram of relationships within a matrix Parameters ---------- data : pandas.DataFrame Rectangular data linkage : numpy.array, optional Linkage matrix axis : int, optional Which axis to use to calculate linkage. 0 is rows, 1 is columns. label : bool, optional If True, label the dendrogram at leaves with col...
171,838
import warnings import matplotlib as mpl from matplotlib.collections import LineCollection import matplotlib.pyplot as plt from matplotlib import gridspec import numpy as np import pandas as pd from . import cm from .axisgrid import Grid from ._compat import get_colormap from .utils import ( despine, axis_tickl...
Plot a matrix dataset as a hierarchically-clustered heatmap. This function requires scipy to be available. Parameters ---------- data : 2D array-like Rectangular data for clustering. Cannot contain NAs. pivot_kws : dict, optional If `data` is a tidy dataframe, can provide keyword arguments for pivot to create a rectang...
171,839
import colorsys from itertools import cycle import numpy as np import matplotlib as mpl from .external import husl from .utils import desaturate, get_color_cycle from .colors import xkcd_rgb, crayons from ._compat import get_colormap class Image: """ This class represents an image object. To create :py:cl...
Simplify the rich display of matplotlib color maps in a notebook.
171,840
import colorsys from itertools import cycle import numpy as np import matplotlib as mpl from .external import husl from .utils import desaturate, get_color_cycle from .colors import xkcd_rgb, crayons from ._compat import get_colormap def color_palette(palette=None, n_colors=None, desat=None, as_cmap=False): """Retu...
Make a palette with color names from the xkcd color survey. See xkcd for the full list of colors: https://xkcd.com/color/rgb/ This is just a simple wrapper around the `seaborn.xkcd_rgb` dictionary. Parameters ---------- colors : list of strings List of keys in the `seaborn.xkcd_rgb` dictionary. Returns ------- palette ...
171,841
import colorsys from itertools import cycle import numpy as np import matplotlib as mpl from .external import husl from .utils import desaturate, get_color_cycle from .colors import xkcd_rgb, crayons from ._compat import get_colormap def color_palette(palette=None, n_colors=None, desat=None, as_cmap=False): """Retu...
Make a palette with color names from Crayola crayons. Colors are taken from here: https://en.wikipedia.org/wiki/List_of_Crayola_crayon_colors This is just a simple wrapper around the `seaborn.crayons` dictionary. Parameters ---------- colors : list of strings List of keys in the `seaborn.crayons` dictionary. Returns --...
171,842
import collections import itertools import re from typing import Callable, Optional, SupportsInt, Tuple, Union Union: _SpecialForm = ... Optional: _SpecialForm = ... class SupportsInt(Protocol, metaclass=ABCMeta): def __int__(self) -> int: ... class Tuple(BaseTypingInstance): def _is_homo...
null
171,843
import collections import itertools import re from typing import Callable, Optional, SupportsInt, Tuple, Union LocalType = Union[ NegativeInfinityType, Tuple[ Union[ SubLocalType, Tuple[SubLocalType, str], Tuple[NegativeInfinityType, SubLocalType], ], ...
Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
171,844
import collections import itertools import re from typing import Callable, Optional, SupportsInt, Tuple, Union Infinity = InfinityType() NegativeInfinity = NegativeInfinityType() PrePostDevType = Union[InfiniteTypes, Tuple[str, int]] SubLocalType = Union[InfiniteTypes, int, str] LocalType = Union[ NegativeInfinityT...
null
171,845
import operator import math def husl_to_rgb(h, s, l): return lch_to_rgb(*husl_to_lch([h, s, l])) def rgb_to_hex(triple): [r, g, b] = triple return '#%02x%02x%02x' % tuple(rgb_prepare([r, g, b])) def husl_to_hex(h, s, l): return rgb_to_hex(husl_to_rgb(h, s, l))
null
171,846
import operator import math def rgb_to_husl(r, g, b): return lch_to_husl(rgb_to_lch(r, g, b)) def hex_to_rgb(hex): if hex.startswith('#'): hex = hex[1:] r = int(hex[0:2], 16) / 255.0 g = int(hex[2:4], 16) / 255.0 b = int(hex[4:6], 16) / 255.0 return [r, g, b] def hex_to_husl(hex): r...
null
171,847
import operator import math def huslp_to_rgb(h, s, l): return lch_to_rgb(*huslp_to_lch([h, s, l])) def rgb_to_hex(triple): [r, g, b] = triple return '#%02x%02x%02x' % tuple(rgb_prepare([r, g, b])) def huslp_to_hex(h, s, l): return rgb_to_hex(huslp_to_rgb(h, s, l))
null
171,848
import operator import math def rgb_to_huslp(r, g, b): return lch_to_huslp(rgb_to_lch(r, g, b)) def hex_to_rgb(hex): if hex.startswith('#'): hex = hex[1:] r = int(hex[0:2], 16) / 255.0 g = int(hex[2:4], 16) / 255.0 b = int(hex[4:6], 16) / 255.0 return [r, g, b] def hex_to_huslp(hex): ...
null
171,849
import inspect import textwrap import re import pydoc from warnings import warn from collections import namedtuple from collections.abc import Callable, Mapping import copy import sys The provided code snippet includes necessary dependencies for implementing the `strip_blank_lines` function. Write a Python function `d...
Remove leading and trailing blank lines from a list of lines
171,850
import inspect import textwrap import re import pydoc from warnings import warn from collections import namedtuple from collections.abc import Callable, Mapping import copy import sys def indent(str, indent=4): indent_str = ' '*indent if str is None: return indent_str lines = str.split('\n') re...
null
171,851
import inspect import textwrap import re import pydoc from warnings import warn from collections import namedtuple from collections.abc import Callable, Mapping import copy import sys The provided code snippet includes necessary dependencies for implementing the `dedent_lines` function. Write a Python function `def de...
Deindent a list of lines maximally
171,852
import inspect import textwrap import re import pydoc from warnings import warn from collections import namedtuple from collections.abc import Callable, Mapping import copy import sys def header(text, style='-'): return text + '\n' + style*len(text) + '\n'
null
171,853
import sys import os The provided code snippet includes necessary dependencies for implementing the `_get_win_folder_from_registry` function. Write a Python function `def _get_win_folder_from_registry(csidl_name)` to solve the following problem: This is a fallback technique at best. I'm not sure if using the registry ...
This is a fallback technique at best. I'm not sure if using the registry for this guarantees us the correct answer for all CSIDL_* names.
171,854
import sys import os unicode = str def _get_win_folder_with_pywin32(csidl_name): from win32com.shell import shellcon, shell dir = shell.SHGetFolderPath(0, getattr(shellcon, csidl_name), 0, 0) # Try to make this a unicode path because SHGetFolderPath does # not return unicode strings when there is unico...
null
171,857
import warnings import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from ._oldcore import ( VectorPlotter, ) from .utils import ( locator_to_legend_entries, adjust_legend_subtitles, _default_color, _deprecate_ci, ) from ._statistics import EstimateAggregat...
null
171,858
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.ticker as ticker def urlopen( url: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ..., cafile: Optional[_string] = ..., capath: Optional[_string] = ..., cadefault: b...
Who's a good boy?
171,859
from numbers import Number import numpy as np import pandas as pd from .algorithms import bootstrap from .utils import _check_argument The provided code snippet includes necessary dependencies for implementing the `_percentile_interval` function. Write a Python function `def _percentile_interval(data, width)` to solve...
Return a percentile interval from data of a given width.
171,860
from numbers import Number import numpy as np import pandas as pd from .algorithms import bootstrap from .utils import _check_argument class Number(metaclass=ABCMeta): def __hash__(self) -> int: ... def _check_argument(param, options, value): """Raise if value for param is not in options.""" if value not ...
Check type and value of errorbar argument and assign default level.
171,861
from __future__ import annotations from itertools import product from inspect import signature import warnings from textwrap import dedent import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from ._oldcore import VectorPlotter, variable_type, categorical_order from ._compat i...
Plot pairwise relationships in a dataset. By default, this function will create a grid of Axes such that each numeric variable in ``data`` will by shared across the y-axes across a single row and the x-axes across a single column. The diagonal plots are treated differently: a univariate distribution plot is drawn to sh...
171,862
from __future__ import annotations from itertools import product from inspect import signature import warnings from textwrap import dedent import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from ._oldcore import VectorPlotter, variable_type, categorical_order from ._compat i...
null
171,863
OPT_HIDE = "hide" OPT_STOP_EXCEPTIONS = "stopatexceptions" import win32api import win32ui def DoGetOption(optsDict, optName, default): optsDict[optName] = win32ui.GetProfileVal("Debugger Options", optName, default) def LoadDebuggerOptions(): opts = {} DoGetOption(opts, OPT_HIDE, 0) DoGetOption(opts, OP...
null