code stringlengths 114 1.05M | path stringlengths 3 312 | quality_prob float64 0.5 0.99 | learning_prob float64 0.2 1 | filename stringlengths 3 168 | kind stringclasses 1
value |
|---|---|---|---|---|---|
import sage.combinat.root_system.weyl_characters
from sage.combinat.root_system.root_system import RootSystem
from sage.matrix.constructor import matrix
from sage.misc.flatten import flatten
from sage.structure.sage_object import SageObject
from sage.combinat.root_system.cartan_type import CartanType
from sage.modules... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/branching_rules.py | 0.884794 | 0.620995 | branching_rules.py | pypi |
from . import ambient_space
from sage.sets.family import Family
from sage.combinat.root_system.root_lattice_realizations import RootLatticeRealizations
class AmbientSpace(ambient_space.AmbientSpace):
"""
EXAMPLES::
sage: e = RootSystem(['G',2]).ambient_space(); e
Ambient space of the Root sy... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_G.py | 0.849285 | 0.614437 | type_G.py | pypi |
from .cartan_type import CartanType_standard_untwisted_affine
class CartanType(CartanType_standard_untwisted_affine):
def __init__(self, n):
"""
EXAMPLES::
sage: ct = CartanType(['B',4,1])
sage: ct
['B', 4, 1]
sage: ct._repr_(compact = True)
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_B_affine.py | 0.743261 | 0.456955 | type_B_affine.py | pypi |
from sage.combinat.root_system.weyl_group import WeylGroup
from sage.combinat.root_system.reflection_group_real import ReflectionGroup
from sage.combinat.root_system.cartan_type import CartanType
def CoxeterGroup(data, implementation="reflection", base_ring=None, index_set=None):
"""
Return an implementation... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/coxeter_group.py | 0.907507 | 0.554772 | coxeter_group.py | pypi |
from . import ambient_space
class AmbientSpace(ambient_space.AmbientSpace):
def dimension(self):
"""
EXAMPLES::
sage: e = RootSystem(['B',3]).ambient_space()
sage: e.dimension()
3
"""
return self.root_system.cartan_type().rank()
def root(se... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_B.py | 0.828696 | 0.550909 | type_B.py | pypi |
from . import ambient_space
class AmbientSpace(ambient_space.AmbientSpace):
def dimension(self):
"""
EXAMPLES::
sage: e = RootSystem(['D',3]).ambient_space()
sage: e.dimension()
3
"""
return self.root_system.cartan_type().rank()
def root(se... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_D.py | 0.747155 | 0.553324 | type_D.py | pypi |
from .cartan_type import CartanType_standard_finite, CartanType_simple
class CartanType(CartanType_standard_finite, CartanType_simple):
def __init__(self, n):
"""
EXAMPLES::
sage: ct = CartanType(['H',3])
sage: ct
['H', 3]
sage: ct._repr_(compact =... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_H.py | 0.883914 | 0.628977 | type_H.py | pypi |
from .cartan_type import CartanType_standard, CartanType_simple
from sage.rings.integer_ring import ZZ
class CartanType(CartanType_standard, CartanType_simple):
r"""
The Cartan type `A_{\infty}`.
We use ``NN`` and ``ZZ`` to explicitly differentiate between the
`A_{+\infty}` and `A_{\infty}` root syst... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_A_infinity.py | 0.905433 | 0.711384 | type_A_infinity.py | pypi |
from .cartan_type import CartanType_standard_untwisted_affine
class CartanType(CartanType_standard_untwisted_affine):
def __init__(self, n):
"""
EXAMPLES::
sage: ct = CartanType(['C',4,1])
sage: ct
['C', 4, 1]
sage: ct._repr_(compact = True)
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_C_affine.py | 0.759493 | 0.323013 | type_C_affine.py | pypi |
from sage.rings.integer_ring import ZZ
from sage.misc.cachefunc import cached_method
from . import ambient_space
from .cartan_type import SuperCartanType_standard
class AmbientSpace(ambient_space.AmbientSpace):
r"""
The ambient space for (super) type `A(m|n)`.
EXAMPLES::
sage: R = RootSystem(['... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_super_A.py | 0.877529 | 0.53443 | type_super_A.py | pypi |
from .cartan_type import CartanType_standard_untwisted_affine, CartanType_simply_laced
class CartanType(CartanType_standard_untwisted_affine, CartanType_simply_laced):
def __init__(self, n):
"""
EXAMPLES::
sage: ct = CartanType(['E',6,1])
sage: ct
['E', 6, 1]
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_E_affine.py | 0.759671 | 0.434881 | type_E_affine.py | pypi |
from sage.misc.cachefunc import cached_method, cached_in_parent_method
from sage.rings.integer_ring import ZZ
from sage.combinat.free_module import CombinatorialFreeModule
from .root_lattice_realizations import RootLatticeRealizations
import functools
class RootSpace(CombinatorialFreeModule):
r"""
The root sp... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/root_space.py | 0.891955 | 0.537709 | root_space.py | pypi |
from .cartan_type import CartanType_standard_untwisted_affine
class CartanType(CartanType_standard_untwisted_affine):
def __init__(self):
"""
EXAMPLES::
sage: ct = CartanType(['F',4,1])
sage: ct
['F', 4, 1]
sage: ct._repr_(compact = True)
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_F_affine.py | 0.814201 | 0.420064 | type_F_affine.py | pypi |
from sage.misc.cachefunc import cached_method
from sage.combinat.free_module import CombinatorialFreeModule
from .weight_lattice_realizations import WeightLatticeRealizations
class AmbientSpace(CombinatorialFreeModule):
r"""
Ambient space for affine types.
This is constructed from the data in the corres... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_affine.py | 0.929672 | 0.745653 | type_affine.py | pypi |
from .cartan_type import CartanType_standard_untwisted_affine, CartanType_simply_laced
class CartanType(CartanType_standard_untwisted_affine, CartanType_simply_laced):
def __init__(self, n):
"""
EXAMPLES::
sage: ct = CartanType(['D',4,1])
sage: ct
['D', 4, 1]
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_D_affine.py | 0.808257 | 0.496887 | type_D_affine.py | pypi |
from .cartan_type import CartanType_standard_affine
from sage.rings.integer_ring import ZZ
class CartanType(CartanType_standard_affine):
def __init__(self, n):
"""
EXAMPLES::
sage: ct = CartanType(['BC',4,2])
sage: ct
['BC', 4, 2]
sage: ct._repr_(c... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_BC_affine.py | 0.796015 | 0.440529 | type_BC_affine.py | pypi |
from .cartan_type import CartanType_standard_untwisted_affine
class CartanType(CartanType_standard_untwisted_affine):
def __init__(self):
"""
EXAMPLES::
sage: ct = CartanType(['G',2,1])
sage: ct
['G', 2, 1]
sage: ct._repr_(compact = True)
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_G_affine.py | 0.777469 | 0.441071 | type_G_affine.py | pypi |
from .cartan_type import CartanType_standard_untwisted_affine, CartanType_simply_laced
class CartanType(CartanType_standard_untwisted_affine):
def __init__(self, n):
"""
EXAMPLES::
sage: ct = CartanType(['A',4,1])
sage: ct
['A', 4, 1]
sage: ct._rep... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_A_affine.py | 0.782995 | 0.522689 | type_A_affine.py | pypi |
from sage.misc.cachefunc import cached_method
from sage.combinat.root_system.cartan_type import CartanType_abstract, CartanType_simple, CartanType_finite, CartanType_simply_laced, CartanType_crystallographic
from sage.matrix.constructor import block_diagonal_matrix
from sage.sets.family import Family
from . import amb... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_reducible.py | 0.903526 | 0.507873 | type_reducible.py | pypi |
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.category_object import CategoryObject
from sage.categories.modules import Modules
from sage.rings.integer_ring import ZZ
from sage.misc.cachefunc import cached_method
from sage.matrix.constructor import Matrix
from sage.sets.recur... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/integrable_representations.py | 0.762954 | 0.676039 | integrable_representations.py | pypi |
from . import ambient_space
class AmbientSpace(ambient_space.AmbientSpace):
"""
EXAMPLES::
sage: e = RootSystem(['C',2]).ambient_space(); e
Ambient space of the Root system of type ['C', 2]
One cannot construct the ambient lattice because the fundamental
coweights have rational coef... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/root_system/type_C.py | 0.852045 | 0.584894 | type_C.py | pypi |
from sage.combinat.posets.posets import Poset, FinitePoset
from sage.misc.lazy_attribute import lazy_attribute
from .linear_extensions import LinearExtensionsOfMobile
class MobilePoset(FinitePoset):
r"""
A mobile poset.
Mobile posets are an extension of d-complete posets which permit a determinant
f... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/posets/mobile.py | 0.847463 | 0.705164 | mobile.py | pypi |
from sage.sets.cartesian_product import CartesianProduct
class CartesianProductPoset(CartesianProduct):
r"""
A class implementing Cartesian products of posets (and elements
thereof). Compared to :class:`CartesianProduct` you are able to
specify an order for comparison of the elements.
INPUT:
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/posets/cartesian_product.py | 0.934406 | 0.830319 | cartesian_product.py | pypi |
r"""
Mutually Orthogonal Latin Squares (MOLS)
The main function of this module is :func:`mutually_orthogonal_latin_squares`
and can be can be used to generate MOLS (or check that they exist)::
sage: MOLS = designs.mutually_orthogonal_latin_squares(4,8)
For more information on MOLS, see the :wikipedia:`Wikipedia ... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/designs/latin_squares.py | 0.80038 | 0.362179 | latin_squares.py | pypi |
r"""
Catalog of designs
This module gathers all designs that can be reached through
``designs.<tab>``. Example with the Witt design on 24 points::
sage: designs.WittDesign(24) # optional - gap_packages
Incidence structure with 24 points and 759 blocks
Or a Steiner Triple System on 19 points::
sage: desi... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/designs/design_catalog.py | 0.863132 | 0.612802 | design_catalog.py | pypi |
r"""
Two-graphs
A two-graph on `n` points is a family `T \subset \binom {[n]}{3}`
of `3`-sets, such that any `4`-set `S\subset [n]` of size four
contains an even number of elements of `T`. Any graph `([n],E)`
gives rise to a two-graph
`T(E)=\{t \in \binom {[n]}{3} : \left| \binom {t}{2} \cap E \right|\ odd \}`,
and an... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/designs/twographs.py | 0.92944 | 0.951074 | twographs.py | pypi |
r"""
Steiner Quadruple Systems
A Steiner Quadruple System on `n` points is a family `SQS_n \subset \binom {[n]}
4` of `4`-sets, such that any set `S\subset [n]` of size three is a subset of
exactly one member of `SQS_n`.
This module implements Haim Hanani's constructive proof that a Steiner Quadruple
System exists if... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/designs/steiner_quadruple_systems.py | 0.86891 | 0.863334 | steiner_quadruple_systems.py | pypi |
import ipywidgets as widgets
from sage.misc.latex import latex
from sage.repl.rich_output.pretty_print import pretty_print
from IPython.display import clear_output
def cluster_interact(self, fig_size=1, circular=True, kind='seed'):
r"""
Start an interactive window for cluster seed mutations.
Only in *Jup... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/combinat/cluster_algebra_quiver/interact.py | 0.617974 | 0.542015 | interact.py | pypi |
r"""
Functions for reading/building graphs/digraphs
This module gathers functions needed to build a graph from any other data.
.. NOTE::
This is an **internal** module of Sage. All features implemented here are
made available to end-users through the constructors of :class:`Graph` and
:class:`DiGraph`.
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/graphs/graph_input.py | 0.695545 | 0.702352 | graph_input.py | pypi |
r"""
Lovász theta-function of graphs
AUTHORS:
- Dima Pasechnik (2015-06-30): Initial version
REFERENCE:
[Lov1979]_
Functions
---------
"""
def lovasz_theta(graph):
r"""
Return the value of Lovász theta-function of graph.
For a graph `G` this function is denoted by `\theta(G)`, and it can be
comp... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/graphs/lovasz_theta.py | 0.911515 | 0.8415 | lovasz_theta.py | pypi |
r"""
Hypergraph generators
This module implements generators of hypergraphs. All hypergraphs can be built
through the ``hypergraphs`` object. For instance, to build a complete 3-uniform
hypergraph on 5 points, one can do::
sage: H = hypergraphs.CompleteUniform(5, 3)
To enumerate hypergraphs with certain properti... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/graphs/hypergraph_generators.py | 0.904326 | 0.776029 | hypergraph_generators.py | pypi |
r"""
Overview of (di)graph data structures
This module contains no code, and describes Sage's data structures for graphs
and digraphs. They can be used directly at Cython/C level, or through the
:class:`Graph` and :class:`DiGraph` classes (except one)
Data structures
---------------
Four data structures are natively... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/graphs/base/overview.py | 0.933325 | 0.81409 | overview.py | pypi |
from sage.rings.integer_ring import ZZ
from sage.symbolic.constants import NaN
from sage.misc.functional import sqrt
from sage.misc.superseded import deprecation
def mean(v):
"""
Return the mean of the elements of `v`.
We define the mean of the empty list to be the (symbolic) NaN,
following the conv... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/stats/basic_stats.py | 0.897367 | 0.709651 | basic_stats.py | pypi |
from sage.sandpiles.sandpile import Sandpile
from sage.graphs.graph_generators import graphs
class SandpileExamples():
"""
Some examples of sandpiles.
Here are the available examples; you can also type
``sandpiles.`` and hit tab to get a list:
- :meth:`Complete`
- :meth:`Cycle`
- :meth:`... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/sandpiles/examples.py | 0.786254 | 0.744865 | examples.py | pypi |
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
EASTER_JULIAN = 1
EASTER_ORTHODOX = 2
EASTER_WESTERN = 3
def easter(year, algorithm=EASTER_WESTERN):
"""
This function was ported ... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/finance/easter.py | 0.560854 | 0.39528 | easter.py | pypi |
r"""
Stock Market Price Series
This module's main class is :class:`Stock`. It defines the following methods:
.. csv-table::
:class: contentstable
:widths: 20,80
:delim: |
:meth:`~sage.finance.stock.Stock.market_value` | Return the current market value of this stock.
:meth:`~sage.finance.stock.Sto... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/finance/stock.py | 0.894306 | 0.561515 | stock.py | pypi |
from sage.monoids.string_monoid import BinaryStrings
from sage.arith.all import is_prime, lcm, primes, random_prime
from sage.rings.integer import Integer
from sage.rings.finite_rings.integer_mod import Mod as mod
from sage.misc.lazy_import import lazy_import
lazy_import('sage.arith.misc', ('carmichael_lambda'), depr... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/crypto/util.py | 0.910361 | 0.498413 | util.py | pypi |
from sage.rings.polynomial.polynomial_ring import is_PolynomialRing
def gen_lattice(type='modular', n=4, m=8, q=11, seed=None,
quotient=None, dual=False, ntl=False, lattice=False):
r"""
This function generates different types of integral lattice bases
of row vectors relevant in cryptograph... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/crypto/lattice.py | 0.917718 | 0.582164 | lattice.py | pypi |
from sage.functions.log import log
from sage.functions.other import floor, ceil
from sage.misc.functional import sqrt
from sage.misc.functional import cyclotomic_polynomial, round
from sage.misc.randstate import set_random_seed
from sage.misc.prandom import randint
from sage.modules.free_module import FreeModule
from s... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/crypto/lwe.py | 0.929688 | 0.445349 | lwe.py | pypi |
r"""
S-Boxes used in cryptographic schemes
This module provides the following SBoxes:
constructions
- BrackenLeander ([BraLea2008]_)
- CarletTangTangLiao ([CTTL2014]_)
- Gold ([Gol1968]_)
- Kasami ([Kas1971]_)
- Niho ([Dob1999a]_)
- Welch ([Dob1999b]_)
9 bit to 9 bit
- DryGASCON256 ([Rio2... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/crypto/sboxes.py | 0.608129 | 0.4081 | sboxes.py | pypi |
from .lfsr import lfsr_sequence
from .cipher import SymmetricKeyCipher
from sage.monoids.string_monoid_element import StringMonoidElement
class LFSRCipher(SymmetricKeyCipher):
def __init__(self, parent, poly, IS):
"""
Create a linear feedback shift register (LFSR) cipher.
INPUT:
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/crypto/stream_cipher.py | 0.698329 | 0.378775 | stream_cipher.py | pypi |
from sage.structure.sage_object import SageObject
class MPolynomialSystemGenerator(SageObject):
"""
Abstract base class for generators of polynomial systems.
"""
def __getattr__(self, attr):
"""
EXAMPLES::
sage: from sage.crypto.mq.mpolynomialsystemgenerator import MPolyn... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/crypto/mq/mpolynomialsystemgenerator.py | 0.907732 | 0.437403 | mpolynomialsystemgenerator.py | pypi |
from sage.rings.integer_ring import ZZ
from sage.matrix.constructor import column_matrix, matrix
from sage.geometry.cone import Cone
class FanNotIsomorphicError(Exception):
"""
Exception to return if there is no fan isomorphism
"""
pass
def fan_isomorphic_necessary_conditions(fan1, fan2):
"""
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/geometry/fan_isomorphism.py | 0.70912 | 0.621254 | fan_isomorphism.py | pypi |
from sage.graphs.digraph import DiGraph
from sage.combinat.posets.lattices import FiniteLatticePoset
def lattice_from_incidences(atom_to_coatoms, coatom_to_atoms,
face_constructor=None,
required_atoms=None,
key=None,
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/geometry/hasse_diagram.py | 0.902524 | 0.766687 | hasse_diagram.py | pypi |
from sage.structure.parent import Parent
from sage.structure.richcmp import richcmp
from sage.structure.element import ModuleElement
from sage.structure.unique_representation import UniqueRepresentation
from sage.misc.cachefunc import cached_method
class LinearExpression(ModuleElement):
"""
A linear expressio... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/geometry/linear_expression.py | 0.921247 | 0.703091 | linear_expression.py | pypi |
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
from sage.structure.element import Element
from sage.structure.richcmp import op_EQ, op_NE, op_LE, op_GE, op_LT
from sage.misc.cachefunc import cached_method
from sage.rings.infinity import Infinity
from sag... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/geometry/newton_polygon.py | 0.944836 | 0.541227 | newton_polygon.py | pypi |
from sage.structure.sage_object import SageObject
from sage.matrix.constructor import vector
class AffineSubspace(SageObject):
"""
An affine subspace.
INPUT:
- ``p`` -- list/tuple/iterable representing a point on the
affine space
- ``V`` -- vector subspace
OUTPUT:
Affine subspa... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/geometry/hyperplane_arrangement/affine_subspace.py | 0.943426 | 0.696313 | affine_subspace.py | pypi |
from copy import copy
from colorsys import hsv_to_rgb
from sage.misc.lazy_import import lazy_import
lazy_import("sage.plot.plot3d.parametric_plot3d", "parametric_plot3d")
lazy_import("sage.plot.plot3d.shapes2", "text3d")
lazy_import("sage.plot.graphics", "Graphics")
lazy_import("sage.plot.line", "line")
lazy_import("s... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/geometry/hyperplane_arrangement/plot.py | 0.680772 | 0.397763 | plot.py | pypi |
from itertools import product
from sage.structure.sage_object import SageObject
from sage.modules.free_module_element import vector
from sage.matrix.constructor import matrix
from sage.calculus.functional import diff
from sage.misc.functional import sqrt
from sage.misc.cachefunc import cached_method
from sage.symboli... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/geometry/riemannian_manifolds/parametrized_surface3d.py | 0.917284 | 0.657982 | parametrized_surface3d.py | pypi |
r"""
Base class for mutable polyhedra.
Just like vectors and matrices they can be set immutable.
The constructor does this by default.
"""
from sage.misc.abstract_method import abstract_method
from .base import Polyhedron_base
class Polyhedron_mutable(Polyhedron_base):
"""
Base class for polyhedra that all... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/geometry/polyhedron/base_mutable.py | 0.889283 | 0.547404 | base_mutable.py | pypi |
from .base import Polyhedron_base
class Polyhedron_field(Polyhedron_base):
"""
Polyhedra over all fields supported by Sage
INPUT:
- ``Vrep`` -- a list ``[vertices, rays, lines]`` or ``None``.
- ``Hrep`` -- a list ``[ieqs, eqns]`` or ``None``.
EXAMPLES::
sage: p = Polyhedron(vert... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/geometry/polyhedron/backend_field.py | 0.948058 | 0.537223 | backend_field.py | pypi |
class LibSingularGBDefaultContext:
def __init__(self):
"""
EXAMPLES::
sage: from sage.libs.singular.standard_options import LibSingularGBDefaultContext
sage: from sage.libs.singular.option import opt
sage: P.<a,b,c> = PolynomialRing(QQ, 3, order='lex')
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/libs/singular/standard_options.py | 0.636805 | 0.483831 | standard_options.py | pypi |
"Cremona modular symbols"
def CremonaModularSymbols(level, sign=0, cuspidal=False, verbose=0):
"""
Return the space of Cremona modular symbols with given level, sign, etc.
INPUT:
- ``level`` -- an integer >= 2 (at least 2, not just positive!)
- ``sign`` -- an integer either 0 (the default) or 1 ... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/libs/eclib/constructor.py | 0.853547 | 0.410579 | constructor.py | pypi |
import re
import string
from sage.structure.sage_object import SageObject
from sage.libs.gap.libgap import libgap
Length = libgap.function_factory('Length')
FlagsType = libgap.function_factory('FlagsType')
TypeObj = libgap.function_factory('TypeObj')
IS_SUBSET_FLAGS = libgap.function_factory('IS_SUBSET_FLAGS')
GET_OP... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/libs/gap/operations.py | 0.70416 | 0.179999 | operations.py | pypi |
from sage.misc.misc import walltime, cputime
def count_noun(number, noun, plural=None, pad_number=False, pad_noun=False):
"""
EXAMPLES::
sage: from sage.doctest.util import count_noun
sage: count_noun(1, "apple")
'1 apple'
sage: count_noun(1, "apple", pad_noun=True)
'... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/doctest/util.py | 0.816809 | 0.296833 | util.py | pypi |
import os
import sys
import re
import random
import doctest
from sage.cpython.string import bytes_to_str
from sage.repl.load import load
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.package_dir import is_package_or_sage_namespace_package_dir
from .parsing import SageDocTestParser
from .util impor... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/doctest/sources.py | 0.438785 | 0.192027 | sources.py | pypi |
import io
import os
import zipfile
from sage.cpython.string import bytes_to_str
from sage.structure.sage_object import SageObject
from sage.misc.cachefunc import cached_method
INNER_HTML_TEMPLATE = """
<html>
<head>
<style>
* {{
margin: 0;
padding: 0;
overflow: hidden;
}}
body, html {... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/repl/display/jsmol_iframe.py | 0.664867 | 0.198219 | jsmol_iframe.py | pypi |
import os
import errno
import warnings
from sage.env import (
SAGE_DOC, SAGE_VENV, SAGE_EXTCODE,
SAGE_VERSION,
THREEJS_DIR,
)
class SageKernelSpec():
def __init__(self, prefix=None):
"""
Utility to manage SageMath kernels and extensions
INPUT:
- ``prefix`` -- (optio... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/repl/ipython_kernel/install.py | 0.451327 | 0.153835 | install.py | pypi |
import os
from xml.dom.minidom import parse
from sage.rings.rational_field import QQ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
class SymbolicData:
"""
Database of ideals as distributed by The SymbolicData Project
(http://symbolicdata.org).
This class needs the optio... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/databases/symbolic_data.py | 0.742982 | 0.421373 | symbolic_data.py | pypi |
import bz2
import os
from sage.cpython.string import bytes_to_str
def _dbz_to_string(name):
r"""
TESTS::
sage: from sage.databases.db_modular_polynomials import _dbz_to_string
sage: _dbz_to_string('PolMod/Atk/pol.002.dbz') # optional - database_kohel
'3 0 1 \n2 1 ... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/databases/db_modular_polynomials.py | 0.644001 | 0.254845 | db_modular_polynomials.py | pypi |
import bz2
import os
import re
from urllib.request import urlretrieve
import ssl
from sage.misc.verbose import verbose
from sage.env import SAGE_SHARE
from sage.rings.integer_ring import ZZ
class SloaneEncyclopediaClass:
"""
A local copy of the Sloane Online Encyclopedia of Integer Sequences
that conta... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/databases/sloane.py | 0.565059 | 0.190837 | sloane.py | pypi |
"Operators"
import operator
from sage.symbolic.ring import is_SymbolicVariable, SR
def add_vararg(first, *rest):
r"""
Return the sum of all the arguments.
INPUT:
- ``first``, ``*rest`` -- arguments to add
OUTPUT: sum of the arguments
EXAMPLES::
sage: from sage.symbolic.operators ... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/symbolic/operators.py | 0.814385 | 0.653846 | operators.py | pypi |
r"""
Benchmarks
Tests that will take a long time if something is wrong, but be very
quick otherwise. See https://wiki.sagemath.org/symbench. The
parameters chosen below are such that with pynac most of these take
well less than a second, but would not even be feasible using Sage's
Maxima-based symbolics.
Problem R1... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/symbolic/benchmark.py | 0.517571 | 0.484868 | benchmark.py | pypi |
from sage.symbolic.expression import Expression
from sage.symbolic.ring import SR
def maxima_integrator(expression, v, a=None, b=None):
"""
Integration using Maxima
EXAMPLES::
sage: from sage.symbolic.integration.external import maxima_integrator
sage: maxima_integrator(sin(x), x)
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/symbolic/integration/external.py | 0.814533 | 0.792544 | external.py | pypi |
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.richcmp import richcmp_method, rich_to_bool
class UnknownError(TypeError):
"""
Raised whenever :class:`Unknown` is used in a boolean operation.
EXAMPLES::
sage: not Unknown
Traceback (most recent c... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/unknown.py | 0.890847 | 0.523177 | unknown.py | pypi |
from functools import (partial, update_wrapper, WRAPPER_ASSIGNMENTS,
WRAPPER_UPDATES)
from copy import copy
from sage.misc.sageinspect import (sage_getsource, sage_getsourcelines,
sage_getargspec)
from inspect import FullArgSpec
def sage_wraps(wrapped, assi... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/decorators.py | 0.773473 | 0.348617 | decorators.py | pypi |
# default variable name
var_name = 'x'
def variable_names(n, name=None):
r"""
Convert a root string into a tuple of variable names by adding
numbers in sequence.
INPUT:
- ``n`` a non-negative Integer; the number of variable names to
output
- ``names`` a string (default: ``None``); th... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/defaults.py | 0.785144 | 0.513425 | defaults.py | pypi |
from sage.structure.sage_object import SageObject
class MethodDecorator(SageObject):
def __init__(self, f):
"""
EXAMPLES::
sage: from sage.misc.method_decorator import MethodDecorator
sage: class Foo:
....: @MethodDecorator
....: def bar(sel... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/method_decorator.py | 0.86267 | 0.332879 | method_decorator.py | pypi |
"Benchmarks"
from .misc import cputime
from sage.all import *
def benchmark(n=-1):
"""
Run a well-chosen range of Sage commands and record the time it
takes for each to run.
INPUT:
n -- int (default: -1) the benchmark number; the default
of -1 runs all the benchmarks.
OUTP... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/benchmark.py | 0.790369 | 0.645874 | benchmark.py | pypi |
import os
from sage.misc.superseded import deprecation
def install_scripts(directory=None, ignore_existing=False):
r"""
This function has been deprecated.
Running ``install_scripts(directory)`` creates scripts in the
given directory that run various software components included with
Sage. Each o... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/dist.py | 0.533884 | 0.199444 | dist.py | pypi |
r"""
ReST index of functions
This module contains a function that generates a ReST index table of functions
for use in doc-strings.
{INDEX_OF_FUNCTIONS}
"""
import inspect
from sage.misc.sageinspect import _extract_embedded_position
from sage.misc.sageinspect import is_function_or_cython_function as _isfunction
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/rest_index_of_methods.py | 0.872605 | 0.76947 | rest_index_of_methods.py | pypi |
r"""
Elements with labels.
This module implements a simple wrapper class for pairs consisting of
an "element" and a "label".
For representation purposes (``repr``, ``str``, ``latex``), this pair
behaves like its label, while the element is "silent".
However, these pairs compare like usual pairs (i.e., both element and... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/element_with_label.py | 0.929208 | 0.792865 | element_with_label.py | pypi |
class SageTimeitResult():
r"""
Represent the statistics of a timeit() command.
Prints as a string so that it can be easily returned to a user.
INPUT:
- ``stats`` -- tuple of length 5 containing the following information:
- integer, number of loops
- integer, repeat number
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/sage_timeit.py | 0.857991 | 0.581481 | sage_timeit.py | pypi |
import types
def abstract_method(f=None, optional=False):
r"""
Abstract methods
INPUT:
- ``f`` -- a function
- ``optional`` -- a boolean; defaults to ``False``
The decorator :obj:`abstract_method` can be used to declare
methods that should be implemented by all concrete derived
c... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/abstract_method.py | 0.715424 | 0.492798 | abstract_method.py | pypi |
class LazyFormat(str):
"""
Lazy format strings
.. NOTE::
We recommend to use :func:`sage.misc.lazy_string.lazy_string` instead,
which is both faster and more flexible.
An instance of :class:`LazyFormat` behaves like a usual format
string, except that the evaluation of the ``__repr... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/lazy_format.py | 0.745491 | 0.682243 | lazy_format.py | pypi |
r"""
Tables
Display a rectangular array as a table, either in plain text, LaTeX,
or html. See the documentation for :class:`table` for details and
examples.
AUTHORS:
- John H. Palmieri (2012-11)
"""
from io import StringIO
from sage.structure.sage_object import SageObject
from sage.misc.cachefunc import cached_me... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/table.py | 0.920767 | 0.877004 | table.py | pypi |
class MultiplexFunction():
"""
A simple wrapper object for functions that are called on a list of
objects.
"""
def __init__(self, multiplexer, name):
"""
EXAMPLES::
sage: from sage.misc.object_multiplexer import Multiplex, MultiplexFunction
sage: m = Multip... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/object_multiplexer.py | 0.738009 | 0.299675 | object_multiplexer.py | pypi |
r"""
Random Numbers with Python API
AUTHORS:
-- Carl Witty (2008-03): new file
This module has the same functions as the Python standard module
\module{random}, but uses the current \sage random number state from
\module{sage.misc.randstate} (so that it can be controlled by the same
global random number seeds).
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/prandom.py | 0.812198 | 0.794982 | prandom.py | pypi |
"Flatten nested lists"
import sys
def flatten(in_list, ltypes=(list, tuple), max_level=sys.maxsize):
"""
Flatten a nested list.
INPUT:
- ``in_list`` -- a list or tuple
- ``ltypes`` -- optional list of particular types to flatten
- ``max_level`` -- the maximum level to flatten
OUTPUT:
... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/misc/flatten.py | 0.563138 | 0.576959 | flatten.py | pypi |
from sage.misc.cachefunc import cached_method
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
from sage.structure.element import ModuleElement, parent
from sage.structure.richcmp import richcmp
from sage.categories.chain_complexes import ChainComplexes
fro... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/homology/hochschild_complex.py | 0.925129 | 0.685035 | hochschild_complex.py | pypi |
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
from sage.combinat.combination import rank
from sage.arith.all import binomial
from sage.rings.integer_ring import ZZ
from sage.matrix.constructor import matrix
from sage.homology.chain_complex import ChainCo... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/homology/koszul_complex.py | 0.914811 | 0.739211 | koszul_complex.py | pypi |
from sage.modules.free_module import VectorSpace
from sage.groups.additive_abelian.additive_abelian_group import AdditiveAbelianGroup_fixed_gens
from sage.rings.integer_ring import ZZ
class HomologyGroup_class(AdditiveAbelianGroup_fixed_gens):
"""
Discrete Abelian group on `n` generators. This class inherits... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/homology/homology_group.py | 0.873417 | 0.455441 | homology_group.py | pypi |
from .calculus import SR
from sage.symbolic.expression import Expression
def simplify(f):
r"""
Simplify the expression `f`.
EXAMPLES: We simplify the expression `i + x - x`.
::
sage: f = I + x - x; simplify(f)
I
In fact, printing `f` yields the same thing - i.e., the
simplif... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/calculus/functional.py | 0.924688 | 0.818338 | functional.py | pypi |
from .calculus import maxima as maxima_calculus
from .calculus import (laplace, inverse_laplace,
limit, lim)
from .integration import numerical_integral, monte_carlo_integral
integral_numerical = numerical_integral
from .interpolation import spline, Spline
from .functional import (diff, derivat... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/calculus/all.py | 0.864697 | 0.683578 | all.py | pypi |
r"""
Further examples from Wester's paper
These are all the problems at
http://yacas.sourceforge.net/essaysmanual.html
They come from the 1994 paper "Review of CAS mathematical
capabilities", by Michael Wester, who put forward 123 problems that
a reasonable computer algebra system should be able to solve and
tested t... | /sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/calculus/wester.py | 0.765637 | 0.656562 | wester.py | pypi |
import dataclasses
from dataclasses import dataclass
from typing import Any, List, Optional
@dataclass
class Device:
"""Device connected to a router."""
uid: Optional[int] = None
alias: Optional[str] = None
phys_address: Optional[str] = None
ip_address: Optional[str] = None
address_source: O... | /sagemcom_api-1.0.8-py3-none-any.whl/sagemcom_api/models.py | 0.851027 | 0.275842 | models.py | pypi |
import json
import boto3
import jmespath
from pymongo import MongoClient
from pymysql.connections import Connection
class Environment():
def __init__(self, stack, region='us-west-2'):
self.stack = stack
self.session = boto3.session.Session(region_name=region)
def notebooks_running(self... | /sagesaver_tools-0.1.2-py3-none-any.whl/sstools/environment.py | 0.596433 | 0.215454 | environment.py | pypi |
import sys
import os
import textwrap
from pyparsing import *
def skipToMatching(opener, closer):
nest = nestedExpr(opener, closer)
return originalTextFor(nest)
curlybrackets = skipToMatching('{', '}')
squarebrackets = skipToMatching('[', ']')
sagemacroparser = r'\sage' + curlybrackets('code')
sagestrmacroparser = ... | /sagetex-3.6.1.tar.gz/sagetex-3.6.1/sagetexparse.py | 0.402862 | 0.186262 | sagetexparse.py | pypi |
<img align="left" src="docs/images/scp.png" width="180">
# SageWorks<sup><i>TM</i></sup>
<p align="center">
<img height="360" align="left" src="https://user-images.githubusercontent.com/4806709/236641571-fc38899a-8b92-4b7c-80a0-cc9d39b92e4a.png">
<img height="360" aligh="right" src="https://user-images.githubusercont... | /sageworks-0.1.5.3.tar.gz/sageworks-0.1.5.3/Readme.md | 0.843638 | 0.848847 | Readme.md | pypi |
from dash import Dash
import dash_bootstrap_components as dbc
# SageWorks Imports
from sageworks.views.artifacts_web_view import ArtifactsWebView
from sageworks.web_components import table
# Local Imports
import layout
# Note: The 'app' and 'server' objects need to be at the top level since NGINX/uWSGI needs to
#... | /sageworks-0.1.5.3.tar.gz/sageworks-0.1.5.3/applications/hello_world/hello_world.py | 0.632389 | 0.168549 | hello_world.py | pypi |
import dash
from dash import Dash
from dash.dependencies import Input, Output
# SageWorks Imports
from sageworks.web_components.mock_model_data import ModelData
from sageworks.web_components import (
feature_importance,
confusion_matrix,
model_details,
feature_details,
)
# Highlights the selected row... | /sageworks-0.1.5.3.tar.gz/sageworks-0.1.5.3/applications/hello_world/callbacks.py | 0.649467 | 0.391929 | callbacks.py | pypi |
from dash import Dash
from dash_bootstrap_templates import load_figure_template
import dash_bootstrap_components as dbc
# SageWorks Imports
from sageworks.web_components import (
table,
data_and_feature_details,
distribution_plots,
scatter_plot,
)
from sageworks.views.data_source_web_view import DataSo... | /sageworks-0.1.5.3.tar.gz/sageworks-0.1.5.3/applications/outlier_inspector/app.py | 0.5794 | 0.337313 | app.py | pypi |
from datetime import datetime
import dash
from dash import Dash
from dash.dependencies import Input, Output
# SageWorks Imports
from sageworks.views.data_source_web_view import DataSourceWebView
from sageworks.web_components import (
table,
data_and_feature_details,
distribution_plots,
scatter_plot,
)
... | /sageworks-0.1.5.3.tar.gz/sageworks-0.1.5.3/applications/outlier_inspector/callbacks.py | 0.768299 | 0.284828 | callbacks.py | pypi |
from pathlib import Path
from dash import Dash
import dash_bootstrap_components as dbc
# SageWorks Imports
from sageworks.web_components import confusion_matrix, table, scatter_plot
from sageworks.web_components import (
feature_importance,
model_data,
model_details,
feature_details,
)
# Local Import... | /sageworks-0.1.5.3.tar.gz/sageworks-0.1.5.3/applications/model_viewer/model_viewer.py | 0.637482 | 0.177169 | model_viewer.py | pypi |
import dash
from dash import Dash
from dash.dependencies import Input, Output
# SageWorks Imports
from sageworks.web_components.mock_model_data import ModelData
from sageworks.web_components import (
feature_importance,
confusion_matrix,
model_details,
feature_details,
)
# Highlights the selected row... | /sageworks-0.1.5.3.tar.gz/sageworks-0.1.5.3/applications/model_viewer/callbacks.py | 0.649467 | 0.391929 | callbacks.py | pypi |
from dash import Dash
from dash_bootstrap_templates import load_figure_template
import dash_bootstrap_components as dbc
# SageWorks Imports
from sageworks.web_components import (
table,
data_and_feature_details,
distribution_plots,
scatter_plot,
)
from sageworks.views.feature_set_web_view import Featur... | /sageworks-0.1.5.3.tar.gz/sageworks-0.1.5.3/applications/anomaly_inspector/app.py | 0.581184 | 0.311139 | app.py | pypi |
from datetime import datetime
import dash
from dash import Dash
from dash.dependencies import Input, Output
# SageWorks Imports
from sageworks.views.feature_set_web_view import FeatureSetWebView
from sageworks.web_components import (
data_and_feature_details,
distribution_plots,
scatter_plot,
)
def refre... | /sageworks-0.1.5.3.tar.gz/sageworks-0.1.5.3/applications/anomaly_inspector/callbacks.py | 0.773302 | 0.268252 | callbacks.py | pypi |
from dash import register_page
import dash
from dash_bootstrap_templates import load_figure_template
# SageWorks Imports
from sageworks.web_components import table, data_and_feature_details, distribution_plots
from sageworks.views.data_source_web_view import DataSourceWebView
# Local Imports
from .layout import data_... | /sageworks-0.1.5.3.tar.gz/sageworks-0.1.5.3/applications/aws_dashboard/pages/data_sources/page.py | 0.525125 | 0.27163 | page.py | pypi |
from datetime import datetime
import dash
from dash import Dash
from dash.dependencies import Input, Output
# SageWorks Imports
from sageworks.views.data_source_web_view import DataSourceWebView
from sageworks.web_components import data_and_feature_details, distribution_plots
def refresh_data_timer(app: Dash):
@... | /sageworks-0.1.5.3.tar.gz/sageworks-0.1.5.3/applications/aws_dashboard/pages/data_sources/callbacks.py | 0.753013 | 0.28123 | callbacks.py | pypi |
from dash import html, dcc, dash_table
import dash_bootstrap_components as dbc
def main_layout(
incoming_data: dash_table.DataTable,
glue_jobs: dash_table.DataTable,
data_sources: dash_table.DataTable,
feature_sets: dash_table.DataTable,
models: dash_table.DataTable,
endpoints: dash_table.Data... | /sageworks-0.1.5.3.tar.gz/sageworks-0.1.5.3/applications/aws_dashboard/pages/main/layout.py | 0.457137 | 0.211295 | layout.py | pypi |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.