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 |
|---|---|---|---|---|---|
from __future__ import absolute_import
import inspect
import sys
import six
from sagemaker_training import mapping
def matching_args(fn, dictionary):
"""Given a function fn and a dict dictionary, returns the function
arguments that match the dict keys.
Example:
def train(channel_dirs, model_d... | /sagemaker_training-4.7.0.tar.gz/sagemaker_training-4.7.0/src/sagemaker_training/functions.py | 0.674694 | 0.373304 | functions.py | pypi |
from sage.misc.cachefunc import cached_method
from sage.categories.category_singleton import Category_singleton
from sage.categories.category_with_axiom import CategoryWithAxiom
from sage.categories.sets_cat import Sets
from sage.categories.homsets import HomsetsCategory
from sage.rings.infinity import Infinity
from s... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/simplicial_sets.py | 0.90287 | 0.627666 | simplicial_sets.py | pypi |
from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring
from sage.categories.graded_modules import GradedModulesCategory
class LambdaBracketAlgebrasWithBasis(CategoryWithAxiom_over_base_ring):
"""
The category of Lambda bracket algebras with basis.
EXAMPLES::
sage: LieCo... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/lambda_bracket_algebras_with_basis.py | 0.807043 | 0.406067 | lambda_bracket_algebras_with_basis.py | pypi |
r"""
Sage categories quickref
- ``sage.categories.primer?`` a primer on Elements, Parents, and Categories
- ``sage.categories.tutorial?`` a tutorial on Elements, Parents, and Categories
- ``Category?`` technical background on categories
- ``Set... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/all.py | 0.839701 | 0.540318 | all.py | pypi |
from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring
from sage.categories.graded_lie_conformal_algebras import GradedLieConformalAlgebrasCategory
from sage.categories.graded_modules import GradedModulesCategory
from sage.categories.super_modules import SuperModulesCategory
class LieConform... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/lie_conformal_algebras_with_basis.py | 0.845942 | 0.462594 | lie_conformal_algebras_with_basis.py | pypi |
from sage.misc.abstract_method import abstract_method
from sage.misc.cachefunc import cached_method
from sage.categories.category_singleton import Category_singleton
from sage.categories.category_with_axiom import CategoryWithAxiom
from sage.categories.simplicial_complexes import SimplicialComplexes
from sage.categori... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/graphs.py | 0.920683 | 0.562026 | graphs.py | pypi |
r"""
Coxeter Group Algebras
"""
import functools
from sage.misc.cachefunc import cached_method
from sage.categories.algebra_functor import AlgebrasCategory
class CoxeterGroupAlgebras(AlgebrasCategory):
class ParentMethods:
def demazure_lusztig_operator_on_basis(self, w, i, q1, q2,
... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/coxeter_group_algebras.py | 0.910212 | 0.508605 | coxeter_group_algebras.py | pypi |
from sage.categories.graded_modules import GradedModulesCategory
from sage.categories.super_modules import SuperModulesCategory
from sage.misc.abstract_method import abstract_method
from sage.categories.lambda_bracket_algebras import LambdaBracketAlgebras
class SuperLieConformalAlgebras(SuperModulesCategory):
r""... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/super_lie_conformal_algebras.py | 0.777553 | 0.36625 | super_lie_conformal_algebras.py | pypi |
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
from sage.categories.graphs import Graphs
class Cycle(UniqueRepresentation, Parent):
r"""
An example of a graph: the cycle of length `n`.
... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/examples/graphs.py | 0.935328 | 0.674771 | graphs.py | pypi |
r"""
Example of a set with grading
"""
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.sets_with_grading import SetsWithGrading
from sage.rings.integer_ring import IntegerRing
from sage.sets.finite_enumerated_set import FiniteEnumerate... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/examples/sets_with_grading.py | 0.938131 | 0.656383 | sets_with_grading.py | pypi |
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.all import Posets
from sage.structure.element_wrapper import ElementWrapper
from sage.sets.set import Set, Set_object_enumerated
from sage.sets.positive_integers import PositiveIntegers
... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/examples/posets.py | 0.934739 | 0.481271 | posets.py | pypi |
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
from sage.categories.manifolds import Manifolds
class Plane(UniqueRepresentation, Parent):
r"""
An example of a manifold: the `n`-dimensional... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/examples/manifolds.py | 0.926748 | 0.512937 | manifolds.py | pypi |
from sage.misc.cachefunc import cached_method
from sage.structure.parent import Parent
from sage.categories.all import CommutativeAdditiveMonoids
from .commutative_additive_semigroups import FreeCommutativeAdditiveSemigroup
class FreeCommutativeAdditiveMonoid(FreeCommutativeAdditiveSemigroup):
r"""
An example... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/examples/commutative_additive_monoids.py | 0.923756 | 0.439928 | commutative_additive_monoids.py | pypi |
from sage.misc.cachefunc import cached_method
from sage.sets.family import Family
from sage.categories.semigroups import Semigroups
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
class LeftRegula... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/examples/finite_semigroups.py | 0.895306 | 0.496643 | finite_semigroups.py | pypi |
from sage.misc.cachefunc import cached_method
from sage.sets.family import Family
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
from sage.categories.all import Monoids
from sage.rings.integer impo... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/examples/finite_monoids.py | 0.937676 | 0.447762 | finite_monoids.py | pypi |
from sage.structure.parent import Parent
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
from sage.structure.unique_representation import UniqueRepresentation
from sage.rings.integer import Integer
class NonNegativeIntegers(UniqueRepresentation, Parent):
r"""
An example of infinit... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/examples/infinite_enumerated_sets.py | 0.912062 | 0.535706 | infinite_enumerated_sets.py | pypi |
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element import Element
from sage.categories.cw_complexes import CWComplexes
from sage.sets.family import Family
class Surface(UniqueRepresentation, Parent):
r"""
An example of a C... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/categories/examples/cw_complexes.py | 0.955992 | 0.673975 | cw_complexes.py | pypi |
import unicodedata
from sage.structure.sage_object import SageObject
class CompoundSymbol(SageObject):
def __init__(self, character, top, extension, bottom,
middle=None,
middle_top=None, middle_bottom=None,
top_2=None, bottom_2=None):
"""
A multi... | /sagemath-categories-10.0b1.tar.gz/sagemath-categories-10.0b1/sage/typeset/symbols.py | 0.885179 | 0.489076 | symbols.py | pypi |
r"""
Features for testing the presence of Python modules in the Sage library
"""
from . import PythonModule, StaticFile
from .join_feature import JoinFeature
class sagemath_doc_html(StaticFile):
r"""
A :class:`Feature` which describes the presence of the documentation
of the Sage library in HTML format.
... | /sagemath-environment-10.0b1.tar.gz/sagemath-environment-10.0b1/sage/features/sagemath.py | 0.893733 | 0.495911 | sagemath.py | pypi |
r"""
Feature for testing the presence of ``csdp``
"""
import os
import re
import subprocess
from . import Executable, FeatureTestResult
class CSDP(Executable):
r"""
A :class:`~sage.features.Feature` which checks for the ``theta`` binary
of CSDP.
EXAMPLES::
sage: from sage.features.csdp imp... | /sagemath-environment-10.0b1.tar.gz/sagemath-environment-10.0b1/sage/features/csdp.py | 0.764276 | 0.471892 | csdp.py | pypi |
r"""
Features for testing the presence of :class:`MixedIntegerLinearProgram` backends
"""
from . import Feature, PythonModule, FeatureTestResult
from .join_feature import JoinFeature
class MIPBackend(Feature):
r"""
A :class:`~sage.features.Feature` describing whether a :class:`MixedIntegerLinearProgram` back... | /sagemath-environment-10.0b1.tar.gz/sagemath-environment-10.0b1/sage/features/mip_backends.py | 0.89431 | 0.572454 | mip_backends.py | pypi |
r"""
Features for testing the presence of package systems
"""
from . import Feature
class PackageSystem(Feature):
r"""
A :class:`Feature` describing a system package manager.
EXAMPLES::
sage: from sage.features.pkg_systems import PackageSystem
sage: PackageSystem('conda')
Feature... | /sagemath-environment-10.0b1.tar.gz/sagemath-environment-10.0b1/sage/features/pkg_systems.py | 0.830319 | 0.465509 | pkg_systems.py | pypi |
r"""
Features for testing the presence of various databases
"""
from . import StaticFile, PythonModule
from sage.env import (
CONWAY_POLYNOMIALS_DATA_DIR,
CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR,
POLYTOPE_DATA_DIR)
class DatabaseConwayPolynomials(StaticFile):
r"""
A :class:`~sage.features.... | /sagemath-environment-10.0b1.tar.gz/sagemath-environment-10.0b1/sage/features/databases.py | 0.868395 | 0.528351 | databases.py | pypi |
r"""
Join features
"""
from . import Feature, FeatureTestResult
class JoinFeature(Feature):
r"""
Join of several :class:`~sage.features.Feature` instances.
This creates a new feature as the union of the given features. Typically
these are executables of an SPKG. For an example, see
:class:`~sage... | /sagemath-environment-10.0b1.tar.gz/sagemath-environment-10.0b1/sage/features/join_feature.py | 0.88239 | 0.578508 | join_feature.py | pypi |
r"""
Feature for testing the presence of ``lrslib``
"""
import subprocess
from . import Executable, FeatureTestResult
from .join_feature import JoinFeature
class Lrs(Executable):
r"""
A :class:`~sage.features.Feature` describing the presence of the ``lrs``
binary which comes as a part of ``lrslib``.
... | /sagemath-environment-10.0b1.tar.gz/sagemath-environment-10.0b1/sage/features/lrs.py | 0.837354 | 0.560583 | lrs.py | pypi |
r"""
Features for testing the presence of ``rubiks``
"""
# ****************************************************************************
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ver... | /sagemath-environment-10.0b1.tar.gz/sagemath-environment-10.0b1/sage/features/rubiks.py | 0.795102 | 0.330613 | rubiks.py | pypi |
r"""
Features for testing the presence of various graph generator programs
"""
import os
import subprocess
from . import Executable, FeatureTestResult
class Plantri(Executable):
r"""
A :class:`~sage.features.Feature` which checks for the ``plantri`` binary.
EXAMPLES::
sage: from sage.features.... | /sagemath-environment-10.0b1.tar.gz/sagemath-environment-10.0b1/sage/features/graph_generators.py | 0.829803 | 0.513425 | graph_generators.py | pypi |
from sage.categories.category import Category
from sage.categories.covariant_functorial_construction import RegressiveCovariantConstructionCategory
class SubobjectsCategory(RegressiveCovariantConstructionCategory):
_functor_category = "Subobjects"
@classmethod
def default_super_categories(cls, category)... | /sagemath-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/categories/subobjects.py | 0.909975 | 0.476519 | subobjects.py | pypi |
from sage.misc.lazy_import import lazy_import
from sage.categories.covariant_functorial_construction import CovariantFunctorialConstruction, CovariantConstructionCategory
from sage.categories.pushout import MultivariateConstructionFunctor
native_python_containers = set([tuple, list, set, frozenset, range])
class C... | /sagemath-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/categories/cartesian_product.py | 0.711331 | 0.521106 | cartesian_product.py | pypi |
from sage.misc.bindable_class import BindableClass
from sage.categories.category import Category
from sage.categories.category_types import Category_over_base
from sage.categories.covariant_functorial_construction import RegressiveCovariantConstructionCategory
class RealizationsCategory(RegressiveCovariantConstructio... | /sagemath-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/categories/realizations.py | 0.836187 | 0.606571 | realizations.py | pypi |
from sage.categories.category import Category
from sage.categories.covariant_functorial_construction import RegressiveCovariantConstructionCategory
class QuotientsCategory(RegressiveCovariantConstructionCategory):
_functor_category = "Quotients"
@classmethod
def default_super_categories(cls, category):
... | /sagemath-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/categories/quotients.py | 0.915207 | 0.565359 | quotients.py | pypi |
from sage.categories.category import Category
from sage.categories.covariant_functorial_construction import RegressiveCovariantConstructionCategory
def WithRealizations(self):
r"""
Return the category of parents in ``self`` endowed with multiple realizations.
INPUT:
- ``self`` -- a category
..... | /sagemath-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/categories/with_realizations.py | 0.946621 | 0.796372 | with_realizations.py | pypi |
from sage.categories.category import Category
from sage.categories.covariant_functorial_construction import RegressiveCovariantConstructionCategory
class IsomorphicObjectsCategory(RegressiveCovariantConstructionCategory):
_functor_category = "IsomorphicObjects"
@classmethod
def default_super_categories(... | /sagemath-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/categories/isomorphic_objects.py | 0.90881 | 0.620995 | isomorphic_objects.py | pypi |
"IntegerFactorization objects"
from sage.structure.factorization import Factorization
from sage.rings.integer_ring import ZZ
class IntegerFactorization(Factorization):
"""
A lightweight class for an ``IntegerFactorization`` object,
inheriting from the more general ``Factorization`` class.
In the ``F... | /sagemath-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/structure/factorization_integer.py | 0.918845 | 0.720848 | factorization_integer.py | pypi |
r"""
Iterable of the keys of a Mapping associated with nonzero values
"""
from collections.abc import MappingView, Sequence, Set
from sage.misc.superseded import deprecation
class SupportView(MappingView, Sequence, Set):
r"""
Dynamic view of the set of keys of a dictionary that are associated with nonzero v... | /sagemath-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/structure/support_view.py | 0.914133 | 0.74269 | support_view.py | pypi |
import os
from sage.misc.temporary_file import tmp_filename
from sage.misc.superseded import deprecation
from sage.structure.sage_object import SageObject
import sage.doctest
deprecation(32988, 'the module sage.structure.graphics_file is deprecated')
class Mime():
TEXT = 'text/plain'
HTML = 'text/html'
... | /sagemath-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/structure/graphics_file.py | 0.548674 | 0.236401 | graphics_file.py | pypi |
def arithmetic(t=None):
"""
Controls the default proof strategy for integer arithmetic algorithms
(such as primality testing).
INPUT:
t -- boolean or ``None``
OUTPUT:
If t is ``True``, requires integer arithmetic operations to (by
default) return results that are true unconditionally... | /sagemath-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/structure/proof/all.py | 0.919566 | 0.865338 | all.py | pypi |
"Global proof preferences"
from sage.structure.sage_object import SageObject
class _ProofPref(SageObject):
"""
An object that holds global proof preferences. For now these are merely True/False flags for various parts of Sage that use probabilistic algorithms.
A True flag means that the subsystem (such a... | /sagemath-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/structure/proof/proof.py | 0.89219 | 0.614365 | proof.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-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/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-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/misc/decorators.py | 0.774839 | 0.310139 | decorators.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-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/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-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/misc/lazy_format.py | 0.745491 | 0.682243 | lazy_format.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-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/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-objects-10.0b1.tar.gz/sagemath-objects-10.0b1/sage/misc/flatten.py | 0.563138 | 0.576959 | flatten.py | pypi |
from sage.matrix.constructor import matrix
from sage.rings.integer_ring import ZZ
# Function below could be replicated into
# sage.matrix.matrix_integer_dense.Matrix_integer_dense.is_LLL_reduced
# which is its only current use (2011-02-26). Then this could
# be deprecated and this file removed.
def gram_schmidt(B):... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/modules/misc.py | 0.838217 | 0.728338 | misc.py | pypi |
r"""
Morphisms defined by a matrix
A matrix morphism is a morphism that is defined by multiplication
by a matrix. Elements of domain must either have a method
``vector()`` that returns a vector that the defining
matrix can hit from the left, or be coercible into vector space of
appropriate dimension.
EXAMPLES::
... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/modules/matrix_morphism.py | 0.839273 | 0.742492 | matrix_morphism.py | pypi |
from sage.geometry.polyhedron.constructor import Polyhedron
from sage.matrix.constructor import matrix, identity_matrix
from sage.modules.free_module_element import vector
from math import sqrt, floor, ceil
def plane_inequality(v):
"""
Return the inequality for points on the same side as the origin
with... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/modules/diamond_cutting.py | 0.880277 | 0.769643 | diamond_cutting.py | pypi |
from sage.misc.abstract_method import abstract_method
from sage.structure.element import Element
from sage.combinat.free_module import CombinatorialFreeModule
from sage.categories.modules import Modules
class Representation_abstract(CombinatorialFreeModule):
"""
Abstract base class for representations of sem... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/modules/with_basis/representation.py | 0.902609 | 0.437824 | representation.py | pypi |
from sage.misc.cachefunc import cached_method
from sage.categories.category_singleton import Category_singleton
from sage.categories.category_with_axiom import CategoryWithAxiom
from sage.categories.sets_cat import Sets
from sage.categories.homsets import HomsetsCategory
from sage.rings.infinity import Infinity
from s... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/simplicial_sets.py | 0.90287 | 0.627666 | simplicial_sets.py | pypi |
from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring
from sage.categories.graded_modules import GradedModulesCategory
class LambdaBracketAlgebrasWithBasis(CategoryWithAxiom_over_base_ring):
"""
The category of Lambda bracket algebras with basis.
EXAMPLES::
sage: LieCo... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/lambda_bracket_algebras_with_basis.py | 0.806167 | 0.406479 | lambda_bracket_algebras_with_basis.py | pypi |
r"""
Sage categories quickref
- ``sage.categories.primer?`` a primer on Elements, Parents, and Categories
- ``sage.categories.tutorial?`` a tutorial on Elements, Parents, and Categories
- ``Category?`` technical background on categories
- ``Set... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/all.py | 0.839701 | 0.540318 | all.py | pypi |
from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring
from sage.categories.graded_lie_conformal_algebras import GradedLieConformalAlgebrasCategory
from sage.categories.graded_modules import GradedModulesCategory
from sage.categories.super_modules import SuperModulesCategory
class LieConform... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/lie_conformal_algebras_with_basis.py | 0.845942 | 0.462594 | lie_conformal_algebras_with_basis.py | pypi |
from sage.misc.abstract_method import abstract_method
from sage.misc.cachefunc import cached_method
from sage.categories.category_singleton import Category_singleton
from sage.categories.category_with_axiom import CategoryWithAxiom
from sage.categories.simplicial_complexes import SimplicialComplexes
from sage.categori... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/graphs.py | 0.920683 | 0.562026 | graphs.py | pypi |
from sage.categories.category import Category
from sage.categories.covariant_functorial_construction import RegressiveCovariantConstructionCategory
class SubobjectsCategory(RegressiveCovariantConstructionCategory):
_functor_category = "Subobjects"
@classmethod
def default_super_categories(cls, category)... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/subobjects.py | 0.91195 | 0.472257 | subobjects.py | pypi |
from sage.misc.lazy_import import lazy_import
from sage.categories.covariant_functorial_construction import CovariantFunctorialConstruction, CovariantConstructionCategory
from sage.categories.pushout import MultivariateConstructionFunctor
native_python_containers = set([tuple, list, set, frozenset, range])
class C... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/cartesian_product.py | 0.719975 | 0.612252 | cartesian_product.py | pypi |
from sage.misc.bindable_class import BindableClass
from sage.categories.category import Category
from sage.categories.category_types import Category_over_base
from sage.categories.covariant_functorial_construction import RegressiveCovariantConstructionCategory
class RealizationsCategory(RegressiveCovariantConstructio... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/realizations.py | 0.8398 | 0.600803 | realizations.py | pypi |
r"""
Coxeter Group Algebras
"""
import functools
from sage.misc.cachefunc import cached_method
from sage.categories.algebra_functor import AlgebrasCategory
class CoxeterGroupAlgebras(AlgebrasCategory):
class ParentMethods:
def demazure_lusztig_operator_on_basis(self, w, i, q1, q2,
... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/coxeter_group_algebras.py | 0.910212 | 0.508605 | coxeter_group_algebras.py | pypi |
from sage.categories.category import Category
from sage.categories.covariant_functorial_construction import RegressiveCovariantConstructionCategory
class QuotientsCategory(RegressiveCovariantConstructionCategory):
_functor_category = "Quotients"
@classmethod
def default_super_categories(cls, category):
... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/quotients.py | 0.91259 | 0.566528 | quotients.py | pypi |
from sage.categories.category import Category
from sage.categories.covariant_functorial_construction import RegressiveCovariantConstructionCategory
def WithRealizations(self):
r"""
Return the category of parents in ``self`` endowed with multiple realizations.
INPUT:
- ``self`` -- a category
..... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/with_realizations.py | 0.946621 | 0.796372 | with_realizations.py | pypi |
from sage.categories.graded_modules import GradedModulesCategory
from sage.categories.super_modules import SuperModulesCategory
from sage.misc.abstract_method import abstract_method
from sage.categories.lambda_bracket_algebras import LambdaBracketAlgebras
class SuperLieConformalAlgebras(SuperModulesCategory):
r""... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/super_lie_conformal_algebras.py | 0.777215 | 0.364891 | super_lie_conformal_algebras.py | pypi |
from sage.categories.category import Category
from sage.categories.covariant_functorial_construction import RegressiveCovariantConstructionCategory
class IsomorphicObjectsCategory(RegressiveCovariantConstructionCategory):
_functor_category = "IsomorphicObjects"
@classmethod
def default_super_categories(... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/isomorphic_objects.py | 0.910244 | 0.616835 | isomorphic_objects.py | pypi |
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
from sage.categories.graphs import Graphs
class Cycle(UniqueRepresentation, Parent):
r"""
An example of a graph: the cycle of length `n`.
... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/examples/graphs.py | 0.935328 | 0.674771 | graphs.py | pypi |
r"""
Example of a set with grading
"""
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.sets_with_grading import SetsWithGrading
from sage.rings.integer_ring import IntegerRing
from sage.sets.finite_enumerated_set import FiniteEnumerate... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/examples/sets_with_grading.py | 0.938131 | 0.656383 | sets_with_grading.py | pypi |
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.all import Posets
from sage.structure.element_wrapper import ElementWrapper
from sage.sets.set import Set, Set_object_enumerated
from sage.sets.positive_integers import PositiveIntegers
... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/examples/posets.py | 0.934582 | 0.479626 | posets.py | pypi |
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
from sage.categories.manifolds import Manifolds
class Plane(UniqueRepresentation, Parent):
r"""
An example of a manifold: the `n`-dimensional... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/examples/manifolds.py | 0.926748 | 0.512937 | manifolds.py | pypi |
from sage.misc.cachefunc import cached_method
from sage.structure.parent import Parent
from sage.categories.all import CommutativeAdditiveMonoids
from .commutative_additive_semigroups import FreeCommutativeAdditiveSemigroup
class FreeCommutativeAdditiveMonoid(FreeCommutativeAdditiveSemigroup):
r"""
An example... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/examples/commutative_additive_monoids.py | 0.91695 | 0.423995 | commutative_additive_monoids.py | pypi |
from sage.misc.cachefunc import cached_method
from sage.sets.family import Family
from sage.categories.semigroups import Semigroups
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
class LeftRegula... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/examples/finite_semigroups.py | 0.895614 | 0.497803 | finite_semigroups.py | pypi |
from sage.misc.cachefunc import cached_method
from sage.sets.family import Family
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
from sage.categories.all import Monoids
from sage.rings.integer impo... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/examples/finite_monoids.py | 0.937225 | 0.445469 | finite_monoids.py | pypi |
from sage.structure.parent import Parent
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
from sage.structure.unique_representation import UniqueRepresentation
from sage.rings.integer import Integer
class NonNegativeIntegers(UniqueRepresentation, Parent):
r"""
An example of infinit... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/examples/infinite_enumerated_sets.py | 0.912086 | 0.536313 | infinite_enumerated_sets.py | pypi |
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element import Element
from sage.categories.cw_complexes import CWComplexes
from sage.sets.family import Family
class Surface(UniqueRepresentation, Parent):
r"""
An example of a C... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/categories/examples/cw_complexes.py | 0.955992 | 0.673975 | cw_complexes.py | pypi |
r"""
Signed and Unsigned Infinities
The unsigned infinity "ring" is the set of two elements
1. infinity
2. A number less than infinity
The rules for arithmetic are that the unsigned infinity ring does
not canonically coerce to any other ring, and all other rings
canonically coerce to the unsigned infinity ring, sen... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/rings/infinity.py | 0.884539 | 0.668691 | infinity.py | pypi |
from sage.structure.parent import Parent
import sage.rings.integer_ring
from . import ideal
from sage.categories.monoids import Monoids
def IdealMonoid(R):
r"""
Return the monoid of ideals in the ring ``R``.
EXAMPLES::
sage: R = QQ['x']
sage: sage.rings.ideal_monoid.IdealMonoid(R)
... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/rings/ideal_monoid.py | 0.872605 | 0.676206 | ideal_monoid.py | pypi |
from sage.categories.homset import HomsetWithBase
from sage.categories.rings import Rings
_Rings = Rings()
from . import morphism
from . import quotient_ring
def is_RingHomset(H):
"""
Return ``True`` if ``H`` is a space of homomorphisms between two rings.
EXAMPLES::
sage: from sage.rings.homset... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/rings/homset.py | 0.877254 | 0.537102 | homset.py | pypi |
r"""
Matrices over an arbitrary ring
AUTHORS:
- William Stein
- Martin Albrecht: conversion to Pyrex
- Jaap Spies: various functions
- Gary Zablackis: fixed a sign bug in generic determinant.
- William Stein and Robert Bradshaw - complete restructuring.
- Rob Beezer - refactor kernel functions.
Elements of matr... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/matrix/docs.py | 0.895027 | 0.884639 | docs.py | pypi |
import sage.rings.rational_field
def berlekamp_massey(a):
r"""
Use the Berlekamp-Massey algorithm to find the minimal polynomial
of a linear recurrence sequence `a`.
The minimal polynomial of a linear recurrence `\{a_r\}` is
by definition the unique monic polynomial `g`, such that if
`\{a_r\... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/matrix/berlekamp_massey.py | 0.710126 | 0.674865 | berlekamp_massey.py | pypi |
from sage.categories.fields import Fields
_Fields = Fields()
def row_iterator(A):
for i in range(A.nrows()):
yield A.row(i)
def prm_mul(p1, p2, mask_free, prec):
"""
Return the product of ``p1`` and ``p2``, putting free variables in
``mask_free`` to `1`.
This function is mainly use as ... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/matrix/matrix_misc.py | 0.870487 | 0.739069 | matrix_misc.py | pypi |
from sage.misc.latex import latex
from sage.misc.prandom import choice
from sage.misc.cachefunc import cached_method
from sage.structure.category_object import CategoryObject
from sage.structure.element import Element
from sage.structure.parent import Parent, Set_generic
from sage.structure.richcmp import richcmp_met... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/sets/set.py | 0.832577 | 0.477432 | set.py | pypi |
r"""
Check for SageMath Python modules
"""
from . import PythonModule
from .join_feature import JoinFeature
class sage__combinat(JoinFeature):
r"""
A :class:`sage.features.Feature` describing the presence of ``sage.combinat``.
EXAMPLES::
sage: from sage.features.sagemath import sage__combinat
... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/features/sagemath.py | 0.945437 | 0.55097 | sagemath.py | pypi |
r"""
Testing for CSDP at runtime
"""
import os
import re
import subprocess
from sage.cpython.string import bytes_to_str
from . import Executable, FeatureTestResult
class CSDP(Executable):
r"""
A :class:`sage.features.Feature` which checks for the ``theta`` binary
of CSDP.
EXAMPLES::
sage: ... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/features/csdp.py | 0.743541 | 0.403978 | csdp.py | pypi |
from . import Feature, FeatureTestResult
from .join_feature import JoinFeature
class MIPBackend(Feature):
r"""
A feature describing whether a :class:`MixedIntegerLinearProgram` backend is available.
"""
def _is_present(self):
r"""
Test for the presence of a :class:`MixedIntegerLinearPr... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/features/mip_backends.py | 0.870143 | 0.486575 | mip_backends.py | pypi |
r"""
Checks for FES
"""
from . import CythonFeature, PythonModule
from .join_feature import JoinFeature
TEST_CODE = """
# distutils: libraries=fes
from libc.stdint cimport uint64_t
cdef extern from "<fes_interface.h>":
ctypedef int (*solution_callback_t)(void *, uint64_t)
void exhaustive_search_wrapper(int ... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/features/fes.py | 0.707304 | 0.280327 | fes.py | pypi |
r"""
Testing for databases at runtime
"""
from . import StaticFile, PythonModule
from sage.env import (
CONWAY_POLYNOMIALS_DATA_DIR,
CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR)
class DatabaseConwayPolynomials(StaticFile):
r"""
A :class:`Feature` which describes the presence of Frank Luebeck's
... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/features/databases.py | 0.863046 | 0.542803 | databases.py | pypi |
r"""
Join features
"""
from . import Feature, FeatureTestResult
class JoinFeature(Feature):
r"""
Join of several :class:`sage.features.Feature` instances.
EXAMPLES::
sage: from sage.features import Executable
sage: from sage.features.join_feature import JoinFeature
sage: F = Joi... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/features/join_feature.py | 0.813905 | 0.420778 | join_feature.py | pypi |
r"""
Check for lrs
"""
import os
import subprocess
from . import Executable, FeatureTestResult
from sage.cpython.string import str_to_bytes, bytes_to_str
class Lrs(Executable):
r"""
A :class:`sage.features.Feature` describing the presence of the ``lrs``
binary which comes as a part of ``lrslib``.
E... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/features/lrs.py | 0.704465 | 0.382343 | lrs.py | pypi |
r"""
Check for rubiks
"""
# ****************************************************************************
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/features/rubiks.py | 0.733261 | 0.371479 | rubiks.py | pypi |
r"""
Check various graph generator programs
"""
import os
import subprocess
from . import Executable, FeatureTestResult
class Plantri(Executable):
r"""
A :class:`sage.features.graph_generators.Feature` which checks for
the ``plantri`` binary.
EXAMPLES::
sage: from sage.features.graph_gener... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/features/graph_generators.py | 0.817101 | 0.449332 | graph_generators.py | pypi |
"IntegerFactorization objects"
from sage.structure.factorization import Factorization
from sage.rings.integer_ring import ZZ
class IntegerFactorization(Factorization):
"""
A lightweight class for an ``IntegerFactorization`` object,
inheriting from the more general ``Factorization`` class.
In the ``F... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/structure/factorization_integer.py | 0.918132 | 0.722967 | factorization_integer.py | pypi |
import os
from sage.misc.temporary_file import tmp_filename
from sage.structure.sage_object import SageObject
import sage.doctest
class Mime(object):
TEXT = u'text/plain'
HTML = u'text/html'
LATEX = u'text/latex'
JSON = u'application/json'
JAVASCRIPT = u'application/javascript'
PDF = u'applic... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/structure/graphics_file.py | 0.525125 | 0.183612 | graphics_file.py | pypi |
r"""
Precision management for non-exact objects
Manage the default precision for non-exact objects such as power series rings or
laurent series rings.
EXAMPLES::
sage: R.<x> = PowerSeriesRing(QQ)
sage: R.default_prec()
20
sage: cos(x)
1 - 1/2*x^2 + 1/24*x^4 - 1/720*x^6 + 1/40320*x^8 - 1/3628800*x... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/structure/nonexact.py | 0.779783 | 0.508666 | nonexact.py | pypi |
def arithmetic(t=None):
"""
Controls the default proof strategy for integer arithmetic algorithms
(such as primality testing).
INPUT:
t -- boolean or ``None``
OUTPUT:
If t is ``True``, requires integer arithmetic operations to (by
default) return results that are true unconditionally... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/structure/proof/all.py | 0.919566 | 0.865338 | all.py | pypi |
"Global proof preferences"
from sage.structure.sage_object import SageObject
class _ProofPref(SageObject):
"""
An object that holds global proof preferences. For now these are merely True/False flags for various parts of Sage that use probabilistic algorithms.
A True flag means that the subsystem (such a... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/structure/proof/proof.py | 0.899968 | 0.564819 | proof.py | pypi |
import unicodedata
from sage.structure.sage_object import SageObject
class CompoundSymbol(SageObject):
def __init__(self, character, top, extension, bottom,
middle=None,
middle_top=None, middle_bottom=None,
top_2=None, bottom_2=None):
"""
A multi... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/typeset/symbols.py | 0.88173 | 0.447521 | symbols.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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/geometry/fan_isomorphism.py | 0.69946 | 0.648828 | 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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/geometry/hasse_diagram.py | 0.902554 | 0.766731 | 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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/geometry/linear_expression.py | 0.919163 | 0.626324 | 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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/geometry/hyperplane_arrangement/affine_subspace.py | 0.94651 | 0.628336 | affine_subspace.py | pypi |
from copy import copy
from colorsys import hsv_to_rgb
from sage.plot.plot3d.parametric_plot3d import parametric_plot3d
from sage.plot.plot3d.shapes2 import text3d
from sage.plot.graphics import Graphics
from sage.plot.line import line
from sage.plot.text import text
from sage.plot.point import point
from sage.plot.plot... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/geometry/hyperplane_arrangement/plot.py | 0.848282 | 0.535888 | plot.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 .base import Polyhedron_base
class Polyhedron_mutable(Polyhedron_base):
"""
Base class for polyhedra that allow mutability.
This should not be used directly.
... | /sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/geometry/polyhedron/base_mutable.py | 0.852522 | 0.614886 | 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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/geometry/polyhedron/backend_field.py | 0.937318 | 0.556641 | backend_field.py | pypi |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.