neulab/docprompting-conala huggingface dataset:
get_flat_tri_mask(min_circle_ratio=0.01, rescale=True)[source]
 
Eliminate excessively flat border triangles from the triangulation. Returns a mask new_mask which allows to clean the encapsulated triangulation from its border-located flat triangles (according to their circle_ratios()). This mask is meant to be subsequently applied to the triangulation using Triangulation.set_mask. new_mask is an extension of the initial triangulation mask in the sense that an initially masked triangle will remain masked. The new_mask array is computed recursively; at each step flat triangles are removed only if they share a side with the current mesh border. Thus no new holes in the triangulated domain will be created.  Parameters 
 
min_circle_ratiofloat, default: 0.01


Border triangles with incircle/circumcircle radii ratio r/R will be removed if r/R < min_circle_ratio.  
rescalebool, default: True


If True, first, internally rescale (based on scale_factors) so that the (unmasked) triangles fit exactly inside a unit square mesh. This rescaling accounts for the difference of scale which might exist between the 2 axis.    Returns 
 array of bool

Mask to apply to encapsulated triangulation. All the initially masked triangles remain masked in the new_mask.     Notes The rationale behind this function is that a Delaunay triangulation - of an unstructured set of points - sometimes contains almost flat triangles at its border, leading to artifacts in plots (especially for high-resolution contouring). Masked with computed new_mask, the encapsulated triangulation would contain no more unmasked border triangles with a circle ratio below min_circle_ratio, thus improving the mesh quality for subsequent plots or interpolation.
classmatplotlib.tri.Triangulation(x, y, triangles=None, mask=None)[source]
 
An unstructured triangular grid consisting of npoints points and ntri triangles. The triangles can either be specified by the user or automatically generated using a Delaunay triangulation.  Parameters 
 
x, y(npoints,) array-like


Coordinates of grid points.  
triangles(ntri, 3) array-like of int, optional


For each triangle, the indices of the three points that make up the triangle, ordered in an anticlockwise manner. If not specified, the Delaunay triangulation is calculated.  
mask(ntri,) array-like of bool, optional


Which triangles are masked out.     Notes For a Triangulation to be valid it must not have duplicate points, triangles formed from colinear points, or overlapping triangles.  Attributes 
 
triangles(ntri, 3) array of int


For each triangle, the indices of the three points that make up the triangle, ordered in an anticlockwise manner. If you want to take the mask into account, use get_masked_triangles instead.  
mask(ntri, 3) array of bool


Masked out triangles.  
is_delaunaybool


Whether the Triangulation is a calculated Delaunay triangulation (where triangles was not specified) or not.       calculate_plane_coefficients(z)[source]
 
Calculate plane equation coefficients for all unmasked triangles from the point (x, y) coordinates and specified z-array of shape (npoints). The returned array has shape (npoints, 3) and allows z-value at (x, y) position in triangle tri to be calculated using z = array[tri, 0] * x  + array[tri, 1] * y + array[tri, 2]. 
   propertyedges
 
Return integer array of shape (nedges, 2) containing all edges of non-masked triangles. Each row defines an edge by it's start point index and end point index. Each edge appears only once, i.e. for an edge between points i and j, there will only be either (i, j) or (j, i). 
   get_cpp_triangulation()[source]
 
Return the underlying C++ Triangulation object, creating it if necessary. 
   staticget_from_args_and_kwargs(*args, **kwargs)[source]
 
Return a Triangulation object from the args and kwargs, and the remaining args and kwargs with the consumed values removed. There are two alternatives: either the first argument is a Triangulation object, in which case it is returned, or the args and kwargs are sufficient to create a new Triangulation to return. In the latter case, see Triangulation.__init__ for the possible args and kwargs. 
   get_masked_triangles()[source]
 
Return an array of triangles that are not masked. 
   get_trifinder()[source]
 
Return the default matplotlib.tri.TriFinder of this triangulation, creating it if necessary. This allows the same TriFinder object to be easily shared. 
   propertyneighbors
 
Return integer array of shape (ntri, 3) containing neighbor triangles. For each triangle, the indices of the three triangles that share the same edges, or -1 if there is no such neighboring triangle. neighbors[i, j] is the triangle that is the neighbor to the edge from point index triangles[i, j] to point index triangles[i, (j+1)%3]. 
   set_mask(mask)[source]
 
Set or clear the mask array.  Parameters 
 
maskNone or bool array of length ntri
calculate_plane_coefficients(z)[source]
 
Calculate plane equation coefficients for all unmasked triangles from the point (x, y) coordinates and specified z-array of shape (npoints). The returned array has shape (npoints, 3) and allows z-value at (x, y) position in triangle tri to be calculated using z = array[tri, 0] * x  + array[tri, 1] * y + array[tri, 2].
get_cpp_triangulation()[source]
 
Return the underlying C++ Triangulation object, creating it if necessary.
staticget_from_args_and_kwargs(*args, **kwargs)[source]
 
Return a Triangulation object from the args and kwargs, and the remaining args and kwargs with the consumed values removed. There are two alternatives: either the first argument is a Triangulation object, in which case it is returned, or the args and kwargs are sufficient to create a new Triangulation to return. In the latter case, see Triangulation.__init__ for the possible args and kwargs.
get_masked_triangles()[source]
 
Return an array of triangles that are not masked.
get_trifinder()[source]
 
Return the default matplotlib.tri.TriFinder of this triangulation, creating it if necessary. This allows the same TriFinder object to be easily shared.
set_mask(mask)[source]
 
Set or clear the mask array.  Parameters 
 
maskNone or bool array of length ntri
classmatplotlib.tri.TriContourSet(ax, *args, **kwargs)[source]
 
Bases: matplotlib.contour.ContourSet Create and store a set of contour lines or filled regions for a triangular grid. This class is typically not instantiated directly by the user but by tricontour and tricontourf.  Attributes 
 
axAxes


The Axes object in which the contours are drawn.  
collectionssilent_list of PathCollections


The Artists representing the contour. This is a list of PathCollections for both line and filled contours.  
levelsarray


The values of the contour levels.  
layersarray


Same as levels for line contours; half-way between levels for filled contours. See ContourSet._process_colors.     Draw triangular grid contour lines or filled regions, depending on whether keyword arg 'filled' is False (default) or True. The first argument of the initializer must be an axes object. The remaining arguments and keyword arguments are described in the docstring of tricontour.
classmatplotlib.tri.TriFinder(triangulation)[source]
 
Abstract base class for classes used to find the triangles of a Triangulation in which (x, y) points lie. Rather than instantiate an object of a class derived from TriFinder, it is usually better to use the function Triangulation.get_trifinder. Derived classes implement __call__(x, y) where x and y are array-like point coordinates of the same shape.
classmatplotlib.tri.TriInterpolator(triangulation, z, trifinder=None)[source]
 
Abstract base class for classes used to interpolate on a triangular grid. Derived classes implement the following methods:  
__call__(x, y), where x, y are array-like point coordinates of the same shape, and that returns a masked array of the same shape containing the interpolated z-values. 
gradient(x, y), where x, y are array-like point coordinates of the same shape, and that returns a list of 2 masked arrays of the same shape containing the 2 derivatives of the interpolator (derivatives of interpolated z values with respect to x and y).
classmatplotlib.tri.TriRefiner(triangulation)[source]
 
Abstract base class for classes implementing mesh refinement. A TriRefiner encapsulates a Triangulation object and provides tools for mesh refinement and interpolation. Derived classes must implement:  
refine_triangulation(return_tri_index=False, **kwargs) , where the optional keyword arguments kwargs are defined in each TriRefiner concrete implementation, and which returns:  a refined triangulation, optionally (depending on return_tri_index), for each point of the refined triangulation: the index of the initial triangulation triangle to which it belongs.   
refine_field(z, triinterpolator=None, **kwargs), where:  
z array of field values (to refine) defined at the base triangulation nodes, 
triinterpolator is an optional TriInterpolator, the other optional keyword arguments kwargs are defined in each TriRefiner concrete implementation;  and which returns (as a tuple) a refined triangular mesh and the interpolated values of the field at the refined triangulation nodes.
classmatplotlib.tri.UniformTriRefiner(triangulation)[source]
 
Bases: matplotlib.tri.trirefine.TriRefiner Uniform mesh refinement by recursive subdivisions.  Parameters 
 
triangulationTriangulation


The encapsulated triangulation (to be refined)       refine_field(z, triinterpolator=None, subdiv=3)[source]
 
Refine a field defined on the encapsulated triangulation.  Parameters 
 
z(npoints,) array-like


Values of the field to refine, defined at the nodes of the encapsulated triangulation. (n_points is the number of points in the initial triangulation)  
triinterpolatorTriInterpolator, optional


Interpolator used for field interpolation. If not specified, a CubicTriInterpolator will be used.  
subdivint, default: 3


Recursion level for the subdivision. Each triangle is divided into 4**subdiv child triangles.    Returns 
 
refi_triTriangulation


The returned refined triangulation.  
refi_z1D array of length: refi_tri node count.


The returned interpolated field (at refi_tri nodes).     
   refine_triangulation(return_tri_index=False, subdiv=3)[source]
 
Compute an uniformly refined triangulation refi_triangulation of the encapsulated triangulation. This function refines the encapsulated triangulation by splitting each father triangle into 4 child sub-triangles built on the edges midside nodes, recursing subdiv times. In the end, each triangle is hence divided into 4**subdiv child triangles.  Parameters 
 
return_tri_indexbool, default: False


Whether an index table indicating the father triangle index of each point is returned.  
subdivint, default: 3


Recursion level for the subdivision. Each triangle is divided into 4**subdiv child triangles; hence, the default results in 64 refined subtriangles for each triangle of the initial triangulation.    Returns 
 
refi_triangulationTriangulation


The refined triangulation.  
found_indexint array


Index of the initial triangulation containing triangle, for each point of refi_triangulation. Returned only if return_tri_index is set to True.
refine_field(z, triinterpolator=None, subdiv=3)[source]
 
Refine a field defined on the encapsulated triangulation.  Parameters 
 
z(npoints,) array-like


Values of the field to refine, defined at the nodes of the encapsulated triangulation. (n_points is the number of points in the initial triangulation)  
triinterpolatorTriInterpolator, optional


Interpolator used for field interpolation. If not specified, a CubicTriInterpolator will be used.  
subdivint, default: 3


Recursion level for the subdivision. Each triangle is divided into 4**subdiv child triangles.    Returns 
 
refi_triTriangulation


The returned refined triangulation.  
refi_z1D array of length: refi_tri node count.


The returned interpolated field (at refi_tri nodes).
refine_triangulation(return_tri_index=False, subdiv=3)[source]
 
Compute an uniformly refined triangulation refi_triangulation of the encapsulated triangulation. This function refines the encapsulated triangulation by splitting each father triangle into 4 child sub-triangles built on the edges midside nodes, recursing subdiv times. In the end, each triangle is hence divided into 4**subdiv child triangles.  Parameters 
 
return_tri_indexbool, default: False


Whether an index table indicating the father triangle index of each point is returned.  
subdivint, default: 3


Recursion level for the subdivision. Each triangle is divided into 4**subdiv child triangles; hence, the default results in 64 refined subtriangles for each triangle of the initial triangulation.    Returns 
 
refi_triangulationTriangulation


The refined triangulation.  
found_indexint array


Index of the initial triangulation containing triangle, for each point of refi_triangulation. Returned only if return_tri_index is set to True.
matplotlib.type1font A class representing a Type 1 font. This version reads pfa and pfb files and splits them for embedding in pdf files. It also supports SlantFont and ExtendFont transformations, similarly to pdfTeX and friends. There is no support yet for subsetting. Usage: >>> font = Type1Font(filename)
>>> clear_part, encrypted_part, finale = font.parts
>>> slanted_font = font.transform({'slant': 0.167})
>>> extended_font = font.transform({'extend': 1.2})
 Sources:  Adobe Technical Note #5040, Supporting Downloadable PostScript Language Fonts. Adobe Type 1 Font Format, Adobe Systems Incorporated, third printing, v1.1, 1993. ISBN 0-201-57044-0.    classmatplotlib.type1font.Type1Font(input)[source]
 
Bases: object A class representing a Type-1 font, for use by backends.  Attributes 
 
partstuple


A 3-tuple of the cleartext part, the encrypted part, and the finale of zeros.  
decryptedbytes


The decrypted form of parts[1].  
propdict[str, Any]


A dictionary of font properties.     Initialize a Type-1 font.  Parameters 
 
inputstr or 3-tuple


Either a pfb file name, or a 3-tuple of already-decoded Type-1 font parts.       decrypted

   parts

   prop

   transform(effects)[source]
 
Return a new font that is slanted and/or extended.  Parameters 
 
effectsdict


A dict with optional entries:  
 'slant'float, default: 0


Tangent of the angle that the font is to be slanted to the right. Negative values slant to the left.    
 'extend'float, default: 1


Scaling factor for the font width. Values less than 1 condense the glyphs.        Returns 
 Type1Font
classmatplotlib.type1font.Type1Font(input)[source]
 
Bases: object A class representing a Type-1 font, for use by backends.  Attributes 
 
partstuple


A 3-tuple of the cleartext part, the encrypted part, and the finale of zeros.  
decryptedbytes


The decrypted form of parts[1].  
propdict[str, Any]


A dictionary of font properties.     Initialize a Type-1 font.  Parameters 
 
inputstr or 3-tuple


Either a pfb file name, or a 3-tuple of already-decoded Type-1 font parts.       decrypted

   parts

   prop

   transform(effects)[source]
 
Return a new font that is slanted and/or extended.  Parameters 
 
effectsdict


A dict with optional entries:  
 'slant'float, default: 0


Tangent of the angle that the font is to be slanted to the right. Negative values slant to the left.    
 'extend'float, default: 1


Scaling factor for the font width. Values less than 1 condense the glyphs.        Returns 
 Type1Font
transform(effects)[source]
 
Return a new font that is slanted and/or extended.  Parameters 
 
effectsdict


A dict with optional entries:  
 'slant'float, default: 0


Tangent of the angle that the font is to be slanted to the right. Negative values slant to the left.    
 'extend'float, default: 1


Scaling factor for the font width. Values less than 1 condense the glyphs.        Returns 
 Type1Font
classmatplotlib.units.AxisInfo(majloc=None, minloc=None, majfmt=None, minfmt=None, label=None, default_limits=None)[source]
 
Bases: object Information to support default axis labeling, tick labeling, and limits. An instance of this class must be returned by ConversionInterface.axisinfo.  Parameters 
 
majloc, minlocLocator, optional


Tick locators for the major and minor ticks.  
majfmt, minfmtFormatter, optional


Tick formatters for the major and minor ticks.  
labelstr, optional


The default axis label.  
default_limitsoptional


The default min and max limits of the axis if no data has been plotted.     Notes If any of the above are None, the axis will simply use the default value.
exceptionmatplotlib.units.ConversionError[source]
 
Bases: TypeError
classmatplotlib.units.ConversionInterface[source]
 
Bases: object The minimal interface for a converter to take custom data types (or sequences) and convert them to values Matplotlib can use.   staticaxisinfo(unit, axis)[source]
 
Return an AxisInfo for the axis with the specified units. 
   staticconvert(obj, unit, axis)[source]
 
Convert obj using unit for the specified axis. If obj is a sequence, return the converted sequence. The output must be a sequence of scalars that can be used by the numpy array layer. 
   staticdefault_units(x, axis)[source]
 
Return the default unit for x or None for the given axis. 
   staticis_numlike(x)[source]
 
[Deprecated] The Matplotlib datalim, autoscaling, locators etc work with scalars which are the units converted to floats given the current unit. The converter may be passed these floats, or arrays of them, even when units are set. Notes  Deprecated since version 3.5.
staticaxisinfo(unit, axis)[source]
 
Return an AxisInfo for the axis with the specified units.
staticconvert(obj, unit, axis)[source]
 
Convert obj using unit for the specified axis. If obj is a sequence, return the converted sequence. The output must be a sequence of scalars that can be used by the numpy array layer.
staticdefault_units(x, axis)[source]
 
Return the default unit for x or None for the given axis.
staticis_numlike(x)[source]
 
[Deprecated] The Matplotlib datalim, autoscaling, locators etc work with scalars which are the units converted to floats given the current unit. The converter may be passed these floats, or arrays of them, even when units are set. Notes  Deprecated since version 3.5.
classmatplotlib.units.DecimalConverter[source]
 
Bases: matplotlib.units.ConversionInterface Converter for decimal.Decimal data to float.   staticconvert(value, unit, axis)[source]
 
Convert Decimals to floats. The unit and axis arguments are not used.  Parameters 
 
valuedecimal.Decimal or iterable


Decimal or list of Decimal need to be converted
staticconvert(value, unit, axis)[source]
 
Convert Decimals to floats. The unit and axis arguments are not used.  Parameters 
 
valuedecimal.Decimal or iterable


Decimal or list of Decimal need to be converted
classmatplotlib.units.Registry[source]
 
Bases: dict Register types with conversion interface.   get_converter(x)[source]
 
Get the converter interface instance for x, or None.
get_converter(x)[source]
 
Get the converter interface instance for x, or None.
matplotlib.use(backend, *, force=True)[source]
 
Select the backend used for rendering and GUI integration.  Parameters 
 
backendstr


The backend to switch to. This can either be one of the standard backend names, which are case-insensitive:  interactive backends: GTK3Agg, GTK3Cairo, GTK4Agg, GTK4Cairo, MacOSX, nbAgg, QtAgg, QtCairo, TkAgg, TkCairo, WebAgg, WX, WXAgg, WXCairo, Qt5Agg, Qt5Cairo non-interactive backends: agg, cairo, pdf, pgf, ps, svg, template  or a string of the form: module://my.module.name. Switching to an interactive backend is not possible if an unrelated event loop has already been started (e.g., switching to GTK3Agg if a TkAgg window has already been opened). Switching to a non-interactive backend is always possible.  
forcebool, default: True


If True (the default), raise an ImportError if the backend cannot be set up (either because it fails to import, or because an incompatible GUI interactive framework is already running); if False, silently ignore the failure.      See also  Backends
matplotlib.get_backend
classmatplotlib.widgets.AxesWidget(ax)[source]
 
Bases: matplotlib.widgets.Widget Widget connected to a single Axes. To guarantee that the widget remains responsive and not garbage-collected, a reference to the object should be maintained by the user. This is necessary because the callback registry maintains only weak-refs to the functions, which are member functions of the widget. If there are no references to the widget object it may be garbage collected which will disconnect the callbacks.  Attributes 
 
axAxes


The parent axes for the widget.  
canvasFigureCanvasBase


The parent figure canvas for the widget.  
activebool


Is the widget active?       propertycids[source]

   connect_event(event, callback)[source]
 
Connect a callback function with an event. This should be used in lieu of figure.canvas.mpl_connect since this function stores callback ids for later clean up. 
   disconnect_events()[source]
 
Disconnect all events created by this widget.
connect_event(event, callback)[source]
 
Connect a callback function with an event. This should be used in lieu of figure.canvas.mpl_connect since this function stores callback ids for later clean up.
classmatplotlib.widgets.Button(ax, label, image=None, color='0.85', hovercolor='0.95')[source]
 
Bases: matplotlib.widgets.AxesWidget A GUI neutral button. For the button to remain responsive you must keep a reference to it. Call on_clicked to connect to the button.  Attributes 
 ax

The matplotlib.axes.Axes the button renders into.  label

A matplotlib.text.Text instance.  color

The color of the button when not hovering.  hovercolor

The color of the button when hovering.      Parameters 
 
axAxes


The Axes instance the button will be placed into.  
labelstr


The button text.  
imagearray-like or PIL Image


The image to place in the button, if not None. The parameter is directly forwarded to imshow.  
colorcolor


The color of the button when not activated.  
hovercolorcolor


The color of the button when the mouse is over it.       propertycnt[source]

   disconnect(cid)[source]
 
Remove the callback function with connection id cid. 
   propertyobservers[source]

   on_clicked(func)[source]
 
Connect the callback function func to button click events. Returns a connection id, which can be used to disconnect the callback.
on_clicked(func)[source]
 
Connect the callback function func to button click events. Returns a connection id, which can be used to disconnect the callback.
classmatplotlib.widgets.CheckButtons(ax, labels, actives=None)[source]
 
Bases: matplotlib.widgets.AxesWidget A GUI neutral set of check buttons. For the check buttons to remain responsive you must keep a reference to this object. Connect to the CheckButtons with the on_clicked method.  Attributes 
 
axAxes


The parent axes for the widget.  
labelslist of Text


rectangleslist of Rectangle


lineslist of (Line2D, Line2D) pairs


List of lines for the x's in the check boxes. These lines exist for each box, but have set_visible(False) when its box is not checked.     Add check buttons to matplotlib.axes.Axes instance ax.  Parameters 
 
axAxes


The parent axes for the widget.  
labelslist of str


The labels of the check buttons.  
activeslist of bool, optional


The initial check states of the buttons. The list must have the same length as labels. If not given, all buttons are unchecked.       propertycnt[source]

   disconnect(cid)[source]
 
Remove the observer with connection id cid. 
   get_status()[source]
 
Return a tuple of the status (True/False) of all of the check buttons. 
   propertyobservers[source]

   on_clicked(func)[source]
 
Connect the callback function func to button click events. Returns a connection id, which can be used to disconnect the callback. 
   set_active(index)[source]
 
Toggle (activate or deactivate) a check button by index. Callbacks will be triggered if eventson is True.  Parameters 
 
indexint


Index of the check button to toggle.    Raises 
 ValueError

If index is invalid.
get_status()[source]
 
Return a tuple of the status (True/False) of all of the check buttons.