rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
raise ValueError, "%s is not a valid perfect matching: there are some repetitions"%p | raise ValueError, ("%s is not a valid perfect matching:\n" "there are some repetitions"%p) | def __classcall_private__(cls,p): r""" This function tries to recognize the input (it can be either a list or a tuple of pairs, or a fix-point free involution given as a list or as a permutation), constructs the parent (enumerated set of PerfectMatchings of the ground set) and calls the __init__ function to construct o... | 506975ec24f2b785477b1f0c809db5be7b8d366e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/506975ec24f2b785477b1f0c809db5be7b8d366e/perfect_matching.py |
or isinstance(p,sage.combinat.permutation.Permutation_class)): | or isinstance(p,Permutation_class)): | def __classcall_private__(cls,p): r""" This function tries to recognize the input (it can be either a list or a tuple of pairs, or a fix-point free involution given as a list or as a permutation), constructs the parent (enumerated set of PerfectMatchings of the ground set) and calls the __init__ function to construct o... | 506975ec24f2b785477b1f0c809db5be7b8d366e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/506975ec24f2b785477b1f0c809db5be7b8d366e/perfect_matching.py |
s="The permutation p (= %s) is not a fixpoint-free involution"%p raise ValueError,s | raise ValueError, ("The permutation p (= %s) is not a " "fixed point free involution"%p) | def __classcall_private__(cls,p): r""" This function tries to recognize the input (it can be either a list or a tuple of pairs, or a fix-point free involution given as a list or as a permutation), constructs the parent (enumerated set of PerfectMatchings of the ground set) and calls the __init__ function to construct o... | 506975ec24f2b785477b1f0c809db5be7b8d366e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/506975ec24f2b785477b1f0c809db5be7b8d366e/perfect_matching.py |
if n == 1: return 1 for p in [2, 3, 5]: if n%p == 0: return p if bound == None: bound = n dif = [6, 4, 2, 4, 2, 4, 6, 2] m = 7; i = 1 while m <= bound and m*m <= n: if n%m == 0: return m m += dif[i%8] i += 1 return n | if bound is None: return ZZ(n).trial_division() else: return ZZ(n).trial_division(bound) | def trial_division(n, bound=None): """ Return the smallest prime divisor <= bound of the positive integer n, or n if there is no such prime. If the optional argument bound is omitted, then bound <= n. INPUT: - ``n`` - a positive integer - ``bound`` - (optional) a positive integer OUTPUT: - ``int`` - a prime p=bo... | 1909947ff6cd628f3224b7a8721bb081a16527c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1909947ff6cd628f3224b7a8721bb081a16527c1/arith.py |
if n < 10000000000000: return factorization.Factorization(__factor_using_trial_division(n), unit) | def factor(n, proof=None, int_=False, algorithm='pari', verbose=0, **kwds): """ Returns the factorization of n. The result depends on the type of n. If n is an integer, factor returns the factorization of the integer n as an object of type Factorization. If n is not an integer, ``n.factor(proof=proof, **kwds)`` gets ... | 1909947ff6cd628f3224b7a8721bb081a16527c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1909947ff6cd628f3224b7a8721bb081a16527c1/arith.py | |
img = self(letter) | img = self.image(letter) | def is_identity(self): r""" Returns ``True`` if ``self`` is the identity morphism. | a02ef8734bf7def52aae8584f83e57b8d08f22b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a02ef8734bf7def52aae8584f83e57b8d08f22b2/morphism.py |
if polynomial not in self.coordinate_ring(): | S = self.coordinate_ring() try: polynomial = S(polynomial) except TypeError: | def is_homogeneous(self, polynomial): r""" Check if ``polynomial`` is homogeneous. | efd25a3ebdf406120dec50c4c26fe9f3351fe4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/efd25a3ebdf406120dec50c4c26fe9f3351fe4f7/toric_variety.py |
polynomial = polynomial.lift() | polynomial = S(polynomial.lift()) | def is_homogeneous(self, polynomial): r""" Check if ``polynomial`` is homogeneous. | efd25a3ebdf406120dec50c4c26fe9f3351fe4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/efd25a3ebdf406120dec50c4c26fe9f3351fe4f7/toric_variety.py |
Returns the intermediate shape of the pm diagram (innner shape plus positions of plusses) | Returns the intermediate shape of the pm diagram (inner shape plus positions of plusses) | def intermediate_shape(self): """ Returns the intermediate shape of the pm diagram (innner shape plus positions of plusses) | 6c0695d12431335aa2bfe89584352810a25e3ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/6c0695d12431335aa2bfe89584352810a25e3ee9/kirillov_reshetikhin.py |
p = p + [0,0] | p = p + [0 for i in range(self.n)] | def intermediate_shape(self): """ Returns the intermediate shape of the pm diagram (innner shape plus positions of plusses) | 6c0695d12431335aa2bfe89584352810a25e3ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/6c0695d12431335aa2bfe89584352810a25e3ee9/kirillov_reshetikhin.py |
([0], [0]) | ([0], []) | def blocks_and_cut_vertices(self): """ Computes the blocks and cut vertices of the graph. In the case of a digraph, this computation is done on the underlying graph. | 66553ffc1b1efb77e8a1bb1e26d0ad20bc27d613 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/66553ffc1b1efb77e8a1bb1e26d0ad20bc27d613/generic_graph.py |
return [s],[s] | return [s],[] | def blocks_and_cut_vertices(self): """ Computes the blocks and cut vertices of the graph. In the case of a digraph, this computation is done on the underlying graph. | 66553ffc1b1efb77e8a1bb1e26d0ad20bc27d613 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/66553ffc1b1efb77e8a1bb1e26d0ad20bc27d613/generic_graph.py |
f_l_dict = {(None,None):[(tuple([x]),tuple(self._vertex_face_indexset([x]))) | f_l_dict = {(None,tuple(range(self.n_Hrepresentation()))):[(tuple([x]),tuple(self._vertex_face_indexset([x]))) | def face_lattice(self): """ Computes the face-lattice poset. Elements are tuples of (vertices, facets) - i.e. this keeps track of both the vertices in each face, and all the facets containing them. | 4a7ca14d8f9d7917c5ad12ea9248edc9b905a5a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4a7ca14d8f9d7917c5ad12ea9248edc9b905a5a9/polyhedra.py |
tuple(range(self.n_Hrepresentation())))) | None)) | def face_lattice(self): """ Computes the face-lattice poset. Elements are tuples of (vertices, facets) - i.e. this keeps track of both the vertices in each face, and all the facets containing them. | 4a7ca14d8f9d7917c5ad12ea9248edc9b905a5a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4a7ca14d8f9d7917c5ad12ea9248edc9b905a5a9/polyhedra.py |
Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the matching polynomial of G is equal to that of G' minus that of G''. | Computes the matching polynomial of the graph `G`. If `p(G, k)` denotes the number of `k`-matchings (matchings with `k` edges) in `G`, then the matching polynomial is defined as [Godsil93]_: .. MATH:: \mu(x)=\sum_{k \geq 0} (-1)^k p(G,k) x^{n-2k} | def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. | 4c721a892902bc64cad5d959527b136a5da04e86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4c721a892902bc64cad5d959527b136a5da04e86/graph.py |
- ``complement`` - (default: True) whether to use a simple formula to compute the matching polynomial from that of the graphs complement | - ``complement`` - (default: ``True``) whether to use Godsil's duality theorem to compute the matching polynomial from that of the graphs complement (see ALGORITHM). | def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. | 4c721a892902bc64cad5d959527b136a5da04e86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4c721a892902bc64cad5d959527b136a5da04e86/graph.py |
NOTE: The ``complement`` option uses matching polynomials of complete graphs, which are cached. So if you are crazy enough to try computing the matching polynomial on a graph with millions of vertices, you might not want to use this option, since it will end up caching millions of polynomials of degree in the million... | def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. | 4c721a892902bc64cad5d959527b136a5da04e86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4c721a892902bc64cad5d959527b136a5da04e86/graph.py | |
sage: V = VectorSpace(QQ,5,sparse=True) sage: U = V.submodule([ V.gen(i) - V.gen(0) for i in range(1,5) ]) sage: print U | sage: VV = VectorSpace(QQ,5,sparse=True) sage: UU = VV.submodule([ VV.gen(i) - VV.gen(0) for i in range(1,5) ]) sage: print UU | def _repr_(self): """ The printing representation of self. | 93d00d87298094b75a6c29b10f58d2febbb42793 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/93d00d87298094b75a6c29b10f58d2febbb42793/free_module.py |
sage: V = VectorSpace(QQ,5,sparse=True) sage: U = V.submodule([ V.gen(i) - V.gen(0) for i in range(1,5) ]) sage: print U | sage: VV = VectorSpace(QQ,5,sparse=True) sage: UU = VV.submodule([ VV.gen(i) - VV.gen(0) for i in range(1,5) ]) sage: print UU | def _repr_(self): """ The default printing representation of self. | 93d00d87298094b75a6c29b10f58d2febbb42793 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/93d00d87298094b75a6c29b10f58d2febbb42793/free_module.py |
- ``triangular`` a boolean (default: False) | - ``triangular`` - "upper" or "lower" or None - "upper": if the `leading_support()` of the image of `F(i)` is `i`, or - "lower": if the `trailing_support()` of the image of `F(i)` is `i`. | def module_morphism(self, on_basis = None, diagonal = None, triangular = None, **keywords): r""" Constructs morphisms by linearity | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
maximal. Note that this may not be the term which actually appears first when ``self`` is printed. If the default term ordering is not what is desired, a comparison function, ``cmp(x,y)``, can be provided. This should return a negative value if `x < y`, `0` if `x == y` and a positive value if `x > y`. | maximal. Note that this may not be the term which actually appears first when ``self`` is printed. If the default term ordering is not what is desired, a comparison function, ``cmp(x,y)``, can be provided. This should return a negative value if `x < y`, `0` if `x == y` and a positive value if `x > y`. | def leading_item(self, cmp=None): r""" Returns the pair ``(k, c)`` where ``c`` * (the basis elt. indexed by ``k``) is the leading term of ``self``. | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
maximal. Note that this may not be the term which actually appears first when ``self`` is printed. If the default term ordering is not what is desired, a comparison function, cmp(x,y), can be provided. | maximal. Note that this may not be the term which actually appears first when ``self`` is printed. If the default term ordering is not what is desired, a comparison function, cmp(x,y), can be provided. | def leading_monomial(self, cmp=None): r""" Returns the leading monomial of ``self``. | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
maximal. Note that this may not be the term which actually appears first when ``self`` is printed. If the default term ordering is not what is desired, a comparison function, cmp(x,y), can be provided. | maximal. Note that this may not be the term which actually appears first when ``self`` is printed. If the default term ordering is not what is desired, a comparison function, cmp(x,y), can be provided. | def leading_coefficient(self, cmp=None): r""" Returns the leading coefficient of ``self``. | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
maximal. Note that this may not be the term which actually appears first when ``self`` is printed. If the default term ordering is not what is desired, a comparison function, cmp(x,y), can be provided. | maximal. Note that this may not be the term which actually appears first when ``self`` is printed. If the default term ordering is not what is desired, a comparison function, cmp(x,y), can be provided. | def leading_term(self, cmp=None): r""" Returns the leading term of ``self``. | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
minimal. Note that this may not be the term which actually appears last when ``self`` is printed. If the default term ordering is not what is desired, a comparison function cmp(x,y), can be provided. | minimal. Note that this may not be the term which actually appears last when ``self`` is printed. If the default term ordering is not what is desired, a comparison function cmp(x,y), can be provided. | def trailing_item(self, cmp=None): r""" Returns the pair ``(c, k)`` where ``c*self.parent().monomial(k)`` is the trailing term of ``self``. | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
minimal. Note that this may not be the term which actually appears last when ``self`` is printed. If the default term ordering is not what is desired, a comparison function cmp(x,y), can be provided. | minimal. Note that this may not be the term which actually appears last when ``self`` is printed. If the default term ordering is not what is desired, a comparison function cmp(x,y), can be provided. | def trailing_monomial(self, cmp=None): r""" Returns the trailing monomial of ``self``. | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
minimal. Note that this may not be the term which actually appears last when ``self`` is printed. If the default term ordering is not what is desired, a comparison function cmp(x,y), can be provided. | minimal. Note that this may not be the term which actually appears last when ``self`` is printed. If the default term ordering is not what is desired, a comparison function cmp(x,y), can be provided. | def trailing_coefficient(self, cmp=None): r""" Returns the trailing coefficient of ``self``. | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
minimal. Note that this may not be the term which actually appears last when ``self`` is printed. If the default term ordering is not what is desired, a comparison function cmp(x,y), can be provided. | minimal. Note that this may not be the term which actually appears last when ``self`` is printed. If the default term ordering is not what is desired, a comparison function cmp(x,y), can be provided. | def trailing_term(self, cmp=None): r""" Returns the trailing term of ``self``. | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
implements operations on elements of tensor products of Hopf algebras | implements operations on elements of tensor products of modules with basis | def extra_super_categories(self): """ EXAMPLES:: | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
- ``domain`` - a modules with basis `F` - ``codomain`` - a modules with basis `G` (defaults to `F`) | - ``domain`` - a module with basis `F` - ``codomain`` - a module with basis `G` (defaults to `F`) | sage: def phi_on_basis(i): return Y.monomial(abs(i)) | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
elements of `G` | elements of `G` which describes the morphism | sage: def phi_on_basis(i): return Y.monomial(abs(i)) | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
J\mapsto I` with the folowing property: for any `j\in J` the function ``inverse_on_support`` should returns a `i\in I` such that the leading term of ``on_basis(i)`` is `j` if there exists such a `i` or ``None`` if not. | J\mapsto I` with the following property: for any `j\in J`, `r(j)` should return an `i\in I` such that the leading term of ``on_basis(i)`` is `j` if there exists such a `i` or ``None`` if not. | sage: def phi_on_basis(i): return Y.monomial(abs(i)) | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
AssertionError: morphims is not triangular on 1 | AssertionError: morphism is not triangular on 1 | def _test_triangular(self, **options): """ Tests that ``self`` is actually triangular | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
AssertionError: morphims is not untriangular on 1 | AssertionError: morphism is not untriangular on 1 | def _test_triangular(self, **options): """ Tests that ``self`` is actually triangular | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
LazyFormat("morphims is not untriangular on %s")%(x)) | LazyFormat("morphism is not untriangular on %s")%(x)) | def _test_triangular(self, **options): """ Tests that ``self`` is actually triangular | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
LazyFormat("morphims is not triangular on %s")%(x)) | LazyFormat("morphism is not triangular on %s")%(x)) | def _test_triangular(self, **options): """ Tests that ``self`` is actually triangular | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py |
Mtrans = Matrix(k, 2, M2)*M1inv | Mtrans = Matrix(k, 2, M2)*Maux*M1inv assert Mtrans[1][0] in N | def is_Gamma0_equivalent(self, other, N, Transformation=False): r""" Checks if cusps ``self`` and ``other`` are `\Gamma_0(N)`- equivalent. | a02baf9d13bfb8ae48b58758ffddff1b6984bb15 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a02baf9d13bfb8ae48b58758ffddff1b6984bb15/cusps_nf.py |
Returns the Hasse invariant of an elliptic curve over a field of positive characteristic, which is an element of the field. | Returns the Hasse invariant of this elliptic curve. OUTPUT: The Hasse invariant of this elliptic curve, as an element of the base field. This is only defined over fields of positive characteristic, and is an element of the field which is zero if and only if the curve is supersingular. Over a field of characteristic... | def hasse_invariant(self): r""" Returns the Hasse invariant of an elliptic curve over a field of positive characteristic, which is an element of the field. | 00919aca0a5b8b25eb1f25b0bc8015a983875bee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/00919aca0a5b8b25eb1f25b0bc8015a983875bee/ell_field.py |
return self.a2()+self.a1()**2 | return self.b2() elif p == 5: return self.c4() elif p == 7: return -self.c6() | def hasse_invariant(self): r""" Returns the Hasse invariant of an elliptic curve over a field of positive characteristic, which is an element of the field. | 00919aca0a5b8b25eb1f25b0bc8015a983875bee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/00919aca0a5b8b25eb1f25b0bc8015a983875bee/ell_field.py |
cones = tuple(tuple(new_fan_rays.index(cone_polytope.vertex(v)) for v in range(cone_polytope.nvertices() - 1)) | cones = tuple(tuple(sorted(new_fan_rays.index(cone_polytope.vertex(v)) for v in range(cone_polytope.nvertices() - 1))) | def _subdivide_palp(self, new_rays, verbose): r""" Subdivide ``self`` adding ``new_rays`` one by one. | 53c47f6547ed2825820604f44bf9468604c2ef0f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/53c47f6547ed2825820604f44bf9468604c2ef0f/fan.py |
for cone, polytope in zip(fan.generating_cones(), cone_polytopes): cone._lattice_polytope = polytope | def _subdivide_palp(self, new_rays, verbose): r""" Subdivide ``self`` adding ``new_rays`` one by one. | 53c47f6547ed2825820604f44bf9468604c2ef0f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/53c47f6547ed2825820604f44bf9468604c2ef0f/fan.py | |
def parse_deps(self, filename, verify=True): | def parse_deps(self, filename, ext_module, verify=True): | def parse_deps(self, filename, verify=True): """ Open a Cython file and extract all of its dependencies. | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py |
if filename[-4:] not in ('.pyx', '.pxd', '.pxi'): | if not is_cython_file(filename): | def parse_deps(self, filename, verify=True): """ Open a Cython file and extract all of its dependencies. | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py |
for idir in CYTHON_INCLUDE_DIRS: new_path = os.path.normpath(idir + base_dependency_name) | for idir in ext_module.include_dirs + CYTHON_INCLUDE_DIRS + include_dirs + extra_include_dirs: new_path = os.path.normpath(idir + '/' + base_dependency_name) | def parse_deps(self, filename, verify=True): """ Open a Cython file and extract all of its dependencies. | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py |
if path[-2:] != '.h': raise IOError, "could not find dependency %s included in %s."%(path, filename) | msg = 'could not find dependency %s included in %s.'%(path, filename) if is_cython_file(filename): raise IOError, msg else: warnings.warn(msg+' I will assume it is a system C/C++ header.') | def parse_deps(self, filename, verify=True): """ Open a Cython file and extract all of its dependencies. | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py |
def immediate_deps(self, filename): | def immediate_deps(self, filename, ext_module): | def immediate_deps(self, filename): """ Returns a list of files directly referenced by this file. """ if (filename not in self._deps or self.timestamp(filename) < self._last_parse[filename]): self._deps[filename] = self.parse_deps(filename) self._last_parse[filename] = self.timestamp(filename) return self._deps[filenam... | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py |
self._deps[filename] = self.parse_deps(filename) | self._deps[filename] = self.parse_deps(filename, ext_module) | def immediate_deps(self, filename): """ Returns a list of files directly referenced by this file. """ if (filename not in self._deps or self.timestamp(filename) < self._last_parse[filename]): self._deps[filename] = self.parse_deps(filename) self._last_parse[filename] = self.timestamp(filename) return self._deps[filenam... | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py |
def all_deps(self, filename, path=None): | def all_deps(self, filename, ext_module, path=None): | def all_deps(self, filename, path=None): """ Returns all files directly or indirectly referenced by this file. | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py |
for f in self.immediate_deps(filename): | for f in self.immediate_deps(filename, ext_module): | def all_deps(self, filename, path=None): """ Returns all files directly or indirectly referenced by this file. | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py |
deps.update(self.all_deps(f, path)) | deps.update(self.all_deps(f, ext_module, path)) | def all_deps(self, filename, path=None): """ Returns all files directly or indirectly referenced by this file. | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py |
def newest_dep(self, filename): | def newest_dep(self, filename, ext_module): | def newest_dep(self, filename): """ Returns the most recently modified file that filename depends on, along with its timestamp. """ nfile = filename ntime = self.timestamp(filename) for f in self.all_deps(filename): if self.timestamp(f) > ntime: nfile = f ntime = self.timestamp(f) return nfile, ntime | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py |
for f in self.all_deps(filename): | for f in self.all_deps(filename, ext_module): | def newest_dep(self, filename): """ Returns the most recently modified file that filename depends on, along with its timestamp. """ nfile = filename ntime = self.timestamp(filename) for f in self.all_deps(filename): if self.timestamp(f) > ntime: nfile = f ntime = self.timestamp(f) return nfile, ntime | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py |
dep_file, dep_time = deps.newest_dep(f) | dep_file, dep_time = deps.newest_dep(f,m) | def compile_command_list(ext_modules, deps): """ Computes a list of commands needed to compile and link the extension modules given in 'ext_modules' """ queue_compile_high = [] queue_compile_med = [] queue_compile_low = [] for m in ext_modules: new_sources = [] for f in m.sources: if f.endswith('.pyx'): dep_file, dep_... | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py |
- ``legend_*`` - all the options valid for :meth:`set_legend_options` prefixed with 'legend_' | - ``legend_*`` - all the options valid for :meth:`set_legend_options` prefixed with ``legend_`` | def show(self, **kwds): """ Show this graphics image with the default image viewer. | a0df834220102bf467dbfeceb037a622a91e77dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a0df834220102bf467dbfeceb037a622a91e77dd/plot.py |
sage: import operator | def derivative(self, ex, operator): """ EXAMPLES:: | ee7089955f50de0b72b5ffc6bb539e38bec10f0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/ee7089955f50de0b72b5ffc6bb539e38bec10f0c/expression_conversions.py | |
sage: a = function('f', x).diff(x); a | sage: f = function('f') sage: a = f(x).diff(x); a | def derivative(self, ex, operator): """ EXAMPLES:: | ee7089955f50de0b72b5ffc6bb539e38bec10f0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/ee7089955f50de0b72b5ffc6bb539e38bec10f0c/expression_conversions.py |
sage: b = function('f', x).diff(x).diff(x) | sage: b = f(x).diff(x, x) | def derivative(self, ex, operator): """ EXAMPLES:: | ee7089955f50de0b72b5ffc6bb539e38bec10f0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/ee7089955f50de0b72b5ffc6bb539e38bec10f0c/expression_conversions.py |
args = ex.args() | args = ex.operands() | def derivative(self, ex, operator): """ EXAMPLES:: | ee7089955f50de0b72b5ffc6bb539e38bec10f0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/ee7089955f50de0b72b5ffc6bb539e38bec10f0c/expression_conversions.py |
EXAMPLES: | EXAMPLES:: | def overlap_partition(self, other, delay=0, p=None, involution=None) : r""" Returns the partition of the alphabet induced by the overlap of self and other with the given delay. | 00735ad72bef5212475bba51cf8ccb87f508a3dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/00735ad72bef5212475bba51cf8ccb87f508a3dc/word.py |
""" Enumerates projective, rational points on scheme X of height up to bound B. | r""" Enumerates projective, rational points on scheme ``X`` of height up to bound ``B``. | def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
- ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound | - ``X`` - a scheme or set of abstract rational points of a scheme; - ``B`` - a positive integer bound. | def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
- a list containing the projective points of X of height up to B, sorted. | - a list containing the projective points of ``X`` of height up to ``B``, sorted. | def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
[(-5 : 6 : 1), (-4 : 5 : 1), (-3 : 4 : 1), (-2 : 3 : 1), (-3/2 : 5/2 : 1), (-1 : 1 : 0), (-1 : 2 : 1), (-2/3 : 5/3 : 1), (-1/2 : 3/2 : 1), (-1/3 : 4/3 : 1), (-1/4 : 5/4 : 1), (-1/5 : 6/5 : 1), (0 : 1 : 1), (1/6 : 5/6 : 1), (1/5 : 4/5 : 1), (1/4 : 3/4 : 1), (1/3 : 2/3 : 1), (2/5 : 3/5 : 1), (1/2 : 1/2 : 1), (3/5 : 2/5 :... | [(-5 : 6 : 1), (-4 : 5 : 1), (-3 : 4 : 1), (-2 : 3 : 1), (-3/2 : 5/2 : 1), (-1 : 1 : 0), (-1 : 2 : 1), (-2/3 : 5/3 : 1), (-1/2 : 3/2 : 1), (-1/3 : 4/3 : 1), (-1/4 : 5/4 : 1), (-1/5 : 6/5 : 1), (0 : 1 : 1), (1/6 : 5/6 : 1), (1/5 : 4/5 : 1), (1/4 : 3/4 : 1), (1/3 : 2/3 : 1), (2/5 : 3/5 : 1), (1/2 : 1/2 : 1), (3/5 : 2/5 :... | def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
of projective space to see if they lie on X. | of projective space to see if they lie on ``X``. | def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
John Cremona and Charlie Turner (06-2010) | - John Cremona and Charlie Turner (06-2010) | def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
n = X.codomain().ambient_space().ngens()-1 zero=tuple([0 for _ in range(n+1)]) pts =[] for c in cartesian_product_iterator([srange(-B,B+1) for _ in range(n+1)]): if gcd(c)==1 and c>zero: | n = X.codomain().ambient_space().ngens() zero = (0,) * n pts = [] for c in cartesian_product_iterator([srange(-B,B+1) for _ in range(n)]): if gcd(c) == 1 and c > zero: | def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
except: | except TypeError: | def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. | Enumerates affine rational points on scheme ``X`` (defined over `\QQ`) up to bound ``B``. | def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
- ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound | - ``X`` - a scheme or set of abstract rational points of a scheme; - ``B`` - a positive integer bound. | def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
- a list containing the affine points of X of height up to B, sorted. | - a list containing the affine points of ``X`` of height up to ``B``, sorted. | def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
AUTHOR: David R. Kohel <kohel@maths.usyd.edu.au> (small adjustments by Charlie Turner 06-2010) | AUTHORS: - David R. Kohel <kohel@maths.usyd.edu.au>: original version. - Charlie Turner (06-2010): small adjustments. | def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
Q = [ k+1 for k in range(B) ] R = [ 0 ] + [ s*k for k in range(1,B+1) for s in [1,-1] ] | Q = range(1, B + 1) R = [ 0 ] + [ s*k for k in range(1, B+1) for s in [1, -1] ] | def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
P = [ 0 for _ in range(n) ] | P = [0] * n | def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
except: | except TypeError: | def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
[ iters[j].next() for j in range(n) ] | for it in iters: it.next() | def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
m = m.gcd(a) P[i] = a for b in Q: if m.gcd(b) == 1: try: pts.append(X([ num/b for num in P ])) except: pass i = 0 m = ZZ(0) | def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py | |
Enumerates projective points on scheme X defined over a finite field | Enumerates projective points on scheme ``X`` defined over a finite field. | def enum_projective_finite_field(X): """ Enumerates projective points on scheme X defined over a finite field INPUT: - ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme OUTPUT: - a list containing the projective points of X over the finite field, sorted EXAMPLES:: s... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
- ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme | - ``X`` - a scheme defined over a finite field or a set of abstract rational points of such a scheme. | def enum_projective_finite_field(X): """ Enumerates projective points on scheme X defined over a finite field INPUT: - ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme OUTPUT: - a list containing the projective points of X over the finite field, sorted EXAMPLES:: s... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
- a list containing the projective points of X over the finite field, sorted | - a list containing the projective points of ``X`` over the finite field, sorted. | def enum_projective_finite_field(X): """ Enumerates projective points on scheme X defined over a finite field INPUT: - ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme OUTPUT: - a list containing the projective points of X over the finite field, sorted EXAMPLES:: s... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
NOTE: Warning:if X given as input is defined over an infinite field then this code will not finish! AUTHORS: John Cremona and Charlie Turner (06-2010) | .. WARNING:: If ``X`` is defined over an infinite field, this code will not finish! AUTHORS: - John Cremona and Charlie Turner (06-2010). | def enum_projective_finite_field(X): """ Enumerates projective points on scheme X defined over a finite field INPUT: - ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme OUTPUT: - a list containing the projective points of X over the finite field, sorted EXAMPLES:: s... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
except: | except TypeError: | def enum_projective_finite_field(X): """ Enumerates projective points on scheme X defined over a finite field INPUT: - ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme OUTPUT: - a list containing the projective points of X over the finite field, sorted EXAMPLES:: s... | 7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py |
return matrix_space.MatrixSpace(ring, n, n, sparse).identity_matrix() | return matrix_space.MatrixSpace(ring, n, n, sparse)(1) | def identity_matrix(ring, n=0, sparse=False): r""" Return the `n \times n` identity matrix over the given ring. The default ring is the integers. EXAMPLES:: sage: M = identity_matrix(QQ, 2); M [1 0] [0 1] sage: M.parent() Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: M = identity_matrix(2); M [... | 5867b3c6276b57244559fd7541b14eaa9e59e477 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/5867b3c6276b57244559fd7541b14eaa9e59e477/constructor.py |
return matrix_space.MatrixSpace(ring, nrows, ncols, sparse).zero_matrix() | return matrix_space.MatrixSpace(ring, nrows, ncols, sparse)(0) | def zero_matrix(ring, nrows, ncols=None, sparse=False): r""" Return the `nrows \times ncols` zero matrix over the given ring. The default ring is the integers. EXAMPLES:: sage: M = zero_matrix(QQ, 2); M [0 0] [0 0] sage: M.parent() Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: M = zero_matrix(2... | 5867b3c6276b57244559fd7541b14eaa9e59e477 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/5867b3c6276b57244559fd7541b14eaa9e59e477/constructor.py |
ValueError: polys (=[x - y, x*y]) must be homogeneous of the same degree | ValueError: polys (=[x - y, x*y]) must be of the same degree sage: H([x-1, x*y+x]) Traceback (most recent call last): ... ValueError: polys (=[x - 1, x*y + x]) must be homogeneous | def _repr_defn(self): """ This function is used internally for printing. | 10f92cffa05831b8a8e3caae116d9e284ca861b6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/10f92cffa05831b8a8e3caae116d9e284ca861b6/morphism.py |
deg = self.defining_polynomials()[0].degree() for poly in self.defining_polynomials(): if (poly.degree() != deg) or not poly.is_homogeneous(): raise ValueError, "polys (=%s) must be homogeneous of the same degree"%polys | polys = self.defining_polynomials() try: d = polys[0].degree() except AttributeError: polys = [f.lift() for f in polys] if not all([f.is_homogeneous() for f in polys]): raise ValueError, "polys (=%s) must be homogeneous"%polys degs = [f.degree() for f in polys] if not all([d==degs[0] for d in degs[1:]]): raise ValueEr... | def __init__(self, parent, polys, check=True): SchemeMorphism_on_points.__init__(self, parent, polys, check) if check: # morphisms from projective space are always given by # homogeneous polynomials of the same degree deg = self.defining_polynomials()[0].degree() for poly in self.defining_polynomials(): if (poly.degree... | 10f92cffa05831b8a8e3caae116d9e284ca861b6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/10f92cffa05831b8a8e3caae116d9e284ca861b6/morphism.py |
except: | except MIPSolverException: | def edge_coloring(g, value_only=False, vizing=False, hex_colors=False, log=0): r""" Properly colors the edges of a graph. See the URL http://en.wikipedia.org/wiki/Edge_coloring for further details on edge coloring. INPUT: - ``g`` -- a graph. - ``value_only`` -- (default: ``False``): - When set to ``True``, only the... | 188d42e47344cfb921672f992048ca37394acd8a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/188d42e47344cfb921672f992048ca37394acd8a/graph_coloring.py |
AUTHORS: - Robert Bradshaw (2007-10): numerical algorithm - Robert Bradshaw (2008-10): algebraic algorithm | def minpoly(ex, var='x', algorithm=None, bits=None, degree=None, epsilon=0): r""" Return the minimal polynomial of self, if possible. INPUT: - ``var`` - polynomial variable name (default 'x') - ``algorithm`` - 'algebraic' or 'numerical' (default both, but with numerical first) - ``bits`` - the number of bits to ... | 79dac1caa595004ce2ee368f13d1ae74f555c29b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/79dac1caa595004ce2ee368f13d1ae74f555c29b/calculus.py | |
AUTHORS: - Golam Mortuza Hossain (2009-06-15) | def _limit_latex_(self, f, x, a): r""" Return latex expression for limit of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _limit_latex_ sage: var('x,a') (x, a) sage: f = function('f',x) sage: _limit_latex_(0, f, x, a) '\\lim_{x \\to a}\\, f\\left(x\\right)' sage: latex(limit(f, x=oo)) \lim_... | 79dac1caa595004ce2ee368f13d1ae74f555c29b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/79dac1caa595004ce2ee368f13d1ae74f555c29b/calculus.py | |
AUTHORS: - Golam Mortuza Hossain (2009-06-22) | def _laplace_latex_(self, *args): r""" Return LaTeX expression for Laplace transform of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _laplace_latex_ sage: var('s,t') (s, t) sage: f = function('f',t) sage: _laplace_latex_(0,f,t,s) '\\mathcal{L}\\left(f\\left(t\\right), t, s\\right)' sage: l... | 79dac1caa595004ce2ee368f13d1ae74f555c29b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/79dac1caa595004ce2ee368f13d1ae74f555c29b/calculus.py | |
AUTHORS: - Golam Mortuza Hossain (2009-06-22) | def _inverse_laplace_latex_(self, *args): r""" Return LaTeX expression for inverse Laplace transform of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _inverse_laplace_latex_ sage: var('s,t') (s, t) sage: F = function('F',s) sage: _inverse_laplace_latex_(0,F,s,t) '\\mathcal{L}^{-1}\\left(F\\... | 79dac1caa595004ce2ee368f13d1ae74f555c29b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/79dac1caa595004ce2ee368f13d1ae74f555c29b/calculus.py | |
libraries=['polybori','pboriCudd', 'groebner', 'gd', 'png', 'm4ri'], | libraries=['polybori','pboriCudd', 'groebner', 'gd', 'png12', 'm4ri'], | def uname_specific(name, value, alternative): if name in os.uname()[0]: return value else: return alternative | bad104d772119429241e8249fe746d8887d913c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/bad104d772119429241e8249fe746d8887d913c0/module_list.py |
Return the frequency table corresponding to the given string. | Return the frequency table corresponding to the given string. | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 08cf8218c91d92b4dcb4602a7135f1d9d706af1e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08cf8218c91d92b4dcb4602a7135f1d9d706af1e/huffman.py |
- ``string`` -- a string EXAMPLE:: | - ``string`` -- a string of symbols over some alphabet. OUTPUT: - A table of frequency of each unique symbol in ``string``. If ``string`` is an empty string, return an empty table. EXAMPLES: The frequency table of a non-empty string:: | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 08cf8218c91d92b4dcb4602a7135f1d9d706af1e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08cf8218c91d92b4dcb4602a7135f1d9d706af1e/huffman.py |
sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a': 5, ' ': 9, 'c': 1, 'b': 1, 'e': 8, 'g': 3, 'f': 1, 'i': 2, 'm': 4, 's': 5, 'o': 4, 'n': 1, 'p': 3, 'S': 1, 'r': 5, 'u': 2, 't': 4, 'v': 1, 'y': 2, 'l': 2} | sage: str = "Stop counting my characters!" sage: T = sorted(frequency_table(str).items()) sage: for symbol, code in T: ... print symbol, code ... 3 ! 1 S 1 a 2 c 3 e 1 g 1 h 1 i 1 m 1 n 2 o 2 p 1 r 2 s 1 t 3 u 1 y 1 The frequency of an empty string:: sage: frequency_table("") {} | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 08cf8218c91d92b4dcb4602a7135f1d9d706af1e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08cf8218c91d92b4dcb4602a7135f1d9d706af1e/huffman.py |
for l in string: d[l] = d.get(l,0) + 1 | for s in string: d[s] = d.get(s, 0) + 1 | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 08cf8218c91d92b4dcb4602a7135f1d9d706af1e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08cf8218c91d92b4dcb4602a7135f1d9d706af1e/huffman.py |
class Huffman(): | class Huffman(SageObject): | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 08cf8218c91d92b4dcb4602a7135f1d9d706af1e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08cf8218c91d92b4dcb4602a7135f1d9d706af1e/huffman.py |
Huffman Encoding This class implements the basic functionalities of Huffman's encoding. It can build a Huffman code from a given string, or from the information of a dictionary associating to each key (the elements of the alphabet) a weight (most of the time, a probability value or a number of occurrences). For examp... | This class implements the basic functionalities of Huffman codes. It can build a Huffman code from a given string, or from the information of a dictionary associating to each key (the elements of the alphabet) a weight (most of the time, a probability value or a number of occurrences). INPUT: - ``string`` -- (defaul... | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 08cf8218c91d92b4dcb4602a7135f1d9d706af1e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08cf8218c91d92b4dcb4602a7135f1d9d706af1e/huffman.py |
We could have obtained the same result by "training" the Huffman code on the following table of frequency :: | We can obtain the same result by "training" the Huffman code with the following table of frequency:: | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 08cf8218c91d92b4dcb4602a7135f1d9d706af1e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08cf8218c91d92b4dcb4602a7135f1d9d706af1e/huffman.py |
sage: h2 = Huffman(frequencies = ft) Once ``h1`` has been trained, and hence possesses an encoding code, | sage: h2 = Huffman(table=ft) Once ``h1`` has been trained, and hence possesses an encoding table, | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 08cf8218c91d92b4dcb4602a7135f1d9d706af1e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08cf8218c91d92b4dcb4602a7135f1d9d706af1e/huffman.py |
Which can be decoded the following way:: | We can decode the above encoded string in the following way:: | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 08cf8218c91d92b4dcb4602a7135f1d9d706af1e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08cf8218c91d92b4dcb4602a7135f1d9d706af1e/huffman.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.