id int64 0 190k | prompt stringlengths 21 13.4M | docstring stringlengths 1 12k ⌀ |
|---|---|---|
171,210 | import inspect
import textwrap
import numpy as np
import matplotlib as mpl
from matplotlib import _api, _docstring
from matplotlib.ticker import (
NullFormatter, ScalarFormatter, LogFormatterSciNotation, LogitFormatter,
NullLocator, LogLocator, AutoLocator, AutoMinorLocator,
SymmetricalLogLocator, AsinhLoca... | Return the names of the available scales. |
171,211 | import inspect
import textwrap
import numpy as np
import matplotlib as mpl
from matplotlib import _api, _docstring
from matplotlib.ticker import (
NullFormatter, ScalarFormatter, LogFormatterSciNotation, LogitFormatter,
NullLocator, LogLocator, AutoLocator, AutoMinorLocator,
SymmetricalLogLocator, AsinhLoca... | Return a scale class by name. Parameters ---------- scale : {%(names)s} axis : `matplotlib.axis.Axis` |
171,212 | import inspect
import textwrap
import numpy as np
import matplotlib as mpl
from matplotlib import _api, _docstring
from matplotlib.ticker import (
NullFormatter, ScalarFormatter, LogFormatterSciNotation, LogitFormatter,
NullLocator, LogLocator, AutoLocator, AutoMinorLocator,
SymmetricalLogLocator, AsinhLoca... | Register a new kind of scale. Parameters ---------- scale_class : subclass of `ScaleBase` The scale to register. |
171,213 | import inspect
import textwrap
import numpy as np
import matplotlib as mpl
from matplotlib import _api, _docstring
from matplotlib.ticker import (
NullFormatter, ScalarFormatter, LogFormatterSciNotation, LogitFormatter,
NullLocator, LogLocator, AutoLocator, AutoMinorLocator,
SymmetricalLogLocator, AsinhLoca... | Helper function for generating docstrings related to scales. |
171,214 | from functools import lru_cache
import math
import warnings
import numpy as np
from matplotlib import _api
def _comb(n, k):
if k > n:
return 0
k = min(k, n - k)
i = np.arange(1, k + 1)
return np.prod((n + 1 - i)/i).astype(int) | null |
171,215 | from functools import lru_cache
import math
import warnings
import numpy as np
from matplotlib import _api
def split_bezier_intersecting_with_closedpath(
bezier, inside_closedpath, tolerance=0.01):
"""
Split a Bézier curve into two at the intersection with a closed path.
Parameters
----------
... | Divide a path into two segments at the point where ``inside(x, y)`` becomes False. |
171,216 | from functools import lru_cache
import math
import warnings
import numpy as np
from matplotlib import _api
The provided code snippet includes necessary dependencies for implementing the `inside_circle` function. Write a Python function `def inside_circle(cx, cy, r)` to solve the following problem:
Return a function th... | Return a function that checks whether a point is in a circle with center (*cx*, *cy*) and radius *r*. The returned function has the signature:: f(xy: tuple[float, float]) -> bool |
171,217 | from functools import lru_cache
import math
import warnings
import numpy as np
from matplotlib import _api
def get_intersection(cx1, cy1, cos_t1, sin_t1,
cx2, cy2, cos_t2, sin_t2):
"""
Return the intersection between the line through (*cx1*, *cy1*) at angle
*t1* and the line through (*c... | Given the quadratic Bézier control points *bezier2*, returns control points of quadratic Bézier lines roughly parallel to given one separated by *width*. |
171,218 | from functools import lru_cache
import math
import warnings
import numpy as np
from matplotlib import _api
def get_normal_points(cx, cy, cos_t, sin_t, length):
"""
For a line passing through (*cx*, *cy*) and having an angle *t*, return
locations of the two points located along its perpendicular line at the
... | Being similar to `get_parallels`, returns control points of two quadratic Bézier lines having a width roughly parallel to given one separated by *width*. |
171,219 | import abc
import base64
import contextlib
from io import BytesIO, TextIOWrapper
import itertools
import logging
from pathlib import Path
import shutil
import subprocess
import sys
from tempfile import TemporaryDirectory
import uuid
import warnings
import numpy as np
from PIL import Image
import matplotlib as mpl
from ... | Compute figure size so that pixels are a multiple of n. Parameters ---------- w, h : float Size in inches. dpi : float The dpi. n : int The target multiple. Returns ------- wnew, hnew : float The new figure size in inches. |
171,220 | import abc
import base64
import contextlib
from io import BytesIO, TextIOWrapper
import itertools
import logging
from pathlib import Path
import shutil
import subprocess
import sys
from tempfile import TemporaryDirectory
import uuid
import warnings
import numpy as np
from PIL import Image
import matplotlib as mpl
from ... | null |
171,221 | import abc
import base64
import contextlib
from io import BytesIO, TextIOWrapper
import itertools
import logging
from pathlib import Path
import shutil
import subprocess
import sys
from tempfile import TemporaryDirectory
import uuid
import warnings
import numpy as np
from PIL import Image
import matplotlib as mpl
from ... | frame_list should be a list of base64-encoded png files |
171,222 | import base64
from collections.abc import Sized, Sequence, Mapping
import functools
import importlib
import inspect
import io
import itertools
from numbers import Number
import re
from PIL import Image
from PIL.PngImagePlugin import PngInfo
import matplotlib as mpl
import numpy as np
from matplotlib import _api, _cm, c... | null |
171,223 | import base64
from collections.abc import Sized, Sequence, Mapping
import functools
import importlib
import inspect
import io
import itertools
from numbers import Number
import re
from PIL import Image
from PIL.PngImagePlugin import PngInfo
import matplotlib as mpl
import numpy as np
from matplotlib import _api, _cm, c... | Return whether *c* is a color with an alpha channel. |
171,224 | import base64
from collections.abc import Sized, Sequence, Mapping
import functools
import importlib
import inspect
import io
import itertools
from numbers import Number
import re
from PIL import Image
from PIL.PngImagePlugin import PngInfo
import matplotlib as mpl
import numpy as np
from matplotlib import _api, _cm, c... | For each *key, value* pair in *kwargs*, check that *value* is color-like. |
171,225 | import base64
from collections.abc import Sized, Sequence, Mapping
import functools
import importlib
import inspect
import io
import itertools
from numbers import Number
import re
from PIL import Image
from PIL.PngImagePlugin import PngInfo
import matplotlib as mpl
import numpy as np
from matplotlib import _api, _cm, c... | Return whether the colors *c1* and *c2* are the same. *c1*, *c2* can be single colors or lists/arrays of colors. |
171,226 | import base64
from collections.abc import Sized, Sequence, Mapping
import functools
import importlib
import inspect
import io
import itertools
from numbers import Number
import re
from PIL import Image
from PIL.PngImagePlugin import PngInfo
import matplotlib as mpl
import numpy as np
from matplotlib import _api, _cm, c... | r""" Create an *N* -element 1D lookup table. This assumes a mapping :math:`f : [0, 1] \rightarrow [0, 1]`. The returned data is an array of N values :math:`y = f(x)` where x is sampled from [0, 1]. By default (*gamma* = 1) x is equidistantly sampled from [0, 1]. The *gamma* correction factor :math:`\gamma` distorts thi... |
171,227 | import base64
from collections.abc import Sized, Sequence, Mapping
import functools
import importlib
import inspect
import io
import itertools
from numbers import Number
import re
from PIL import Image
from PIL.PngImagePlugin import PngInfo
import matplotlib as mpl
import numpy as np
from matplotlib import _api, _cm, c... | Convert float RGB values (in the range [0, 1]), in a numpy array to HSV values. Parameters ---------- arr : (..., 3) array-like All values must be in the range [0, 1] Returns ------- (..., 3) `~numpy.ndarray` Colors converted to HSV values in range [0, 1] |
171,228 | import base64
from collections.abc import Sized, Sequence, Mapping
import functools
import importlib
import inspect
import io
import itertools
from numbers import Number
import re
from PIL import Image
from PIL.PngImagePlugin import PngInfo
import matplotlib as mpl
import numpy as np
from matplotlib import _api, _cm, c... | Convert HSV values to RGB. Parameters ---------- hsv : (..., 3) array-like All values assumed to be in range [0, 1] Returns ------- (..., 3) `~numpy.ndarray` Colors converted to RGB values in range [0, 1] |
171,229 | import base64
from collections.abc import Sized, Sequence, Mapping
import functools
import importlib
import inspect
import io
import itertools
from numbers import Number
import re
from PIL import Image
from PIL.PngImagePlugin import PngInfo
import matplotlib as mpl
import numpy as np
from matplotlib import _api, _cm, c... | null |
171,230 | import base64
from collections.abc import Sized, Sequence, Mapping
import functools
import importlib
import inspect
import io
import itertools
from numbers import Number
import re
from PIL import Image
from PIL.PngImagePlugin import PngInfo
import matplotlib as mpl
import numpy as np
from matplotlib import _api, _cm, c... | A helper routine to generate a cmap and a norm instance which behave similar to contourf's levels and colors arguments. Parameters ---------- levels : sequence of numbers The quantization levels used to construct the `BoundaryNorm`. Value ``v`` is quantized to level ``i`` if ``lev[i] <= v < lev[i+1]``. colors : sequenc... |
171,231 | from io import StringIO
from pathlib import Path
import subprocess
from matplotlib.transforms import TransformNode
class StringIO(TextIOWrapper):
def __init__(self, initial_value: Optional[str] = ..., newline: Optional[str] = ...) -> None: ...
# StringIO does not contain a "name" field. This workaround is nece... | Generate a graphical representation of the transform tree for *transform* using the :program:`dot` program (which this function depends on). The output format (png, dot, etc.) is determined from the suffix of *dest*. Parameters ---------- transform : `~matplotlib.transform.Transform` The represented transform. dest : s... |
171,232 | import numpy as np
import matplotlib as mpl
from matplotlib import _api, artist as martist
from matplotlib.font_manager import FontProperties
from matplotlib.transforms import Bbox
The provided code snippet includes necessary dependencies for implementing the `get_subplotspec_list` function. Write a Python function `d... | Return a list of subplotspec from the given list of axes. For an instance of axes that does not support subplotspec, None is inserted in the list. If grid_spec is given, None is inserted for those not from the given grid_spec. |
171,233 | import numpy as np
import matplotlib as mpl
from matplotlib import _api, artist as martist
from matplotlib.font_manager import FontProperties
from matplotlib.transforms import Bbox
def _auto_adjust_subplotpars(
fig, renderer, shape, span_pairs, subplot_list,
ax_bbox_list=None, pad=1.08, h_pad=None, w_pa... | Return subplot parameters for tight-layouted-figure with specified padding. Parameters ---------- fig : Figure axes_list : list of Axes subplotspec_list : list of `.SubplotSpec` The subplotspecs of each axes. renderer : renderer pad : float Padding between the figure edge and the edges of subplots, as a fraction of the... |
171,234 | import contextlib
import functools
import inspect
import math
import warnings
def warn_deprecated(
since, *, message='', name='', alternative='', pending=False,
obj_type='', addendum='', removal=''):
"""
Display a standardized deprecation.
Parameters
----------
since : str
Th... | Decorator to mark a function, a class, or a property as deprecated. When deprecating a classmethod, a staticmethod, or a property, the ``@deprecated`` decorator should go *under* ``@classmethod`` and ``@staticmethod`` (i.e., `deprecated` should directly decorate the underlying callable), but *over* ``@property``. When ... |
171,235 | import contextlib
import functools
import inspect
import math
import warnings
def warn_deprecated(
since, *, message='', name='', alternative='', pending=False,
obj_type='', addendum='', removal=''):
"""
Display a standardized deprecation.
Parameters
----------
since : str
Th... | Decorator indicating that parameter *old* of *func* is renamed to *new*. The actual implementation of *func* should use *new*, not *old*. If *old* is passed to *func*, a DeprecationWarning is emitted, and its value is used, even if *new* is also passed by keyword (this is to simplify pyplot wrapper functions, which alw... |
171,236 | import contextlib
import functools
import inspect
import math
import warnings
def warn_deprecated(
since, *, message='', name='', alternative='', pending=False,
obj_type='', addendum='', removal=''):
"""
Display a standardized deprecation.
Parameters
----------
since : str
Th... | Decorator indicating that parameter *name* of *func* is being deprecated. The actual implementation of *func* should keep the *name* parameter in its signature, or accept a ``**kwargs`` argument (through which *name* would be passed). Parameters that come after the deprecated parameter effectively become keyword-only (... |
171,237 | import contextlib
import functools
import inspect
import math
import warnings
def warn_deprecated(
since, *, message='', name='', alternative='', pending=False,
obj_type='', addendum='', removal=''):
"""
Display a standardized deprecation.
Parameters
----------
since : str
Th... | Decorator indicating that passing parameter *name* (or any of the following ones) positionally to *func* is being deprecated. When used on a method that has a pyplot wrapper, this should be the outermost decorator, so that :file:`boilerplate.py` can access the original signature. |
171,238 | import contextlib
import functools
import inspect
import math
import warnings
def warn_deprecated(
since, *, message='', name='', alternative='', pending=False,
obj_type='', addendum='', removal=''):
"""
Display a standardized deprecation.
Parameters
----------
since : str
Th... | Return ``obj.method`` with a deprecation if it was overridden, else None. Parameters ---------- method An unbound method, i.e. an expression of the form ``Class.method_name``. Remember that within the body of a method, one can always use ``__class__`` to refer to the class that is currently being defined. obj Either an... |
171,239 | import contextlib
import functools
import inspect
import math
import warnings
class MatplotlibDeprecationWarning(DeprecationWarning):
"""A class for issuing deprecation warnings for Matplotlib users."""
def suppress_matplotlib_deprecation_warning():
with warnings.catch_warnings():
warnings.simplefilter... | null |
171,240 | import contextlib
import doctest
from io import StringIO
import itertools
import os
from os.path import relpath
from pathlib import Path
import re
import shutil
import sys
import textwrap
import traceback
from docutils.parsers.rst import directives, Directive
from docutils.parsers.rst.directives.images import Image
imp... | null |
171,241 | import contextlib
import doctest
from io import StringIO
import itertools
import os
from os.path import relpath
from pathlib import Path
import re
import shutil
import sys
import textwrap
import traceback
from docutils.parsers.rst import directives, Directive
from docutils.parsers.rst.directives.images import Image
imp... | null |
171,242 | import contextlib
import doctest
from io import StringIO
import itertools
import os
from os.path import relpath
from pathlib import Path
import re
import shutil
import sys
import textwrap
import traceback
from docutils.parsers.rst import directives, Directive
from docutils.parsers.rst.directives.images import Image
imp... | null |
171,243 | import contextlib
import doctest
from io import StringIO
import itertools
import os
from os.path import relpath
from pathlib import Path
import re
import shutil
import sys
import textwrap
import traceback
from docutils.parsers.rst import directives, Directive
from docutils.parsers.rst.directives.images import Image
imp... | null |
171,244 | import hashlib
from pathlib import Path
from docutils import nodes
from docutils.parsers.rst import Directive, directives
import sphinx
from sphinx.errors import ConfigError, ExtensionError
import matplotlib as mpl
from matplotlib import _api, mathtext
from matplotlib.rcsetup import validate_float_or_None
def fontset_... | null |
171,245 | import enum
import functools
import re
import time
from types import SimpleNamespace
import uuid
from weakref import WeakKeyDictionary
import numpy as np
import matplotlib as mpl
from matplotlib._pylab_helpers import Gcf
from matplotlib import _api, cbook
_tool_registry = set()
The provided code snippet includes neces... | Decorator registering *tool_cls* as a tool class for *canvas_cls*. |
171,246 | import enum
import functools
import re
import time
from types import SimpleNamespace
import uuid
from weakref import WeakKeyDictionary
import numpy as np
import matplotlib as mpl
from matplotlib._pylab_helpers import Gcf
from matplotlib import _api, cbook
_tool_registry = set()
The provided code snippet includes neces... | Find a subclass of *tool_cls* registered for *canvas_cls*. |
171,247 | import enum
import functools
import re
import time
from types import SimpleNamespace
import uuid
from weakref import WeakKeyDictionary
import numpy as np
import matplotlib as mpl
from matplotlib._pylab_helpers import Gcf
from matplotlib import _api, cbook
default_tools = {'home': ToolHome, 'back': ToolBack, 'forward': ... | Add multiple tools to a `.ToolManager`. Parameters ---------- toolmanager : `.backend_managers.ToolManager` Manager to which the tools are added. tools : {str: class_like}, optional The tools to add in a {name: tool} dict, see `.backend_managers.ToolManager.add_tool` for more info. |
171,248 | import enum
import functools
import re
import time
from types import SimpleNamespace
import uuid
from weakref import WeakKeyDictionary
import numpy as np
import matplotlib as mpl
from matplotlib._pylab_helpers import Gcf
from matplotlib import _api, cbook
default_toolbar_tools = [['navigation', ['home', 'back', 'forwar... | Add multiple tools to the container. Parameters ---------- container : Container `.backend_bases.ToolContainerBase` object that will get the tools added. tools : list, optional List in the form ``[[group1, [tool1, tool2 ...]], [group2, [...]]]`` where the tools ``[tool1, tool2, ...]`` will display in group1. See `.back... |
171,249 | import numpy as np
from matplotlib import _api
from matplotlib.collections import PolyCollection, TriMesh
from matplotlib.colors import Normalize
from matplotlib.tri._triangulation import Triangulation
"antialiased": ["antialiaseds", "aa"],
"edgecolor": ["edgecolors", "ec"],
"facecolor": ["facecolors", "fc"],
... | Create a pseudocolor plot of an unstructured triangular grid. Call signatures:: tripcolor(triangulation, c, *, ...) tripcolor(x, y, c, *, [triangles=triangles], [mask=mask], ...) The triangular grid can be specified either by passing a `.Triangulation` object as the first parameter, or by passing the points *x*, *y* an... |
171,250 | import numpy as np
from matplotlib import _docstring
from matplotlib.contour import ContourSet
from matplotlib.tri._triangulation import Triangulation
class TriContourSet(ContourSet):
"""
Create and store a set of contour lines or filled regions for
a triangular grid.
This class is typically not instant... | %(_tricontour_doc)s linewidths : float or array-like, default: :rc:`contour.linewidth` The line width of the contour lines. If a number, all levels will be plotted with this linewidth. If a sequence, the levels in ascending order will be plotted with the linewidths in the order specified. If None, this falls back to :r... |
171,251 | import numpy as np
from matplotlib import _docstring
from matplotlib.contour import ContourSet
from matplotlib.tri._triangulation import Triangulation
class TriContourSet(ContourSet):
"""
Create and store a set of contour lines or filled regions for
a triangular grid.
This class is typically not instant... | %(_tricontour_doc)s hatches : list[str], optional A list of crosshatch patterns to use on the filled areas. If None, no hatching will be added to the contour. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Notes ----- `.tricontourf` fills intervals that are closed at the top; that is, for boun... |
171,252 | import numpy as np
from matplotlib import _api
from matplotlib.tri import Triangulation
from matplotlib.tri._trifinder import TriFinder
from matplotlib.tri._tritools import TriAnalyzer
The provided code snippet includes necessary dependencies for implementing the `_cg` function. Write a Python function `def _cg(A, b, ... | Use Preconditioned Conjugate Gradient iteration to solve A x = b A simple Jacobi (diagonal) preconditioner is used. Parameters ---------- A : _Sparse_Matrix_coo *A* must have been compressed before by compress_csc or compress_csr method. b : array Right hand side of the linear system. x0 : array, optional Starting gues... |
171,253 | import numpy as np
from matplotlib import _api
from matplotlib.tri import Triangulation
from matplotlib.tri._trifinder import TriFinder
from matplotlib.tri._tritools import TriAnalyzer
The provided code snippet includes necessary dependencies for implementing the `_safe_inv22_vectorized` function. Write a Python funct... | Inversion of arrays of (2, 2) matrices, returns 0 for rank-deficient matrices. *M* : array of (2, 2) matrices to inverse, shape (n, 2, 2) |
171,254 | import numpy as np
from matplotlib import _api
from matplotlib.tri import Triangulation
from matplotlib.tri._trifinder import TriFinder
from matplotlib.tri._tritools import TriAnalyzer
The provided code snippet includes necessary dependencies for implementing the `_pseudo_inv22sym_vectorized` function. Write a Python ... | Inversion of arrays of (2, 2) SYMMETRIC matrices; returns the (Moore-Penrose) pseudo-inverse for rank-deficient matrices. In case M is of rank 1, we have M = trace(M) x P where P is the orthogonal projection on Im(M), and we return trace(M)^-1 x P == M / trace(M)**2 In case M is of rank 0, we return the null matrix. *M... |
171,255 | import numpy as np
from matplotlib import _api
from matplotlib.tri import Triangulation
from matplotlib.tri._trifinder import TriFinder
from matplotlib.tri._tritools import TriAnalyzer
The provided code snippet includes necessary dependencies for implementing the `_scalar_vectorized` function. Write a Python function ... | Scalar product between scalars and matrices. |
171,256 | import numpy as np
from matplotlib import _api
from matplotlib.tri import Triangulation
from matplotlib.tri._trifinder import TriFinder
from matplotlib.tri._tritools import TriAnalyzer
The provided code snippet includes necessary dependencies for implementing the `_transpose_vectorized` function. Write a Python functi... | Transposition of an array of matrices *M*. |
171,257 | import numpy as np
from matplotlib import _api
from matplotlib.tri import Triangulation
from matplotlib.tri._trifinder import TriFinder
from matplotlib.tri._tritools import TriAnalyzer
The provided code snippet includes necessary dependencies for implementing the `_roll_vectorized` function. Write a Python function `d... | Roll an array of matrices along *axis* (0: rows, 1: columns) according to an array of indices *roll_indices*. |
171,258 | import numpy as np
from matplotlib import _api
from matplotlib.tri import Triangulation
from matplotlib.tri._trifinder import TriFinder
from matplotlib.tri._tritools import TriAnalyzer
The provided code snippet includes necessary dependencies for implementing the `_to_matrix_vectorized` function. Write a Python functi... | Build an array of matrices from individuals np.arrays of identical shapes. Parameters ---------- M ncols-list of nrows-lists of shape sh. Returns ------- M_res : np.array of shape (sh, nrow, ncols) *M_res* satisfies ``M_res[..., i, j] = M[i][j]``. |
171,259 | import numpy as np
from matplotlib import _api
from matplotlib.tri import Triangulation
from matplotlib.tri._trifinder import TriFinder
from matplotlib.tri._tritools import TriAnalyzer
The provided code snippet includes necessary dependencies for implementing the `_extract_submatrices` function. Write a Python functio... | Extract selected blocks of a matrices *M* depending on parameters *block_indices* and *block_size*. Returns the array of extracted matrices *Mres* so that :: M_res[..., ir, :] = M[(block_indices*block_size+ir), :] |
171,260 | import numpy as np
from matplotlib.tri._triangulation import Triangulation
import matplotlib.cbook as cbook
import matplotlib.lines as mlines
class Triangulation:
"""
An unstructured triangular grid consisting of npoints points and
ntri triangles. The triangles can either be specified by the user
or a... | Draw an unstructured triangular grid as lines and/or markers. Call signatures:: triplot(triangulation, ...) triplot(x, y, [triangles], *, [mask=mask], ...) The triangular grid can be specified either by passing a `.Triangulation` object as the first parameter, or by passing the points *x*, *y* and optionally the *trian... |
171,261 | import itertools
import logging
import time
import numpy as np
import matplotlib as mpl
from matplotlib import _api, _docstring, colors, offsetbox
from matplotlib.artist import Artist, allow_rasterization
from matplotlib.cbook import silent_list
from matplotlib.font_manager import FontProperties
from matplotlib.lines i... | Get the handles and labels from the calls to either ``figure.legend`` or ``axes.legend``. The parser is a bit involved because we support:: legend() legend(labels) legend(handles, labels) legend(labels=labels) legend(handles=handles) legend(handles=handles, labels=labels) The behavior for a mixture of positional and ke... |
171,262 | import functools
from numbers import Number
import numpy as np
from matplotlib import _api, _docstring, cbook
The provided code snippet includes necessary dependencies for implementing the `window_none` function. Write a Python function `def window_none(x)` to solve the following problem:
No window function; simply re... | No window function; simply return *x*. See Also -------- window_hanning : Another window algorithm. |
171,263 | import functools
from numbers import Number
import numpy as np
from matplotlib import _api, _docstring, cbook
def _stride_windows(x, n, noverlap=0, axis=0):
# np>=1.20 provides sliding_window_view, and we only ever use axis=0.
if hasattr(np.lib.stride_tricks, "sliding_window_view") and axis == 0:
if nov... | Get all windows of *x* with length *n* as a single array, using strides to avoid data duplication. .. warning:: It is not safe to write to the output array. Multiple elements may point to the same piece of memory, so modifying one value may change others. Parameters ---------- x : 1D array or sequence Array or sequence... |
171,264 | import functools
from numbers import Number
import numpy as np
from matplotlib import _api, _docstring, cbook
def detrend_none(x, axis=None):
"""
Return *x*: no detrending.
Parameters
----------
x : any object
An object containing the data
axis : int
This parameter is ignored.
... | Private helper implementing the commonality between the complex, magnitude, angle, and phase spectrums. |
171,265 | import functools
from numbers import Number
import numpy as np
from matplotlib import _api, _docstring, cbook
def _spectral_helper(x, y=None, NFFT=None, Fs=None, detrend_func=None,
window=None, noverlap=None, pad_to=None,
sides=None, scale_by_freq=None, mode=None):
"""
... | Compute a spectrogram. Compute and plot a spectrogram of data in *x*. Data are split into *NFFT* length segments and the spectrum of each section is computed. The windowing function *window* is applied to each segment, and the amount of overlap of each segment is specified with *noverlap*. Parameters ---------- x : arr... |
171,266 | import functools
from numbers import Number
import numpy as np
from matplotlib import _api, _docstring, cbook
def window_hanning(x):
"""
Return *x* times the Hanning (or Hann) window of len(*x*).
See Also
--------
window_none : Another window algorithm.
"""
return np.hanning(len(x))*x
def de... | r""" The coherence between *x* and *y*. Coherence is the normalized cross spectral density: .. math:: C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}} Parameters ---------- x, y Array or sequence containing the data %(Spectral)s %(PSD)s noverlap : int, default: 0 (no overlap) The number of points of overlap between segments. R... |
171,267 | from collections import namedtuple
import enum
from functools import lru_cache, partial, wraps
import logging
import os
from pathlib import Path
import re
import struct
import subprocess
import sys
import numpy as np
from matplotlib import _api, cbook
The provided code snippet includes necessary dependencies for imple... | Return *delta* without reading anything more from the dvi file. |
171,268 | from collections import namedtuple
import enum
from functools import lru_cache, partial, wraps
import logging
import os
from pathlib import Path
import re
import struct
import subprocess
import sys
import numpy as np
from matplotlib import _api, cbook
def _arg(nbytes, signed, dvi, _):
"""
Read *nbytes* bytes, r... | Read *delta* bytes, returning None if *delta* is zero, and the bytes interpreted as a signed integer otherwise. |
171,269 | from collections import namedtuple
import enum
from functools import lru_cache, partial, wraps
import logging
import os
from pathlib import Path
import re
import struct
import subprocess
import sys
import numpy as np
from matplotlib import _api, cbook
def _arg(nbytes, signed, dvi, _):
"""
Read *nbytes* bytes, r... | Read *delta*+1 bytes, returning the bytes interpreted as signed. |
171,270 | from collections import namedtuple
import enum
from functools import lru_cache, partial, wraps
import logging
import os
from pathlib import Path
import re
import struct
import subprocess
import sys
import numpy as np
from matplotlib import _api, cbook
def _arg(nbytes, signed, dvi, _):
"""
Read *nbytes* bytes, r... | Read *delta*+1 bytes, returning the bytes interpreted as unsigned. |
171,271 | from collections import namedtuple
import enum
from functools import lru_cache, partial, wraps
import logging
import os
from pathlib import Path
import re
import struct
import subprocess
import sys
import numpy as np
from matplotlib import _api, cbook
def _arg(nbytes, signed, dvi, _):
"""
Read *nbytes* bytes, r... | Read *delta*+1 bytes, returning the bytes interpreted as unsigned integer for 0<=*delta*<3 and signed if *delta*==3. |
171,272 | from collections import namedtuple
import enum
from functools import lru_cache, partial, wraps
import logging
import os
from pathlib import Path
import re
import struct
import subprocess
import sys
import numpy as np
from matplotlib import _api, cbook
_arg_mapping = dict(raw=_arg_raw,
u1=partial(_ar... | Decorator for dispatch by opcode. Sets the values in *table* from *min* to *max* to this method, adds a check that the Dvi state matches *state* if not None, reads arguments from the file according to *args*. Parameters ---------- table : dict[int, callable] The dispatch table to be filled in. min, max : int Range of o... |
171,273 | from collections import namedtuple
import enum
from functools import lru_cache, partial, wraps
import logging
import os
from pathlib import Path
import re
import struct
import subprocess
import sys
import numpy as np
from matplotlib import _api, cbook
The provided code snippet includes necessary dependencies for imple... | Multiply two numbers in 20.12 fixed point format. |
171,274 | from collections import namedtuple
import enum
from functools import lru_cache, partial, wraps
import logging
import os
from pathlib import Path
import re
import struct
import subprocess
import sys
import numpy as np
from matplotlib import _api, cbook
class Path(PurePath):
def __new__(cls: Type[_P], *args: Union[s... | r""" Parse a \*.enc file referenced from a psfonts.map style file. The format supported by this function is a tiny subset of PostScript. Parameters ---------- path : `os.PathLike` Returns ------- list The nth entry of the list is the PostScript glyph name of the nth glyph. |
171,275 | from collections import namedtuple
import enum
from functools import lru_cache, partial, wraps
import logging
import os
from pathlib import Path
import re
import struct
import subprocess
import sys
import numpy as np
from matplotlib import _api, cbook
def _find_tex_file(filename):
def find_tex_file(filename):
try:... | null |
171,276 | from collections import namedtuple
import enum
from functools import lru_cache, partial, wraps
import logging
import os
from pathlib import Path
import re
import struct
import subprocess
import sys
import numpy as np
from matplotlib import _api, cbook
def _find_tex_file(filename):
"""
Find a file in the texmf t... | null |
171,277 | import wx
from .. import _api
from .backend_agg import FigureCanvasAgg
from .backend_wx import _BackendWx, _FigureCanvasWxBase, FigureFrameWx
from .backend_wx import ( # noqa: F401 # pylint: disable=W0611
NavigationToolbar2Wx as NavigationToolbar2WxAgg)
"3.6", alternative="FigureFrameWx(..., canvas_class=Figur... | Convert an RGBA buffer to a wx.Bitmap. |
171,278 | import logging
import sys
import matplotlib as mpl
from matplotlib import _api, backend_tools, cbook
from matplotlib._pylab_helpers import Gcf
from matplotlib.backend_bases import (
_Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2,
TimerBase)
from matplotlib.backend_tools import Cursors
import ... | null |
171,279 | import functools
import gzip
import math
import numpy as np
import matplotlib as mpl
from .. import _api, cbook, font_manager
from matplotlib.backend_bases import (
_Backend, FigureCanvasBase, FigureManagerBase, GraphicsContextBase,
RendererBase)
from matplotlib.font_manager import ttfFontProperty
from matplotl... | null |
171,280 | import functools
import gzip
import math
import numpy as np
try:
import cairo
if cairo.version_info < (1, 14, 0): # Introduced set_device_scale.
raise ImportError
except ImportError:
try:
import cairocffi as cairo
except ImportError as err:
raise ImportError(
"cairo ... | Convert a `.FontProperties` or a `.FontEntry` to arguments that can be passed to `.Context.select_font_face`. |
171,281 | import functools
import operator
import os
import platform
import sys
import signal
import socket
import contextlib
from packaging.version import parse as parse_version
import matplotlib as mpl
from . import _QT_FORCE_QT5_BINDING
QT_API_PYQT6 = "PyQt6"
QT_API_PYSIDE6 = "PySide6"
QT_API_PYQT5 = "PyQt5"
QT_API_PYSIDE2 = ... | null |
171,282 | import functools
import operator
import os
import platform
import sys
import signal
import socket
import contextlib
from packaging.version import parse as parse_version
import matplotlib as mpl
from . import _QT_FORCE_QT5_BINDING
def _exec(obj):
# exec on PyQt6, exec_ elsewhere.
obj.exec() if hasattr(obj, "exe... | null |
171,283 | import functools
import operator
import os
import platform
import sys
import signal
import socket
import contextlib
from packaging.version import parse as parse_version
import matplotlib as mpl
from . import _QT_FORCE_QT5_BINDING
def _enum(name):
# foo.bar.Enum.Entry (PyQt6) <=> foo.bar.Entry (non-PyQt6).
retur... | This manager allows to terminate a plot by sending a SIGINT. It is necessary because the running Qt backend prevents Python interpreter to run and process signals (i.e., to raise KeyboardInterrupt exception). To solve this one needs to somehow wake up the interpreter and make it close the plot window. We do this by usi... |
171,284 | from .. import backends
from .backend_qt import ( # noqa
SPECIAL_KEYS,
# Public API
cursord, _create_qApp, _BackendQT, TimerQT, MainWindow, FigureCanvasQT,
FigureManagerQT, ToolbarQt, NavigationToolbar2QT, SubplotToolQt,
SaveFigureQt, ConfigureSubplotsQt, RubberbandQt,
HelpQt, ToolCopyToClipboa... | null |
171,285 | from base64 import b64encode
import io
import json
import pathlib
import uuid
from ipykernel.comm import Comm
from IPython.display import display, Javascript, HTML
from matplotlib import is_interactive
from matplotlib._pylab_helpers import Gcf
from matplotlib.backend_bases import _Backend, CloseEvent, NavigationToolbar... | Return a string showing the figure and connection status for the backend. This is intended as a diagnostic tool, and not for general use. |
171,286 | from io import BytesIO
import functools
from fontTools import subset
import matplotlib as mpl
from .. import font_manager, ft2font
from .._afm import AFM
from ..backend_bases import RendererBase
class AFM:
def __init__(self, fh):
"""Parse the AFM file in file object *fh*."""
self._header = _parse_... | null |
171,287 | from contextlib import nullcontext
from math import radians, cos, sin
import threading
import numpy as np
import matplotlib as mpl
from matplotlib import _api, cbook
from matplotlib.backend_bases import (
_Backend, FigureCanvasBase, FigureManagerBase, RendererBase)
from matplotlib.font_manager import fontManager as... | null |
171,288 | import functools
import logging
import os
from pathlib import Path
import sys
import matplotlib as mpl
from matplotlib import _api, backend_tools, cbook
from matplotlib.backend_bases import (
ToolContainerBase, CloseEvent, KeyEvent, LocationEvent, MouseEvent,
ResizeEvent)
from gi.repository import Gio, GLib, GO... | null |
171,289 | import functools
import logging
import os
from pathlib import Path
import sys
import matplotlib as mpl
from matplotlib import _api, backend_tools, cbook
from matplotlib.backend_bases import (
ToolContainerBase, CloseEvent, KeyEvent, LocationEvent, MouseEvent,
ResizeEvent)
from gi.repository import Gio, GLib, GO... | null |
171,290 | import functools
import logging
import math
import pathlib
import sys
import weakref
import numpy as np
import PIL
import matplotlib as mpl
from matplotlib.backend_bases import (
_Backend, FigureCanvasBase, FigureManagerBase,
GraphicsContextBase, MouseButton, NavigationToolbar2, RendererBase,
TimerBase, Too... | Signal an error condition with a popup error dialog. |
171,291 | import functools
import logging
import math
import pathlib
import sys
import weakref
import numpy as np
import PIL
import matplotlib as mpl
from matplotlib.backend_bases import (
_Backend, FigureCanvasBase, FigureManagerBase,
GraphicsContextBase, MouseButton, NavigationToolbar2, RendererBase,
TimerBase, Too... | null |
171,292 | import functools
import logging
import math
import pathlib
import sys
import weakref
import numpy as np
import PIL
import matplotlib as mpl
from matplotlib.backend_bases import (
_Backend, FigureCanvasBase, FigureManagerBase,
GraphicsContextBase, MouseButton, NavigationToolbar2, RendererBase,
TimerBase, Too... | null |
171,293 | import codecs
from datetime import datetime
from enum import Enum
from functools import total_ordering
from io import BytesIO
import itertools
import logging
import math
import os
import string
import struct
import sys
import time
import types
import warnings
import zlib
import numpy as np
from PIL import Image
import ... | null |
171,294 | import codecs
from datetime import datetime
from enum import Enum
from functools import total_ordering
from io import BytesIO
import itertools
import logging
import math
import os
import string
import struct
import sys
import time
import types
import warnings
import zlib
import numpy as np
from PIL import Image
import ... | Create a PDF infoDict based on user-supplied metadata. A default ``Creator``, ``Producer``, and ``CreationDate`` are added, though the user metadata may override it. The date may be the current time, or a time set by the ``SOURCE_DATE_EPOCH`` environment variable. Metadata is verified to have the correct keys and their... |
171,295 | import codecs
from datetime import datetime
from enum import Enum
from functools import total_ordering
from io import BytesIO
import itertools
import logging
import math
import os
import string
import struct
import sys
import time
import types
import warnings
import zlib
import numpy as np
from PIL import Image
import ... | Create a link annotation object for embedding URLs. |
171,296 | import codecs
from datetime import datetime
from enum import Enum
from functools import total_ordering
from io import BytesIO
import itertools
import logging
import math
import os
import string
import struct
import sys
import time
import types
import warnings
import zlib
import numpy as np
from PIL import Image
import ... | Map Python objects to PDF syntax. |
171,297 | import codecs
from datetime import datetime
from enum import Enum
from functools import total_ordering
from io import BytesIO
import itertools
import logging
import math
import os
import string
import struct
import sys
import time
import types
import warnings
import zlib
import numpy as np
from PIL import Image
import ... | Returns True if the font is able to provide codepoint *glyph* in a PDF. For a Type 3 font, this method returns True only for single-byte characters. For Type 42 fonts this method return True if the character is from the Basic Multilingual Plane. |
171,298 | import codecs
from datetime import datetime
from enum import Enum
from functools import total_ordering
from io import BytesIO
import itertools
import logging
import math
import os
import string
import struct
import sys
import time
import types
import warnings
import zlib
import numpy as np
from PIL import Image
import ... | null |
171,299 | import codecs
import datetime
from enum import Enum
import functools
from io import StringIO
import itertools
import logging
import os
import pathlib
import re
import shutil
from tempfile import TemporaryDirectory
import time
import numpy as np
import matplotlib as mpl
from matplotlib import _api, cbook, _path, _text_h... | null |
171,300 | import codecs
import datetime
from enum import Enum
import functools
from io import StringIO
import itertools
import logging
import os
import pathlib
import re
import shutil
from tempfile import TemporaryDirectory
import time
import numpy as np
import matplotlib as mpl
from matplotlib import _api, cbook, _path, _text_h... | null |
171,301 | import codecs
import datetime
from enum import Enum
import functools
from io import StringIO
import itertools
import logging
import os
import pathlib
import re
import shutil
from tempfile import TemporaryDirectory
import time
import numpy as np
import matplotlib as mpl
from matplotlib import _api, cbook, _path, _text_h... | Quote dangerous characters of S for use in a PostScript string constant. |
171,302 | import codecs
import datetime
from enum import Enum
import functools
from io import StringIO
import itertools
import logging
import os
import pathlib
import re
import shutil
from tempfile import TemporaryDirectory
import time
import numpy as np
import matplotlib as mpl
from matplotlib import _api, cbook, _path, _text_h... | Move the contents of file at *src* to path-or-filelike *dst*. If *dst* is a path, the metadata of *src* are *not* copied. |
171,303 | import codecs
import datetime
from enum import Enum
import functools
from io import StringIO
import itertools
import logging
import os
import pathlib
import re
import shutil
from tempfile import TemporaryDirectory
import time
import numpy as np
import matplotlib as mpl
from matplotlib import _api, cbook, _path, _text_h... | Subset *chars* from the font at *font_path* into a Type 3 font. Parameters ---------- font_path : path-like Path to the font to be subsetted. chars : str The characters to include in the subsetted font. Returns ------- str The string representation of a Type 3 font, which can be included verbatim into a PostScript file... |
171,304 | import codecs
import datetime
from enum import Enum
import functools
from io import StringIO
import itertools
import logging
import os
import pathlib
import re
import shutil
from tempfile import TemporaryDirectory
import time
import numpy as np
import matplotlib as mpl
from matplotlib import _api, cbook, _path, _text_h... | Subset *chars* from the font at *font_path* into a Type 42 font at *fh*. Parameters ---------- font_path : path-like Path to the font to be subsetted. chars : str The characters to include in the subsetted font. fh : file-like Where to write the font. |
171,305 | import codecs
import datetime
from enum import Enum
import functools
from io import StringIO
import itertools
import logging
import os
import pathlib
import re
import shutil
from tempfile import TemporaryDirectory
import time
import numpy as np
import matplotlib as mpl
from matplotlib import _api, cbook, _path, _text_h... | Wrap `RendererPS` method *meth* to emit a PS comment with the method name, if the global flag `debugPS` is set. |
171,306 | import codecs
import datetime
from enum import Enum
import functools
from io import StringIO
import itertools
import logging
import os
import pathlib
import re
import shutil
from tempfile import TemporaryDirectory
import time
import numpy as np
import matplotlib as mpl
from matplotlib import _api, cbook, _path, _text_h... | null |
171,307 | import codecs
import datetime
from enum import Enum
import functools
from io import StringIO
import itertools
import logging
import os
import pathlib
import re
import shutil
from tempfile import TemporaryDirectory
import time
import numpy as np
import matplotlib as mpl
from matplotlib import _api, cbook, _path, _text_h... | null |
171,308 | import codecs
import datetime
from enum import Enum
import functools
from io import StringIO
import itertools
import logging
import os
import pathlib
import re
import shutil
from tempfile import TemporaryDirectory
import time
import numpy as np
import matplotlib as mpl
from matplotlib import _api, cbook, _path, _text_h... | Use ghostscript's pswrite or epswrite device to distill a file. This yields smaller files without illegal encapsulated postscript operators. The output is low-level, converting text to outlines. |
171,309 | import codecs
import datetime
from enum import Enum
import functools
from io import StringIO
import itertools
import logging
import os
import pathlib
import re
import shutil
from tempfile import TemporaryDirectory
import time
import numpy as np
import matplotlib as mpl
from matplotlib import _api, cbook, _path, _text_h... | Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file. This yields smaller files without illegal encapsulated postscript operators. This distiller is preferred, generating high-level postscript output that treats text as text. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.