repository stringclasses 11
values | repo_id stringlengths 1 3 | target_module_path stringlengths 16 72 | prompt stringlengths 298 21.7k | relavent_test_path stringlengths 50 99 | full_function stringlengths 336 33.8k | function_name stringlengths 2 51 | content_class stringclasses 3
values | external_dependencies stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
seaborn | 0 | seaborn/_core/scales.py | def label(
self,
formatter: Formatter | None = None, *,
like: str | Callable | None = None,
base: int | None | Default = default,
unit: str | None = None,
) -> Continuous:
"""
Configure the appearance of tick labels for the scale's axis or legend.
... | /usr/src/app/target_test_cases/failed_tests_Continuous.label.txt | def label(
self,
formatter: Formatter | None = None, *,
like: str | Callable | None = None,
base: int | None | Default = default,
unit: str | None = None,
) -> Continuous:
"""
Configure the appearance of tick labels for the scale's axis or legend.
... | Continuous.label | repository-level | external |
seaborn | 1 | seaborn/_core/plot.py | def add(
self,
mark: Mark,
*transforms: Stat | Move,
orient: str | None = None,
legend: bool = True,
label: str | None = None,
data: DataSource = None,
**variables: VariableSpec,
) -> Plot:
"""
Specify a layer of the visualization i... | /usr/src/app/target_test_cases/failed_tests_Plot.add.txt | def add(
self,
mark: Mark,
*transforms: Stat | Move,
orient: str | None = None,
legend: bool = True,
label: str | None = None,
data: DataSource = None,
**variables: VariableSpec,
) -> Plot:
"""
Specify a layer of the visualization i... | Plot.add | repository-level | external |
seaborn | 2 | seaborn/_core/plot.py | def facet(
self,
col: VariableSpec = None,
row: VariableSpec = None,
order: OrderSpec | dict[str, OrderSpec] = None,
wrap: int | None = None,
) -> Plot:
"""
Produce subplots with conditional subsets of the data.
Parameters
----------
... | /usr/src/app/target_test_cases/failed_tests_Plot.facet.txt | def facet(
self,
col: VariableSpec = None,
row: VariableSpec = None,
order: OrderSpec | dict[str, OrderSpec] = None,
wrap: int | None = None,
) -> Plot:
"""
Produce subplots with conditional subsets of the data.
Parameters
----------
... | Plot.facet | repository-level | non_external |
seaborn | 3 | seaborn/_core/plot.py | def on(self, target: Axes | SubFigure | Figure) -> Plot:
"""
Provide existing Matplotlib figure or axes for drawing the plot.
When using this method, you will also need to explicitly call a method that
triggers compilation, such as :meth:`Plot.show` or :meth:`Plot.save`. If you
... | /usr/src/app/target_test_cases/failed_tests_Plot.on.txt | def on(self, target: Axes | SubFigure | Figure) -> Plot:
"""
Provide existing Matplotlib figure or axes for drawing the plot.
When using this method, you will also need to explicitly call a method that
triggers compilation, such as :meth:`Plot.show` or :meth:`Plot.save`. If you
... | Plot.on | file-level | external |
seaborn | 4 | seaborn/_core/plot.py | def pair(
self,
x: VariableSpecList = None,
y: VariableSpecList = None,
wrap: int | None = None,
cross: bool = True,
) -> Plot:
"""
Produce subplots by pairing multiple `x` and/or `y` variables.
Parameters
----------
x, y : sequenc... | /usr/src/app/target_test_cases/failed_tests_Plot.pair.txt | def pair(
self,
x: VariableSpecList = None,
y: VariableSpecList = None,
wrap: int | None = None,
cross: bool = True,
) -> Plot:
"""
Produce subplots by pairing multiple `x` and/or `y` variables.
Parameters
----------
x, y : sequenc... | Plot.pair | repository-level | non_external |
seaborn | 5 | seaborn/_base.py | def _attach(
self,
obj,
allowed_types=None,
log_scale=None,
):
"""Associate the plotter with an Axes manager and initialize its units.
Parameters
----------
obj : :class:`matplotlib.axes.Axes` or :class:'FacetGrid`
Structural object th... | /usr/src/app/target_test_cases/failed_tests__base.VectorPlotter._attach.txt | def _attach(
self,
obj,
allowed_types=None,
log_scale=None,
):
"""Associate the plotter with an Axes manager and initialize its units.
Parameters
----------
obj : :class:`matplotlib.axes.Axes` or :class:'FacetGrid`
Structural object th... | VectorPlotter._attach | repository-level | external |
seaborn | 6 | seaborn/_base.py | def iter_data(
self, grouping_vars=None, *,
reverse=False, from_comp_data=False,
by_facet=True, allow_empty=False, dropna=True,
):
"""Generator for getting subsets of data defined by semantic variables.
Also injects "col" and "row" into grouping semantics.
Param... | /usr/src/app/target_test_cases/failed_tests_VectorPlotter.iter_data.txt | def iter_data(
self, grouping_vars=None, *,
reverse=False, from_comp_data=False,
by_facet=True, allow_empty=False, dropna=True,
):
"""Generator for getting subsets of data defined by semantic variables.
Also injects "col" and "row" into grouping semantics.
Param... | VectorPlotter.iter_data | repository-level | external |
seaborn | 7 | seaborn/_base.py | def scale_categorical(self, axis, order=None, formatter=None):
"""
Enforce categorical (fixed-scale) rules for the data on given axis.
Parameters
----------
axis : "x" or "y"
Axis of the plot to operate on.
order : list
Order that unique value... | /usr/src/app/target_test_cases/failed_tests__base.VectorPlotter.scale_categorical.txt | def scale_categorical(self, axis, order=None, formatter=None):
"""
Enforce categorical (fixed-scale) rules for the data on given axis.
Parameters
----------
axis : "x" or "y"
Axis of the plot to operate on.
order : list
Order that unique value... | VectorPlotter.scale_categorical | repository-level | external |
seaborn | 8 | seaborn/_base.py | def categorical_order(vector, order=None):
"""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 c... | /usr/src/app/target_test_cases/failed_tests__base.categorical_order.txt | def categorical_order(vector, order=None):
"""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 c... | _base.categorical_order | file-level | external |
seaborn | 9 | seaborn/_base.py | def infer_orient(x=None, y=None, orient=None, require_numeric=True):
"""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 ... | /usr/src/app/target_test_cases/failed_tests_infer_orient.txt | def infer_orient(x=None, y=None, orient=None, require_numeric=True):
"""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 ... | _base.infer_orient | file-level | external |
seaborn | 10 | seaborn/_base.py | def unique_dashes(n):
"""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:... | /usr/src/app/target_test_cases/failed_tests__base.unique_dashes.txt | def unique_dashes(n):
"""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:... | _base.unique_dashes | self-contained | non_external |
seaborn | 11 | seaborn/_base.py | def unique_markers(n):
"""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.MarkerStyl... | /usr/src/app/target_test_cases/failed_tests_unique_markers.txt | def unique_markers(n):
"""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.MarkerStyl... | _base.unique_markers | self-contained | non_external |
seaborn | 12 | seaborn/_base.py | def variable_type(vector, boolean_type="numeric"):
"""
Determine whether a vector contains numeric, categorical, or datetime data.
This function differs from the pandas typing API in two ways:
- Python sequences or object-typed PyData objects are considered numeric if
all of their entries are nu... | /usr/src/app/target_test_cases/failed_tests_variable_type.txt | def variable_type(vector, boolean_type="numeric"):
"""
Determine whether a vector contains numeric, categorical, or datetime data.
This function differs from the pandas typing API in two ways:
- Python sequences or object-typed PyData objects are considered numeric if
all of their entries are nu... | _base.variable_type | file-level | external |
seaborn | 13 | seaborn/_statistics.py | def __init__(self, k_depth, outlier_prop, trust_alpha):
"""
Compute percentiles of a distribution using various tail stopping rules.
Parameters
----------
k_depth: "tukey", "proportion", "trustworthy", or "full"
Stopping rule for choosing tail percentiled to show... | /usr/src/app/target_test_cases/failed_tests__statistics.LetterValues.__init__.txt | def __init__(self, k_depth, outlier_prop, trust_alpha):
"""
Compute percentiles of a distribution using various tail stopping rules.
Parameters
----------
k_depth: "tukey", "proportion", "trustworthy", or "full"
Stopping rule for choosing tail percentiled to show... | _statistics.LetterValues.__init__ | repository-level | non_external |
seaborn | 14 | seaborn/_statistics.py | def __init__(self, estimator, errorbar=None, **boot_kws):
"""
Data aggregator that produces a weighted estimate and error bar interval.
Parameters
----------
estimator : string
Function (or method name) that maps a vector to a scalar. Currently
suppor... | /usr/src/app/target_test_cases/failed_tests__statistics.WeightedAggregator.__init__.txt | def __init__(self, estimator, errorbar=None, **boot_kws):
"""
Data aggregator that produces a weighted estimate and error bar interval.
Parameters
----------
estimator : string
Function (or method name) that maps a vector to a scalar. Currently
suppor... | _statistics.WeightedAggregator.__init__ | file-level | non_external |
seaborn | 15 | seaborn/algorithms.py | def bootstrap(*args, **kwargs):
"""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 itera... | /usr/src/app/target_test_cases/failed_tests_algorithms.bootstrap.txt | def bootstrap(*args, **kwargs):
"""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 itera... | algorithms.bootstrap | file-level | external |
seaborn | 16 | seaborn/axisgrid.py | def facet_data(self):
"""Generator for name indices and data subsets for each facet.
Yields
------
(i, j, k), data_ijk : tuple of ints, DataFrame
The ints provide an index into the {row, col, hue}_names attribute,
and the dataframe contains a subset of the fu... | /usr/src/app/target_test_cases/failed_tests_axisgrid.FacetGrid.facet_data.txt | def facet_data(self):
"""Generator for name indices and data subsets for each facet.
Yields
------
(i, j, k), data_ijk : tuple of ints, DataFrame
The ints provide an index into the {row, col, hue}_names attribute,
and the dataframe contains a subset of the fu... | axisgrid.FacetGrid.facet_data | file-level | external |
seaborn | 17 | seaborn/axisgrid.py | def map(self, func, *args, **kwargs):
"""Apply a plotting function to each facet's subset of the data.
Parameters
----------
func : callable
A plotting function that takes data and keyword arguments. It
must plot to the currently active matplotlib Axes and ta... | /usr/src/app/target_test_cases/failed_tests_axisgrid.FacetGrid.map.txt | def map(self, func, *args, **kwargs):
"""Apply a plotting function to each facet's subset of the data.
Parameters
----------
func : callable
A plotting function that takes data and keyword arguments. It
must plot to the currently active matplotlib Axes and ta... | axisgrid.FacetGrid.map | repository-level | external |
seaborn | 18 | seaborn/axisgrid.py | def map_dataframe(self, func, *args, **kwargs):
"""Like ``.map`` but passes args as strings and inserts data in kwargs.
This method is suitable for plotting with functions that accept a
long-form DataFrame as a `data` keyword argument and access the
data in that DataFrame using stri... | /usr/src/app/target_test_cases/failed_tests_axisgrid.FacetGrid.map_dataframe.txt | def map_dataframe(self, func, *args, **kwargs):
"""Like ``.map`` but passes args as strings and inserts data in kwargs.
This method is suitable for plotting with functions that accept a
long-form DataFrame as a `data` keyword argument and access the
data in that DataFrame using stri... | axisgrid.FacetGrid.map_dataframe | file-level | non_external |
seaborn | 19 | seaborn/axisgrid.py | def refline(self, *, x=None, y=None, color='.5', linestyle='--', **line_kws):
"""Add a reference line(s) to each facet.
Parameters
----------
x, y : numeric
Value(s) to draw the line(s) at.
color : :mod:`matplotlib color <matplotlib.colors>`
Specifies... | /usr/src/app/target_test_cases/failed_tests_axisgrid.FacetGrid.refline.txt | def refline(self, *, x=None, y=None, color='.5', linestyle='--', **line_kws):
"""Add a reference line(s) to each facet.
Parameters
----------
x, y : numeric
Value(s) to draw the line(s) at.
color : :mod:`matplotlib color <matplotlib.colors>`
Specifies... | axisgrid.FacetGrid.refline | file-level | external |
seaborn | 20 | seaborn/axisgrid.py | def set_titles(self, template=None, row_template=None, col_template=None, **kwargs):
"""Draw titles either above each facet or on the grid margins.
Parameters
----------
template : string
Template for all titles with the formatting keys {col_var} and
{col_nam... | /usr/src/app/target_test_cases/failed_tests_axisgrid.FacetGrid.set_titles.txt | def set_titles(self, template=None, row_template=None, col_template=None, **kwargs):
"""Draw titles either above each facet or on the grid margins.
Parameters
----------
template : string
Template for all titles with the formatting keys {col_var} and
{col_nam... | axisgrid.FacetGrid.set_titles | repository-level | external |
seaborn | 21 | seaborn/axisgrid.py | def add_legend(self, legend_data=None, title=None, label_order=None,
adjust_subtitles=False, **kwargs):
"""Draw a legend, maybe placing it outside axes and resizing the figure.
Parameters
----------
legend_data : dict
Dictionary mapping label names (or... | /usr/src/app/target_test_cases/failed_tests_axisgrid.Grid.add_legend.txt | def add_legend(self, legend_data=None, title=None, label_order=None,
adjust_subtitles=False, **kwargs):
"""Draw a legend, maybe placing it outside axes and resizing the figure.
Parameters
----------
legend_data : dict
Dictionary mapping label names (or... | axisgrid.Grid.add_legend | repository-level | external |
seaborn | 22 | seaborn/axisgrid.py | def tick_params(self, axis='both', **kwargs):
"""Modify the ticks, tick labels, and gridlines.
Parameters
----------
axis : {'x', 'y', 'both'}
The axis on which to apply the formatting.
kwargs : keyword arguments
Additional keyword arguments to pass t... | /usr/src/app/target_test_cases/failed_tests_axisgrid.Grid.tick_params.txt | def tick_params(self, axis='both', **kwargs):
"""Modify the ticks, tick labels, and gridlines.
Parameters
----------
axis : {'x', 'y', 'both'}
The axis on which to apply the formatting.
kwargs : keyword arguments
Additional keyword arguments to pass t... | axisgrid.Grid.tick_params | file-level | non_external |
seaborn | 23 | seaborn/axisgrid.py | def plot(self, joint_func, marginal_func, **kwargs):
"""Draw the plot by passing functions for joint and marginal axes.
This method passes the ``kwargs`` dictionary to both functions. If you
need more control, call :meth:`JointGrid.plot_joint` and
:meth:`JointGrid.plot_marginals` di... | /usr/src/app/target_test_cases/failed_tests_axisgrid.JointGrid.plot.txt | def plot(self, joint_func, marginal_func, **kwargs):
"""Draw the plot by passing functions for joint and marginal axes.
This method passes the ``kwargs`` dictionary to both functions. If you
need more control, call :meth:`JointGrid.plot_joint` and
:meth:`JointGrid.plot_marginals` di... | axisgrid.JointGrid.plot | file-level | non_external |
seaborn | 24 | seaborn/axisgrid.py | def plot_joint(self, func, **kwargs):
"""Draw a bivariate plot on the joint axes of the grid.
Parameters
----------
func : plotting callable
If a seaborn function, it should accept ``x`` and ``y``. Otherwise,
it must accept ``x`` and ``y`` vectors of data as ... | /usr/src/app/target_test_cases/failed_tests_axisgrid.JointGrid.plot_joint.txt | def plot_joint(self, func, **kwargs):
"""Draw a bivariate plot on the joint axes of the grid.
Parameters
----------
func : plotting callable
If a seaborn function, it should accept ``x`` and ``y``. Otherwise,
it must accept ``x`` and ``y`` vectors of data as ... | axisgrid.JointGrid.plot_joint | file-level | external |
seaborn | 25 | seaborn/axisgrid.py | def plot_marginals(self, func, **kwargs):
"""Draw univariate plots on each marginal axes.
Parameters
----------
func : plotting callable
If a seaborn function, it should accept ``x`` and ``y`` and plot
when only one of them is defined. Otherwise, it must acc... | /usr/src/app/target_test_cases/failed_tests_axisgrid.JointGrid.plot_marginals.txt | def plot_marginals(self, func, **kwargs):
"""Draw univariate plots on each marginal axes.
Parameters
----------
func : plotting callable
If a seaborn function, it should accept ``x`` and ``y`` and plot
when only one of them is defined. Otherwise, it must acc... | axisgrid.JointGrid.plot_marginals | file-level | external |
seaborn | 26 | seaborn/axisgrid.py | def refline(
self, *, x=None, y=None, joint=True, marginal=True,
color='.5', linestyle='--', **line_kws
):
"""Add a reference line(s) to joint and/or marginal axes.
Parameters
----------
x, y : numeric
Value(s) to draw the line(s) at.
joint, m... | /usr/src/app/target_test_cases/failed_tests_axisgrid.JointGrid.refline.txt | def refline(
self, *, x=None, y=None, joint=True, marginal=True,
color='.5', linestyle='--', **line_kws
):
"""Add a reference line(s) to joint and/or marginal axes.
Parameters
----------
x, y : numeric
Value(s) to draw the line(s) at.
joint, m... | axisgrid.JointGrid.refline | file-level | non_external |
seaborn | 27 | seaborn/axisgrid.py | def set_axis_labels(self, xlabel="", ylabel="", **kwargs):
"""Set axis labels on the bivariate axes.
Parameters
----------
xlabel, ylabel : strings
Label names for the x and y variables.
kwargs : key, value mappings
Other keyword arguments are passed ... | /usr/src/app/target_test_cases/failed_tests_axisgrid.JointGrid.set_axis_labels.txt | def set_axis_labels(self, xlabel="", ylabel="", **kwargs):
"""Set axis labels on the bivariate axes.
Parameters
----------
xlabel, ylabel : strings
Label names for the x and y variables.
kwargs : key, value mappings
Other keyword arguments are passed ... | axisgrid.JointGrid.set_axis_labels | file-level | non_external |
seaborn | 28 | seaborn/axisgrid.py | def __init__(
self, data, *, hue=None, vars=None, x_vars=None, y_vars=None,
hue_order=None, palette=None, hue_kws=None, corner=False, diag_sharey=True,
height=2.5, aspect=1, layout_pad=.5, despine=True, dropna=False,
):
"""Initialize the plot figure and PairGrid object.
... | /usr/src/app/target_test_cases/failed_tests_axisgrid.PairGrid.__init__.txt | def __init__(
self, data, *, hue=None, vars=None, x_vars=None, y_vars=None,
hue_order=None, palette=None, hue_kws=None, corner=False, diag_sharey=True,
height=2.5, aspect=1, layout_pad=.5, despine=True, dropna=False,
):
"""Initialize the plot figure and PairGrid object.
... | axisgrid.PairGrid.__init__ | repository-level | external |
seaborn | 29 | seaborn/axisgrid.py | def pairplot(
data, *,
hue=None, hue_order=None, palette=None,
vars=None, x_vars=None, y_vars=None,
kind="scatter", diag_kind="auto", markers=None,
height=2.5, aspect=1, corner=False, dropna=False,
plot_kws=None, diag_kws=None, grid_kws=None, size=None,
):
"""Plot pairwise relationships in a... | /usr/src/app/target_test_cases/failed_tests_axisgrid.pairplot.txt | def pairplot(
data, *,
hue=None, hue_order=None, palette=None,
vars=None, x_vars=None, y_vars=None,
kind="scatter", diag_kind="auto", markers=None,
height=2.5, aspect=1, corner=False, dropna=False,
plot_kws=None, diag_kws=None, grid_kws=None, size=None,
):
"""Plot pairwise relationships in a... | axisgrid.pairplot | repository-level | external |
seaborn | 30 | seaborn/_marks/base.py | def _resolve(
self,
data: DataFrame | dict[str, Any],
name: str,
scales: dict[str, Scale] | None = None,
) -> Any:
"""Obtain default, specified, or mapped value for a named feature.
Parameters
----------
data : DataFrame or dict with scalar values... | /usr/src/app/target_test_cases/failed_tests_base.Mark._resolve.txt | def _resolve(
self,
data: DataFrame | dict[str, Any],
name: str,
scales: dict[str, Scale] | None = None,
) -> Any:
"""Obtain default, specified, or mapped value for a named feature.
Parameters
----------
data : DataFrame or dict with scalar values... | base.Mark._resolve | repository-level | external |
seaborn | 31 | seaborn/_marks/base.py | def resolve_color(
mark: Mark,
data: DataFrame | dict,
prefix: str = "",
scales: dict[str, Scale] | None = None,
) -> RGBATuple | ndarray:
"""
Obtain a default, specified, or mapped value for a color feature.
This method exists separately to support the relationship between a
color and ... | /usr/src/app/target_test_cases/failed_tests_resolve_color.txt | def resolve_color(
mark: Mark,
data: DataFrame | dict,
prefix: str = "",
scales: dict[str, Scale] | None = None,
) -> RGBATuple | ndarray:
"""
Obtain a default, specified, or mapped value for a color feature.
This method exists separately to support the relationship between a
color and ... | base.resolve_color | repository-level | external |
seaborn | 32 | seaborn/_core/rules.py | def categorical_order(vector: Series, order: list | None = None) -> list:
"""
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 or... | /usr/src/app/target_test_cases/failed_tests_rules.categorical_order.txt | def categorical_order(vector: Series, order: list | None = None) -> list:
"""
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 or... | categorical_order | file-level | external |
seaborn | 33 | seaborn/palettes.py | def color_palette(palette=None, n_colors=None, desat=None, as_cmap=False):
"""Return a list of colors or continuous colormap defining a palette.
Possible ``palette`` values include:
- Name of a seaborn palette (deep, muted, bright, pastel, dark, colorblind)
- Name of matplotlib colormap
... | /usr/src/app/target_test_cases/failed_tests_color_palette.txt | def color_palette(palette=None, n_colors=None, desat=None, as_cmap=False):
"""Return a list of colors or continuous colormap defining a palette.
Possible ``palette`` values include:
- Name of a seaborn palette (deep, muted, bright, pastel, dark, colorblind)
- Name of matplotlib colormap
... | color_palette | repository-level | external |
seaborn | 34 | seaborn/utils.py | def desaturate(color, prop):
"""Decrease the saturation channel of a color by some percent.
Parameters
----------
color : matplotlib color
hex, rgb-tuple, or html color name
prop : float
saturation channel of color will be multiplied by this value
Returns
-------
new_co... | /usr/src/app/target_test_cases/failed_tests_desaturate.txt | def desaturate(color, prop):
"""Decrease the saturation channel of a color by some percent.
Parameters
----------
color : matplotlib color
hex, rgb-tuple, or html color name
prop : float
saturation channel of color will be multiplied by this value
Returns
-------
new_co... | desaturate | self-contained | external |
seaborn | 35 | seaborn/_core/groupby.py | def __init__(self, order: list[str] | dict[str, list | None]):
"""
Initialize the GroupBy from grouping variables and optional level orders.
Parameters
----------
order
List of variable names or dict mapping names to desired level orders.
Level order ... | /usr/src/app/target_test_cases/failed_tests_groupby.GroupBy.__init__.txt | def __init__(self, order: list[str] | dict[str, list | None]):
"""
Initialize the GroupBy from grouping variables and optional level orders.
Parameters
----------
order
List of variable names or dict mapping names to desired level orders.
Level order ... | groupby.GroupBy.__init__ | file-level | non_external |
seaborn | 36 | seaborn/external/kde.py | def evaluate(self, points):
"""Evaluate the estimated pdf on a set of points.
Parameters
----------
points : (# of dimensions, # of points)-array
Alternatively, a (# of dimensions,) vector can be passed in and
treated as a single point.
Returns
... | /usr/src/app/target_test_cases/failed_tests_kde.gaussian_kde.evaluate.txt | def evaluate(self, points):
"""Evaluate the estimated pdf on a set of points.
Parameters
----------
points : (# of dimensions, # of points)-array
Alternatively, a (# of dimensions,) vector can be passed in and
treated as a single point.
Returns
... | kde.gaussian_kde.evaluate | file-level | external |
seaborn | 37 | seaborn/external/kde.py | def set_bandwidth(self, bw_method=None):
"""Compute the estimator bandwidth with given method.
The new bandwidth calculated after a call to `set_bandwidth` is used
for subsequent evaluations of the estimated density.
Parameters
----------
bw_method : str, scalar or ... | /usr/src/app/target_test_cases/failed_tests_kde.gaussian_kde.set_bandwidth.txt | def set_bandwidth(self, bw_method=None):
"""Compute the estimator bandwidth with given method.
The new bandwidth calculated after a call to `set_bandwidth` is used
for subsequent evaluations of the estimated density.
Parameters
----------
bw_method : str, scalar or ... | kde.gaussian_kde.set_bandwidth | file-level | external |
seaborn | 38 | seaborn/utils.py | def load_dataset(name, cache=True, data_home=None, **kws):
"""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... | /usr/src/app/target_test_cases/failed_tests_load_dataset.txt | def load_dataset(name, cache=True, data_home=None, **kws):
"""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... | load_dataset | file-level | external |
seaborn | 39 | seaborn/matrix.py | def clustermap(
data, *,
pivot_kws=None, method='average', metric='euclidean',
z_score=None, standard_scale=None, figsize=(10, 10),
cbar_kws=None, row_cluster=True, col_cluster=True,
row_linkage=None, col_linkage=None,
row_colors=None, col_colors=None, mask=None,
dendrogram_ratio=.2, colors_... | /usr/src/app/target_test_cases/failed_tests_matrix.clustermap.txt | def clustermap(
data, *,
pivot_kws=None, method='average', metric='euclidean',
z_score=None, standard_scale=None, figsize=(10, 10),
cbar_kws=None, row_cluster=True, col_cluster=True,
row_linkage=None, col_linkage=None,
row_colors=None, col_colors=None, mask=None,
dendrogram_ratio=.2, colors_... | matrix.clustermap | file-level | non_external |
seaborn | 40 | seaborn/matrix.py | def dendrogram(
data, *,
linkage=None, axis=1, label=True, metric='euclidean',
method='average', rotate=False, tree_kws=None, ax=None
):
"""Draw a tree diagram of relationships within a matrix
Parameters
----------
data : pandas.DataFrame
Rectangular data
linkage : numpy.array, ... | /usr/src/app/target_test_cases/failed_tests_matrix.dendrogram.txt | def dendrogram(
data, *,
linkage=None, axis=1, label=True, metric='euclidean',
method='average', rotate=False, tree_kws=None, ax=None
):
"""Draw a tree diagram of relationships within a matrix
Parameters
----------
data : pandas.DataFrame
Rectangular data
linkage : numpy.array, ... | matrix.dendrogram | file-level | external |
seaborn | 41 | seaborn/matrix.py | def heatmap(
data, *,
vmin=None, vmax=None, cmap=None, center=None, robust=False,
annot=None, fmt=".2g", annot_kws=None,
linewidths=0, linecolor="white",
cbar=True, cbar_kws=None, cbar_ax=None,
square=False, xticklabels="auto", yticklabels="auto",
mask=None, ax=None,
**kwargs
):
"""P... | /usr/src/app/target_test_cases/failed_tests_matrix.heatmap.txt | def heatmap(
data, *,
vmin=None, vmax=None, cmap=None, center=None, robust=False,
annot=None, fmt=".2g", annot_kws=None,
linewidths=0, linecolor="white",
cbar=True, cbar_kws=None, cbar_ax=None,
square=False, xticklabels="auto", yticklabels="auto",
mask=None, ax=None,
**kwargs
):
"""P... | matrix.heatmap | file-level | external |
seaborn | 42 | seaborn/palettes.py | def blend_palette(colors, n_colors=6, as_cmap=False, input="rgb"):
"""Make a palette that blends between a list of colors.
Parameters
----------
colors : sequence of colors in various formats interpreted by `input`
hex code, html color name, or tuple in `input` space.
n_colors : int, option... | /usr/src/app/target_test_cases/failed_tests_palettes.blend_palette.txt | def blend_palette(colors, n_colors=6, as_cmap=False, input="rgb"):
"""Make a palette that blends between a list of colors.
Parameters
----------
colors : sequence of colors in various formats interpreted by `input`
hex code, html color name, or tuple in `input` space.
n_colors : int, option... | palettes.blend_palette | file-level | external |
seaborn | 43 | seaborn/palettes.py | def crayon_palette(colors):
"""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 string... | /usr/src/app/target_test_cases/failed_tests_palettes.crayon_palette.txt | def crayon_palette(colors):
"""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 string... | palettes.crayon_palette | repository-level | non_external |
seaborn | 44 | seaborn/palettes.py | def cubehelix_palette(n_colors=6, start=0, rot=.4, gamma=1.0, hue=0.8,
light=.85, dark=.15, reverse=False, as_cmap=False):
"""Make a sequential palette from the cubehelix system.
This produces a colormap with linearly-decreasing (or increasing)
brightness. That means that information ... | /usr/src/app/target_test_cases/failed_tests_palettes.cubehelix_palette.txt | def cubehelix_palette(n_colors=6, start=0, rot=.4, gamma=1.0, hue=0.8,
light=.85, dark=.15, reverse=False, as_cmap=False):
"""Make a sequential palette from the cubehelix system.
This produces a colormap with linearly-decreasing (or increasing)
brightness. That means that information ... | palettes.cubehelix_palette | file-level | external |
seaborn | 45 | seaborn/palettes.py | def dark_palette(color, n_colors=6, reverse=False, as_cmap=False, input="rgb"):
"""Make a sequential palette that blends from dark to ``color``.
This kind of palette is good for data that range between relatively
uninteresting low values and interesting high values.
The ``color`` parameter can be spec... | /usr/src/app/target_test_cases/failed_tests_palettes.dark_palette.txt | def dark_palette(color, n_colors=6, reverse=False, as_cmap=False, input="rgb"):
"""Make a sequential palette that blends from dark to ``color``.
This kind of palette is good for data that range between relatively
uninteresting low values and interesting high values.
The ``color`` parameter can be spec... | palettes.dark_palette | repository-level | non_external |
seaborn | 46 | seaborn/palettes.py | def diverging_palette(h_neg, h_pos, s=75, l=50, sep=1, n=6, # noqa
center="light", as_cmap=False):
"""Make a diverging palette between two HUSL colors.
If you are using the IPython notebook, you can also choose this palette
interactively with the :func:`choose_diverging_palette` func... | /usr/src/app/target_test_cases/failed_tests_palettes.diverging_palette.txt | def diverging_palette(h_neg, h_pos, s=75, l=50, sep=1, n=6, # noqa
center="light", as_cmap=False):
"""Make a diverging palette between two HUSL colors.
If you are using the IPython notebook, you can also choose this palette
interactively with the :func:`choose_diverging_palette` func... | palettes.diverging_palette | file-level | external |
Can Language Models Replace Programmers? REPOCOD Says 'Not Yet'
Large language models (LLMs) have achieved high accuracy, i.e., more than 90 pass@1, in solving Python coding problems in HumanEval and MBPP. Thus, a natural question is, whether LLMs achieve comparable code completion performance compared to human developers? Unfortunately, one cannot answer this question using existing manual crafted or simple (e.g., single-line) code generation benchmarks, since such tasks fail to represent real-world software development tasks. In addition, existing benchmarks often use poor code correctness metrics, providing misleading conclusions.
To address these challenges, we create REPOCOD, a code generation benchmark with 980 problems collected from 11 popular real-world projects, with more than 58% of them requiring file-level or repository-level context information. In addition, REPOCOD has the longest average canonical solution length (331.6 tokens) and the highest average cyclomatic complexity (9.00) compared to existing benchmarks. Each task in REPOCOD includes 313.5 developer-written test cases on average for better correctness evaluation. In our evaluations on ten LLMs, none of the models achieves more than 30 pass@1 on REPOCOD, disclosing the necessity of building stronger LLMs that can help developers in real-world software development.
For more details on data collection and evaluation results, please refer to our arxiv preprint.
Examples code for downloading repositories, preparing repository snapshot, and running test cases for evaluation are propived at code
Check our Leaderboard for preliminary results using GPT-4o with BM25 and dense retrieval.
Usage
from datasets import load_dataset
data = load_dataset('lt-asset/REPOCOD')
print(data)
DatasetDict({
train: Dataset({
features: ['repository', 'repo_id', 'target_module_path', 'prompt', 'relavent_test_path', 'full_function', 'function_name'],
num_rows: 980
})
})
Data Fields
- repository: the source repository of the current sample
- repo_id: the unique index of the sample in the corresponding source repository
- target_module_path: the file path containing the current sample relative to the root of the source repository
- prompt: the developer provided function signature and docstring
- relavent_test_path: the path to the relevant test cases
- full_function: the canonical solution of the current sample
- function_name: the name of the target function (current sample)
Example
"repository": "seaborn", # collected from seaborn
"repo_id": "0", # first sample from seaborn
"target_module_path": "seaborn/_core/scales.py", # the target function is in this path
"prompt": " def label(
self,
formatter: Formatter | None = None, *,
like: str | Callable | None = None,
base: int | None | Default = default,
unit: str | None = None,
) -> Continuous: ....", # the function signature and docstring for the target function
"relevant_test_path": "/usr/src/app/target_test_cases/failed_tests_Continuous.label.txt", # Path to relevant tests for the function
"full_function": " def label(
self,
formatter: Formatter | None = None, *,
like: str | Callable | None = None,
base: int | None | Default = default,
unit: str | None = None,
) -> Continuous: ....", # the full snippet of the target function, including the function signature and docstring for the target function
"function_name": "Continuous.label" # The name of the target function
Citation
@inproceedings{liang2025repocod,
title = {Can Language Models Replace Programmers for Coding? {REPOCOD} Says `Not Yet'},
author = {Liang, Shanchao and Jiang, Nan and Hu, Yiran and Tan, Lin},
editor = {Che, Wanxiang and Nabende, Joyce and Shutova, Ekaterina and Pilehvar, Mohammad Taher},
booktitle = {Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
month = {jul},
year = {2025},
address = {Vienna, Austria},
publisher = {Association for Computational Linguistics},
url = {https://aclanthology.org/2025.acl-long.1204/},
doi = {10.18653/v1/2025.acl-long.1204},
pages = {24698--24717},
ISBN = {979-8-89176-251-0},
}
- Downloads last month
- 71