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 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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/doctest/util.py
0.816809
0.296833
util.py
pypi
import os import sys import re import random import doctest from Cython.Utils import is_package_dir from sage.cpython.string import bytes_to_str from sage.repl.load import load from sage.misc.lazy_attribute import lazy_attribute from .parsing import SageDocTestParser from .util import NestedName from sage.structure.dy...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/doctest/sources.py
0.433022
0.197193
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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/repl/display/jsmol_iframe.py
0.664976
0.19853
jsmol_iframe.py
pypi
import os import errno from sage.env import ( SAGE_DOC, SAGE_VENV, SAGE_EXTCODE, SAGE_VERSION, THREEJS_DIR, ) class SageKernelSpec(object): def __init__(self, prefix=None): """ Utility to manage SageMath kernels and extensions INPUT: - ``prefix`` -- (optional, defau...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/repl/ipython_kernel/install.py
0.445047
0.173673
install.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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/misc/unknown.py
0.891941
0.522324
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 ArgSpec def sage_wraps(wrapped, assigned=...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/misc/decorators.py
0.788665
0.361277
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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/misc/method_decorator.py
0.86267
0.332879
method_decorator.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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/misc/element_with_label.py
0.929448
0.78968
element_with_label.py
pypi
class SageTimeitResult(object): 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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/misc/sage_timeit.py
0.857843
0.653652
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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/misc/abstract_method.py
0.738386
0.496277
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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/misc/lazy_format.py
0.737914
0.685857
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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/misc/table.py
0.920767
0.877004
table.py
pypi
class MultiplexFunction(object): """ 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 = ...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/misc/object_multiplexer.py
0.735831
0.291
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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/misc/prandom.py
0.815196
0.823683
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-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage/misc/flatten.py
0.563138
0.576959
flatten.py
pypi
import os import importlib.util from sage_setup.find import installed_files_by_module, get_extensions def _remove(file_set, module_base, to_remove): """ Helper to remove files from a set of filenames. INPUT: - ``file_set`` -- a set of filenames. - ``module_base`` -- string. Name of a Python...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage_setup/clean.py
0.415136
0.251441
clean.py
pypi
from setuptools.extension import Extension from sage.misc.package import list_packages all_packages = list_packages(local=True) class CythonizeExtension(Extension): """ A class for extensions which are only cythonized, but not built. The file ``src/setup.py`` contains some logic to check the ``skip...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage_setup/optional_extension.py
0.762513
0.18567
optional_extension.py
pypi
import os import sys import time keep_going = False def run_command(cmd): """ INPUT: - ``cmd`` -- a string; a command to run OUTPUT: prints ``cmd`` to the console and then runs ``os.system(cmd)``. """ print(cmd) sys.stdout.flush() return os.system(cmd) def apply_func_progress(p...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage_setup/run_parallel.py
0.511473
0.419707
run_parallel.py
pypi
from __future__ import print_function, absolute_import from .utils import je, reindent_lines as ri def string_of_addr(a): r""" An address or a length from a parameter specification may be either None, an integer, or a MemoryChunk. If the address or length is an integer or a MemoryChunk, this functio...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage_setup/autogen/interpreters/memory.py
0.842766
0.44565
memory.py
pypi
from __future__ import print_function, absolute_import import re from .storage import ty_int def params_gen(**chunks): r""" Instructions have a parameter specification that says where they get their inputs and where their outputs go. Each parameter has the same form: it is a triple (chunk, addr, le...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage_setup/autogen/interpreters/instructions.py
0.723993
0.560583
instructions.py
pypi
from __future__ import print_function, absolute_import import os import textwrap from jinja2 import Environment from jinja2.runtime import StrictUndefined # We share a single jinja2 environment among all templating in this # file. We use trim_blocks=True (which means that we ignore white # space after "%}" jinja2 ...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage_setup/autogen/interpreters/utils.py
0.55266
0.296826
utils.py
pypi
from __future__ import print_function, absolute_import from .utils import je, reindent_lines as ri class StorageType(object): r""" A StorageType specifies the C types used to deal with values of a given type. We currently support three categories of types. First are the "simple" types. These a...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage_setup/autogen/interpreters/storage.py
0.831554
0.452234
storage.py
pypi
from __future__ import print_function, absolute_import from .base import StackInterpreter from ..instructions import (params_gen, instr_funcall_2args, instr_unary, InstrSpec) from ..memory import MemoryChunk from ..storage import ty_python from ..utils import je, reindent_lines as ri cla...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage_setup/autogen/interpreters/specs/python.py
0.787686
0.360292
python.py
pypi
from __future__ import print_function, absolute_import from .base import StackInterpreter from .python import MemoryChunkPyConstant from ..instructions import (params_gen, instr_funcall_1arg_mpfr, instr_funcall_2args_mpfr, InstrSpec) from ..memory import MemoryChunk, MemoryChunkConstants f...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage_setup/autogen/interpreters/specs/rr.py
0.660391
0.269255
rr.py
pypi
from __future__ import print_function, absolute_import from .base import StackInterpreter from ..instructions import (params_gen, instr_infix, instr_funcall_2args, instr_unary, InstrSpec) from ..memory import MemoryChunkConstants from ..storage import ty_double_complex, ty_python from ..ut...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage_setup/autogen/interpreters/specs/cdf.py
0.576423
0.232757
cdf.py
pypi
from __future__ import print_function, absolute_import from .base import StackInterpreter from .python import (MemoryChunkPyConstant, MemoryChunkPythonArguments, PythonInterpreter) from ..storage import ty_python from ..utils import reindent_lines as ri class MemoryChunkElementArguments(MemoryC...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage_setup/autogen/interpreters/specs/element.py
0.709523
0.381738
element.py
pypi
from __future__ import print_function, absolute_import from .base import StackInterpreter from .python import MemoryChunkPyConstant from ..instructions import (params_gen, instr_funcall_1arg_mpc, instr_funcall_2args_mpc, InstrSpec) from ..memory import MemoryChunk, MemoryChunkConstants fro...
/sagemath-polyhedra-9.5b6.tar.gz/sagemath-polyhedra-9.5b6/sage_setup/autogen/interpreters/specs/cc.py
0.709925
0.21213
cc.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-repl-10.0b0.tar.gz/sagemath-repl-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-repl-10.0b0.tar.gz/sagemath-repl-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-repl-10.0b0.tar.gz/sagemath-repl-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-repl-10.0b0.tar.gz/sagemath-repl-10.0b0/sage/repl/ipython_kernel/install.py
0.451327
0.153835
install.py
pypi
r""" Parallel Interface to the Sage interpreter This is an expect interface to \emph{multiple} copy of the \sage interpreter, which can all run simultaneous calculations. A PSage object does not work as well as the usual Sage object, but does have the great property that when you construct an object in a PSage you ge...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/interfaces/psage.py
0.631935
0.472318
psage.py
pypi
r""" Abstract base classes for interface elements """ class AxiomElement: r""" Abstract base class for :class:`~sage.interfaces.axiom.AxiomElement`. This class is defined for the purpose of ``isinstance`` tests. It should not be instantiated. EXAMPLES: By design, there is a unique direct su...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/interfaces/abc.py
0.849035
0.57093
abc.py
pypi
import os from sage.misc.cachefunc import cached_function @cached_function def sage_spawned_process_file(): """ EXAMPLES:: sage: from sage.interfaces.quit import sage_spawned_process_file sage: len(sage_spawned_process_file()) > 1 True """ # This is the old value of SAGE_TM...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/interfaces/quit.py
0.558809
0.323327
quit.py
pypi
from sympy.core.basic import Basic from sympy.core.decorators import sympify_method_args from sympy.core.sympify import sympify from sympy.sets.sets import Set @sympify_method_args class SageSet(Set): r""" Wrapper for a Sage set providing the SymPy Set API. Parents in the category :class:`sage.categorie...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/interfaces/sympy_wrapper.py
0.904021
0.541833
sympy_wrapper.py
pypi
import builtins class ExtraTabCompletion(): def __dir__(self): """ Add to the dir() output This is used by IPython to read off the tab completions. EXAMPLES:: sage: from sage.interfaces.tab_completion import ExtraTabCompletion sage: obj = ExtraTabComplet...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/interfaces/tab_completion.py
0.601945
0.334943
tab_completion.py
pypi
from sage.structure.sage_object import SageObject from sage.combinat.rigged_configurations.tensor_product_kr_tableaux import TensorProductOfKirillovReshetikhinTableaux from sage.combinat.rigged_configurations.kr_tableaux import KirillovReshetikhinTableaux from sage.combinat.rigged_configurations.rigged_configurations ...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/dynamics/cellular_automata/solitons.py
0.87006
0.616301
solitons.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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/modules/misc.py
0.844313
0.739963
misc.py
pypi
from . import free_module_element from sage.symbolic.all import Expression def apply_map(phi): """ Returns a function that applies phi to its argument. EXAMPLES:: sage: from sage.modules.vector_symbolic_dense import apply_map sage: v = vector([1,2,3]) sage: f = apply_map(lambda ...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/modules/vector_symbolic_dense.py
0.832305
0.688823
vector_symbolic_dense.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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/modules/with_basis/representation.py
0.902492
0.437884
representation.py
pypi
r""" Monoids """ from sage.structure.parent import Parent from sage.misc.cachefunc import cached_method def is_Monoid(x): r""" Returns True if ``x`` is of type ``Monoid_class``. EXAMPLES:: sage: from sage.monoids.monoid import is_Monoid sage: is_Monoid(0) False sage: is_M...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/monoids/monoid.py
0.808521
0.498779
monoid.py
pypi
from copy import copy from sage.misc.abstract_method import abstract_method from sage.misc.cachefunc import cached_method from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation from sage.structure.element import MonoidElement from sage.structure.indexed_generator...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/monoids/indexed_free_monoid.py
0.874573
0.476701
indexed_free_monoid.py
pypi
from sage.rings.integer import Integer from sage.structure.element import MonoidElement from sage.structure.richcmp import richcmp, richcmp_not_equal def is_FreeMonoidElement(x): return isinstance(x, FreeMonoidElement) class FreeMonoidElement(MonoidElement): """ Element of a free monoid. EXAMPLES:...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/monoids/free_monoid_element.py
0.649245
0.460228
free_monoid_element.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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/categories/realizations.py
0.836187
0.606571
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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/categories/super_lie_conformal_algebras.py
0.777553
0.36625
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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/categories/isomorphic_objects.py
0.90881
0.620995
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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/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-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/categories/examples/cw_complexes.py
0.955992
0.673975
cw_complexes.py
pypi
from sage.categories.groups import Groups from sage.categories.poor_man_map import PoorManMap from sage.groups.group import Group, AbelianGroup from sage.monoids.indexed_free_monoid import (IndexedMonoid, IndexedFreeMonoidElement, IndexedFreeAbelianMonoidElement) from sage.misc.cachefunc import cached_method i...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/groups/indexed_free_group.py
0.845433
0.498352
indexed_free_group.py
pypi
r""" Galois groups of field extensions. We don't necessarily require extensions to be normal, but we do require them to be separable. When an extension is not normal, the Galois group refers to the automorphism group of the normal closure. AUTHORS: - David Roe (2019): initial version """ from sage.groups.perm_gps.p...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/groups/galois_group.py
0.870625
0.580411
galois_group.py
pypi
r""" PARI Groups See :pari:`polgalois` for the PARI documentation of these objects. """ from sage.libs.pari import pari from sage.rings.integer import Integer from sage.groups.perm_gps.permgroup_named import TransitiveGroup class PariGroup(): def __init__(self, x, degree): """ EXAMPLES:: ...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/groups/pari_group.py
0.894182
0.617051
pari_group.py
pypi
from sage.groups.group import Group from sage.groups.libgap_wrapper import ParentLibGAP, ElementLibGAP from sage.groups.libgap_mixin import GroupMixinLibGAP from sage.structure.unique_representation import UniqueRepresentation from sage.libs.gap.libgap import libgap from sage.libs.gap.element import GapElement from sa...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/groups/finitely_presented.py
0.833528
0.562237
finitely_presented.py
pypi
from sage.categories.groups import Groups from sage.groups.group import Group from sage.groups.libgap_wrapper import ParentLibGAP, ElementLibGAP from sage.structure.unique_representation import UniqueRepresentation from sage.libs.gap.libgap import libgap from sage.libs.gap.element import GapElement from sage.rings.int...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/groups/free_group.py
0.834002
0.406185
free_group.py
pypi
from sage.libs.gap.libgap import libgap from sage.libs.gap.element import GapElement from sage.structure.element import parent from sage.misc.cachefunc import cached_method from sage.groups.class_function import ClassFunction_libgap from sage.groups.libgap_wrapper import ElementLibGAP class GroupMixinLibGAP(): def...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/groups/libgap_mixin.py
0.843057
0.364382
libgap_mixin.py
pypi
from sage.structure.element import MultiplicativeGroupElement from sage.misc.cachefunc import cached_method from sage.arith.all import GCD, LCM from sage.rings.integer import Integer from sage.rings.integer_ring import ZZ from sage.rings.infinity import infinity from sage.structure.richcmp import richcmp class Abeli...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/groups/abelian_gps/element_base.py
0.856737
0.467575
element_base.py
pypi
from sage.arith.all import LCM from sage.groups.abelian_gps.element_base import AbelianGroupElementBase def is_DualAbelianGroupElement(x) -> bool: """ Test whether ``x`` is a dual Abelian group element. INPUT: - ``x`` -- anything OUTPUT: Boolean EXAMPLES:: sage: from sage.gro...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/groups/abelian_gps/dual_abelian_group_element.py
0.811377
0.598957
dual_abelian_group_element.py
pypi
from sage.groups.abelian_gps.element_base import AbelianGroupElementBase def is_AbelianGroupElement(x): """ Return true if x is an abelian group element, i.e., an element of type AbelianGroupElement. EXAMPLES: Though the integer 3 is in the integers, and the integers have an abelian group struct...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/groups/abelian_gps/abelian_group_element.py
0.823399
0.557424
abelian_group_element.py
pypi
from . import permgroup_element from sage.misc.sage_eval import sage_eval from sage.misc.lazy_import import lazy_import from sage.interfaces.gap import GapElement from sage.libs.pari.all import pari_gen from sage.libs.gap.element import GapElement_Permutation lazy_import('sage.combinat.permutation', ['Permutation', 'f...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/groups/perm_gps/constructor.py
0.758466
0.502502
constructor.py
pypi
r""" Semimonomial transformation group The semimonomial transformation group of degree `n` over a ring `R` is the semidirect product of the monomial transformation group of degree `n` (also known as the complete monomial group over the group of units `R^{\times}` of `R`) and the group of ring automorphisms. The multi...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/groups/semimonomial_transformations/semimonomial_transformation_group.py
0.801276
0.984411
semimonomial_transformation_group.py
pypi
from sage.structure.unique_representation import CachedRepresentation from sage.groups.matrix_gps.matrix_group import ( MatrixGroup_generic, MatrixGroup_gap ) def normalize_args_vectorspace(*args, **kwds): """ Normalize the arguments that relate to a vector space. INPUT: Something that defines ...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/groups/matrix_gps/named_group.py
0.952761
0.687879
named_group.py
pypi
from sage.sat.solvers import SatSolver from sage.sat.converters import ANF2CNFConverter from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence def solve(F, converter=None, solver=None, n=1, target_variables=None, **kwds): """ Solve system of Boolean polynomials ``F`` by solving the ...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/sat/boolean_polynomials.py
0.935472
0.659302
boolean_polynomials.py
pypi
import os import sys import subprocess import shlex from sage.sat.solvers.satsolver import SatSolver from sage.misc.temporary_file import tmp_filename from time import sleep class DIMACS(SatSolver): """ Generic DIMACS Solver. .. note:: Usually, users won't have to use this class directly but s...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/sat/solvers/dimacs.py
0.629091
0.254694
dimacs.py
pypi
r""" Solve SAT problems Integer Linear Programming The class defined here is a :class:`~sage.sat.solvers.satsolver.SatSolver` that solves its instance using :class:`MixedIntegerLinearProgram`. Its performance can be expected to be slower than when using :class:`~sage.sat.solvers.cryptominisat.cryptominisat.CryptoMiniS...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/sat/solvers/sat_lp.py
0.935788
0.712176
sat_lp.py
pypi
from sage.matrix.constructor import matrix from sage.structure.element import is_Matrix from sage.arith.all import legendre_symbol from sage.rings.integer_ring import ZZ def is_triangular_number(n, return_value=False): """ Return whether ``n`` is a triangular number. A *triangular number* is a number of ...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/quadratic_forms/extras.py
0.92183
0.666741
extras.py
pypi
from sage.quadratic_forms.genera.genus import Genus, LocalGenusSymbol from sage.rings.integer_ring import ZZ from sage.arith.all import is_prime, prime_divisors def global_genus_symbol(self): r""" Return the genus of two times a quadratic form over `\ZZ`. These are defined by a collection of local genus...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/quadratic_forms/quadratic_form__genus.py
0.894513
0.736637
quadratic_form__genus.py
pypi
from sage.rings.all import ZZ, QQ, Integer from sage.modules.free_module_element import vector from sage.matrix.constructor import Matrix def qfsolve(G): r""" Find a solution `x = (x_0,...,x_n)` to `x G x^t = 0` for an `n \times n`-matrix ``G`` over `\QQ`. OUTPUT: If a solution exists, return a...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/quadratic_forms/qfsolve.py
0.913782
0.778186
qfsolve.py
pypi
from sage.arith.all import valuation from sage.rings.rational_field import QQ def local_density(self, p, m): """ Return the local density. .. NOTE:: This screens for imprimitive forms, and puts the quadratic form in local normal form, which is a *requirement* of the routines per...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/quadratic_forms/quadratic_form__local_density_interfaces.py
0.828349
0.612484
quadratic_form__local_density_interfaces.py
pypi
r""" Routines for computing special values of `L`-functions - :func:`gamma__exact` -- Exact values of the `\Gamma` function at integers and half-integers - :func:`zeta__exact` -- Exact values of the Riemann `\zeta` function at critical values - :func:`quadratic_L_function__exact` -- Exact values of the Dirichlet L-fun...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/quadratic_forms/special_values.py
0.927256
0.782164
special_values.py
pypi
from sage.misc.cachefunc import cached_method from sage.libs.pari.all import pari from sage.matrix.constructor import Matrix from sage.rings.integer_ring import ZZ from sage.modules.all import FreeModule from sage.modules.free_module_element import vector from sage.arith.all import GCD @cached_method def basis_of_sh...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/quadratic_forms/quadratic_form__automorphisms.py
0.790328
0.514095
quadratic_form__automorphisms.py
pypi
from sage.rings.integer_ring import ZZ from sage.rings.polynomial.polynomial_element import is_Polynomial from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.quadratic_forms.quadratic_form import QuadraticForm def BezoutianQuadraticForm(f, g): r""" Compute the Bezoutian of...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/quadratic_forms/constructions.py
0.916168
0.677132
constructions.py
pypi
from copy import deepcopy from sage.matrix.constructor import matrix from sage.functions.all import floor from sage.misc.mrange import mrange from sage.modules.free_module_element import vector from sage.rings.integer_ring import ZZ def reduced_binary_form1(self): r""" Reduce the form `ax^2 + bxy+cy^2` to sat...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/quadratic_forms/quadratic_form__reduction_theory.py
0.819316
0.557845
quadratic_form__reduction_theory.py
pypi
def swap_variables(self, r, s, in_place=False): """ Switch the variables `x_r` and `x_s` in the quadratic form (replacing the original form if the in_place flag is True). INPUT: - `r`, `s` -- integers >= 0 OUTPUT: a QuadraticForm (by default, otherwise none) EXAMPLES:: sa...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/quadratic_forms/quadratic_form__variable_substitutions.py
0.719581
0.722992
quadratic_form__variable_substitutions.py
pypi
import copy from sage.rings.infinity import Infinity from sage.rings.integer_ring import IntegerRing, ZZ from sage.rings.rational_field import QQ from sage.arith.all import GCD, valuation, is_prime def find_entry_with_minimal_scale_at_prime(self, p): """ Finds the entry of the quadratic form with minimal sca...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/quadratic_forms/quadratic_form__local_normal_form.py
0.761893
0.58673
quadratic_form__local_normal_form.py
pypi
from sage.misc.lazy_import import lazy_import lazy_import('sage.functions.piecewise', 'piecewise') lazy_import('sage.functions.error', ['erf', 'erfc', 'erfi', 'erfinv', 'fresnel_sin', 'fresnel_cos']) from .trig import ( sin, cos, sec, csc, cot, tan, asin, acos, atan, acot, ac...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/functions/all.py
0.665954
0.183265
all.py
pypi
import sys from sage.rings.integer_ring import ZZ from sage.rings.real_mpfr import RR from sage.rings.real_double import RDF from sage.rings.complex_mpfr import ComplexField, is_ComplexNumber from sage.rings.cc import CC from sage.rings.real_mpfr import (RealField, is_RealNumber) from sage.symbolic.function import Gi...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/functions/transcendental.py
0.610686
0.476092
transcendental.py
pypi
from sage.symbolic.function import GinacFunction, BuiltinFunction from sage.symbolic.constants import e as const_e from sage.symbolic.constants import pi as const_pi from sage.libs.mpmath import utils as mpmath_utils from sage.structure.all import parent as s_parent from sage.symbolic.expression import Expression, reg...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/functions/log.py
0.905719
0.703131
log.py
pypi
from sage.symbolic.function import GinacFunction, BuiltinFunction from sage.symbolic.expression import register_symbol, symbol_table from sage.structure.all import parent as s_parent from sage.rings.complex_mpfr import ComplexField from sage.rings.rational import Rational from sage.functions.exp_integral import Ei from...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/functions/gamma.py
0.887951
0.717964
gamma.py
pypi
r""" Congruence subgroup `\Gamma(N)` """ #***************************************************************************** # 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 L...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/modular/arithgroup/congroup_gamma.py
0.781497
0.495178
congroup_gamma.py
pypi
r""" The matrix monoid `\Sigma_0(N)`. This stands for a monoid of matrices over `\ZZ`, `\QQ`, `\ZZ_p`, or `\QQ_p`, depending on an integer `N \ge 1`. This class exists in order to act on p-adic distribution spaces. Over `\QQ` or `\ZZ`, it is the monoid of matrices `2\times2` matrices `\begin{pmatrix} a & b \\ c & d \...
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/modular/pollack_stevens/sigma0.py
0.88993
0.80456
sigma0.py
pypi