repository stringclasses 11
values | repo_id stringlengths 1 3 | target_module_path stringlengths 16 72 | prompt stringlengths 407 21.7k | relavent_test_path stringlengths 51 97 | full_function stringlengths 2.6k 33.8k | function_name stringlengths 3 49 | context-complexity stringclasses 3
values |
|---|---|---|---|---|---|---|---|
plotly.py | 17 | packages/python/plotly/plotly/express/_imshow.py | def imshow(
img,
zmin=None,
zmax=None,
origin=None,
labels={},
x=None,
y=None,
animation_frame=None,
facet_col=None,
facet_col_wrap=None,
facet_col_spacing=None,
facet_row_spacing=None,
color_continuous_scale=None,
color_continuous_midpoint=None,
range_color=N... | /usr/src/app/target_test_cases/failed_tests__imshow.imshow.txt | def imshow(
img,
zmin=None,
zmax=None,
origin=None,
labels={},
x=None,
y=None,
animation_frame=None,
facet_col=None,
facet_col_wrap=None,
facet_col_spacing=None,
facet_row_spacing=None,
color_continuous_scale=None,
color_continuous_midpoint=None,
range_color=N... | _imshow.imshow | Repo-Level |
plotly.py | 29 | packages/python/plotly/plotly/graph_objs/layout/_legend.py | def __init__(
self,
arg=None,
bgcolor=None,
bordercolor=None,
borderwidth=None,
entrywidth=None,
entrywidthmode=None,
font=None,
groupclick=None,
grouptitlefont=None,
indentation=None,
itemclick=None,
itemdoublec... | /usr/src/app/target_test_cases/failed_tests__legend.Legend.__init__.txt | def __init__(
self,
arg=None,
bgcolor=None,
bordercolor=None,
borderwidth=None,
entrywidth=None,
entrywidthmode=None,
font=None,
groupclick=None,
grouptitlefont=None,
indentation=None,
itemclick=None,
itemdoublec... | _legend.Legend.__init__ | Self-Contained |
plotly.py | 31 | packages/python/plotly/plotly/graph_objs/layout/_modebar.py | def __init__(
self,
arg=None,
activecolor=None,
add=None,
addsrc=None,
bgcolor=None,
color=None,
orientation=None,
remove=None,
removesrc=None,
uirevision=None,
**kwargs,
):
"""
Construct a new Modeba... | /usr/src/app/target_test_cases/failed_tests__modebar.Modebar.__init__.txt | def __init__(
self,
arg=None,
activecolor=None,
add=None,
addsrc=None,
bgcolor=None,
color=None,
orientation=None,
remove=None,
removesrc=None,
uirevision=None,
**kwargs,
):
"""
Construct a new Modeba... | _modebar.Modebar.__init__ | Self-Contained |
plotly.py | 32 | packages/python/plotly/plotly/graph_objs/layout/_newshape.py | def __init__(
self,
arg=None,
drawdirection=None,
fillcolor=None,
fillrule=None,
label=None,
layer=None,
legend=None,
legendgroup=None,
legendgrouptitle=None,
legendrank=None,
legendwidth=None,
line=None,
... | /usr/src/app/target_test_cases/failed_tests__newshape.Newshape.__init__.txt | def __init__(
self,
arg=None,
drawdirection=None,
fillcolor=None,
fillrule=None,
label=None,
layer=None,
legend=None,
legendgroup=None,
legendgrouptitle=None,
legendrank=None,
legendwidth=None,
line=None,
... | _newshape.Newshape.__init__ | Self-Contained |
plotly.py | 33 | packages/python/plotly/plotly/graph_objs/_parcats.py | def __init__(
self,
arg=None,
arrangement=None,
bundlecolors=None,
counts=None,
countssrc=None,
dimensions=None,
dimensiondefaults=None,
domain=None,
hoverinfo=None,
hoveron=None,
hovertemplate=None,
labelfont=No... | /usr/src/app/target_test_cases/failed_tests__parcats.Parcats.__init__.txt | def __init__(
self,
arg=None,
arrangement=None,
bundlecolors=None,
counts=None,
countssrc=None,
dimensions=None,
dimensiondefaults=None,
domain=None,
hoverinfo=None,
hoveron=None,
hovertemplate=None,
labelfont=No... | _parcats.Parcats.__init__ | Self-Contained |
plotly.py | 38 | packages/python/plotly/plotly/figure_factory/_quiver.py | def create_quiver(
x, y, u, v, scale=0.1, arrow_scale=0.3, angle=math.pi / 9, scaleratio=None, **kwargs
):
"""
Returns data for a quiver plot.
:param (list|ndarray) x: x coordinates of the arrow locations
:param (list|ndarray) y: y coordinates of the arrow locations
:param (list|ndarray) u: x c... | /usr/src/app/target_test_cases/failed_tests__quiver.create_quiver.txt | def create_quiver(
x, y, u, v, scale=0.1, arrow_scale=0.3, angle=math.pi / 9, scaleratio=None, **kwargs
):
"""
Returns data for a quiver plot.
:param (list|ndarray) x: x coordinates of the arrow locations
:param (list|ndarray) y: y coordinates of the arrow locations
:param (list|ndarray) u: x c... | _quiver.create_quiver | Self-Contained |
plotly.py | 39 | packages/python/plotly/plotly/graph_objs/_sankey.py | def __init__(
self,
arg=None,
arrangement=None,
customdata=None,
customdatasrc=None,
domain=None,
hoverinfo=None,
hoverlabel=None,
ids=None,
idssrc=None,
legend=None,
legendgrouptitle=None,
legendrank=None,
... | /usr/src/app/target_test_cases/failed_tests__sankey.Sankey.__init__.txt | def __init__(
self,
arg=None,
arrangement=None,
customdata=None,
customdatasrc=None,
domain=None,
hoverinfo=None,
hoverlabel=None,
ids=None,
idssrc=None,
legend=None,
legendgrouptitle=None,
legendrank=None,
... | _sankey.Sankey.__init__ | Self-Contained |
plotly.py | 45 | packages/python/plotly/plotly/figure_factory/_scatterplot.py | def create_scatterplotmatrix(
df,
index=None,
endpts=None,
diag="scatter",
height=500,
width=500,
size=6,
title="Scatterplot Matrix",
colormap=None,
colormap_type="cat",
dataframe=None,
headers=None,
index_vals=None,
**kwargs,
):
"""
Returns data for a sca... | /usr/src/app/target_test_cases/failed_tests__scatterplot.create_scatterplotmatrix.txt | def create_scatterplotmatrix(
df,
index=None,
endpts=None,
diag="scatter",
height=500,
width=500,
size=6,
title="Scatterplot Matrix",
colormap=None,
colormap_type="cat",
dataframe=None,
headers=None,
index_vals=None,
**kwargs,
):
"""
Returns data for a sca... | _scatterplot.create_scatterplotmatrix | File-Level |
plotly.py | 48 | packages/python/plotly/plotly/graph_objs/layout/_selection.py | def __init__(
self,
arg=None,
line=None,
name=None,
opacity=None,
path=None,
templateitemname=None,
type=None,
x0=None,
x1=None,
xref=None,
y0=None,
y1=None,
yref=None,
**kwargs,
):
""... | /usr/src/app/target_test_cases/failed_tests__selection.Selection.__init__.txt | def __init__(
self,
arg=None,
line=None,
name=None,
opacity=None,
path=None,
templateitemname=None,
type=None,
x0=None,
x1=None,
xref=None,
y0=None,
y1=None,
yref=None,
**kwargs,
):
""... | _selection.Selection.__init__ | Self-Contained |
plotly.py | 49 | packages/python/plotly/plotly/graph_objs/layout/_slider.py | def __init__(
self,
arg=None,
active=None,
activebgcolor=None,
bgcolor=None,
bordercolor=None,
borderwidth=None,
currentvalue=None,
font=None,
len=None,
lenmode=None,
minorticklen=None,
name=None,
pad=Non... | /usr/src/app/target_test_cases/failed_tests__slider.Slider.__init__.txt | def __init__(
self,
arg=None,
active=None,
activebgcolor=None,
bgcolor=None,
bordercolor=None,
borderwidth=None,
currentvalue=None,
font=None,
len=None,
lenmode=None,
minorticklen=None,
name=None,
pad=Non... | _slider.Slider.__init__ | Self-Contained |
plotly.py | 50 | packages/python/plotly/plotly/graph_objs/_splom.py | def __init__(
self,
arg=None,
customdata=None,
customdatasrc=None,
diagonal=None,
dimensions=None,
dimensiondefaults=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
... | /usr/src/app/target_test_cases/failed_tests__splom.Splom.__init__.txt | def __init__(
self,
arg=None,
customdata=None,
customdatasrc=None,
diagonal=None,
dimensions=None,
dimensiondefaults=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
... | _splom.Splom.__init__ | Self-Contained |
plotly.py | 52 | packages/python/plotly/plotly/_subplots.py | def make_subplots(
rows=1,
cols=1,
shared_xaxes=False,
shared_yaxes=False,
start_cell="top-left",
print_grid=False,
horizontal_spacing=None,
vertical_spacing=None,
subplot_titles=None,
column_widths=None,
row_heights=None,
specs=None,
insets=None,
column_titles=No... | /usr/src/app/target_test_cases/failed_tests__subplots.make_subplots.txt | def make_subplots(
rows=1,
cols=1,
shared_xaxes=False,
shared_yaxes=False,
start_cell="top-left",
print_grid=False,
horizontal_spacing=None,
vertical_spacing=None,
subplot_titles=None,
column_widths=None,
row_heights=None,
specs=None,
insets=None,
column_titles=No... | _subplots.make_subplots | File-Level |
plotly.py | 53 | packages/python/plotly/plotly/graph_objs/_sunburst.py | def __init__(
self,
arg=None,
branchvalues=None,
count=None,
customdata=None,
customdatasrc=None,
domain=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
hovert... | /usr/src/app/target_test_cases/failed_tests__sunburst.Sunburst.__init__.txt | def __init__(
self,
arg=None,
branchvalues=None,
count=None,
customdata=None,
customdatasrc=None,
domain=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
hovert... | _sunburst.Sunburst.__init__ | Self-Contained |
plotly.py | 56 | packages/python/plotly/plotly/io/_templates.py | def to_templated(fig, skip=("title", "text")):
"""
Return a copy of a figure where all styling properties have been moved
into the figure's template. The template property of the resulting figure
may then be used to set the default styling of other figures.
Parameters
----------
fig
... | /usr/src/app/target_test_cases/failed_tests__templates.to_templated.txt | def to_templated(fig, skip=("title", "text")):
"""
Return a copy of a figure where all styling properties have been moved
into the figure's template. The template property of the resulting figure
may then be used to set the default styling of other figures.
Parameters
----------
fig
... | _templates.to_templated | File-Level |
plotly.py | 58 | packages/python/plotly/plotly/graph_objs/scatter/_textfont.py | def __init__(
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
lineposition=None,
linepositionsrc=None,
shadow=None,
shadowsrc=None,
size=None,
sizesrc=None,
style=None,
stylesrc=No... | /usr/src/app/target_test_cases/failed_tests__textfont.Textfont.__init__.txt | def __init__(
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
lineposition=None,
linepositionsrc=None,
shadow=None,
shadowsrc=None,
size=None,
sizesrc=None,
style=None,
stylesrc=No... | _textfont.Textfont.__init__ | Self-Contained |
plotly.py | 59 | packages/python/plotly/plotly/graph_objs/_treemap.py | def __init__(
self,
arg=None,
branchvalues=None,
count=None,
customdata=None,
customdatasrc=None,
domain=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
hovert... | /usr/src/app/target_test_cases/failed_tests__treemap.Treemap.__init__.txt | def __init__(
self,
arg=None,
branchvalues=None,
count=None,
customdata=None,
customdatasrc=None,
domain=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
hovert... | _treemap.Treemap.__init__ | Self-Contained |
plotly.py | 61 | packages/python/plotly/plotly/figure_factory/_trisurf.py | def create_trisurf(
x,
y,
z,
simplices,
colormap=None,
show_colorbar=True,
scale=None,
color_func=None,
title="Trisurf Plot",
plot_edges=True,
showbackground=True,
backgroundcolor="rgb(230, 230, 230)",
gridcolor="rgb(255, 255, 255)",
zerolinecolor="rgb(255, 255, 2... | /usr/src/app/target_test_cases/failed_tests__trisurf.create_trisurf.txt | def create_trisurf(
x,
y,
z,
simplices,
colormap=None,
show_colorbar=True,
scale=None,
color_func=None,
title="Trisurf Plot",
plot_edges=True,
showbackground=True,
backgroundcolor="rgb(230, 230, 230)",
gridcolor="rgb(255, 255, 255)",
zerolinecolor="rgb(255, 255, 2... | _trisurf.create_trisurf | File-Level |
plotly.py | 62 | packages/python/plotly/plotly/graph_objs/layout/_updatemenu.py | def __init__(
self,
arg=None,
active=None,
bgcolor=None,
bordercolor=None,
borderwidth=None,
buttons=None,
buttondefaults=None,
direction=None,
font=None,
name=None,
pad=None,
showactive=None,
templateite... | /usr/src/app/target_test_cases/failed_tests__updatemenu.Updatemenu.__init__.txt | def __init__(
self,
arg=None,
active=None,
bgcolor=None,
bordercolor=None,
borderwidth=None,
buttons=None,
buttondefaults=None,
direction=None,
font=None,
name=None,
pad=None,
showactive=None,
templateite... | _updatemenu.Updatemenu.__init__ | Self-Contained |
plotly.py | 64 | packages/python/plotly/plotly/graph_objs/_violin.py | def __init__(
self,
arg=None,
alignmentgroup=None,
bandwidth=None,
box=None,
customdata=None,
customdatasrc=None,
fillcolor=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hoveron=None,
hovertemplate=No... | /usr/src/app/target_test_cases/failed_tests__violin.Violin.__init__.txt | def __init__(
self,
arg=None,
alignmentgroup=None,
bandwidth=None,
box=None,
customdata=None,
customdatasrc=None,
fillcolor=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hoveron=None,
hovertemplate=No... | _violin.Violin.__init__ | Self-Contained |
plotly.py | 65 | packages/python/plotly/plotly/figure_factory/_violin.py | def create_violin(
data,
data_header=None,
group_header=None,
colors=None,
use_colorscale=False,
group_stats=None,
rugplot=True,
sort=False,
height=450,
width=600,
title="Violin and Rug Plot",
):
"""
**deprecated**, use instead the plotly.graph_objects trace
:clas... | /usr/src/app/target_test_cases/failed_tests__violin.create_violin.txt | def create_violin(
data,
data_header=None,
group_header=None,
colors=None,
use_colorscale=False,
group_stats=None,
rugplot=True,
sort=False,
height=450,
width=600,
title="Violin and Rug Plot",
):
"""
**deprecated**, use instead the plotly.graph_objects trace
:clas... | _violin.create_violin | File-Level |
plotly.py | 66 | packages/python/plotly/plotly/graph_objs/_waterfall.py | def __init__(
self,
arg=None,
alignmentgroup=None,
base=None,
cliponaxis=None,
connector=None,
constraintext=None,
customdata=None,
customdatasrc=None,
decreasing=None,
dx=None,
dy=None,
hoverinfo=None,
h... | /usr/src/app/target_test_cases/failed_tests__waterfall.Waterfall.__init__.txt | def __init__(
self,
arg=None,
alignmentgroup=None,
base=None,
cliponaxis=None,
connector=None,
constraintext=None,
customdata=None,
customdatasrc=None,
decreasing=None,
dx=None,
dy=None,
hoverinfo=None,
h... | _waterfall.Waterfall.__init__ | Self-Contained |
plotly.py | 71 | packages/python/plotly/plotly/offline/offline.py | def plot(
figure_or_data,
show_link=False,
link_text="Export to plot.ly",
validate=True,
output_type="file",
include_plotlyjs=True,
filename="temp-plot.html",
auto_open=True,
image=None,
image_filename="plot_image",
image_width=800,
image_height=600,
config=None,
... | /usr/src/app/target_test_cases/failed_tests_offline.plot.txt | def plot(
figure_or_data,
show_link=False,
link_text="Export to plot.ly",
validate=True,
output_type="file",
include_plotlyjs=True,
filename="temp-plot.html",
auto_open=True,
image=None,
image_filename="plot_image",
image_width=800,
image_height=600,
config=None,
... | offline.plot | File-Level |
plotly.py | 72 | packages/python/plotly/_plotly_utils/png.py | def __init__(
self,
width=None,
height=None,
size=None,
greyscale=Default,
alpha=False,
bitdepth=8,
palette=None,
transparent=None,
background=None,
gamma=None,
compression=None,
interlace=False,
planes=N... | /usr/src/app/target_test_cases/failed_tests_png.Writer.__init__.txt | def __init__(
self,
width=None,
height=None,
size=None,
greyscale=Default,
alpha=False,
bitdepth=8,
palette=None,
transparent=None,
background=None,
gamma=None,
compression=None,
interlace=False,
planes=N... | png.Writer.__init__ | File-Level |
plotly.py | 73 | packages/python/plotly/_plotly_utils/png.py | def from_array(a, mode=None, info={}):
"""
Create a PNG :class:`Image` object from a 2-dimensional array.
One application of this function is easy PIL-style saving:
``png.from_array(pixels, 'L').save('foo.png')``.
Unless they are specified using the *info* parameter,
the PNG's height and width ... | /usr/src/app/target_test_cases/failed_tests_png.from_array.txt | def from_array(a, mode=None, info={}):
"""
Create a PNG :class:`Image` object from a 2-dimensional array.
One application of this function is easy PIL-style saving:
``png.from_array(pixels, 'L').save('foo.png')``.
Unless they are specified using the *info* parameter,
the PNG's height and width ... | png.from_array | File-Level |
plotly.py | 74 | packages/python/plotly/plotly/subplots.py | def make_subplots(
rows=1,
cols=1,
shared_xaxes=False,
shared_yaxes=False,
start_cell="top-left",
print_grid=False,
horizontal_spacing=None,
vertical_spacing=None,
subplot_titles=None,
column_widths=None,
row_heights=None,
specs=None,
insets=None,
column_titles=No... | /usr/src/app/target_test_cases/failed_tests_subplots.make_subplots.txt | def make_subplots(
rows=1,
cols=1,
shared_xaxes=False,
shared_yaxes=False,
start_cell="top-left",
print_grid=False,
horizontal_spacing=None,
vertical_spacing=None,
subplot_titles=None,
column_widths=None,
row_heights=None,
specs=None,
insets=None,
column_titles=No... | subplots.make_subplots | Self-Contained |
plotly.py | 75 | packages/python/plotly/plotly/tools.py | def make_subplots(
rows=1,
cols=1,
shared_xaxes=False,
shared_yaxes=False,
start_cell="top-left",
print_grid=None,
**kwargs,
):
"""Return an instance of plotly.graph_objs.Figure
with the subplots domain set in 'layout'.
Example 1:
# stack two subplots vertically
fig = to... | /usr/src/app/target_test_cases/failed_tests_tools.make_subplots.txt | def make_subplots(
rows=1,
cols=1,
shared_xaxes=False,
shared_yaxes=False,
start_cell="top-left",
print_grid=None,
**kwargs,
):
"""Return an instance of plotly.graph_objs.Figure
with the subplots domain set in 'layout'.
Example 1:
# stack two subplots vertically
fig = to... | tools.make_subplots | Self-Contained |
sphinx | 0 | sphinx/application.py | def __init__(self, srcdir: str | os.PathLike[str], confdir: str | os.PathLike[str] | None,
outdir: str | os.PathLike[str], doctreedir: str | os.PathLike[str],
buildername: str, confoverrides: dict | None = None,
status: IO[str] | None = sys.stdout, warning: IO[str]... | /usr/src/app/target_test_cases/failed_tests___init__.txt | def __init__(self, srcdir: str | os.PathLike[str], confdir: str | os.PathLike[str] | None,
outdir: str | os.PathLike[str], doctreedir: str | os.PathLike[str],
buildername: str, confoverrides: dict | None = None,
status: IO[str] | None = sys.stdout, warning: IO[str]... | __init__ | Self-Contained |
xarray | 7 | xarray/core/indexing.py | def _decompose_outer_indexer(
indexer: BasicIndexer | OuterIndexer,
shape: _Shape,
indexing_support: IndexingSupport,
) -> tuple[ExplicitIndexer, ExplicitIndexer]:
"""
Decompose outer indexer to the successive two indexers, where the
first indexer will be used to index backend arrays, while the ... | /usr/src/app/target_test_cases/failed_tests__decompose_outer_indexer.txt | def _decompose_outer_indexer(
indexer: BasicIndexer | OuterIndexer,
shape: _Shape,
indexing_support: IndexingSupport,
) -> tuple[ExplicitIndexer, ExplicitIndexer]:
"""
Decompose outer indexer to the successive two indexers, where the
first indexer will be used to index backend arrays, while the ... | _decompose_outer_indexer | File-Level |
xarray | 9 | xarray/plot/utils.py | def _determine_cmap_params(
plot_data,
vmin=None,
vmax=None,
cmap=None,
center=None,
robust=False,
extend=None,
levels=None,
filled=True,
norm=None,
_is_facetgrid=False,
):
"""
Use some heuristics to set good defaults for colorbar and range.
Parameters
------... | /usr/src/app/target_test_cases/failed_tests__determine_cmap_params.txt | def _determine_cmap_params(
plot_data,
vmin=None,
vmax=None,
cmap=None,
center=None,
robust=False,
extend=None,
levels=None,
filled=True,
norm=None,
_is_facetgrid=False,
):
"""
Use some heuristics to set good defaults for colorbar and range.
Parameters
------... | _determine_cmap_params | File-Level |
xarray | 18 | xarray/core/computation.py | def apply_ufunc(
func: Callable,
*args: Any,
input_core_dims: Sequence[Sequence] | None = None,
output_core_dims: Sequence[Sequence] | None = ((),),
exclude_dims: Set = frozenset(),
vectorize: bool = False,
join: JoinOptions = "exact",
dataset_join: str = "exact",
dataset_fill_value:... | /usr/src/app/target_test_cases/failed_tests_apply_ufunc.txt | def apply_ufunc(
func: Callable,
*args: Any,
input_core_dims: Sequence[Sequence] | None = None,
output_core_dims: Sequence[Sequence] | None = ((),),
exclude_dims: Set = frozenset(),
vectorize: bool = False,
join: JoinOptions = "exact",
dataset_join: str = "exact",
dataset_fill_value:... | apply_ufunc | File-Level |
xarray | 23 | xarray/coding/cftime_offsets.py | def cftime_range(
start=None,
end=None,
periods=None,
freq=None,
normalize=False,
name=None,
closed: NoDefault | SideOptions = no_default,
inclusive: None | InclusiveOptions = None,
calendar="standard",
) -> CFTimeIndex:
"""Return a fixed frequency CFTimeIndex.
Parameters
... | /usr/src/app/target_test_cases/failed_tests_cftime_range.txt | def cftime_range(
start=None,
end=None,
periods=None,
freq=None,
normalize=False,
name=None,
closed: NoDefault | SideOptions = no_default,
inclusive: None | InclusiveOptions = None,
calendar="standard",
) -> CFTimeIndex:
"""Return a fixed frequency CFTimeIndex.
Parameters
... | cftime_range | File-Level |
xarray | 25 | xarray/core/combine.py | def combine_by_coords(
data_objects: Iterable[Dataset | DataArray] = [],
compat: CompatOptions = "no_conflicts",
data_vars: Literal["all", "minimal", "different"] | list[str] = "all",
coords: str = "different",
fill_value: object = dtypes.NA,
join: JoinOptions = "outer",
combine_attrs: Combi... | /usr/src/app/target_test_cases/failed_tests_combine_by_coords.txt | def combine_by_coords(
data_objects: Iterable[Dataset | DataArray] = [],
compat: CompatOptions = "no_conflicts",
data_vars: Literal["all", "minimal", "different"] | list[str] = "all",
coords: str = "different",
fill_value: object = dtypes.NA,
join: JoinOptions = "outer",
combine_attrs: Combi... | combine_by_coords | File-Level |
xarray | 26 | xarray/core/combine.py | def combine_nested(
datasets: DATASET_HYPERCUBE,
concat_dim: str | DataArray | None | Sequence[str | DataArray | pd.Index | None],
compat: str = "no_conflicts",
data_vars: str = "all",
coords: str = "different",
fill_value: object = dtypes.NA,
join: JoinOptions = "outer",
combine_attrs: ... | /usr/src/app/target_test_cases/failed_tests_combine_nested.txt | def combine_nested(
datasets: DATASET_HYPERCUBE,
concat_dim: str | DataArray | None | Sequence[str | DataArray | pd.Index | None],
compat: str = "no_conflicts",
data_vars: str = "all",
coords: str = "different",
fill_value: object = dtypes.NA,
join: JoinOptions = "outer",
combine_attrs: ... | combine_nested | File-Level |
xarray | 28 | xarray/coding/calendar_ops.py | def convert_calendar(
obj,
calendar,
dim="time",
align_on=None,
missing=None,
use_cftime=None,
):
"""Transform a time-indexed Dataset or DataArray to one that uses another calendar.
This function only converts the individual timestamps; it does not modify any
data except in dropping... | /usr/src/app/target_test_cases/failed_tests_convert_calendar.txt | def convert_calendar(
obj,
calendar,
dim="time",
align_on=None,
missing=None,
use_cftime=None,
):
"""Transform a time-indexed Dataset or DataArray to one that uses another calendar.
This function only converts the individual timestamps; it does not modify any
data except in dropping... | convert_calendar | File-Level |
xarray | 33 | xarray/core/computation.py | def cross(
a: DataArray | Variable, b: DataArray | Variable, *, dim: Hashable
) -> DataArray | Variable:
"""
Compute the cross product of two (arrays of) vectors.
The cross product of `a` and `b` in :math:`R^3` is a vector
perpendicular to both `a` and `b`. The vectors in `a` and `b` are
define... | /usr/src/app/target_test_cases/failed_tests_cross.txt | def cross(
a: DataArray | Variable, b: DataArray | Variable, *, dim: Hashable
) -> DataArray | Variable:
"""
Compute the cross product of two (arrays of) vectors.
The cross product of `a` and `b` in :math:`R^3` is a vector
perpendicular to both `a` and `b`. The vectors in `a` and `b` are
define... | cross | File-Level |
xarray | 37 | xarray/conventions.py | def decode_cf_variable(
name: Hashable,
var: Variable,
concat_characters: bool = True,
mask_and_scale: bool = True,
decode_times: bool = True,
decode_endianness: bool = True,
stack_char_dim: bool = True,
use_cftime: bool | None = None,
decode_timedelta: bool | None = None,
) -> Varia... | /usr/src/app/target_test_cases/failed_tests_decode_cf_variable.txt | def decode_cf_variable(
name: Hashable,
var: Variable,
concat_characters: bool = True,
mask_and_scale: bool = True,
decode_times: bool = True,
decode_endianness: bool = True,
stack_char_dim: bool = True,
use_cftime: bool | None = None,
decode_timedelta: bool | None = None,
) -> Varia... | decode_cf_variable | Self-Contained |
xarray | 38 | xarray/core/computation.py | def dot(
*arrays,
dim: Dims = None,
**kwargs: Any,
):
"""Generalized dot product for xarray objects. Like ``np.einsum``, but
provides a simpler interface based on array dimension names.
Parameters
----------
*arrays : DataArray or Variable
Arrays to compute.
dim : str, itera... | /usr/src/app/target_test_cases/failed_tests_dot.txt | def dot(
*arrays,
dim: Dims = None,
**kwargs: Any,
):
"""Generalized dot product for xarray objects. Like ``np.einsum``, but
provides a simpler interface based on array dimension names.
Parameters
----------
*arrays : DataArray or Variable
Arrays to compute.
dim : str, itera... | dot | File-Level |
xarray | 50 | xarray/core/dataset.py | def isel(
self,
indexers: Mapping[Any, Any] | None = None,
drop: bool = False,
missing_dims: ErrorOptionsWithWarn = "raise",
**indexers_kwargs: Any,
) -> Self:
"""Returns a new dataset with each array indexed along the specified
dimension(s).
This... | /usr/src/app/target_test_cases/failed_tests_isel.txt | def isel(
self,
indexers: Mapping[Any, Any] | None = None,
drop: bool = False,
missing_dims: ErrorOptionsWithWarn = "raise",
**indexers_kwargs: Any,
) -> Self:
"""Returns a new dataset with each array indexed along the specified
dimension(s).
This... | isel | Self-Contained |
xarray | 52 | xarray/plot/utils.py | def legend_elements(
self, prop="colors", num="auto", fmt=None, func=lambda x: x, **kwargs
):
"""
Create legend handles and labels for a PathCollection.
Each legend handle is a `.Line2D` representing the Path that was drawn,
and each label is a string what each Path represents.
This is useful ... | /usr/src/app/target_test_cases/failed_tests_legend_elements.txt | def legend_elements(
self, prop="colors", num="auto", fmt=None, func=lambda x: x, **kwargs
):
"""
Create legend handles and labels for a PathCollection.
Each legend handle is a `.Line2D` representing the Path that was drawn,
and each label is a string what each Path represents.
This is useful ... | legend_elements | File-Level |
xarray | 54 | xarray/core/parallel.py | def map_blocks(
func: Callable[..., T_Xarray],
obj: DataArray | Dataset,
args: Sequence[Any] = (),
kwargs: Mapping[str, Any] | None = None,
template: DataArray | Dataset | None = None,
) -> T_Xarray:
"""Apply a function to each block of a DataArray or Dataset.
.. warning::
This func... | /usr/src/app/target_test_cases/failed_tests_map_blocks.txt | def map_blocks(
func: Callable[..., T_Xarray],
obj: DataArray | Dataset,
args: Sequence[Any] = (),
kwargs: Mapping[str, Any] | None = None,
template: DataArray | Dataset | None = None,
) -> T_Xarray:
"""Apply a function to each block of a DataArray or Dataset.
.. warning::
This func... | map_blocks | File-Level |
xarray | 58 | xarray/core/merge.py | def merge(
objects: Iterable[DataArray | CoercibleMapping],
compat: CompatOptions = "no_conflicts",
join: JoinOptions = "outer",
fill_value: object = dtypes.NA,
combine_attrs: CombineAttrsOptions = "override",
) -> Dataset:
"""Merge any number of xarray objects into a single Dataset as variables... | /usr/src/app/target_test_cases/failed_tests_merge.txt | def merge(
objects: Iterable[DataArray | CoercibleMapping],
compat: CompatOptions = "no_conflicts",
join: JoinOptions = "outer",
fill_value: object = dtypes.NA,
combine_attrs: CombineAttrsOptions = "override",
) -> Dataset:
"""Merge any number of xarray objects into a single Dataset as variables... | merge | File-Level |
xarray | 60 | xarray/backends/api.py | def open_dataarray(
filename_or_obj: str | os.PathLike[Any] | BufferedIOBase | AbstractDataStore,
*,
engine: T_Engine | None = None,
chunks: T_Chunks | None = None,
cache: bool | None = None,
decode_cf: bool | None = None,
mask_and_scale: bool | None = None,
decode_times: bool | None = N... | /usr/src/app/target_test_cases/failed_tests_open_dataarray.txt | def open_dataarray(
filename_or_obj: str | os.PathLike[Any] | BufferedIOBase | AbstractDataStore,
*,
engine: T_Engine | None = None,
chunks: T_Chunks | None = None,
cache: bool | None = None,
decode_cf: bool | None = None,
mask_and_scale: bool | None = None,
decode_times: bool | None = N... | open_dataarray | File-Level |
xarray | 61 | xarray/backends/api.py | def open_dataset(
filename_or_obj: str | os.PathLike[Any] | BufferedIOBase | AbstractDataStore,
*,
engine: T_Engine = None,
chunks: T_Chunks = None,
cache: bool | None = None,
decode_cf: bool | None = None,
mask_and_scale: bool | Mapping[str, bool] | None = None,
decode_times: bool | Map... | /usr/src/app/target_test_cases/failed_tests_open_dataset.txt | def open_dataset(
filename_or_obj: str | os.PathLike[Any] | BufferedIOBase | AbstractDataStore,
*,
engine: T_Engine = None,
chunks: T_Chunks = None,
cache: bool | None = None,
decode_cf: bool | None = None,
mask_and_scale: bool | Mapping[str, bool] | None = None,
decode_times: bool | Map... | open_dataset | File-Level |
xarray | 63 | xarray/backends/api.py | def open_mfdataset(
paths: str | NestedSequence[str | os.PathLike],
chunks: T_Chunks | None = None,
concat_dim: (
str
| DataArray
| Index
| Sequence[str]
| Sequence[DataArray]
| Sequence[Index]
| None
) = None,
compat: CompatOptions = "no_confl... | /usr/src/app/target_test_cases/failed_tests_open_mfdataset.txt | def open_mfdataset(
paths: str | NestedSequence[str | os.PathLike],
chunks: T_Chunks | None = None,
concat_dim: (
str
| DataArray
| Index
| Sequence[str]
| Sequence[DataArray]
| Sequence[Index]
| None
) = None,
compat: CompatOptions = "no_confl... | open_mfdataset | Self-Contained |
xarray | 64 | xarray/backends/zarr.py | def open_zarr(
store,
group=None,
synchronizer=None,
chunks="auto",
decode_cf=True,
mask_and_scale=True,
decode_times=True,
concat_characters=True,
decode_coords=True,
drop_variables=None,
consolidated=None,
overwrite_encoded_chunks=False,
chunk_store=None,
storag... | /usr/src/app/target_test_cases/failed_tests_open_zarr.txt | def open_zarr(
store,
group=None,
synchronizer=None,
chunks="auto",
decode_cf=True,
mask_and_scale=True,
decode_times=True,
concat_characters=True,
decode_coords=True,
drop_variables=None,
consolidated=None,
overwrite_encoded_chunks=False,
chunk_store=None,
storag... | open_zarr | File-Level |
xarray | 65 | xarray/plot/dataarray_plot.py | def plot(
darray: DataArray,
*,
row: Hashable | None = None,
col: Hashable | None = None,
col_wrap: int | None = None,
ax: Axes | None = None,
hue: Hashable | None = None,
subplot_kws: dict[str, Any] | None = None,
**kwargs: Any,
) -> Any:
"""
Default plot of DataArray using ... | /usr/src/app/target_test_cases/failed_tests_plot.txt | def plot(
darray: DataArray,
*,
row: Hashable | None = None,
col: Hashable | None = None,
col_wrap: int | None = None,
ax: Axes | None = None,
hue: Hashable | None = None,
subplot_kws: dict[str, Any] | None = None,
**kwargs: Any,
) -> Any:
"""
Default plot of DataArray using ... | plot | Self-Contained |
xarray | 67 | xarray/core/groupby.py | def quantile(
self,
q: ArrayLike,
dim: Dims = None,
*,
method: QuantileMethods = "linear",
keep_attrs: bool | None = None,
skipna: bool | None = None,
interpolation: QuantileMethods | None = None,
) -> T_Xarray:
"""Compute the qth quantile ... | /usr/src/app/target_test_cases/failed_tests_quantile.txt | def quantile(
self,
q: ArrayLike,
dim: Dims = None,
*,
method: QuantileMethods = "linear",
keep_attrs: bool | None = None,
skipna: bool | None = None,
interpolation: QuantileMethods | None = None,
) -> T_Xarray:
"""Compute the qth quantile ... | quantile | Self-Contained |
xarray | 71 | xarray/backends/api.py | def save_mfdataset(
datasets,
paths,
mode="w",
format=None,
groups=None,
engine=None,
compute=True,
**kwargs,
):
"""Write multiple datasets to disk as netCDF files simultaneously.
This function is intended for use with datasets consisting of dask.array
objects, in which case... | /usr/src/app/target_test_cases/failed_tests_save_mfdataset.txt | def save_mfdataset(
datasets,
paths,
mode="w",
format=None,
groups=None,
engine=None,
compute=True,
**kwargs,
):
"""Write multiple datasets to disk as netCDF files simultaneously.
This function is intended for use with datasets consisting of dask.array
objects, in which case... | save_mfdataset | File-Level |
xarray | 81 | xarray/testing/strategies.py | def variables(
draw: st.DrawFn,
*,
array_strategy_fn: ArrayStrategyFn | None = None,
dims: st.SearchStrategy[Sequence[Hashable] | Mapping[Hashable, int]] | None = None,
dtype: st.SearchStrategy[np.dtype] | None = None,
attrs: st.SearchStrategy[Mapping] = ATTRS,
) -> xr.Variable:
"""
Gene... | /usr/src/app/target_test_cases/failed_tests_variables.txt | def variables(
draw: st.DrawFn,
*,
array_strategy_fn: ArrayStrategyFn | None = None,
dims: st.SearchStrategy[Sequence[Hashable] | Mapping[Hashable, int]] | None = None,
dtype: st.SearchStrategy[np.dtype] | None = None,
attrs: st.SearchStrategy[Mapping] = ATTRS,
) -> xr.Variable:
"""
Gene... | variables | File-Level |
datasets | 4 | src/datasets/dataset_dict.py | def push_to_hub(
self,
repo_id,
config_name: str = "default",
set_default: Optional[bool] = None,
data_dir: Optional[str] = None,
commit_message: Optional[str] = None,
commit_description: Optional[str] = None,
private: Optional[bool] = False,
t... | /usr/src/app/target_test_cases/failed_tests_DatasetDict.push_to_hub.txt | def push_to_hub(
self,
repo_id,
config_name: str = "default",
set_default: Optional[bool] = None,
data_dir: Optional[str] = None,
commit_message: Optional[str] = None,
commit_description: Optional[str] = None,
private: Optional[bool] = False,
t... | DatasetDict.push_to_hub | Repo-Level |
datasets | 20 | src/datasets/iterable_dataset.py | def map(
self,
function: Optional[Callable] = None,
with_indices: bool = False,
input_columns: Optional[Union[str, List[str]]] = None,
batched: bool = False,
batch_size: Optional[int] = 1000,
drop_last_batch: bool = False,
remove_columns: Optional[Unio... | /usr/src/app/target_test_cases/failed_tests_IterableDataset.map.txt | def map(
self,
function: Optional[Callable] = None,
with_indices: bool = False,
input_columns: Optional[Union[str, List[str]]] = None,
batched: bool = False,
batch_size: Optional[int] = 1000,
drop_last_batch: bool = False,
remove_columns: Optional[Unio... | IterableDataset.map | Self-Contained |
datasets | 49 | src/datasets/combine.py | def interleave_datasets(
datasets: List[DatasetType],
probabilities: Optional[List[float]] = None,
seed: Optional[int] = None,
info: Optional[DatasetInfo] = None,
split: Optional[NamedSplit] = None,
stopping_strategy: Literal["first_exhausted", "all_exhausted"] = "first_exhausted",
) -> DatasetT... | /usr/src/app/target_test_cases/failed_tests_interleave_datasets.txt | def interleave_datasets(
datasets: List[DatasetType],
probabilities: Optional[List[float]] = None,
seed: Optional[int] = None,
info: Optional[DatasetInfo] = None,
split: Optional[NamedSplit] = None,
stopping_strategy: Literal["first_exhausted", "all_exhausted"] = "first_exhausted",
) -> DatasetT... | interleave_datasets | Repo-Level |
datasets | 50 | src/datasets/load.py | def load_dataset(
path: str,
name: Optional[str] = None,
data_dir: Optional[str] = None,
data_files: Optional[Union[str, Sequence[str], Mapping[str, Union[str, Sequence[str]]]]] = None,
split: Optional[Union[str, Split]] = None,
cache_dir: Optional[str] = None,
features: Optional[Features] =... | /usr/src/app/target_test_cases/failed_tests_load_dataset.txt | def load_dataset(
path: str,
name: Optional[str] = None,
data_dir: Optional[str] = None,
data_files: Optional[Union[str, Sequence[str], Mapping[str, Union[str, Sequence[str]]]]] = None,
split: Optional[Union[str, Split]] = None,
cache_dir: Optional[str] = None,
features: Optional[Features] =... | load_dataset | Repo-Level |
datasets | 51 | src/datasets/load.py | def load_dataset_builder(
path: str,
name: Optional[str] = None,
data_dir: Optional[str] = None,
data_files: Optional[Union[str, Sequence[str], Mapping[str, Union[str, Sequence[str]]]]] = None,
cache_dir: Optional[str] = None,
features: Optional[Features] = None,
download_config: Optional[Do... | /usr/src/app/target_test_cases/failed_tests_load_dataset_builder.txt | def load_dataset_builder(
path: str,
name: Optional[str] = None,
data_dir: Optional[str] = None,
data_files: Optional[Union[str, Sequence[str], Mapping[str, Union[str, Sequence[str]]]]] = None,
cache_dir: Optional[str] = None,
features: Optional[Features] = None,
download_config: Optional[Do... | load_dataset_builder | File-Level |
datasets | 54 | src/datasets/utils/py_utils.py | def map_nested(
function: Callable[[Any], Any],
data_struct: Any,
dict_only: bool = False,
map_list: bool = True,
map_tuple: bool = False,
map_numpy: bool = False,
num_proc: Optional[int] = None,
parallel_min_length: int = 2,
batched: bool = False,
batch_size: Optional[int] = 100... | /usr/src/app/target_test_cases/failed_tests_map_nested.txt | def map_nested(
function: Callable[[Any], Any],
data_struct: Any,
dict_only: bool = False,
map_list: bool = True,
map_tuple: bool = False,
map_numpy: bool = False,
num_proc: Optional[int] = None,
parallel_min_length: int = 2,
batched: bool = False,
batch_size: Optional[int] = 100... | map_nested | Repo-Level |
pylint | 15 | pylint/extensions/docparams.py | def check_arguments_in_docstring(
self,
doc: Docstring,
arguments_node: astroid.Arguments,
warning_node: astroid.NodeNG,
accept_no_param_doc: bool | None = None,
) -> None:
"""Check that all parameters are consistent with the parameters mentioned
in the pa... | /usr/src/app/target_test_cases/failed_tests_check_arguments_in_docstring.txt | def check_arguments_in_docstring(
self,
doc: Docstring,
arguments_node: astroid.Arguments,
warning_node: astroid.NodeNG,
accept_no_param_doc: bool | None = None,
) -> None:
"""Check that all parameters are consistent with the parameters mentioned
in the pa... | check_arguments_in_docstring | Self-Contained |
sympy | 6 | sympy/physics/continuum_mechanics/cable.py | def apply_load(self, order, load):
"""
This method adds load to the cable.
Parameters
==========
order : Integer
The order of the applied load.
- For point loads, order = -1
- For distributed load, order = 0
load : tuple... | /usr/src/app/target_test_cases/failed_tests_Cable.apply_load.txt | def apply_load(self, order, load):
"""
This method adds load to the cable.
Parameters
==========
order : Integer
The order of the applied load.
- For point loads, order = -1
- For distributed load, order = 0
load : tuple... | Cable.apply_load | Self-Contained |
sympy | 9 | sympy/stats/stochastic_process_types.py | def communication_classes(self) -> tList[tTuple[tList[Basic], Boolean, Integer]]:
"""
Returns the list of communication classes that partition
the states of the markov chain.
A communication class is defined to be a set of states
such that every state in that set is reachabl... | /usr/src/app/target_test_cases/failed_tests_DiscreteMarkovChain.communication_classes.txt | def communication_classes(self) -> tList[tTuple[tList[Basic], Boolean, Integer]]:
"""
Returns the list of communication classes that partition
the states of the markov chain.
A communication class is defined to be a set of states
such that every state in that set is reachabl... | DiscreteMarkovChain.communication_classes | Self-Contained |
sympy | 15 | sympy/physics/control/lti.py | def doit(self, cancel=False, expand=False, **hints):
"""
Returns the resultant transfer function or state space obtained by
feedback connection of transfer functions or state space objects.
Examples
========
>>> from sympy.abc import s
>>> from sympy import ... | /usr/src/app/target_test_cases/failed_tests_Feedback.doit.txt | def doit(self, cancel=False, expand=False, **hints):
"""
Returns the resultant transfer function or state space obtained by
feedback connection of transfer functions or state space objects.
Examples
========
>>> from sympy.abc import s
>>> from sympy import ... | Feedback.doit | Self-Contained |
sympy | 17 | sympy/integrals/integrals.py | def as_sum(self, n=None, method="midpoint", evaluate=True):
"""
Approximates a definite integral by a sum.
Parameters
==========
n :
The number of subintervals to use, optional.
method :
One of: 'left', 'right', 'midpoint', 'trapezoid'.
... | /usr/src/app/target_test_cases/failed_tests_Integral.as_sum.txt | def as_sum(self, n=None, method="midpoint", evaluate=True):
"""
Approximates a definite integral by a sum.
Parameters
==========
n :
The number of subintervals to use, optional.
method :
One of: 'left', 'right', 'midpoint', 'trapezoid'.
... | Integral.as_sum | Self-Contained |
sympy | 20 | sympy/combinatorics/perm_groups.py | def schreier_sims_incremental(self, base=None, gens=None, slp_dict=False):
"""Extend a sequence of points and generating set to a base and strong
generating set.
Parameters
==========
base
The sequence of points to be extended to a base. Optional
par... | /usr/src/app/target_test_cases/failed_tests_PermutationGroup.schreier_sims_incremental.txt | def schreier_sims_incremental(self, base=None, gens=None, slp_dict=False):
"""Extend a sequence of points and generating set to a base and strong
generating set.
Parameters
==========
base
The sequence of points to be extended to a base. Optional
par... | PermutationGroup.schreier_sims_incremental | File-Level |
sympy | 30 | sympy/calculus/finite_diff.py | def _as_finite_diff(derivative, points=1, x0=None, wrt=None):
"""
Returns an approximation of a derivative of a function in
the form of a finite difference formula. The expression is a
weighted sum of the function at a number of discrete values of
(one of) the independent variable(s).
Parameter... | /usr/src/app/target_test_cases/failed_tests__as_finite_diff.txt | def _as_finite_diff(derivative, points=1, x0=None, wrt=None):
"""
Returns an approximation of a derivative of a function in
the form of a finite difference formula. The expression is a
weighted sum of the function at a number of discrete values of
(one of) the independent variable(s).
Parameter... | _as_finite_diff | File-Level |
sympy | 31 | sympy/core/exprtools.py | def _mask_nc(eq, name=None):
"""
Return ``eq`` with non-commutative objects replaced with Dummy
symbols. A dictionary that can be used to restore the original
values is returned: if it is None, the expression is noncommutative
and cannot be made commutative. The third value returned is a list
of... | /usr/src/app/target_test_cases/failed_tests__mask_nc.txt | def _mask_nc(eq, name=None):
"""
Return ``eq`` with non-commutative objects replaced with Dummy
symbols. A dictionary that can be used to restore the original
values is returned: if it is None, the expression is noncommutative
and cannot be made commutative. The third value returned is a list
of... | _mask_nc | Repo-Level |
sympy | 33 | sympy/solvers/simplex.py | def _simplex(A, B, C, D=None, dual=False):
"""Return ``(o, x, y)`` obtained from the two-phase simplex method
using Bland's rule: ``o`` is the minimum value of primal,
``Cx - D``, under constraints ``Ax <= B`` (with ``x >= 0``) and
the maximum of the dual, ``y^{T}B - D``, under constraints
``A^{T}*y... | /usr/src/app/target_test_cases/failed_tests__simplex.txt | def _simplex(A, B, C, D=None, dual=False):
"""Return ``(o, x, y)`` obtained from the two-phase simplex method
using Bland's rule: ``o`` is the minimum value of primal,
``Cx - D``, under constraints ``Ax <= B`` (with ``x >= 0``) and
the maximum of the dual, ``y^{T}B - D``, under constraints
``A^{T}*y... | _simplex | File-Level |
sympy | 34 | sympy/solvers/inequalities.py | def _solve_inequality(ie, s, linear=False):
"""Return the inequality with s isolated on the left, if possible.
If the relationship is non-linear, a solution involving And or Or
may be returned. False or True are returned if the relationship
is never True or always True, respectively.
If `linear` is... | /usr/src/app/target_test_cases/failed_tests__solve_inequality.txt | def _solve_inequality(ie, s, linear=False):
"""Return the inequality with s isolated on the left, if possible.
If the relationship is non-linear, a solution involving And or Or
may be returned. False or True are returned if the relationship
is never True or always True, respectively.
If `linear` is... | _solve_inequality | File-Level |
sympy | 37 | sympy/assumptions/ask.py | def ask(proposition, assumptions=True, context=global_assumptions):
"""
Function to evaluate the proposition with assumptions.
Explanation
===========
This function evaluates the proposition to ``True`` or ``False`` if
the truth value can be determined. If not, it returns ``None``.
It sho... | /usr/src/app/target_test_cases/failed_tests_ask.txt | def ask(proposition, assumptions=True, context=global_assumptions):
"""
Function to evaluate the proposition with assumptions.
Explanation
===========
This function evaluates the proposition to ``True`` or ``False`` if
the truth value can be determined. If not, it returns ``None``.
It sho... | ask | File-Level |
sympy | 38 | sympy/matrices/sparsetools.py | def banded(*args, **kwargs):
"""Returns a SparseMatrix from the given dictionary describing
the diagonals of the matrix. The keys are positive for upper
diagonals and negative for those below the main diagonal. The
values may be:
* expressions or single-argument functions,
* lists or tuples of... | /usr/src/app/target_test_cases/failed_tests_banded.txt | def banded(*args, **kwargs):
"""Returns a SparseMatrix from the given dictionary describing
the diagonals of the matrix. The keys are positive for upper
diagonals and negative for those below the main diagonal. The
values may be:
* expressions or single-argument functions,
* lists or tuples of... | banded | File-Level |
sympy | 39 | sympy/combinatorics/tensor_can.py | def canonicalize(g, dummies, msym, *v):
"""
canonicalize tensor formed by tensors
Parameters
==========
g : permutation representing the tensor
dummies : list representing the dummy indices
it can be a list of dummy indices of the same type
or a list of lists of dummy indices, one... | /usr/src/app/target_test_cases/failed_tests_canonicalize.txt | def canonicalize(g, dummies, msym, *v):
"""
canonicalize tensor formed by tensors
Parameters
==========
g : permutation representing the tensor
dummies : list representing the dummy indices
it can be a list of dummy indices of the same type
or a list of lists of dummy indices, one... | canonicalize | File-Level |
sympy | 43 | sympy/combinatorics/coset_table.py | def coset_enumeration_r(fp_grp, Y, max_cosets=None, draft=None,
incomplete=False, modified=False):
"""
This is easier of the two implemented methods of coset enumeration.
and is often called the HLT method, after Hazelgrove, Leech, Trotter
The idea is that we make use... | /usr/src/app/target_test_cases/failed_tests_coset_enumeration_r.txt | def coset_enumeration_r(fp_grp, Y, max_cosets=None, draft=None,
incomplete=False, modified=False):
"""
This is easier of the two implemented methods of coset enumeration.
and is often called the HLT method, after Hazelgrove, Leech, Trotter
The idea is that we make use... | coset_enumeration_r | Self-Contained |
sympy | 44 | sympy/simplify/cse_main.py | def cse(exprs, symbols=None, optimizations=None, postprocess=None,
order='canonical', ignore=(), list=True):
""" Perform common subexpression elimination on an expression.
Parameters
==========
exprs : list of SymPy expressions, or a single SymPy expression
The expressions to reduce.
... | /usr/src/app/target_test_cases/failed_tests_cse.txt | def cse(exprs, symbols=None, optimizations=None, postprocess=None,
order='canonical', ignore=(), list=True):
""" Perform common subexpression elimination on an expression.
Parameters
==========
exprs : list of SymPy expressions, or a single SymPy expression
The expressions to reduce.
... | cse | File-Level |
sympy | 45 | sympy/polys/matrices/dense.py | def ddm_irref_den(a, K):
"""a <-- rref(a); return (den, pivots)
Compute the fraction-free reduced row echelon form (RREF) of $a$. Modifies
$a$ in place and returns a tuple containing the denominator of the RREF and
a list of the pivot columns.
Explanation
===========
The algorithm used ... | /usr/src/app/target_test_cases/failed_tests_ddm_irref_den.txt | def ddm_irref_den(a, K):
"""a <-- rref(a); return (den, pivots)
Compute the fraction-free reduced row echelon form (RREF) of $a$. Modifies
$a$ in place and returns a tuple containing the denominator of the RREF and
a list of the pivot columns.
Explanation
===========
The algorithm used ... | ddm_irref_den | Self-Contained |
sympy | 46 | sympy/core/sorting.py | def default_sort_key(item, order=None):
"""Return a key that can be used for sorting.
The key has the structure:
(class_key, (len(args), args), exponent.sort_key(), coefficient)
This key is supplied by the sort_key routine of Basic objects when
``item`` is a Basic object or an object (other than ... | /usr/src/app/target_test_cases/failed_tests_default_sort_key.txt | def default_sort_key(item, order=None):
"""Return a key that can be used for sorting.
The key has the structure:
(class_key, (len(args), args), exponent.sort_key(), coefficient)
This key is supplied by the sort_key routine of Basic objects when
``item`` is a Basic object or an object (other than ... | default_sort_key | Repo-Level |
sympy | 47 | sympy/solvers/diophantine/diophantine.py | def diophantine(eq, param=symbols("t", integer=True), syms=None,
permute=False):
"""
Simplify the solution procedure of diophantine equation ``eq`` by
converting it into a product of terms which should equal zero.
Explanation
===========
For example, when solving, `x^2 - y^2 = ... | /usr/src/app/target_test_cases/failed_tests_diophantine.txt | def diophantine(eq, param=symbols("t", integer=True), syms=None,
permute=False):
"""
Simplify the solution procedure of diophantine equation ``eq`` by
converting it into a product of terms which should equal zero.
Explanation
===========
For example, when solving, `x^2 - y^2 = ... | diophantine | File-Level |
sympy | 49 | sympy/ntheory/egyptian_fraction.py | def egyptian_fraction(r, algorithm="Greedy"):
"""
Return the list of denominators of an Egyptian fraction
expansion [1]_ of the said rational `r`.
Parameters
==========
r : Rational or (p, q)
a positive rational number, ``p/q``.
algorithm : { "Greedy", "Graham Jewett", "Takenouchi"... | /usr/src/app/target_test_cases/failed_tests_egyptian_fraction.txt | def egyptian_fraction(r, algorithm="Greedy"):
"""
Return the list of denominators of an Egyptian fraction
expansion [1]_ of the said rational `r`.
Parameters
==========
r : Rational or (p, q)
a positive rational number, ``p/q``.
algorithm : { "Greedy", "Graham Jewett", "Takenouchi"... | egyptian_fraction | File-Level |
sympy | 52 | sympy/physics/secondquant.py | def evaluate_deltas(e):
"""
We evaluate KroneckerDelta symbols in the expression assuming Einstein summation.
Explanation
===========
If one index is repeated it is summed over and in effect substituted with
the other one. If both indices are repeated we substitute according to what
is the... | /usr/src/app/target_test_cases/failed_tests_evaluate_deltas.txt | def evaluate_deltas(e):
"""
We evaluate KroneckerDelta symbols in the expression assuming Einstein summation.
Explanation
===========
If one index is repeated it is summed over and in effect substituted with
the other one. If both indices are repeated we substitute according to what
is the... | evaluate_deltas | Self-Contained |
sympy | 55 | sympy/calculus/finite_diff.py | def finite_diff_weights(order, x_list, x0=S.One):
"""
Calculates the finite difference weights for an arbitrarily spaced
one-dimensional grid (``x_list``) for derivatives at ``x0`` of order
0, 1, ..., up to ``order`` using a recursive formula. Order of accuracy
is at least ``len(x_list) - order``, i... | /usr/src/app/target_test_cases/failed_tests_finite_diff_weights.txt | def finite_diff_weights(order, x_list, x0=S.One):
"""
Calculates the finite difference weights for an arbitrarily spaced
one-dimensional grid (``x_list``) for derivatives at ``x0`` of order
0, 1, ..., up to ``order`` using a recursive formula. Order of accuracy
is at least ``len(x_list) - order``, i... | finite_diff_weights | Self-Contained |
sympy | 58 | sympy/utilities/iterables.py | def generate_bell(n):
"""Return permutations of [0, 1, ..., n - 1] such that each permutation
differs from the last by the exchange of a single pair of neighbors.
The ``n!`` permutations are returned as an iterator. In order to obtain
the next permutation from a random starting permutation, use the
... | /usr/src/app/target_test_cases/failed_tests_generate_bell.txt | def generate_bell(n):
"""Return permutations of [0, 1, ..., n - 1] such that each permutation
differs from the last by the exchange of a single pair of neighbors.
The ``n!`` permutations are returned as an iterator. In order to obtain
the next permutation from a random starting permutation, use the
... | generate_bell | Self-Contained |
sympy | 59 | sympy/physics/quantum/identitysearch.py | def generate_gate_rules(gate_seq, return_as_muls=False):
"""Returns a set of gate rules. Each gate rules is represented
as a 2-tuple of tuples or Muls. An empty tuple represents an arbitrary
scalar value.
This function uses the four operations (LL, LR, RL, RR)
to generate the gate rules.
A g... | /usr/src/app/target_test_cases/failed_tests_generate_gate_rules.txt | def generate_gate_rules(gate_seq, return_as_muls=False):
"""Returns a set of gate rules. Each gate rules is represented
as a 2-tuple of tuples or Muls. An empty tuple represents an arbitrary
scalar value.
This function uses the four operations (LL, LR, RL, RR)
to generate the gate rules.
A g... | generate_gate_rules | File-Level |
sympy | 60 | sympy/tensor/index_methods.py | def get_contraction_structure(expr):
"""Determine dummy indices of ``expr`` and describe its structure
By *dummy* we mean indices that are summation indices.
The structure of the expression is determined and described as follows:
1) A conforming summation of Indexed objects is described with a dict w... | /usr/src/app/target_test_cases/failed_tests_get_contraction_structure.txt | def get_contraction_structure(expr):
"""Determine dummy indices of ``expr`` and describe its structure
By *dummy* we mean indices that are summation indices.
The structure of the expression is determined and described as follows:
1) A conforming summation of Indexed objects is described with a dict w... | get_contraction_structure | File-Level |
sympy | 61 | sympy/physics/vector/functions.py | def get_motion_params(frame, **kwargs):
"""
Returns the three motion parameters - (acceleration, velocity, and
position) as vectorial functions of time in the given frame.
If a higher order differential function is provided, the lower order
functions are used as boundary conditions. For example, gi... | /usr/src/app/target_test_cases/failed_tests_get_motion_params.txt | def get_motion_params(frame, **kwargs):
"""
Returns the three motion parameters - (acceleration, velocity, and
position) as vectorial functions of time in the given frame.
If a higher order differential function is provided, the lower order
functions are used as boundary conditions. For example, gi... | get_motion_params | Repo-Level |
sympy | 63 | sympy/integrals/heurisch.py | def heurisch(f, x, rewrite=False, hints=None, mappings=None, retries=3,
degree_offset=0, unnecessary_permutations=None,
_try_heurisch=None):
"""
Compute indefinite integral using heuristic Risch algorithm.
Explanation
===========
This is a heuristic approach to indefinite... | /usr/src/app/target_test_cases/failed_tests_heurisch.txt | def heurisch(f, x, rewrite=False, hints=None, mappings=None, retries=3,
degree_offset=0, unnecessary_permutations=None,
_try_heurisch=None):
"""
Compute indefinite integral using heuristic Risch algorithm.
Explanation
===========
This is a heuristic approach to indefinite... | heurisch | File-Level |
sympy | 64 | sympy/integrals/integrals.py | def integrate(*args, meijerg=None, conds='piecewise', risch=None, heurisch=None, manual=None, **kwargs):
"""integrate(f, var, ...)
.. deprecated:: 1.6
Using ``integrate()`` with :class:`~.Poly` is deprecated. Use
:meth:`.Poly.integrate` instead. See :ref:`deprecated-integrate-poly`.
Explana... | /usr/src/app/target_test_cases/failed_tests_integrate.txt | def integrate(*args, meijerg=None, conds='piecewise', risch=None, heurisch=None, manual=None, **kwargs):
"""integrate(f, var, ...)
.. deprecated:: 1.6
Using ``integrate()`` with :class:`~.Poly` is deprecated. Use
:meth:`.Poly.integrate` instead. See :ref:`deprecated-integrate-poly`.
Explana... | integrate | Self-Contained |
sympy | 66 | sympy/geometry/util.py | def intersection(*entities, pairwise=False, **kwargs):
"""The intersection of a collection of GeometryEntity instances.
Parameters
==========
entities : sequence of GeometryEntity
pairwise (keyword argument) : Can be either True or False
Returns
=======
intersection : list of GeometryE... | /usr/src/app/target_test_cases/failed_tests_intersection.txt | def intersection(*entities, pairwise=False, **kwargs):
"""The intersection of a collection of GeometryEntity instances.
Parameters
==========
entities : sequence of GeometryEntity
pairwise (keyword argument) : Can be either True or False
Returns
=======
intersection : list of GeometryE... | intersection | Self-Contained |
sympy | 70 | sympy/utilities/lambdify.py | def lambdify(args, expr, modules=None, printer=None, use_imps=True,
dummify=False, cse=False, docstring_limit=1000):
"""Convert a SymPy expression into a function that allows for fast
numeric evaluation.
.. warning::
This function uses ``exec``, and thus should not be used on
uns... | /usr/src/app/target_test_cases/failed_tests_lambdify.txt | def lambdify(args, expr, modules=None, printer=None, use_imps=True,
dummify=False, cse=False, docstring_limit=1000):
"""Convert a SymPy expression into a function that allows for fast
numeric evaluation.
.. warning::
This function uses ``exec``, and thus should not be used on
uns... | lambdify | File-Level |
sympy | 71 | sympy/crypto/crypto.py | def lfsr_connection_polynomial(s):
"""
This function computes the LFSR connection polynomial.
Parameters
==========
s
A sequence of elements of even length, with entries in a finite
field.
Returns
=======
C(x)
The connection polynomial of a minimal LFSR yieldi... | /usr/src/app/target_test_cases/failed_tests_lfsr_connection_polynomial.txt | def lfsr_connection_polynomial(s):
"""
This function computes the LFSR connection polynomial.
Parameters
==========
s
A sequence of elements of even length, with entries in a finite
field.
Returns
=======
C(x)
The connection polynomial of a minimal LFSR yieldi... | lfsr_connection_polynomial | Self-Contained |
sympy | 72 | sympy/utilities/iterables.py | def multiset_partitions(multiset, m=None):
"""
Return unique partitions of the given multiset (in list form).
If ``m`` is None, all multisets will be returned, otherwise only
partitions with ``m`` parts will be returned.
If ``multiset`` is an integer, a range [0, 1, ..., multiset - 1]
will be s... | /usr/src/app/target_test_cases/failed_tests_multiset_partitions.txt | def multiset_partitions(multiset, m=None):
"""
Return unique partitions of the given multiset (in list form).
If ``m`` is None, all multisets will be returned, otherwise only
partitions with ``m`` parts will be returned.
If ``multiset`` is an integer, a range [0, 1, ..., multiset - 1]
will be s... | multiset_partitions | File-Level |
sympy | 73 | sympy/utilities/enumerative.py | def multiset_partitions_taocp(multiplicities):
"""Enumerates partitions of a multiset.
Parameters
==========
multiplicities
list of integer multiplicities of the components of the multiset.
Yields
======
state
Internal data structure which encodes a particular partition.... | /usr/src/app/target_test_cases/failed_tests_multiset_partitions_taocp.txt | def multiset_partitions_taocp(multiplicities):
"""Enumerates partitions of a multiset.
Parameters
==========
multiplicities
list of integer multiplicities of the components of the multiset.
Yields
======
state
Internal data structure which encodes a particular partition.... | multiset_partitions_taocp | Self-Contained |
sympy | 74 | sympy/codegen/algorithms.py | def newtons_method(expr, wrt, atol=1e-12, delta=None, *, rtol=4e-16, debug=False,
itermax=None, counter=None, delta_fn=lambda e, x: -e/e.diff(x),
cse=False, handle_nan=None,
bounds=None):
""" Generates an AST for Newton-Raphson method (a root-finding algorith... | /usr/src/app/target_test_cases/failed_tests_newtons_method.txt | def newtons_method(expr, wrt, atol=1e-12, delta=None, *, rtol=4e-16, debug=False,
itermax=None, counter=None, delta_fn=lambda e, x: -e/e.diff(x),
cse=False, handle_nan=None,
bounds=None):
""" Generates an AST for Newton-Raphson method (a root-finding algorith... | newtons_method | Self-Contained |
sympy | 75 | sympy/utilities/iterables.py | def partitions(n, m=None, k=None, size=False):
"""Generate all partitions of positive integer, n.
Each partition is represented as a dictionary, mapping an integer
to the number of copies of that integer in the partition. For example,
the first partition of 4 returned is {4: 1}, "4: one of them".
... | /usr/src/app/target_test_cases/failed_tests_partitions.txt | def partitions(n, m=None, k=None, size=False):
"""Generate all partitions of positive integer, n.
Each partition is represented as a dictionary, mapping an integer
to the number of copies of that integer in the partition. For example,
the first partition of 4 returned is {4: 1}, "4: one of them".
... | partitions | Self-Contained |
sympy | 77 | sympy/calculus/util.py | def periodicity(f, symbol, check=False):
"""
Tests the given function for periodicity in the given symbol.
Parameters
==========
f : :py:class:`~.Expr`
The concerned function.
symbol : :py:class:`~.Symbol`
The variable for which the period is to be determined.
check : bool,... | /usr/src/app/target_test_cases/failed_tests_periodicity.txt | def periodicity(f, symbol, check=False):
"""
Tests the given function for periodicity in the given symbol.
Parameters
==========
f : :py:class:`~.Expr`
The concerned function.
symbol : :py:class:`~.Symbol`
The variable for which the period is to be determined.
check : bool,... | periodicity | File-Level |
sympy | 79 | sympy/plotting/plot.py | def plot(*args, show=True, **kwargs):
"""Plots a function of a single variable as a curve.
Parameters
==========
args :
The first argument is the expression representing the function
of single variable to be plotted.
The last argument is a 3-tuple denoting the range of the fre... | /usr/src/app/target_test_cases/failed_tests_plot.txt | def plot(*args, show=True, **kwargs):
"""Plots a function of a single variable as a curve.
Parameters
==========
args :
The first argument is the expression representing the function
of single variable to be plotted.
The last argument is a 3-tuple denoting the range of the fre... | plot | File-Level |
sympy | 80 | sympy/ntheory/factor_.py | def pollard_pm1(n, B=10, a=2, retries=0, seed=1234):
"""
Use Pollard's p-1 method to try to extract a nontrivial factor
of ``n``. Either a divisor (perhaps composite) or ``None`` is returned.
The value of ``a`` is the base that is used in the test gcd(a**M - 1, n).
The default is 2. If ``retries``... | /usr/src/app/target_test_cases/failed_tests_pollard_pm1.txt | def pollard_pm1(n, B=10, a=2, retries=0, seed=1234):
"""
Use Pollard's p-1 method to try to extract a nontrivial factor
of ``n``. Either a divisor (perhaps composite) or ``None`` is returned.
The value of ``a`` is the base that is used in the test gcd(a**M - 1, n).
The default is 2. If ``retries``... | pollard_pm1 | Repo-Level |
sympy | 81 | sympy/simplify/powsimp.py | def powsimp(expr, deep=False, combine='all', force=False, measure=count_ops):
"""
Reduce expression by combining powers with similar bases and exponents.
Explanation
===========
If ``deep`` is ``True`` then powsimp() will also simplify arguments of
functions. By default ``deep`` is set to ``Fa... | /usr/src/app/target_test_cases/failed_tests_powsimp.txt | def powsimp(expr, deep=False, combine='all', force=False, measure=count_ops):
"""
Reduce expression by combining powers with similar bases and exponents.
Explanation
===========
If ``deep`` is ``True`` then powsimp() will also simplify arguments of
functions. By default ``deep`` is set to ``Fa... | powsimp | File-Level |
sympy | 82 | sympy/series/formal.py | def rational_algorithm(f, x, k, order=4, full=False):
"""
Rational algorithm for computing
formula of coefficients of Formal Power Series
of a function.
Explanation
===========
Applicable when f(x) or some derivative of f(x)
is a rational function in x.
:func:`rational_algorithm` ... | /usr/src/app/target_test_cases/failed_tests_rational_algorithm.txt | def rational_algorithm(f, x, k, order=4, full=False):
"""
Rational algorithm for computing
formula of coefficients of Formal Power Series
of a function.
Explanation
===========
Applicable when f(x) or some derivative of f(x)
is a rational function in x.
:func:`rational_algorithm` ... | rational_algorithm | File-Level |
sympy | 85 | sympy/physics/optics/utils.py | def refraction_angle(incident, medium1, medium2, normal=None, plane=None):
"""
This function calculates transmitted vector after refraction at planar
surface. ``medium1`` and ``medium2`` can be ``Medium`` or any sympifiable object.
If ``incident`` is a number then treated as angle of incidence (in radia... | /usr/src/app/target_test_cases/failed_tests_refraction_angle.txt | def refraction_angle(incident, medium1, medium2, normal=None, plane=None):
"""
This function calculates transmitted vector after refraction at planar
surface. ``medium1`` and ``medium2`` can be ``Medium`` or any sympifiable object.
If ``incident`` is a number then treated as angle of incidence (in radia... | refraction_angle | File-Level |
sympy | 87 | sympy/polys/matrices/sdm.py | def sdm_irref(A):
"""RREF and pivots of a sparse matrix *A*.
Compute the reduced row echelon form (RREF) of the matrix *A* and return a
list of the pivot columns. This routine does not work in place and leaves
the original matrix *A* unmodified.
The domain of the matrix must be a field.
Examp... | /usr/src/app/target_test_cases/failed_tests_sdm_irref.txt | def sdm_irref(A):
"""RREF and pivots of a sparse matrix *A*.
Compute the reduced row echelon form (RREF) of the matrix *A* and return a
list of the pivot columns. This routine does not work in place and leaves
the original matrix *A* unmodified.
The domain of the matrix must be a field.
Examp... | sdm_irref | Self-Contained |
sympy | 90 | sympy/solvers/polysys.py | def solve_generic(polys, opt, strict=False):
"""
Solve a generic system of polynomial equations.
Returns all possible solutions over C[x_1, x_2, ..., x_m] of a
set F = { f_1, f_2, ..., f_n } of polynomial equations, using
Groebner basis approach. For now only zero-dimensional systems
are suppor... | /usr/src/app/target_test_cases/failed_tests_solve_generic.txt | def solve_generic(polys, opt, strict=False):
"""
Solve a generic system of polynomial equations.
Returns all possible solutions over C[x_1, x_2, ..., x_m] of a
set F = { f_1, f_2, ..., f_n } of polynomial equations, using
Groebner basis approach. For now only zero-dimensional systems
are suppor... | solve_generic | File-Level |
sympy | 93 | sympy/physics/secondquant.py | def substitute_dummies(expr, new_indices=False, pretty_indices={}):
"""
Collect terms by substitution of dummy variables.
Explanation
===========
This routine allows simplification of Add expressions containing terms
which differ only due to dummy variables.
The idea is to substitute all ... | /usr/src/app/target_test_cases/failed_tests_substitute_dummies.txt | def substitute_dummies(expr, new_indices=False, pretty_indices={}):
"""
Collect terms by substitution of dummy variables.
Explanation
===========
This routine allows simplification of Add expressions containing terms
which differ only due to dummy variables.
The idea is to substitute all ... | substitute_dummies | File-Level |
sympy | 94 | sympy/core/sympify.py | def sympify(a, locals=None, convert_xor=True, strict=False, rational=False,
evaluate=None):
"""
Converts an arbitrary expression to a type that can be used inside SymPy.
Explanation
===========
It will convert Python ints into instances of :class:`~.Integer`, floats
into instances of :... | /usr/src/app/target_test_cases/failed_tests_sympify.txt | def sympify(a, locals=None, convert_xor=True, strict=False, rational=False,
evaluate=None):
"""
Converts an arbitrary expression to a type that can be used inside SymPy.
Explanation
===========
It will convert Python ints into instances of :class:`~.Integer`, floats
into instances of :... | sympify | File-Level |
sympy | 96 | sympy/solvers/solvers.py | def unrad(eq, *syms, **flags):
"""
Remove radicals with symbolic arguments and return (eq, cov),
None, or raise an error.
Explanation
===========
None is returned if there are no radicals to remove.
NotImplementedError is raised if there are radicals and they cannot be
removed or if t... | /usr/src/app/target_test_cases/failed_tests_unrad.txt | def unrad(eq, *syms, **flags):
"""
Remove radicals with symbolic arguments and return (eq, cov),
None, or raise an error.
Explanation
===========
None is returned if there are no radicals to remove.
NotImplementedError is raised if there are radicals and they cannot be
removed or if t... | unrad | File-Level |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.