Ticket #15096: trac_15096.patch

File trac_15096.patch, 145.8 KB (added by zimmerma, 8 years ago)
  • sage/algebras/algebra.py

    # HG changeset patch
    # User Paul Zimmermann <zimmerma@loria.fr>
    # Date 1377426076 -7200
    # Node ID 97e176ab1ec9eef6c49788c3480b8635340f6873
    # Parent  50e4bca6dc56b9e512897136e60dd9a5caa23133
    #15096: corrupted documentation (global fix)
    
    diff --git a/sage/algebras/algebra.py b/sage/algebras/algebra.py
    a b  
    2323    r"""
    2424    Return True if x is an Algebra
    2525
    26     EXAMPLES:
     26    EXAMPLES::
     27
    2728        sage: from sage.algebras.algebra import is_Algebra
    2829        sage: R.<x,y> = FreeAlgebra(QQ,2)
    2930        sage: is_Algebra(R)
  • sage/coding/ag_code.py

    diff --git a/sage/coding/ag_code.py b/sage/coding/ag_code.py
    a b  
    3737    singular curves or if the field size is too large, etc.; when
    3838    this happens a ??? exception is raised.
    3939
    40     EXAMPLES:
     40    EXAMPLES::
     41
    4142        sage: x,y,z = ProjectiveSpace(2, GF(17), names = 'xyz').gens()
    4243        sage: C   = Curve(y^2*z^7 - x^9 - x*z^8)
    4344        sage: pts = C.rational_points(sorted=False)
  • sage/coding/decoder.py

    diff --git a/sage/coding/decoder.py b/sage/coding/decoder.py
    a b  
    2929    elements in V (including v) which belong to the
    3030    syndrome of v (ie, the coset v+C, sorted by weight).
    3131
    32     EXAMPLES:
     32    EXAMPLES::
     33
    3334        sage: C = HammingCode(2,GF(3)); C
    3435        Linear code of length 4, dimension 2 over Finite Field of size 3
    3536        sage: V = VectorSpace(GF(3), 4)
     
    5354    be in the same ambient space V as C. Returns an
    5455    element of the syndrome of v of lowest weight.
    5556
    56     EXAMPLES:
     57    EXAMPLES::
     58
    5759        sage: C = HammingCode(2,GF(3)); C                                 
    5860        Linear code of length 4, dimension 2 over Finite Field of size 3   
    5961        sage: V = VectorSpace(GF(3), 4)                                   
     
    8890    Methods implemented include "nearest neighbor" (essentially
    8991    a brute force search) and "syndrome".
    9092
    91     EXAMPLES:
     93    EXAMPLES::
     94
    9295        sage: C = HammingCode(2,GF(3))
    9396        sage: V = VectorSpace(GF(3), 4)
    9497        sage: v = V([0, 2, 0, 1])
  • sage/databases/sloane.py

    diff --git a/sage/databases/sloane.py b/sage/databases/sloane.py
    a b  
    372372       
    373373        OUTPUT: string
    374374
    375         EXAMPLES:
     375        EXAMPLES::
    376376
    377377        sage: SloaneEncyclopedia.sequence_name(1) # optional - sloane_database
    378378        'Number of groups of order n.'
  • sage/geometry/polyhedron/palp_database.py

    diff --git a/sage/geometry/polyhedron/palp_database.py b/sage/geometry/polyhedron/palp_database.py
    a b  
    412412    Any additional keyword arguments are passed to
    413413    :class:`PALPreader`.
    414414
    415     EXAMPLES:
     415    EXAMPLES::
    416416
    417417        sage: from sage.geometry.polyhedron.palp_database import Reflexive4dHodge
    418418        sage: ref = Reflexive4dHodge(1,101)             # optional - polytopes_db_4d
  • sage/groups/matrix_gps/orthogonal.py

    diff --git a/sage/groups/matrix_gps/orthogonal.py b/sage/groups/matrix_gps/orthogonal.py
    a b  
    167167    The general orthogonal group of given degree, base ring, and
    168168    choice of invariant form.
    169169
    170     EXAMPLES:
     170    EXAMPLES::
    171171
    172172        sage: GO( 3, GF(7))
    173173        General Orthogonal Group of degree 3 over Finite Field of size 7
  • sage/interfaces/gap.py

    diff --git a/sage/interfaces/gap.py b/sage/interfaces/gap.py
    a b  
    282282
    283283    String.
    284284
    285     EXAMPLES:
     285    EXAMPLES::
    286286
    287287        sage: from sage.interfaces.gap import \
    288288        ...       _get_gap_memory_pool_size_MB
  • sage/interfaces/lie.py

    diff --git a/sage/interfaces/lie.py b/sage/interfaces/lie.py
    a b  
    1818To access the LiE interpreter directly, run lie_console().
    1919
    2020
    21 EXAMPLES:
     21EXAMPLES::
     22
    2223    sage: a4 = lie('A4')  # optional - lie
    2324    sage: lie.diagram('A4')          # optional - lie
    2425    O---O---O---O
     
    307308                 logfile=None,
    308309                 server=None):
    309310        """
    310         EXAMPLES:
     311        EXAMPLES::
     312
    311313            sage: lie == loads(dumps(lie))
    312314            True
    313315        """
     
    351353
    352354    def _read_info_files(self, use_disk_cache=True):
    353355        """
    354         EXAMPLES:
     356        EXAMPLES::
     357
    355358            sage: from sage.interfaces.lie import LiE
    356359            sage: lie = LiE()
    357360            sage: lie._trait_names_list is None
     
    456459
    457460    def _repr_(self):
    458461        """
    459         EXAMPLES:
     462        EXAMPLES::
     463
    460464            sage: lie
    461465            LiE Interpreter
    462466        """
     
    464468
    465469    def __reduce__(self):
    466470        """
    467         EXAMPLES:
     471        EXAMPLES::
     472
    468473            sage: lie.__reduce__()
    469474            (<function reduce_load_lie at 0x...>, ())
    470475
     
    473478   
    474479    def _function_class(self):
    475480        """
    476         EXAMPLES:
     481        EXAMPLES::
     482
    477483            sage: lie._function_class()
    478484            <class 'sage.interfaces.lie.LiEFunction'>
    479485        """
     
    481487
    482488    def _quit_string(self):
    483489        """
    484         EXAMPLES:
     490        EXAMPLES::
     491
    485492            sage: lie._quit_string()
    486493            'quit'
    487494        """
     
    489496   
    490497    def _read_in_file_command(self, filename):
    491498        """
    492         EXAMPLES:
     499        EXAMPLES::
     500
    493501            sage: lie._read_in_file_command('testfile')
    494502            Traceback (most recent call last):
    495503            ...
     
    500508
    501509    def trait_names(self, type=None, verbose=False, use_disk_cache=True):
    502510        """
    503         EXAMPLES:
     511        EXAMPLES::
     512
    504513            sage: lie.trait_names() # optional - lie
    505514            ['Cartan_type',
    506515             'cent_roots',
     
    517526
    518527    def _an_element_impl(self):
    519528        """
    520         EXAMPLES:
     529        EXAMPLES::
     530
    521531            sage: lie._an_element_impl() # optional - lie
    522532            0
    523533        """
     
    525535       
    526536    def read(self, filename):
    527537        """
    528         EXAMPLES:
     538        EXAMPLES::
     539
    529540            sage: filename = tmp_filename()
    530541            sage: f = open(filename, 'w')
    531542            sage: f.write('x = 2\n')
     
    542553        """
    543554        Spawn a new LiE command-line session.
    544555
    545         EXAMPLES:
     556        EXAMPLES::
     557
    546558            sage: lie.console()                    # not tested
    547559            LiE version 2.2.2 created on Sep 26 2007 at 18:13:19
    548560            Authors: Arjeh M. Cohen, Marc van Leeuwen, Bert Lisser.
     
    554566
    555567    def version(self):
    556568        """
    557         EXAMPLES:
     569        EXAMPLES::
     570
    558571            sage: lie.version() # optional - lie
    559572            '2.1'
    560573        """
     
    562575
    563576    def _object_class(self):
    564577        """
    565         EXAMPLES:
     578        EXAMPLES::
     579
    566580            sage: lie._object_class()
    567581            <class 'sage.interfaces.lie.LiEElement'>
    568582
     
    571585
    572586    def _true_symbol(self):
    573587        """
    574         EXAMPLES:
     588        EXAMPLES::
     589
    575590            sage: lie._true_symbol()
    576591            '1'
    577592        """
     
    579594
    580595    def _false_symbol(self):
    581596        """
    582         EXAMPLES:
     597        EXAMPLES::
     598
    583599            sage: lie._false_symbol()
    584600            '0'
    585601        """
     
    587603       
    588604    def _equality_symbol(self):
    589605        """
    590         EXAMPLES:
     606        EXAMPLES::
     607
    591608            sage: lie._equality_symbol()
    592609            '=='
    593610        """
     
    597614        """
    598615        Returns a string of the LiE help for command.
    599616
    600         EXAMPLES:
     617        EXAMPLES::
     618
    601619            sage: lie.help('diagram') # optional - lie
    602620            'diagram(g)...'
    603621        """
     
    611629
    612630    def _eval_line(self, line, allow_use_file=True, wait_for_prompt=True, restart_if_needed=False):
    613631        """
    614         EXAMPLES:
     632        EXAMPLES::
     633
    615634            sage: lie._eval_line('2+2') # optional - lie
    616635            '     4'
    617636            sage: lie._eval_line('diagram(2)') # optional - lie
     
    632651
    633652    def eval(self, code, strip=True, **kwds):
    634653        """
    635         EXAMPLES:
     654        EXAMPLES::
     655
    636656            sage: lie.eval('2+2')  # optional - lie
    637657            '4'
    638658        """
     
    647667        """
    648668        Set the variable var to the given value.
    649669
    650         EXAMPLES:
     670        EXAMPLES::
     671
    651672            sage: lie.set('x', '2')  # optional - lie
    652673            sage: lie.get('x')       # optional - lie
    653674            '2'
     
    662683        """
    663684        Get the value of the variable var.
    664685
    665         EXAMPLES:
     686        EXAMPLES::
     687
    666688            sage: lie.set('x', '2')  # optional - lie
    667689            sage: lie.get('x')       # optional - lie
    668690            '2'
     
    673695
    674696    def get_using_file(self, var):
    675697        """
    676         EXAMPLES:
     698        EXAMPLES::
     699
    677700            sage: lie.get_using_file('x')
    678701            Traceback (most recent call last):
    679702            ...
     
    683706
    684707    def function_call(self, function, args=None, kwds=None):
    685708        """
    686         EXAMPLES:
     709        EXAMPLES::
     710
    687711            sage: lie.function_call("diagram", args=['A4']) # optional - lie
    688712            O---O---O---O
    689713            1   2   3   4   
     
    701725
    702726    def _function_element_class(self):
    703727        """
    704         EXAMPLES:
     728        EXAMPLES::
     729
    705730            sage: lie._function_element_class()
    706731            <class 'sage.interfaces.lie.LiEFunctionElement'>
    707732        """
     
    712737        """
    713738        Returns the possible tab completions for self.
    714739
    715         EXAMPLES:
     740        EXAMPLES::
     741
    716742            sage: a4 = lie('A4')   # optional - lie
    717743            sage: a4.trait_names() # optional - lie
    718744            ['center',
     
    725751
    726752    def type(self):
    727753        """       
    728         EXAMPLES:
     754        EXAMPLES::
     755
    729756            sage: m = lie('[[1,0,3,3],[12,4,-4,7],[-1,9,8,0],[3,-5,-2,9]]') # optional - lie
    730757            sage: m.type() # optional - lie
    731758            'mat'
     
    736763
    737764    def _matrix_(self, R=None):
    738765        """
    739         EXAMPLES:
     766        EXAMPLES::
     767
    740768            sage: m = lie('[[1,0,3,3],[12,4,-4,7],[-1,9,8,0],[3,-5,-2,9]]') # optional - lie
    741769            sage: matrix(m)  # optional - lie
    742770            [ 1  0  3  3]
     
    761789   
    762790    def _sage_(self):
    763791        """
    764         EXAMPLES:
     792        EXAMPLES::
     793
    765794            sage: m = lie('[[1,0,3,3],[12,4,-4,7],[-1,9,8,0],[3,-5,-2,9]]') # optional - lie
    766795            sage: m.sage()  # optional - lie
    767796            [ 1  0  3  3]
     
    823852class LiEFunctionElement(FunctionElement):
    824853    def _sage_doc_(self):
    825854        """
    826         EXAMPLES:
     855        EXAMPLES::
     856
    827857            sage: a4 = lie('A4')  # optional - lie
    828858            sage: a4.diagram._sage_doc_() # optional - lie
    829859            'diagram(g)...'
     
    837867        """
    838868        Returns the help for self.
    839869
    840         EXAMPLES:
     870        EXAMPLES::
     871
    841872            sage: lie.diagram._sage_doc_() # optional - lie
    842873            'diagram(g)...'
    843874        """
     
    848879
    849880def is_LiEElement(x):
    850881    """
    851     EXAMPLES:
     882    EXAMPLES::
     883
    852884        sage: from sage.interfaces.lie import is_LiEElement
    853885        sage: l = lie(2) # optional - lie
    854886        sage: is_LiEElement(l) # optional - lie
     
    863895
    864896def reduce_load_lie():
    865897    """
    866     EXAMPLES:
     898    EXAMPLES::
     899
    867900        sage: from sage.interfaces.lie import reduce_load_lie
    868901        sage: reduce_load_lie()
    869902        LiE Interpreter
     
    875908    """
    876909    Spawn a new LiE command-line session.
    877910
    878     EXAMPLES:
     911    EXAMPLES::
     912
    879913        sage: from sage.interfaces.lie import lie_console
    880914        sage: lie_console()                    # not tested
    881915        LiE version 2.2.2 created on Sep 26 2007 at 18:13:19
     
    889923
    890924def lie_version():
    891925    """
    892     EXAMPLES:
     926    EXAMPLES::
     927
    893928        sage: from sage.interfaces.lie import lie_version
    894929        sage: lie_version() # optional - lie
    895930        '2.1'
  • sage/interfaces/macaulay2.py

    diff --git a/sage/interfaces/macaulay2.py b/sage/interfaces/macaulay2.py
    a b  
    2626
    2727\end{enumerate}
    2828
    29 EXAMPLES:
     29EXAMPLES::
     30
    3031    sage: print macaulay2('3/5 + 7/11') #optional
    3132    68
    3233    --
     
    122123        spaces (or maybe even pieces of output labels). However, this
    123124        function will try not cut any messages.
    124125   
    125     EXAMPLES:
     126    EXAMPLES::
     127
    126128        sage: from sage.interfaces.macaulay2 import remove_output_labels
    127129        sage: output = 'o1 = QQ [x, y]\n\no1 : PolynomialRing\n'
    128130        sage: remove_output_labels(output)
     
    195197        """
    196198        Used in serializing an Macaulay2 interface.
    197199       
    198         EXAMPLES:
     200        EXAMPLES::
     201
    199202            sage: rlm2, t = macaulay2.__reduce__()
    200203            sage: rlm2(*t)
    201204            Macaulay2
     
    234237
    235238    def __getattr__(self, attrname):
    236239        """
    237         EXAMPLES:
     240        EXAMPLES::
     241
    238242            sage: gb = macaulay2.gb  #optional
    239243            sage: type(gb)           #optional
    240244            <class 'sage.interfaces.macaulay2.Macaulay2Function'>
     
    254258            code -- str
    255259            strip -- ignored
    256260
    257         EXAMPLES:
     261        EXAMPLES::
     262
    258263            sage: macaulay2.eval("2+2") #optional
    259264            4
    260265        """
     
    280285        """
    281286        Get the value of the variable var.
    282287
    283         EXAMPLES:
     288        EXAMPLES::
     289
    284290            sage: macaulay2.set("a", "2") #optional
    285291            sage: macaulay2.get("a")      #optional
    286292            2
     
    291297        """
    292298        Set the variable var to the given value.
    293299
    294         EXAMPLES:
     300        EXAMPLES::
     301
    295302            sage: macaulay2.set("a", "2")  #optional
    296303            sage: macaulay2.get("a")       #optional
    297304            2
     
    305312        """
    306313        Returns the class of Macaulay2 elements.
    307314
    308         EXAMPLES:
     315        EXAMPLES::
     316
    309317            sage: macaulay2._object_class()
    310318            <class 'sage.interfaces.macaulay2.Macaulay2Element'>
    311319
     
    316324        """
    317325        Spawn a new M2 command-line session.
    318326       
    319         EXAMPLES:
     327        EXAMPLES::
     328
    320329            sage: macaulay2.console()                    # not tested
    321330            Macaulay 2, version 1.1
    322331            with packages: Classic, Core, Elimination, IntegralClosure, LLLBases, Parsing, PrimaryDecomposition, SchurRings, TangentCone
     
    329338        """
    330339        Returns the Macaulay2 left delimiter for lists.
    331340
    332         EXAMPLES:
     341        EXAMPLES::
     342
    333343            sage: macaulay2._left_list_delim()
    334344            '{'
    335345        """
     
    339349        """
    340350        Returns the Macaulay2 right delimiter for lists.
    341351
    342         EXAMPLES:
     352        EXAMPLES::
     353
    343354            sage: macaulay2._right_list_delim()
    344355            '}'
    345356        """
     
    349360        """
    350361        Returns the Macaulay2 symbol for True.
    351362
    352         EXAMPLES:
     363        EXAMPLES::
     364
    353365            sage: macaulay2._true_symbol()
    354366            'true'
    355367        """
     
    359371        """
    360372        Returns the Macaulay2 symbol for False.
    361373
    362         EXAMPLES:
     374        EXAMPLES::
     375
    363376            sage: macaulay2._false_symbol()
    364377            'false'
    365378        """
     
    369382        """
    370383        Returns the Macaulay2 symbol for equality.
    371384
    372         EXAMPLES:
     385        EXAMPLES::
     386
    373387            sage: macaulay2._false_symbol()
    374388            'false'
    375389        """
     
    377391
    378392    def cputime(self, t=None):
    379393        """
    380         EXAMPLES:
     394        EXAMPLES::
     395
    381396            sage: R = macaulay2("QQ[x,y]")  #optional
    382397            sage: x,y = R.gens()            #optional
    383398            sage: a = (x+y+1)^20            #optional
     
    394409        """
    395410        Returns the version of Macaulay2.
    396411       
    397         EXAMPLES:
     412        EXAMPLES::
     413
    398414            sage: macaulay2.version() #optional
    399415            (1, 3, 1)
    400416        """
     
    415431        OUTPUT:
    416432            the Macaulay2 ideal generated by the given list of gens
    417433
    418         EXAMPLES:
     434        EXAMPLES::
     435
    419436            sage: R2 = macaulay2.ring('QQ', '[x, y]'); R2            # optional
    420437            QQ[x..y, Degrees => {2:1}, Heft => {1}, MonomialOrder => {MonomialSize => 16}, DegreeRank => 1]
    421438                                                                     {Lex => 2          }
     
    452469        OUTPUT:
    453470            a Macaulay2 ring (with base ring ZZ)
    454471
    455         EXAMPLES:
     472        EXAMPLES::
     473
    456474        This is a ring in variables named a through d over the finite field
    457475        of order 7, with graded reverse lex ordering:
    458476            sage: R1 = macaulay2.ring('ZZ/7', '[a..d]', 'GRevLex');  R1  # optional
     
    478496
    479497    def help(self, s):
    480498        """
    481         EXAMPLES:
     499        EXAMPLES::
     500
    482501            sage: macaulay2.help("load")  # optional
    483502            load -- read Macaulay2 commands
    484503            *******************************
     
    529548        """
    530549        Use the Macaulay2 ring R.
    531550
    532         EXAMPLES:
     551        EXAMPLES::
     552
    533553            sage: R = macaulay2("QQ[x,y]")                  #optional
    534554            sage: P = macaulay2("ZZ/7[symbol x, symbol y]") #optional
    535555            sage: macaulay2("x").cls()                      #optional
     
    551571        Returns a new Macaulay2Element of type type constructed from
    552572        value.
    553573
    554         EXAMPLES:
     574        EXAMPLES::
     575
    555576            sage: l = macaulay2.new_from("MutableList", [1,2,3]) #optional
    556577            sage: l                                              #optional
    557578            MutableList{...3...}
     
    567588class Macaulay2Element(ExpectElement):
    568589    def _latex_(self):
    569590        """
    570         EXAMPLES:
     591        EXAMPLES::
     592
    571593            sage: m = macaulay2('matrix {{1,2},{3,4}}') #optional
    572594            sage: m                                     #optional
    573595            | 1 2 |
     
    581603
    582604    def __iter__(self):
    583605        """
    584         EXAMPLES:
     606        EXAMPLES::
     607
    585608            sage: l = macaulay2([1,2,3]) #optional
    586609            sage: list(iter(l))          #optional
    587610            [1, 2, 3]
     
    591614
    592615    def __str__(self):
    593616        """
    594         EXAMPLES:
     617        EXAMPLES::
     618
    595619            sage: R = macaulay2("QQ[x,y,z]/(x^3-y^3-z^3)") #optional
    596620            sage: x = macaulay2('x')                       #optional
    597621            sage: y = macaulay2('y')                       #optional
     
    613637
    614638    def external_string(self):
    615639        """
    616         EXAMPLES:
     640        EXAMPLES::
     641
    617642           sage: R = macaulay2("QQ[symbol x, symbol y]")  #optional
    618643           sage: R.external_string()                      #optional
    619644           'QQ[x..y, Degrees => {2:1}, Heft => {1}, MonomialOrder => VerticalList{MonomialSize => 32, GRevLex => {2:1}, Position => Up}, DegreeRank => 1]'
     
    632657   
    633658    def __len__(self):
    634659        """
    635         EXAMPLES:
     660        EXAMPLES::
     661
    636662            sage: l = macaulay2([1,2,3])  #optional
    637663            sage: len(l)                  #optional
    638664            3
     
    644670
    645671    def __getitem__(self, n):
    646672        """
    647         EXAMPLES:
     673        EXAMPLES::
     674
    648675            sage: l = macaulay2([1,2,3])  #optional
    649676            sage: l[0]                    #optional
    650677            1
     
    655682
    656683    def __setitem__(self, index, value):
    657684        """
    658         EXAMPLES:
     685        EXAMPLES::
     686
    659687            sage: l = macaulay2.new_from("MutableList", [1,2,3]) #optional
    660688            sage: l[0] = 4               #optional
    661689            sage: list(l)                #optional
     
    671699
    672700    def __call__(self, x):
    673701        """
    674         EXAMPLES:
     702        EXAMPLES::
     703
    675704            sage: R = macaulay2("QQ[x, y]")     #optional
    676705            sage: x,y = R.gens()                #optional
    677706            sage: I = macaulay2.ideal(x*y, x+y) #optional
     
    754783
    755784    def __nonzero__(self):
    756785        """
    757         EXAMPLES:
     786        EXAMPLES::
     787
    758788            sage: a = macaulay2(0)  #optional
    759789            sage: a == 0            #optional
    760790            True
     
    772802        and ** for exponentiation.   This function is primarily
    773803        used internally.
    774804       
    775         EXAMPLES:
     805        EXAMPLES::
     806
    776807            sage: R = macaulay2.ring('QQ','(x,y)')               # optional
    777808            sage: f = macaulay2('x^3 + 3*y^11 + 5')              # optional
    778809            sage: print f                                        # optional
     
    785816
    786817    def structure_sheaf(self):
    787818        """
    788         EXAMPLES:
     819        EXAMPLES::
     820
    789821            sage: S = macaulay2('QQ[a..d]')                     # optional
    790822            sage: R = S/macaulay2('a^3+b^3+c^3+d^3')            # optional
    791823            sage: X = R.Proj()                                  # optional
     
    800832        Note that we have to override the substitute method so that we get
    801833        the default one from Macaulay2 instead of the one provided by Element.
    802834
    803         EXAMPLES:
     835        EXAMPLES::
     836
    804837            sage: R = macaulay2("QQ[x]")            #optional
    805838            sage: P = macaulay2("ZZ/7[symbol x]")   #optional
    806839            sage: x, = R.gens()                     #optional
     
    859892        Macaulay2's class.  In Macaulay2, class corresponds to Sage's
    860893        notion of parent.
    861894
    862         EXAMPLES:
     895        EXAMPLES::
     896
    863897            sage: macaulay2(ZZ).cls()  #optional
    864898            Ring
    865899
     
    871905    ##########################
    872906    def dot(self, x):
    873907        """
    874         EXAMPLES:
     908        EXAMPLES::
     909
    875910            sage: d = macaulay2.new("MutableHashTable") #optional
    876911            sage: d["k"] = 4                            #optional
    877912            sage: d.dot("k")                            #optional
     
    886921        Returns the infix binary operation specified by opstr applied
    887922        to self and x.
    888923
    889         EXAMPLES:
     924        EXAMPLES::
     925
    890926            sage: a = macaulay2("3")     #optional
    891927            sage: a._operator("+", a)    #optional
    892928            6
     
    899935
    900936    def sharp(self, x):
    901937        """
    902         EXAMPLES:
     938        EXAMPLES::
     939
    903940            sage: a = macaulay2([1,2,3]) #optional
    904941            sage: a.sharp(0)             #optional
    905942            1
     
    911948        The binary operator ** in Macaulay2 is usually used for tensor
    912949        or Cartesian power.
    913950       
    914         EXAMPLES:
     951        EXAMPLES::
     952
    915953            sage: a = macaulay2([1,2]).set()  #optional
    916954            sage: a.starstar(a)               #optional
    917955            set {(1, 1), (1, 2), (2, 1), (2, 2)}
     
    921959
    922960    def underscore(self, x):
    923961        """
    924         EXAMPLES:
     962        EXAMPLES::
     963
    925964            sage: a = macaulay2([1,2,3])  #optional
    926965            sage: a.underscore(0)         #optional
    927966            1
     
    933972    ####################
    934973    def to_sage(self):
    935974        """
    936         EXAMPLES:
     975        EXAMPLES::
     976
    937977            sage: macaulay2(ZZ).to_sage()      #optional
    938978            Integer Ring
    939979            sage: macaulay2(QQ).to_sage()      #optional
     
    11041144class Macaulay2Function(ExpectFunction):
    11051145    def _sage_doc_(self):
    11061146        """
    1107         EXAMPLES:
     1147        EXAMPLES::
     1148
    11081149            sage: print macaulay2.load._sage_doc_()  # optional
    11091150            load -- read Macaulay2 commands
    11101151            *******************************
     
    11161157
    11171158    def _sage_src_(self):
    11181159        """
    1119         EXAMPLES:
     1160        EXAMPLES::
     1161
    11201162            sage: print macaulay2.gb._sage_src_() #optional
    11211163            code(methods gb)
    11221164            ...
     
    11321174
    11331175def is_Macaulay2Element(x):
    11341176    """
    1135     EXAMPLES:
     1177    EXAMPLES::
     1178
    11361179        sage: from sage.interfaces.macaulay2 import is_Macaulay2Element
    11371180        sage: is_Macaulay2Element(2)              #optional
    11381181        False
     
    11501193    """
    11511194    Spawn a new M2 command-line session.
    11521195
    1153     EXAMPLES:
     1196    EXAMPLES::
     1197
    11541198        sage: macaulay2_console()                    # not tested
    11551199        Macaulay 2, version 1.1
    11561200        with packages: Classic, Core, Elimination, IntegralClosure, LLLBases, Parsing, PrimaryDecomposition, SchurRings, TangentCone
     
    11651209    """
    11661210    Used for reconstructing a copy of the Macaulay2 interpreter from a pickle.
    11671211   
    1168     EXAMPLES:
     1212    EXAMPLES::
     1213
    11691214        sage: from sage.interfaces.macaulay2 import reduce_load_macaulay2
    11701215        sage: reduce_load_macaulay2()
    11711216        Macaulay2
  • sage/interfaces/magma_free.py

    diff --git a/sage/interfaces/magma_free.py b/sage/interfaces/magma_free.py
    a b  
    2525    LIMITATIONS: The code must evaluate in at most 20 seconds
    2626    and there is a limitation on the amount of RAM.
    2727
    28     EXAMPLES:
     28    EXAMPLES::
     29
    2930        sage: magma_free("Factorization(9290348092384)")  # optional - internet
    3031        [ <2, 5>, <290323377887, 1> ]
    3132    """
     
    6768    Evaluate MAGMA code without requiring that MAGMA be installed
    6869    on your computer by using the free online MAGMA calculator.
    6970
    70     EXAMPLES:
     71    EXAMPLES::
     72
    7173        sage: magma_free("Factorization(9290348092384)")  # optional - internet
    7274        [ <2, 5>, <290323377887, 1> ]
    7375    """
  • sage/interfaces/mupad.py

    diff --git a/sage/interfaces/mupad.py b/sage/interfaces/mupad.py
    a b  
    108108        """
    109109        Create an instance of the MuPAD interpreter.
    110110
    111         EXAMPLES:
     111        EXAMPLES::
     112
    112113            sage: mupad == loads(dumps(mupad))                      # optional - mupad
    113114            True
    114115        """
     
    130131
    131132    def _function_class(self):
    132133        """
    133         EXAMPLES:
     134        EXAMPLES::
     135
    134136            sage: mupad._function_class()
    135137            <class 'sage.interfaces.mupad.MupadFunction'>
    136138
     
    143145
    144146    def __reduce__(self):
    145147        """
    146         EXAMPLES:
     148        EXAMPLES::
     149
    147150            sage: mupad.__reduce__()
    148151            (<function reduce_load_mupad at 0x...>, ())
    149152
     
    152155
    153156    def _read_in_file_command(self, filename):
    154157        """
    155         EXAMPLES:
     158        EXAMPLES::
     159
    156160            sage: mupad._read_in_file_command('test')
    157161            'read("test")'
    158162
     
    169173       
    170174    def _quit_string(self):
    171175        """
    172         EXAMPLES:
     176        EXAMPLES::
     177
    173178            sage: mupad._quit_string()
    174179            'quit'
    175180        """
     
    179184        """
    180185        Hints for installing MuPAD on your computer.
    181186
    182         EXAMPLES:
     187        EXAMPLES::
     188
    183189            sage: print mupad._install_hints()
    184190            <BLANKLINE>
    185191            In order to use the MuPAD interface you need to have MuPAD installed
     
    201207
    202208    def expect(self):
    203209        """
    204         EXAMPLES:
     210        EXAMPLES::
     211
    205212            sage: a = mupad(1)   # optional - mupad
    206213            sage: mupad.expect() # optional - mupad
    207214            <pexpect.spawn instance at 0x...>
     
    212219        """
    213220        Spawn a new MuPAD command-line session.
    214221
    215         EXAMPLES:
     222        EXAMPLES::
     223
    216224            sage: mupad.console() #not tested
    217225
    218226               *----*    MuPAD Pro 4.0.2 -- The Open Computer Algebra System
     
    227235
    228236    def eval(self, code, strip=True, **kwds):
    229237        """
    230         EXAMPLES:
     238        EXAMPLES::
     239
    231240            sage: mupad.eval('2+2')   # optional - mupad
    232241                                                   4
    233242
     
    238247    def _eval_line(self, line, allow_use_file=True, wait_for_prompt=True,
    239248                   need_output=True, restart_if_needed=False):
    240249        """
    241         EXAMPLES:
     250        EXAMPLES::
     251
    242252            sage: mupad._eval_line('2+2')  # optional - mupad
    243253            '                                       4'
    244254            sage: mupad._eval_line('x::asdf') # optional - mupad
     
    278288
    279289    def cputime(self, t=None):
    280290        """
    281         EXAMPLES:
     291        EXAMPLES::
     292
    282293            sage: t = mupad.cputime() #random, optional - MuPAD
    283294            0.11600000000000001
    284295        """
     
    291302        """
    292303        Set the variable var to the given value.
    293304
    294         EXAMPLES:
     305        EXAMPLES::
     306
    295307            sage: mupad.set('a', 4) # optional - mupad
    296308            sage: mupad.get('a').strip() # optional - mupad
    297309            '4'
     
    306318        """
    307319        Get the value of the variable var.
    308320
    309         EXAMPLES:
     321        EXAMPLES::
     322
    310323            sage: mupad.set('a', 4) # optional - mupad
    311324            sage: mupad.get('a').strip() # optional - mupad
    312325            '4'
     
    318331
    319332    def _object_class(self):
    320333        """
    321         EXAMPLES:
     334        EXAMPLES::
     335
    322336            sage: mupad._object_class()
    323337            <class 'sage.interfaces.mupad.MupadElement'>
    324338        """
     
    326340
    327341    def _equality_symbol(self):
    328342        """
    329         EXAMPLES:
     343        EXAMPLES::
     344
    330345            sage: mupad._equality_symbol()
    331346            '='
    332347        """
     
    334349
    335350    def _assign_symbol(self):
    336351        """
    337         EXAMPLES:
     352        EXAMPLES::
     353
    338354            sage: mupad._assign_symbol()
    339355            ':='
    340356        """
     
    342358
    343359    def _continuation_prompt(self):
    344360        """
    345         EXAMPLES:
     361        EXAMPLES::
     362
    346363            sage: mupad._continuation_prompt()
    347364            '&>'
    348365        """
     
    352369        """
    353370        Return list of all commands defined in MuPAD.
    354371
    355         EXAMPLES:
     372        EXAMPLES::
     373
    356374            sage: cmds = mupad._commands()  # optional - mupad
    357375            sage: len(cmds) > 100 # optional - mupad
    358376            True
     
    373391
    374392    def trait_names(self, verbose=True, use_disk_cache=True):
    375393        """
    376         EXAMPLES:
     394        EXAMPLES::
     395
    377396            sage: names = mupad.trait_names() # optional - mupad
    378397            sage: len(names) > 100 # optional - mupad
    379398            True
     
    403422
    404423    def completions(self, string, strip=False):
    405424        """
    406         EXAMPLES:
     425        EXAMPLES::
     426
    407427            sage: mupad.completions('linal') # optional - mupad
    408428            ['linalg']
    409429        """
     
    422442class MupadFunction(ExpectFunction):
    423443    def _sage_doc_(self):
    424444        """
    425         EXAMPLES:
     445        EXAMPLES::
     446
    426447            sage: mupad.diff._sage_doc_()
    427448            No help on diff available
    428449        """
     
    431452   
    432453    def __getattr__(self, attrname):
    433454        """
    434         EXAMPLES:
     455        EXAMPLES::
     456
    435457            sage: mupad.linalg.addRow
    436458            linalg::addRow
    437459        """
     
    441463
    442464    def trait_names(self):
    443465        """
    444         EXAMPLES:
     466        EXAMPLES::
     467
    445468            sage: mupad.linalg.trait_names() # optional - mupad
    446469            ['addCol',
    447470             'addRow',
     
    455478class MupadFunctionElement(FunctionElement):
    456479    def _sage_doc_(self):
    457480        """
    458         EXAMPLES:
     481        EXAMPLES::
     482
    459483            sage: x = mupad('x') # optional - mupad
    460484            sage: x.diff._sage_doc_() # optional - mupad
    461485            No help on diff available
     
    465489
    466490    def __getattr__(self, attrname):
    467491        """
    468         EXAMPLES:
     492        EXAMPLES::
     493
    469494            sage: mupad.package('"MuPAD-Combinat"')  # optional - mupad-Combinat
    470495            sage: combinat = mupad.combinat          # optional - mupad-Combinat
    471496            sage: three = mupad(3)                   # optional - mupad-Combinat
     
    489514
    490515    def trait_names(self):
    491516        """
    492         EXAMPLES:
     517        EXAMPLES::
     518
    493519            sage: three = mupad(3) # optional - mupad
    494520            sage: 'list' in three.combinat.tableaux.trait_names() #optional
    495521            True
     
    501527
    502528    def __call__(self, *args):
    503529        """
    504         EXAMPLES:
     530        EXAMPLES::
     531
    505532            sage: mupad.package('"MuPAD-Combinat"') # optional - mupad-Combinat
    506533            sage: combinat = mupad.combinat         # optional - mupad-Combinat
    507534            sage: examples = mupad.examples         # optional - mupad-Combinat
     
    520547class MupadElement(ExpectElement):
    521548    def __getattr__(self, attrname):
    522549        """
    523         EXAMPLES:
     550        EXAMPLES::
     551
    524552            sage: mupad.package('"MuPAD-Combinat"') # optional - mupad-Combinat
    525553            sage: S = mupad.examples.SymmetricFunctions() #optional
    526554            sage: type(S)                           # optional - mupad-Combinat
     
    555583
    556584    def trait_names(self):
    557585        """
    558         EXAMPLES:
     586        EXAMPLES::
     587
    559588            sage: mupad.package('"MuPAD-Combinat"')       # optional - mupad-Combinat
    560589            sage: S = mupad.examples.SymmetricFunctions() # optional - mupad-Combinat
    561590            sage: 'HallLittlewood' in S.trait_names()     # optional - mupad-Combinat
     
    566595
    567596    def __repr__(self):
    568597        """
    569         EXAMPLES:
     598        EXAMPLES::
     599
    570600            sage: mupad.package('"MuPAD-Combinat"')  # optional - mupad-Combinat
    571601            sage: S = mupad.examples.SymmetricFunctions(); S # optional - mupad-Combinat
    572602            examples::SymmetricFunctions(Dom::ExpressionField())
     
    576606
    577607    def _latex_(self):
    578608        r"""
    579         EXAMPLES:
     609        EXAMPLES::
     610
    580611            sage: mupad.package('"MuPAD-Combinat"') # optional - mupad-Combinat
    581612            sage: S = mupad.examples.SymmetricFunctions() # optional - mupad-Combinat
    582613            sage: latex(S) # optional - mupad-Combinat
     
    622653
    623654def reduce_load_mupad():
    624655    """
    625     EXAMPLES:
     656    EXAMPLES::
     657
    626658        sage: from sage.interfaces.mupad import reduce_load_mupad
    627659        sage: reduce_load_mupad()
    628660        Mupad
     
    634666    """
    635667    Spawn a new MuPAD command-line session.
    636668
    637     EXAMPLES:
     669    EXAMPLES::
     670
    638671        sage: from sage.interfaces.mupad import mupad_console
    639672        sage: mupad_console() #not tested
    640673
     
    651684
    652685def __doctest_cleanup():
    653686    """
    654     EXAMPLES:
     687    EXAMPLES::
     688
    655689        sage: from sage.interfaces.mupad import __doctest_cleanup
    656690        sage: m = mupad(2)         # optional - mupad
    657691        sage: mupad.is_running()   # optional - mupad
  • sage/interfaces/scilab.py

    diff --git a/sage/interfaces/scilab.py b/sage/interfaces/scilab.py
    a b  
    196196    """
    197197    Interface to the Scilab interpreter.
    198198
    199     EXAMPLES:
     199    EXAMPLES::
     200
    200201        sage: a = scilab('[ 1, 1, 2; 3, 5, 8; 13, 21, 33 ]')    # optional - scilab
    201202        sage: b = scilab('[ 1; 3; 13]')                         # optional - scilab
    202203        sage: c = a * b                                         # optional - scilab
     
    210211        """
    211212        Initializes the Scilab class.
    212213
    213         EXAMPLES:
     214        EXAMPLES::
     215
    214216            sage: from sage.interfaces.scilab import Scilab
    215217            sage: sci_obj = Scilab(script_subdirectory='user')  # optional - scilab
    216218            sage: del sci_obj                                   # optional - scilab
     
    232234        """
    233235        Returns the string used to quit the pexpect interface.
    234236
    235         EXAMPLES:
     237        EXAMPLES::
     238
    236239            sage: scilab._quit_string()                 # optional - scilab
    237240            'quit;'
    238241        """
     
    242245        """
    243246        Hints for installing Scilab.
    244247
    245         EXAMPLES:
     248        EXAMPLES::
     249
    246250            sage: print scilab._install_hints()               # optional - scilab
    247251            You must ...
    248252        """
     
    257261        """
    258262        Starts Scilab and sets some options.
    259263
    260         EXAMPLES:
     264        EXAMPLES::
     265
    261266            sage: scilab._start()                       # optional - scilab
    262267        """
    263268        Expect._start(self)
     
    267272        """
    268273        Evaluates commands.
    269274
    270         EXAMPLES:
     275        EXAMPLES::
     276
    271277            sage: scilab.eval("5")                      # optional - scilab
    272278            'ans  =\n \n    5.'
    273279            sage: scilab.eval("d=44")                   # optional - scilab
     
    283289        nam: first characters of selected names
    284290        typ: name of selected Scilab variable type
    285291
    286         EXAMPLES:
     292        EXAMPLES::
     293
    287294            sage: scilab.whos("core")                   # optional - scilab
    288295            'Name                     Type           Size           Bytes...'
    289296            sage: scilab.whos(typ='function')           # optional - scilab
     
    300307        """
    301308        Set the variable var to the given value.
    302309       
    303         EXAMPLES:
     310        EXAMPLES::
     311
    304312            sage: scilab.set('a', 123)        # optional - scilab
    305313            sage: scilab.get('a')               # optional - scilab
    306314            '\n \n    123.'
     
    314322        """
    315323        Get the value of the variable var.
    316324       
    317         EXAMPLES:
     325        EXAMPLES::
     326
    318327            sage: scilab.eval('b=124;')                 # optional - scilab
    319328            ''
    320329            sage: scilab.get('b')                       # optional - scilab
     
    328337        """
    329338        Starts Scilab console.
    330339
    331         EXAMPLES:
     340        EXAMPLES::
     341
    332342            sage: scilab.console()          # optional - scilab; not tested
    333343
    334344        """
     
    338348        """
    339349        Returns the version of the Scilab software used.
    340350
    341         EXAMPLES:
     351        EXAMPLES::
     352
    342353            sage: scilab.version()                      # optional - scilab
    343354            'scilab-...'
    344355        """
     
    354365        OUTPUT:
    355366            A string that evaluates to an Scilab matrix.
    356367
    357         EXAMPLES:
     368        EXAMPLES::
     369
    358370            sage: M33 = MatrixSpace(QQ,3,3)             # optional - scilab
    359371            sage: A = M33([1,2,3,4,5,6,7,8,0])          # optional - scilab
    360372            sage: scilab.sage2scilab_matrix_string(A)   # optional - scilab
     
    367379        """
    368380        Returns the class of the object.
    369381
    370         EXAMPLES:
     382        EXAMPLES::
     383
    371384            sage: scilab._object_class()                # optional - scilab
    372385            <class 'sage.interfaces.scilab.ScilabElement'>
    373386            sage: type(scilab(2))                       # optional - scilab
     
    381394        """
    382395        Use parenthesis for Scilab matrices instead.
    383396
    384         EXAMPLES:
     397        EXAMPLES::
     398
    385399            sage: M = scilab('[1,2,3;4,5,6;7,8,9]')     # optional - scilab
    386400            sage: M[1]                                  # optional - scilab
    387401            1.
     
    400414        """
    401415        Sets an element of a matrix.
    402416
    403         EXAMPLES:
     417        EXAMPLES::
     418
    404419            sage: M = scilab('[1,2,3;4,5,6;7,8,9]')     # optional - scilab
    405420            sage: M[6] = 0                              # optional - scilab
    406421            sage: M                                     # optional - scilab
     
    423438        r"""
    424439        Return \sage matrix from this scilab element.
    425440
    426         EXAMPLES:
     441        EXAMPLES::
     442
    427443            sage: A = scilab('[1,2;3,4]')       # optional - scilab
    428444            sage: matrix(ZZ, A)                 # optional - scilab
    429445            [1 2]
     
    449465        """
    450466        Set the variable var to the given value.
    451467       
    452         EXAMPLES:
     468        EXAMPLES::
     469
    453470            sage: scilab.set('c', 125)          # optional - scilab
    454471            sage: scilab.get('c')               # optional - scilab
    455472            '\n \n    125.'
     
    469486    This requires that the optional Scilab program be installed and in
    470487    your PATH, but no optional Sage packages need to be installed.
    471488   
    472     EXAMPLES:
     489    EXAMPLES::
     490
    473491        sage: from sage.interfaces.scilab import scilab_console # optional - scilab
    474492        sage: scilab_console()                               # optional - scilab; not tested
    475493                ___________________________________________       
     
    502520    """
    503521    Return the version of Scilab installed.
    504522   
    505     EXAMPLES:
     523    EXAMPLES::
     524
    506525        sage: from sage.interfaces.scilab import scilab_version # optional - scilab
    507526        sage: scilab_version()    # optional - scilab
    508527        'scilab-...'
  • sage/libs/pari/gen_py.py

    diff --git a/sage/libs/pari/gen_py.py b/sage/libs/pari/gen_py.py
    a b  
    112112    t_REAL:   ComplexField(prec) for equivalent precision
    113113    t_INTMOD, t_PADIC: raise NotImplementedError
    114114
    115     EXAMPLES:
     115    EXAMPLES::
     116
    116117        sage: a = pari('(3+I)').python(); a
    117118        i + 3
    118119        sage: a.parent()
  • sage/logic/boolformula.py

    diff --git a/sage/logic/boolformula.py b/sage/logic/boolformula.py
    a b  
    1010    AUTHORS:
    1111        -- Chris Gorecki
    1212   
    13     EXAMPLES:
     13    EXAMPLES::
     14
    1415        sage: import sage.logic.propcalc as propcalc
    1516        sage: f = propcalc.formula("a&((b|c)^a->c)<->b")
    1617        sage: g = propcalc.formula("boolean<->algebra")
    1718        sage: (f&~g).ifthen(f)
    1819        ((a&((b|c)^a->c)<->b)&(~(boolean<->algebra)))->(a&((b|c)^a->c)<->b)
    1920       
    20      EXAMPLES:
     21     EXAMPLES::
     22
    2123        sage: import sage.logic.propcalc as propcalc
    2224        sage: f = propcalc.formula("a&((b|c)^a->c)<->b")
    2325        sage: g = propcalc.formula("boolean<->algebra")
     
    152154            Effectively returns an instance of this class.
    153155
    154156        EXAMPLES:
    155         This example illustrates the creation of a statement.
     157        This example illustrates the creation of a statement.::
     158
    156159            sage: import sage.logic.propcalc as propcalc
    157160            sage: s = propcalc.formula("a&b|~(c|a)")
    158161            sage: s
     
    176179        OUTPUT:
    177180            Returns the string representation of this statement.
    178181
    179         EXAMPLES:
     182        EXAMPLES::
     183
    180184            sage: import sage.logic.propcalc as propcalc
    181185            sage: propcalc.formula("man->monkey&human")
    182186            man->monkey&human
     
    193197        OUTPUT:
    194198            Returns the latex representation of this statement.
    195199
    196         EXAMPLES:
     200        EXAMPLES::
     201
    197202            sage: import sage.logic.propcalc as propcalc
    198203            sage: s = propcalc.formula("man->monkey&human")
    199204            sage: latex(s)
     
    218223        OUTPUT:
    219224            A list containing the parse tree of self.
    220225
    221         EXAMPLES:
     226        EXAMPLES::
     227
    222228            sage: import sage.logic.propcalc as propcalc
    223229            sage: s = propcalc.formula("man -> monkey & human")
    224230            sage: s.tree()
     
    243249        OUTPUT:
    244250            Returns a new statement that is the first statement logically
    245251                or'ed together.
    246         EXAMPLES:
     252        EXAMPLES::
     253
    247254            sage: import sage.logic.propcalc as propcalc
    248255            sage: s = propcalc.formula("a&b")
    249256            sage: f = propcalc.formula("c^d")
     
    264271            Returns a new statement that is the first statement logically
    265272            and'ed together.
    266273       
    267         EXAMPLES:
     274        EXAMPLES::
     275
    268276            sage: import sage.logic.propcalc as propcalc
    269277            sage: s = propcalc.formula("a&b")
    270278            sage: f = propcalc.formula("c^d")
     
    285293            Returns a new statement that is the first statement logically
    286294            xor'ed together.
    287295 
    288         EXAMPLES:
     296        EXAMPLES::
     297
    289298            sage: import sage.logic.propcalc as propcalc
    290299            sage: s = propcalc.formula("a&b")
    291300            sage: f = propcalc.formula("c^d")
     
    306315            Returns a new statement that is the first statement logically
    307316            xor'ed together.
    308317 
    309         EXAMPLES:
     318        EXAMPLES::
     319
    310320            sage: import sage.logic.propcalc as propcalc
    311321            sage: s = propcalc.formula("a&b")
    312322            sage: f = propcalc.formula("c^d")
     
    327337            Returns a new statement that is the first statement logically
    328338            not'ed.
    329339     
    330         EXAMPLES:
     340        EXAMPLES::
     341
    331342            sage: import sage.logic.propcalc as propcalc
    332343            sage: s = propcalc.formula("a&b")
    333344            sage: ~s
     
    349360            Returns a new statement that is the first statement logically
    350361            ifthen'ed together.
    351362
    352        EXAMPLES:
     363       EXAMPLES::
     364
    353365           sage: import sage.logic.propcalc as propcalc
    354366           sage: s = propcalc.formula("a&b")
    355367           sage: f = propcalc.formula("c^d")
     
    370382            Returns a new statement that is the first statement logically
    371383            ifandonlyif'ed together.
    372384
    373         EXAMPLES:
     385        EXAMPLES::
     386
    374387            sage: import sage.logic.propcalc as propcalc
    375388            sage: s = propcalc.formula("a&b")
    376389            sage: f = propcalc.formula("c^d")
     
    392405            Returns true if the left hand side is equivalent to the
    393406            right hand side, and false otherwise.
    394407 
    395         EXAMPLES:
     408        EXAMPLES::
     409
    396410            sage: import sage.logic.propcalc as propcalc
    397411            sage: f = propcalc.formula("(a|b)&c")
    398412            sage: g = propcalc.formula("c&(b|a)")
     
    429443            tacked on the front) corresponding to the statement.
    430444   
    431445        EXAMPLES:
    432         This example illustrates the creation of a statement.
     446        This example illustrates the creation of a statement.::
     447
    433448            sage: import sage.logic.propcalc as propcalc
    434449            sage: s = propcalc.formula("a&b|~(c|a)")
    435450            sage: s.truthtable()
     
    501516            Return the evaluation of the formula with the given
    502517            inputs, either True or False.
    503518
    504         EXAMPLES:
     519        EXAMPLES::
     520
    505521            sage: import sage.logic.propcalc as propcalc
    506522            sage: f = propcalc.formula("a&b|c")
    507523            sage: f.evaluate({'a':False, 'b':False, 'c':True})
     
    522538        OUTPUT:
    523539            True if the formula can be satisfied, False otherwise.
    524540
    525         EXAMPLES:
     541        EXAMPLES::
     542
    526543            sage: import sage.logic.propcalc as propcalc
    527544            sage: f = propcalc.formula("a|b")
    528545            sage: f.is_satisfiable()
     
    548565        OUTPUT:
    549566            True if the formula is a tautology, False otherwise.
    550567
    551         EXAMPLES:
     568        EXAMPLES::
     569
    552570            sage: import sage.logic.propcalc as propcalc
    553571            sage: f = propcalc.formula("a|~a")
    554572            sage: f.is_tautology()
     
    574592        OUTPUT:
    575593            True if the formula is a contradiction, False otherwise.
    576594
    577         EXAMPLES:
     595        EXAMPLES::
     596
    578597            sage: import sage.logic.propcalc as propcalc
    579598            sage: f = propcalc.formula("a&~a")
    580599            sage: f.is_contradiction()
     
    601620            True if the two formulas are logically equivalent, False
    602621            otherwise.
    603622
    604         EXAMPLES:
     623        EXAMPLES::
     624
    605625            sage: import sage.logic.propcalc as propcalc
    606626            sage: f = propcalc.formula("(a|b)&c")
    607627            sage: g = propcalc.formula("c&(a|b)")
     
    686706            An instance of boolformula with an identical truth table that is in
    687707            conjunctive normal form.
    688708
    689         EXAMPLES:
     709        EXAMPLES::
     710
    690711            sage: import sage.logic.propcalc as propcalc
    691712            sage: s = propcalc.formula("a^b<->c")
    692713            sage: s.convert_cnf_recur()
     
    716737        OUTPUT:
    717738            A string representing the satformat representation of this object.
    718739
    719         EXAMPLES:       
     740        EXAMPLES::
     741
    720742            sage: import sage.logic.propcalc as propcalc
    721743            sage: f = propcalc.formula("a&((b|c)^a->c)<->b")
    722744            sage: f.convert_cnf()
     
    776798#        OUTPUT:
    777799#            A simplified expression.
    778800#
    779 #        EXAMPLES:     
     801#        EXAMPLES::
     802#     
    780803#            sage: import sage.logic.propcalc as propcalc
    781804#            sage: f = propcalc.formula("a&((b|c)^a->c)<->b")
    782805#            sage: f.truthtable()
     
    845868        OUTPUT:
    846869            A tree branch that does not contain ^, ->, or <-> operators.       
    847870               
    848         EXAMPLES:
     871        EXAMPLES::
     872
    849873            sage: import sage.logic.propcalc as propcalc, sage.logic.logicparser as logicparser
    850874            sage: s = propcalc.formula("a&(b|~c)")
    851875            sage: tree = ['&', 'a', ['|', 'b', ['~', 'c', None]]]
     
    882906            Returns a new statement that is the first statement attached to
    883907            the second statement by the operator op.
    884908
    885         EXAMPLES:
     909        EXAMPLES::
     910
    886911            sage: import sage.logic.propcalc as propcalc
    887912            sage: s = propcalc.formula("a&b")
    888913            sage: f = propcalc.formula("c^d")
     
    911936        OUTPUT:
    912937            returns True if bit c of number x is 1, False otherwise.
    913938 
    914         EXAMPLES:
     939        EXAMPLES::
     940
    915941            sage: import sage.logic.propcalc as propcalc
    916942            sage: s = propcalc.formula("a&b")
    917943            sage: s.get_bit(2, 1)
     
    956982        OUTPUT:
    957983            A tree branch that does not contain ^, ->, or <-> operators.       
    958984               
    959         EXAMPLES:
     985        EXAMPLES::
     986
    960987            sage: import sage.logic.propcalc as propcalc, sage.logic.logicparser as logicparser
    961988            sage: s = propcalc.formula("a->b^c")
    962989            sage: tree = ['->', 'a', ['^', 'b', 'c']]
     
    9901017        OUTPUT:
    9911018            A tree branch that does not contain un-distributed nots.       
    9921019
    993         EXAMPLES:
     1020        EXAMPLES::
     1021
    9941022            sage: import sage.logic.propcalc as propcalc, sage.logic.logicparser as logicparser
    9951023            sage: s = propcalc.formula("~(a&b)")
    9961024            sage: tree = ['~', ['&', 'a', 'b'], None]
     
    10231051        OUTPUT:
    10241052            A tree branch that does not contain un-distributed ors.       
    10251053   
    1026         EXAMPLES:
     1054        EXAMPLES::
     1055
    10271056            sage: import sage.logic.propcalc as propcalc, sage.logic.logicparser as logicparser
    10281057            sage: s = propcalc.formula("(a&b)|(a&c)")
    10291058            sage: tree = ['|', ['&', 'a', 'b'], ['&', 'a', 'c']]
     
    10521081        OUTPUT:
    10531082            A tree branch in infix form.       
    10541083
    1055         EXAMPLES:
     1084        EXAMPLES::
     1085
    10561086            sage: import sage.logic.propcalc as propcalc, sage.logic.logicparser as logicparser
    10571087            sage: s = propcalc.formula("(a&b)|(a&c)")
    10581088            sage: tree = ['|', ['&', 'a', 'b'], ['&', 'a', 'c']]
     
    10751105        OUTPUT:
    10761106            None.
    10771107
    1078         EXAMPLES:
     1108        EXAMPLES::
     1109
    10791110            sage: import sage.logic.propcalc as propcalc
    10801111            sage: s = propcalc.formula("a^b<->c")
    10811112            sage: s.convert_cnf_recur(); s  #long time
     
    11171148        OUTPUT:
    11181149            The next operator in the string.
    11191150
    1120         EXAMPLES:
     1151        EXAMPLES::
     1152
    11211153            sage: import sage.logic.propcalc as propcalc
    11221154            sage: s = propcalc.formula("f&p")
    11231155            sage: s.get_next_op("abra|cadabra")
  • sage/logic/logic.py

    diff --git a/sage/logic/logic.py b/sage/logic/logic.py
    a b  
    3333class SymbolicLogic:
    3434    """
    3535
    36     EXAMPLES:
     36    EXAMPLES::
     37
    3738        sage: log = SymbolicLogic()
    3839        sage: s = log.statement("a&b|!(c|a)")
    3940        sage: t = log.truthtable(s)
     
    6768            and a list of the variable names in the order they were found
    6869
    6970        EXAMPLES:
    70         This example illustrates the creation of a statement.
     71        This example illustrates the creation of a statement.::
     72
    7173            sage: log = SymbolicLogic()
    7274            sage: s = log.statement("a&b|!(c|a)")
    7375
     
    123125            tacked on the front) corresponding to the statement
    124126
    125127        EXAMPLES:
    126         This example illustrates the creation of a statement.
     128        This example illustrates the creation of a statement.::
     129
    127130            sage: log = SymbolicLogic()
    128131            sage: s = log.statement("a&b|!(c|a)")
    129132            sage: t = log.truthtable(s) #creates the whole truth table
     
    178181            the truthtable (which is basically a 2-d array).
    179182
    180183        EXAMPLES:
    181         This example illustrates the creation of a statement.
     184        This example illustrates the creation of a statement.::
     185
    182186            sage: log = SymbolicLogic()
    183187            sage: s = log.statement("a&b|!(c|a)")
    184188            sage: t = log.truthtable(s) #creates the whole truth table
  • sage/logic/logicparser.py

    diff --git a/sage/logic/logicparser.py b/sage/logic/logicparser.py
    a b  
    55AUTHORS:
    66    -- Chris Gorecki
    77
    8 EXAMPLES:
     8EXAMPLES::
     9
    910    sage: import sage.logic.logicparser as logicparser
    1011    sage: s = 'a|b&c'
    1112    sage: t = logicparser.parse(s)
     
    2930    OUTPUT:       
    3031        Returns the tuple (parse tree of s, variables in s).
    3132   
    32     EXAMPLES:
     33    EXAMPLES::
     34
    3335        sage: import sage.logic.logicparser as logicparser
    3436        sage: s = 'a|b&c'
    3537        sage: t = logicparser.parse(s)
     
    5355    OUTPUT:       
    5456        Returns a tuple consisting of (tokens in s, variables in s).
    5557   
    56     EXAMPLES:
     58    EXAMPLES::
     59
    5760        sage: import sage.logic.logicparser as logicparser
    5861        sage: s = 'a|b&c'
    5962        sage: t = logicparser.tokenize(s)
     
    119122    OUTPUT:       
    120123        Returns a parse tree of the tokens toks.
    121124   
    122     EXAMPLES:
     125    EXAMPLES::
     126
    123127        sage: import sage.logic.logicparser as logicparser
    124128        sage: t = ['(', 'a', '|', 'b', '&', 'c', ')']
    125129        sage: logicparser.tree_parse(t)
     
    150154    OUTPUT:       
    151155        Returns a parse tree of the tokens toks.
    152156   
    153     EXAMPLES:
     157    EXAMPLES::
     158
    154159        sage: import sage.logic.logicparser as logicparser
    155160        sage: t = ['a', '|', 'b', '&', 'c']
    156161        sage: logicparser.parse_ltor(t)
     
    194199        Returns a parse tree after func has been applied
    195200        to it.
    196201
    197     EXAMPLES:
     202    EXAMPLES::
     203
    198204        sage: import sage.logic.logicparser as logicparser
    199205        sage: t = ['|', ['&', 'a', 'b'], ['&', 'a', 'c']]
    200206        sage: f = lambda t: t
  • sage/matrix/matrix_integer_dense_hnf.py

    diff --git a/sage/matrix/matrix_integer_dense_hnf.py b/sage/matrix/matrix_integer_dense_hnf.py
    a b  
    5757    OUTPUT:
    5858        A triple (det bound, new z_so_far, new N_so_far).
    5959       
    60     EXAMPLES:
     60    EXAMPLES::
     61
    6162        sage: a = matrix(ZZ, 3, [6, 1, 2, -56, -2, -1, -11, 2, -3])
    6263        sage: factor(a.det())
    6364        -1 * 13 * 29
     
    231232    OUTPUT:
    232233        a pair of two integers.
    233234
    234     EXAMPLES:
     235    EXAMPLES::
     236
    235237        sage: from sage.matrix.matrix_integer_dense_hnf import double_det
    236238        sage: A = matrix(ZZ, 2, 3, [1,2,3, 4,-2,5])
    237239        sage: b = matrix(ZZ, 1, 3, [1,-2,5])
     
    283285    OUTPUT:
    284286        x   -- a vector such that H' = H_B.augment(x) is the HNF of A = B.augment(a).
    285287
    286     EXAMPLES:
     288    EXAMPLES::
     289
    287290        sage: B = matrix(ZZ,3, [-1, -1, 1, -3, 8, -2, -1, -1, -1])
    288291        sage: a = matrix(ZZ,3,1, [1,2,3])
    289292        sage: import sage.matrix.matrix_integer_dense_hnf as matrix_integer_dense_hnf
     
    321324    OUTPUT:
    322325        the unique solution to B*x = a.
    323326
    324     EXAMPLES:
     327    EXAMPLES::
     328
    325329        sage: from sage.matrix.matrix_integer_dense_hnf import solve_system_with_difficult_last_row
    326330        sage: B = matrix(ZZ, 3, [1,2,4, 3,-4,7, 939082,2930982,132902384098234])
    327331        sage: a = matrix(ZZ,3,1, [1,2,5])
     
    402406    OUTPUT:
    403407        x   -- a vector such that H' = H_B.augment(x) is the HNF of A = B.augment(a).
    404408
    405     EXAMPLES:
     409    EXAMPLES::
     410
    406411        sage: B = matrix(ZZ, 3, 3, [1,2,5, 0,-5,3, 1,1,2])
    407412        sage: H_B = B.echelon_form()
    408413        sage: a = matrix(ZZ, 3, 1, [1,8,-2])
     
    448453        H -- the Hermite normal form of A.stack(b).
    449454        new_pivots -- the pivot columns of H.
    450455
    451     EXAMPLES:
     456    EXAMPLES::
     457
    452458        sage: import sage.matrix.matrix_integer_dense_hnf as hnf
    453459        sage: A = matrix(ZZ, 2, 3, [-21, -7, 5, 1,20,-7])
    454460        sage: b = matrix(ZZ, 1,3, [-1,1,-1])
     
    481487    OUTPUT:
    482488        list -- list of pivots
    483489
    484     EXAMPLES:
     490    EXAMPLES::
     491
    485492        sage: H = matrix(ZZ, 3, 5, [1, 0, 0, 45, -36, 0, 1, 0, 131, -107, 0, 0, 0, 178, -145]); H
    486493        [   1    0    0   45  -36]
    487494        [   0    1    0  131 -107]
     
    510517    OUTPUT:
    511518        the Hermite normal form of A.
    512519
    513     EXAMPLES:
     520    EXAMPLES::
     521
    514522        sage: import sage.matrix.matrix_integer_dense_hnf as hnf
    515523        sage: A = matrix(ZZ, 3, [-21, -7, 5, 1,20,-7, -1,1,-1])
    516524        sage: hnf.hnf_square(A, False)
     
    603611        of A at the positions specified by cols1 and the
    604612        columns of B at the positions specified by cols2.
    605613
    606     EXAMPLES:
     614    EXAMPLES::
     615
    607616        sage: A = matrix(ZZ, 2, [1,2,3,4]); B = matrix(ZZ, 2, [-1,5,2,3])
    608617        sage: A
    609618        [1 2]
     
    632641    OUTPUT:
    633642        a tuple of integers
    634643
    635     EXAMPLES:
     644    EXAMPLES::
     645
    636646        sage: import sage.matrix.matrix_integer_dense_hnf as matrix_integer_dense_hnf
    637647        sage: a = matrix(ZZ,3,[0, -1, -1, 0, -20, 1, 0, 1, 2])
    638648        sage: a
     
    651661    OUTPUT:
    652662        a tuple of integers
    653663
    654     EXAMPLES:
     664    EXAMPLES::
     665
    655666        sage: import sage.matrix.matrix_integer_dense_hnf as matrix_integer_dense_hnf
    656667        sage: a = matrix(ZZ,3,[0, -1, -1, 0, -20, 1, 0, 1, 2])
    657668        sage: a
     
    679690    OUTPUT:
    680691        4-tuple of integer lists: onecol, onerow, non_oneol, non_onerow
    681692
    682     EXAMPLES:
     693    EXAMPLES::
     694
    683695        sage: H = matrix(ZZ, 3, 5, [1, 0, 0, 45, -36, 0, 1, 0, 131, -107, 0, 0, 0, 178, -145]); H
    684696        [   1    0    0   45  -36]
    685697        [   0    1    0  131 -107]
     
    722734        If D isn't invertible or there are 0 or more than 2 non onecols,
    723735        then C, D, and E are set to None.
    724736
    725     EXAMPLES:
     737    EXAMPLES::
     738
    726739        sage: H = matrix(ZZ, 3, 4, [1, 0, 0, 7, 0, 1, 5, 2, 0, 0, 6, 6])
    727740        sage: import sage.matrix.matrix_integer_dense_hnf as matrix_integer_dense_hnf
    728741        sage: matrix_integer_dense_hnf.extract_ones_data(H, [0,1,2])
     
    769782    OUTPUT:
    770783        bool -- True or False
    771784
    772     EXAMPLES:
     785    EXAMPLES::
     786
    773787        sage: a = matrix(ZZ,3,5,[-2, -6, -3, -17, -1, 2, -1, -1, -2, -1, -2, -2, -6, 9, 2])
    774788        sage: import sage.matrix.matrix_integer_dense_hnf as matrix_integer_dense_hnf         
    775789        sage: matrix_integer_dense_hnf.is_in_hnf_form(a,range(3))
     
    816830        the Hermite normal form of A.
    817831        cols -- pivot columns
    818832
    819     EXAMPLES:
     833    EXAMPLES::
     834
    820835        sage: a = matrix(ZZ,4,3,[-1, -1, -1, -20, 4, 1, -1, 1, 2,1,2,3])
    821836        sage: import sage.matrix.matrix_integer_dense_hnf as matrix_integer_dense_hnf         
    822837        sage: matrix_integer_dense_hnf.probable_hnf(a, True, True)
     
    937952    OUTPUT:
    938953        a matrix with nrows rows.
    939954
    940     EXAMPLES:
     955    EXAMPLES::
     956
    941957        sage: import sage.matrix.matrix_integer_dense_hnf as matrix_integer_dense_hnf
    942958        sage: a = matrix(ZZ, 2, 4, [1, 0, 0, 7, 0, 1, 5, 2])
    943959        sage: matrix_integer_dense_hnf.pad_zeros(a, 4)
     
    972988        matrix -- the Hermite normal form of A
    973989        pivots -- the pivot column positions of A
    974990
    975     EXAMPLES:
     991    EXAMPLES::
     992
    976993        sage: import sage.matrix.matrix_integer_dense_hnf as matrix_integer_dense_hnf
    977994        sage: a = matrix(ZZ,3,5,[-2, -6, -3, -17, -1, 2, -1, -1, -2, -1, -2, -2, -6, 9, 2])
    978995        sage: matrix_integer_dense_hnf.hnf(a)
     
    10421059        U -- a unimodular matrix such that U * A = H
    10431060        pivots -- the pivot column positions of A
    10441061
    1045     EXAMPLES:
     1062    EXAMPLES::
     1063
    10461064        sage: import sage.matrix.matrix_integer_dense_hnf as matrix_integer_dense_hnf     
    10471065        sage: A = matrix(ZZ, 2, [1, -5, -10, 1, 3, 197]); A
    10481066        [  1  -5 -10]
     
    10701088    Use this to randomly test that hnf with transformation matrix
    10711089    is working.
    10721090   
    1073     EXAMPLES:
     1091    EXAMPLES::
     1092
    10741093        sage: from sage.matrix.matrix_integer_dense_hnf import hnf_with_transformation_tests
    10751094        sage: hnf_with_transformation_tests(n=15,m=10, trials=10)
    10761095        0 1 2 3 4 5 6 7 8 9
     
    10931112    """
    10941113    Run benchmark program.
    10951114   
    1096     EXAMPLES:
     1115    EXAMPLES::
     1116
    10971117        sage: import sage.matrix.matrix_integer_dense_hnf as hnf
    10981118        sage: hnf.benchmark_hnf([50,100],32)   
    10991119        ('sage', 50, 32, ...),
     
    11091129   
    11101130def benchmark_magma_hnf(nrange, bits=4):
    11111131    """
    1112     EXAMPLES:
     1132    EXAMPLES::
     1133
    11131134        sage: import sage.matrix.matrix_integer_dense_hnf as hnf
    11141135        sage: hnf.benchmark_magma_hnf([50,100],32)     # optional - magma
    11151136        ('magma', 50, 32, ...),
     
    11441165                             aren't normalized to be nonnegative) the
    11451166                             default is Magma.
    11461167   
    1147     EXAMPLES:
     1168    EXAMPLES::
     1169
    11481170        sage: import sage.matrix.matrix_integer_dense_hnf as matrix_integer_dense_hnf     
    11491171        sage: matrix_integer_dense_hnf.sanity_checks(times=5, check_using_magma=False)
    11501172        small 8 x 5
  • sage/matrix/matrix_integer_dense_saturation.py

    diff --git a/sage/matrix/matrix_integer_dense_saturation.py b/sage/matrix/matrix_integer_dense_saturation.py
    a b  
    2121        The p-saturation of the matrix A, i.e., a new matrix in Hermite form
    2222        whose row span a ZZ-module that is p-saturated.
    2323
    24     EXAMPLES:
     24    EXAMPLES::
     25
    2526        sage: from sage.matrix.matrix_integer_dense_saturation import p_saturation
    2627        sage: A = matrix(ZZ, 2, 2, [3,2,3,4]); B = matrix(ZZ, 2,3,[1,2,3,4,5,6])
    2728        sage: A.det()
     
    7172    OUTPUT:
    7273        a randomly chosen sublist of range(k) of size n.
    7374
    74     EXAMPLES:
     75    EXAMPLES::
     76
    7577        sage: import sage.matrix.matrix_integer_dense_saturation as s
    7678        sage: s.random_sublist_of_size(10,3)
    7779        [0, 1, 5]
     
    112114    OUTPUT:
    113115        the unique solution to B*Z = A.
    114116       
    115     EXAMPLES:
     117    EXAMPLES::
     118
    116119        sage: from sage.matrix.matrix_integer_dense_saturation import solve_system_with_difficult_last_row
    117120        sage: B = matrix(ZZ, 3, [1,2,3, 3,-1,2,939239082,39202803080,2939028038402834]); A = matrix(ZZ,3,2,[1,2,4,3,-1,0])
    118121        sage: X = solve_system_with_difficult_last_row(B, A); X
     
    180183    OUTPUT:
    181184        matrix -- saturation of the matrix A.
    182185
    183     EXAMPLES:
     186    EXAMPLES::
     187
    184188        sage: from sage.matrix.matrix_integer_dense_saturation import saturation
    185189        sage: A = matrix(ZZ, 2, 2, [3,2,3,4]); B = matrix(ZZ, 2,3,[1,2,3,4,5,6]); C = A*B
    186190        sage: C
  • sage/matrix/symplectic_basis.py

    diff --git a/sage/matrix/symplectic_basis.py b/sage/matrix/symplectic_basis.py
    a b  
    6565
    6666    WARNING: not intended for external use!
    6767
    68     EXAMPLES:
     68    EXAMPLES::
     69
    6970        sage: from sage.matrix.symplectic_basis import _inplace_move_to_positive_pivot
    7071        sage: E = matrix(ZZ, 4, 4, [0, 16, 0, 2, -16, 0, 0, -4, 0, 0, 0, 0, -2, 4, 0, 0]); E
    7172        [  0  16   0   2]
     
    147148
    148149    See the examples for a pictorial description of such a basis.
    149150
    150     EXAMPLES:
     151    EXAMPLES::
     152
    151153        sage: from sage.matrix.symplectic_basis import symplectic_basis_over_field
    152154
    153155        A full rank exact example:
     
    323325
    324326    WARNING: not intended for external use!
    325327
    326     EXAMPLES:
     328    EXAMPLES::
     329
    327330        sage: from sage.matrix.symplectic_basis import _smallest_element_position_or_None
    328331
    329332        sage: E = matrix(ZZ, 4, 4, [0, 16, 0, 2, -16, 0, 0, -4, 0, 0, 0, 0, -2, 4, 0, 0]); E
     
    374377
    375378    See the examples for a pictorial description of such a basis.
    376379
    377     EXAMPLES:
     380    EXAMPLES::
     381
    378382        sage: from sage.matrix.symplectic_basis import symplectic_basis_over_ZZ
    379383
    380384        An example which does not have full rank:
  • sage/misc/banner.py

    diff --git a/sage/misc/banner.py b/sage/misc/banner.py
    a b  
    2323    OUTPUT:
    2424       str
    2525
    26     EXAMPLES:
     26    EXAMPLES::
     27
    2728       sage: version()   
    2829       'Sage Version ..., Release Date: ...'
    2930       sage: version(clone=True)
     
    129130    If the Sage version is '3.2.alpha0', then the dictionary is
    130131    {'major': 3, 'minor': 2, 'tiny': 0, 'prerelease': True}.
    131132
    132     EXAMPLES:
     133    EXAMPLES::
     134
    133135        sage: from sage.misc.banner import version_dict
    134136        sage: print "Sage major version is %s" % version_dict()['major']
    135137        Sage major version is ...
     
    183185    If optional argument print_message is True and this function
    184186    is returning False, print a warning message.
    185187
    186     EXAMPLES:
     188    EXAMPLES::
     189
    187190        sage: from sage.misc.banner import require_version
    188191        sage: require_version(2, 1, 3)
    189192        True
  • sage/misc/explain_pickle.py

    diff --git a/sage/misc/explain_pickle.py b/sage/misc/explain_pickle.py
    a b  
    23862386    Create a new object; this corresponds to the C code
    23872387    klass->tp_new(klass, args, NULL).  Used by ``explain_pickle``.
    23882388
    2389     EXAMPLES:
     2389    EXAMPLES::
     2390
    23902391        sage: unpickle_newobj(tuple, ([1, 2, 3],))
    23912392        (1, 2, 3)
    23922393    """
     
    26392640        r"""
    26402641        Print an EmptyOldstyleClass.
    26412642
    2642         EXAMPLES:
     2643        EXAMPLES::
     2644
    26432645            sage: from sage.misc.explain_pickle import *
    26442646            sage: v = EmptyOldstyleClass()
    26452647            sage: v
     
    26552657        r"""
    26562658        Produce a predictable hash value for EmptyOldstyleClass.
    26572659
    2658         EXAMPLES:
     2660        EXAMPLES::
     2661
    26592662            sage: from sage.misc.explain_pickle import *
    26602663            sage: v = EmptyOldstyleClass()
    26612664            sage: hash(v)
     
    29812984    of TestGlobalOldName, it is redirected to create an instance of this
    29822985    class instead.  Used for testing explain_pickle.
    29832986
    2984     EXAMPLES:
     2987    EXAMPLES::
     2988
    29852989        sage: from sage.misc.explain_pickle import *
    29862990        sage: loads(dumps(TestGlobalOldName()))
    29872991        TestGlobalNewName
  • sage/misc/map_threaded.py

    diff --git a/sage/misc/map_threaded.py b/sage/misc/map_threaded.py
    a b  
    77    Apply the function to the elements in the sequence by threading
    88    recursively through all sub-sequences in the sequence.
    99
    10     EXAMPLES:
     10    EXAMPLES::
     11
    1112        sage: map_threaded(log, [[1,2], [3,e]])
    1213        [[0, log(2)], [log(3), 1]]
    1314        sage: map_threaded(log, [(1,2), (3,e)])
  • sage/misc/remote_file.py

    diff --git a/sage/misc/remote_file.py b/sage/misc/remote_file.py
    a b  
    1111        creates a file in the temp directory and returns the
    1212        absolute path to that file.
    1313
    14     EXAMPLES:
     14    EXAMPLES::
     15
    1516        sage: g = get_remote_file("http://sagemath.org/ack.html", verbose=False)   # optional - internet
    1617        sage: len(open(g).read())   # optional; randomly growing.
    1718        10198                 
  • sage/misc/sage_input.py

    diff --git a/sage/misc/sage_input.py b/sage/misc/sage_input.py
    a b  
    195195            \function{sage_eval}.  (Otherwise, if \function{sage_input}
    196196            cannot handle a value, an exception is raised.)
    197197
    198     EXAMPLES:
     198    EXAMPLES::
     199
    199200        sage: sage_input(GF(2)(1))
    200201        GF(2)(1)
    201202        sage: sage_input((GF(2)(0), GF(2)(1)), verify=True)
     
    278279    internally by \function{sage_input}, but it may be useful to create
    279280    an instance directly for testing or doctesting.
    280281
    281     EXAMPLES:
     282    EXAMPLES::
     283
    282284        sage: from sage.misc.sage_input import SageInputBuilder
    283285       
    284286    We can create a \class{SageInputBuilder}, use it to create some
     
    310312                If \code{None}, then the result will work whether or
    311313                not the preparser is enabled.
    312314
    313         EXAMPLES:
     315        EXAMPLES::
     316
    314317            sage: from sage.misc.sage_input import SageInputBuilder
    315318            sage: SageInputBuilder().preparse()
    316319            True
     
    345348        \code{self._allow_locals} is true, we add it to a
    346349        ``locals'' dictionary.
    347350
    348         EXAMPLES:
     351        EXAMPLES::
     352
    349353            sage: from sage.misc.sage_input import SageInputBuilder
    350354
    351355            sage: sib = SageInputBuilder()
     
    552556        methods of \class{Integer} and \class{RealNumber}; but most
    553557        \method{_sage_input_} methods will not need to examine this.
    554558
    555         EXAMPLES:
     559        EXAMPLES::
     560
    556561            sage: from sage.misc.sage_input import SageInputBuilder
    557562            sage: SageInputBuilder().preparse()
    558563            True
     
    570575        a \class{long}, depending on its size and whether the preparser
    571576        is enabled).
    572577
    573         EXAMPLES:
     578        EXAMPLES::
     579
    574580            sage: from sage.misc.sage_input import SageInputBuilder
    575581
    576582            sage: sib = SageInputBuilder()
     
    596602        produces a \class{SageInputExpression} that formats as that
    597603        string.
    598604
    599         EXAMPLES:
     605        EXAMPLES::
     606
    600607            sage: from sage.misc.sage_input import SageInputBuilder
    601608
    602609            sage: sib = SageInputBuilder()
     
    610617        Given a string representing a Python name,
    611618        produces a \class{SageInputExpression} for that name.
    612619
    613         EXAMPLES:
     620        EXAMPLES::
     621
    614622            sage: from sage.misc.sage_input import SageInputBuilder
    615623
    616624            sage: sib = SageInputBuilder()
     
    636644        are both large and likely to be used multiple times in a single
    637645        expression.
    638646
    639         EXAMPLES:
     647        EXAMPLES::
     648
    640649            sage: from sage.misc.sage_input import SageInputBuilder
    641650
    642651            sage: sib = SageInputBuilder()
     
    680689        \method{cache} if equality on the values is difficult or impossible
    681690        to compute.
    682691
    683         EXAMPLES:
     692        EXAMPLES::
     693
    684694            sage: from sage.misc.sage_input import SageInputBuilder
    685695
    686696            sage: x = polygen(ZZ)
     
    723733        Creates an expression that will import a name from a module and
    724734        then use that name.
    725735
    726         EXAMPLES:
     736        EXAMPLES::
     737
    727738            sage: from sage.misc.sage_input import SageInputBuilder
    728739
    729740            sage: sib = SageInputBuilder()
     
    756767        Can only be used as an argument to the \method{command}
    757768        method.
    758769
    759         EXAMPLES:
     770        EXAMPLES::
     771
    760772            sage: from sage.misc.sage_input import SageInputBuilder
    761773
    762774            sage: sib = SageInputBuilder()
     
    780792        Attaches a command to v, which will be executed before v is used.
    781793        Multiple commands will be executed in the order added.
    782794
    783         EXAMPLES:
     795        EXAMPLES::
     796
    784797            sage: from sage.misc.sage_input import SageInputBuilder
    785798
    786799            sage: sib = SageInputBuilder()
     
    804817        produces a \class{SageInputExpression} representing
    805818        the dictionary.
    806819
    807         EXAMPLES:
     820        EXAMPLES::
     821
    808822            sage: from sage.misc.sage_input import SageInputBuilder
    809823
    810824            sage: sib = SageInputBuilder()
     
    827841        is some attribute that bypasses __getattr__ (such as if
    828842        bar is '__getattr__' itself).
    829843
    830         EXAMPLES:
     844        EXAMPLES::
     845
    831846            sage: from sage.misc.sage_input import SageInputBuilder
    832847
    833848            sage: sib = SageInputBuilder()
     
    845860        Since this is not legal Python syntax, it is useful only for
    846861        producing the \sage generator syntax for a polynomial ring.
    847862
    848         EXAMPLES:
     863        EXAMPLES::
     864
    849865            sage: from sage.misc.sage_input import SageInputBuilder
    850866
    851867            sage: sib = SageInputBuilder()
     
    866882        is the final top-level expression, though, it will not use
    867883        a variable.)
    868884
    869         EXAMPLES:
     885        EXAMPLES::
     886
    870887            sage: from sage.misc.sage_input import SageInputBuilder
    871888
    872889            sage: sib = SageInputBuilder()
     
    901918        by a variable if it occurs multiple times in the expression.
    902919        (Most non-single-token expressions are already sharable.)
    903920
    904         EXAMPLES:
     921        EXAMPLES::
     922
    905923            sage: from sage.misc.sage_input import SageInputBuilder
    906924
    907925        Without explicitly using .share(), string literals are not shared:
     
    933951        generator syntax is used; typically this will be the same as
    934952        the first SIE except omitting a \var{names} parameter.
    935953
    936         EXAMPLES:
     954        EXAMPLES::
     955
    937956            sage: from sage.misc.sage_input import SageInputBuilder
    938957
    939958
     
    9981017        Given a parent, returns a \class{SageInputExpression} for
    9991018        the $n$th (default 0) generator of the parent.
    10001019
    1001         EXAMPLES:
     1020        EXAMPLES::
     1021
    10021022            sage: from sage.misc.sage_input import SageInputBuilder
    10031023
    10041024            sage: sib = SageInputBuilder()
     
    10311051        And any negations are removed from the elements and moved to the
    10321052        outside of the product.
    10331053
    1034         EXAMPLES:
     1054        EXAMPLES::
     1055
    10351056            sage: from sage.misc.sage_input import SageInputBuilder
    10361057
    10371058            sage: sib = SageInputBuilder()
     
    10931114        element in the sequence); and any instances of \code{a + -b}
    10941115        are changed to \code{a - b}.
    10951116
    1096         EXAMPLES:
     1117        EXAMPLES::
     1118
    10971119            sage: from sage.misc.sage_input import SageInputBuilder
    10981120
    10991121            sage: sib = SageInputBuilder()
     
    11391161        (and possibly a dictionary of local variables) suitable for
    11401162        \function{sage_eval}.
    11411163
    1142         EXAMPLES:
     1164        EXAMPLES::
     1165
    11431166            sage: from sage.misc.sage_input import SageInputBuilder
    11441167
    11451168            sage: sib = SageInputBuilder()
     
    12171240        r"""
    12181241        Initialize a \class{SageInputExpression}.
    12191242
    1220         EXAMPLES:
     1243        EXAMPLES::
     1244
    12211245            sage: from sage.misc.sage_input import SageInputBuilder
    12221246
    12231247            sage: sib = SageInputBuilder()
     
    12431267        enough that duplicate uses are not worth caching.  Normally
    12441268        this will be true if the expression represents a single token.
    12451269
    1246         EXAMPLES:
     1270        EXAMPLES::
     1271
    12471272            sage: from sage.misc.sage_input import SageInputBuilder
    12481273
    12491274            sage: sib = SageInputBuilder()
     
    12591284        Returns a list of the immediate subexpressions of this
    12601285        \class{SageInputExpression}.
    12611286
    1262         EXAMPLES:
     1287        EXAMPLES::
     1288
    12631289            sage: from sage.misc.sage_input import SageInputBuilder
    12641290
    12651291            sage: sib = SageInputBuilder()
     
    12771303        to replace with a variable (rather than generating the value
    12781304        multiple times).
    12791305
    1280         EXAMPLES:
     1306        EXAMPLES::
     1307
    12811308            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    12821309
    12831310            sage: sib = SageInputBuilder()
     
    13171344        and register it with a \class{SageInputFormatter} (which will
    13181345        allocate a variable name at the end of the preparatory phase).
    13191346
    1320         EXAMPLES:
     1347        EXAMPLES::
     1348
    13211349            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    13221350
    13231351            sage: sib = SageInputBuilder()
     
    13371365        Get the variable name that the \class{SageInputFormatter} allocated
    13381366        for this \class{SageInputExpression}.
    13391367
    1340         EXAMPLES:
     1368        EXAMPLES::
     1369
    13411370            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    13421371
    13431372            sage: sib = SageInputBuilder()
     
    13611390        See the documentation for \method{SIE_unary._sie_is_negation}
    13621391        for useful examples.
    13631392
    1364         EXAMPLES:
     1393        EXAMPLES::
     1394
    13651395            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    13661396
    13671397            sage: sib = SageInputBuilder()
     
    13771407        \class{SageInputExpression} representing a function call node
    13781408        (with \code{self} as the function).
    13791409
    1380         EXAMPLES:
     1410        EXAMPLES::
     1411
    13811412            sage: from sage.misc.sage_input import SageInputBuilder
    13821413
    13831414            sage: sib = SageInputBuilder()
     
    13981429
    13991430        Currently, slices are not supported.
    14001431
    1401         EXAMPLES:
     1432        EXAMPLES::
     1433
    14021434            sage: from sage.misc.sage_input import SageInputBuilder
    14031435
    14041436            sage: sib = SageInputBuilder()
     
    14161448        Given a \class{SageInputExpression}, build a new
    14171449        \class{SageInputExpression} representing an attribute access.
    14181450
    1419         EXAMPLES:
     1451        EXAMPLES::
     1452
    14201453            sage: from sage.misc.sage_input import SageInputBuilder
    14211454
    14221455            sage: sib = SageInputBuilder()
     
    14321465        r"""
    14331466        Compute an expression tree for \code{self ** other}.
    14341467
    1435         EXAMPLES:
     1468        EXAMPLES::
     1469
    14361470            sage: from sage.misc.sage_input import SageInputBuilder
    14371471
    14381472            sage: sib = SageInputBuilder()
     
    14461480        r"""
    14471481        Compute an expression tree for \code{self * other}.
    14481482
    1449         EXAMPLES:
     1483        EXAMPLES::
     1484
    14501485            sage: from sage.misc.sage_input import SageInputBuilder
    14511486
    14521487            sage: sib = SageInputBuilder()
     
    14601495        r"""
    14611496        Compute an expression tree for \code{self / other}.
    14621497
    1463         EXAMPLES:
     1498        EXAMPLES::
     1499
    14641500            sage: from sage.misc.sage_input import SageInputBuilder
    14651501
    14661502            sage: sib = SageInputBuilder()
     
    14741510        r"""
    14751511        Compute an expression tree for \code{self + other}.
    14761512
    1477         EXAMPLES:
     1513        EXAMPLES::
     1514
    14781515            sage: from sage.misc.sage_input import SageInputBuilder
    14791516
    14801517            sage: sib = SageInputBuilder()
     
    14881525        r"""
    14891526        Compute an expression tree for \code{self - other}.
    14901527
    1491         EXAMPLES:
     1528        EXAMPLES::
     1529
    14921530            sage: from sage.misc.sage_input import SageInputBuilder
    14931531
    14941532            sage: sib = SageInputBuilder()
     
    15041542        where OP is a string representing a binary operator (such as
    15051543        '+' or '**').
    15061544
    1507         EXAMPLES:
     1545        EXAMPLES::
     1546
    15081547            sage: from sage.misc.sage_input import SageInputBuilder
    15091548
    15101549            sage: sib = SageInputBuilder()
     
    15221561        r"""
    15231562        Compute an expression tree for \code{-self}.
    15241563
    1525         EXAMPLES:
     1564        EXAMPLES::
     1565
    15261566            sage: from sage.misc.sage_input import SageInputBuilder
    15271567
    15281568            sage: sib = SageInputBuilder()
     
    15361576        r"""
    15371577        Compute an expression tree for \code{~self}.
    15381578
    1539         EXAMPLES:
     1579        EXAMPLES::
     1580
    15401581            sage: from sage.misc.sage_input import SageInputBuilder
    15411582
    15421583            sage: sib = SageInputBuilder()
     
    15501591        r"""
    15511592        Compute an expression tree for \code{abs(self)}.
    15521593
    1553         EXAMPLES:
     1594        EXAMPLES::
     1595
    15541596            sage: from sage.misc.sage_input import SageInputBuilder
    15551597
    15561598            sage: sib = SageInputBuilder()
     
    15661608        where OP is a string representing a unary operator (such as
    15671609        '-' or '~').
    15681610
    1569         EXAMPLES:
     1611        EXAMPLES::
     1612
    15701613            sage: from sage.misc.sage_input import SageInputBuilder
    15711614
    15721615            sage: sib = SageInputBuilder()
     
    15911634        Actually, all of these are examples of the \method{_sie_format}
    15921635        method on subclasses of \class{SageInputExpression};
    15931636        \class{SageInputExpression} itself is an abstract base class
    1594         (that cannot be instantiated).
     1637        (that cannot be instantiated).::
    15951638       
    15961639            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    15971640
     
    16271670        an error.  (This is to prevent accidental use of
    16281671        \class{SIE_assign} as a value.)
    16291672
    1630         EXAMPLES:
     1673        EXAMPLES::
     1674
    16311675            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    16321676
    16331677            sage: sib = SageInputBuilder()
     
    16491693    An abstract base class for ``literals'' (basically, values which
    16501694    consist of a single token).
    16511695
    1652     EXAMPLES:
     1696    EXAMPLES::
     1697
    16531698        sage: from sage.misc.sage_input import SageInputBuilder, SIE_literal
    16541699
    16551700        sage: sib = SageInputBuilder()
     
    16661711        variables (for ``common subexpression elimination'') even if they
    16671712        occur multiple times in an expression.
    16681713
    1669         EXAMPLES:
     1714        EXAMPLES::
     1715
    16701716            sage: from sage.misc.sage_input import SageInputBuilder
    16711717
    16721718            sage: sib = SageInputBuilder()
     
    16921738    string representation of that token.  They are used for integer,
    16931739    floating-point, and string literals, and for name expressions.
    16941740
    1695     EXAMPLES:
     1741    EXAMPLES::
     1742
    16961743        sage: from sage.misc.sage_input import SageInputBuilder, SIE_literal_stringrep
    16971744
    16981745        sage: sib = SageInputBuilder()
     
    17161763            sib -- a \class{SageInputBuilder}
    17171764            n -- a string; the value to be printed for this expression
    17181765
    1719         EXAMPLES:
     1766        EXAMPLES::
     1767
    17201768            sage: from sage.misc.sage_input import SageInputBuilder
    17211769
    17221770            sage: sib = SageInputBuilder()
     
    17341782        Returns a string representing this \class{SIE_literal_stringrep}
    17351783        value.
    17361784
    1737         EXAMPLES:
     1785        EXAMPLES::
     1786
    17381787            sage: from sage.misc.sage_input import SageInputBuilder
    17391788
    17401789            sage: sib = SageInputBuilder()
     
    17501799        Return the formatted string value of this expression, and an indication
    17511800        that it is ``atomic'' (never needs to be parenthesized).
    17521801
    1753         EXAMPLES:
     1802        EXAMPLES::
     1803
    17541804            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    17551805
    17561806            sage: sib = SageInputBuilder()
     
    17671817    This class represents a function-call node in a \function{sage_input}
    17681818    expression tree.
    17691819
    1770     EXAMPLES:
     1820    EXAMPLES::
     1821
    17711822        sage: from sage.misc.sage_input import SageInputBuilder
    17721823
    17731824        sage: sib = SageInputBuilder()
     
    17891840                    \class{SageInputExpression}s representing the keyword
    17901841                    arguments
    17911842
    1792         EXAMPLES:
     1843        EXAMPLES::
     1844
    17931845            sage: from sage.misc.sage_input import SageInputBuilder
    17941846
    17951847            sage: sib = SageInputBuilder()
     
    18041856        r"""
    18051857        Returns a string representing this \class{SIE_call} value.
    18061858
    1807         EXAMPLES:
     1859        EXAMPLES::
     1860
    18081861            sage: from sage.misc.sage_input import SageInputBuilder
    18091862
    18101863            sage: sib = SageInputBuilder()
     
    18201873        r"""
    18211874        Returns a list of the immediate subexpressions of this \class{SIE_call}.
    18221875
    1823         EXAMPLES:
     1876        EXAMPLES::
     1877
    18241878            sage: from sage.misc.sage_input import SageInputBuilder
    18251879
    18261880            sage: sib = SageInputBuilder()
     
    18381892        Return the formatted string value of this expression, and an indication
    18391893        that it is a function call.
    18401894
    1841         EXAMPLES:
     1895        EXAMPLES::
     1896
    18421897            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    18431898
    18441899            sage: sib = SageInputBuilder()
     
    18591914    This class represents a subscript node in a \function{sage_input}
    18601915    expression tree.
    18611916
    1862     EXAMPLES:
     1917    EXAMPLES::
     1918
    18631919        sage: from sage.misc.sage_input import SageInputBuilder
    18641920
    18651921        sage: sib = SageInputBuilder()
     
    18811937        empty subscript.  This is not legal Python syntax, but it is legal
    18821938        in the \sage preparser in examples like \code{K.<x> = QQ[]}.
    18831939
    1884         EXAMPLES:
     1940        EXAMPLES::
     1941
    18851942            sage: from sage.misc.sage_input import SageInputBuilder
    18861943
    18871944            sage: sib = SageInputBuilder()
     
    19001957        r"""
    19011958        Returns a string representing this \class{SIE_subscript} value.
    19021959
    1903         EXAMPLES:
     1960        EXAMPLES::
     1961
    19041962            sage: from sage.misc.sage_input import SageInputBuilder
    19051963
    19061964            sage: sib = SageInputBuilder()
     
    19191977        Returns a list of the immediate subexpressions of this
    19201978        \class{SIE_subscript}.
    19211979
    1922         EXAMPLES:
     1980        EXAMPLES::
     1981
    19231982            sage: from sage.misc.sage_input import SageInputBuilder
    19241983
    19251984            sage: sib = SageInputBuilder()
     
    19371996        Return the formatted string value of this expression, and an
    19381997        indication that it is a subscript.
    19391998
    1940         EXAMPLES:
     1999        EXAMPLES::
     2000
    19412001            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    19422002
    19432003            sage: sib = SageInputBuilder()
     
    19592019    This class represents a getattr node in a \function{sage_input}
    19602020    expression tree.
    19612021
    1962     EXAMPLES:
     2022    EXAMPLES::
     2023
    19632024        sage: from sage.misc.sage_input import SageInputBuilder
    19642025
    19652026        sage: sib = SageInputBuilder()
     
    19772038            obj -- a \class{SageInputExpression} representing an object
    19782039            attr -- a string; the attribute name
    19792040
    1980         EXAMPLES:
     2041        EXAMPLES::
     2042
    19812043            sage: from sage.misc.sage_input import SageInputBuilder
    19822044
    19832045            sage: sib = SageInputBuilder()
     
    19922054        r"""
    19932055        Returns a string representing this \class{SIE_getattr} value.
    19942056
    1995         EXAMPLES:
     2057        EXAMPLES::
     2058
    19962059            sage: from sage.misc.sage_input import SageInputBuilder
    19972060
    19982061            sage: sib = SageInputBuilder()
     
    20072070        Returns a list of the immediate subexpressions of this
    20082071        \class{SIE_subscript}.
    20092072
    2010         EXAMPLES:
     2073        EXAMPLES::
     2074
    20112075            sage: from sage.misc.sage_input import SageInputBuilder
    20122076
    20132077            sage: sib = SageInputBuilder()
     
    20222086        Return the formatted string value of this expression, and an
    20232087        indication that it is an attribute reference.
    20242088
    2025         EXAMPLES:
     2089        EXAMPLES::
     2090
    20262091            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    20272092
    20282093            sage: sib = SageInputBuilder()
     
    20412106    This class represents a tuple or list node in a \function{sage_input}
    20422107    expression tree.
    20432108
    2044     EXAMPLES:
     2109    EXAMPLES::
     2110
    20452111        sage: from sage.misc.sage_input import SageInputBuilder
    20462112
    20472113        sage: sib = SageInputBuilder()
     
    20622128            is_list -- is True if this class represents a list, False for
    20632129                 a tuple
    20642130
    2065         EXAMPLES:
     2131        EXAMPLES::
     2132
    20662133            sage: from sage.misc.sage_input import SageInputBuilder
    20672134
    20682135            sage: sib = SageInputBuilder()
     
    20792146        r"""
    20802147        Returns a string representing this \class{SIE_tuple} value.
    20812148
    2082         EXAMPLES:
     2149        EXAMPLES::
     2150
    20832151            sage: from sage.misc.sage_input import SageInputBuilder
    20842152
    20852153            sage: sib = SageInputBuilder()
     
    20972165        Returns a list of the immediate subexpressions of this
    20982166        \class{SIE_tuple}.
    20992167
    2100         EXAMPLES:
     2168        EXAMPLES::
     2169
    21012170            sage: from sage.misc.sage_input import SageInputBuilder
    21022171
    21032172            sage: sib = SageInputBuilder()
     
    21122181        Return the formatted string value of this tuple or list, and an
    21132182        indication that it is atomic (never needs to be parenthesized).
    21142183
    2115         EXAMPLES:
     2184        EXAMPLES::
     2185
    21162186            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    21172187
    21182188            sage: sib = SageInputBuilder()
     
    21422212    This class represents a dict node in a \function{sage_input}
    21432213    expression tree.
    21442214
    2145     EXAMPLES:
     2215    EXAMPLES::
     2216
    21462217        sage: from sage.misc.sage_input import SageInputBuilder
    21472218
    21482219        sage: sib = SageInputBuilder()
     
    21622233                \class{SageInputExpression}s representing the entries of
    21632234                this dict
    21642235
    2165         EXAMPLES:
     2236        EXAMPLES::
     2237
    21662238            sage: from sage.misc.sage_input import SageInputBuilder
    21672239
    21682240            sage: sib = SageInputBuilder()
     
    21782250        r"""
    21792251        Returns a string representing this \class{SIE_dict} value.
    21802252
    2181         EXAMPLES:
     2253        EXAMPLES::
     2254
    21822255            sage: from sage.misc.sage_input import SageInputBuilder
    21832256
    21842257            sage: sib = SageInputBuilder()
     
    21942267        Returns a list of the immediate subexpressions of this
    21952268        \class{SIE_dict}.
    21962269
    2197         EXAMPLES:
     2270        EXAMPLES::
     2271
    21982272            sage: from sage.misc.sage_input import SageInputBuilder
    21992273
    22002274            sage: sib = SageInputBuilder()
     
    22092283        Return the formatted string value of this dict, and an
    22102284        indication that it is atomic (never needs to be parenthesized).
    22112285
    2212         EXAMPLES:
     2286        EXAMPLES::
     2287
    22132288            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    22142289
    22152290            sage: sib = SageInputBuilder()
     
    22282303    This class represents an arithmetic expression with a binary operator
    22292304    and its two arguments, in a \function{sage_input} expression tree.
    22302305
    2231     EXAMPLES:
     2306    EXAMPLES::
     2307
    22322308        sage: from sage.misc.sage_input import SageInputBuilder
    22332309
    22342310        sage: sib = SageInputBuilder()
     
    22462322            lhs -- a \class{SageInputExpression}
    22472323            rhs -- a \class{SageInputExpression}
    22482324
    2249         EXAMPLES:
     2325        EXAMPLES::
     2326
    22502327            sage: from sage.misc.sage_input import SageInputBuilder
    22512328
    22522329            sage: sib = SageInputBuilder()
     
    22622339        r"""
    22632340        Returns a string representing this \class{SIE_binary} value.
    22642341
    2265         EXAMPLES:
     2342        EXAMPLES::
     2343
    22662344            sage: from sage.misc.sage_input import SageInputBuilder
    22672345
    22682346            sage: sib = SageInputBuilder()
     
    22762354        Returns a tuple of the immediate subexpressions of this
    22772355        \class{SIE_binary}.
    22782356
    2279         EXAMPLES:
     2357        EXAMPLES::
     2358
    22802359            sage: from sage.misc.sage_input import SageInputBuilder
    22812360
    22822361            sage: sib = SageInputBuilder()
     
    22912370        Return the formatted string value of this expression,
    22922371        and the precedence of the top-level operator in the expression.
    22932372
    2294         EXAMPLES:
     2373        EXAMPLES::
     2374
    22952375            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    22962376
    22972377            sage: sib = SageInputBuilder()
     
    23672447    This class represents an arithmetic expression with a unary operator
    23682448    and its argument, in a \function{sage_input} expression tree.
    23692449
    2370     EXAMPLES:
     2450    EXAMPLES::
     2451
    23712452        sage: from sage.misc.sage_input import SageInputBuilder
    23722453
    23732454        sage: sib = SageInputBuilder()
     
    23842465            op -- a string representing a unary operator, such as '-'
    23852466            operand -- a \class{SageInputExpression}
    23862467
    2387         EXAMPLES:
     2468        EXAMPLES::
     2469
    23882470            sage: from sage.misc.sage_input import SageInputBuilder
    23892471
    23902472            sage: sib = SageInputBuilder()
     
    23992481        r"""
    24002482        Returns a string representing this \class{SIE_unary} value.
    24012483
    2402         EXAMPLES:
     2484        EXAMPLES::
     2485
    24032486            sage: from sage.misc.sage_input import SageInputBuilder
    24042487
    24052488            sage: sib = SageInputBuilder()
     
    24132496        Returns a list of the immediate subexpressions of this
    24142497        \class{SIE_unary}.
    24152498
    2416         EXAMPLES:
     2499        EXAMPLES::
     2500
    24172501            sage: from sage.misc.sage_input import SageInputBuilder
    24182502
    24192503            sage: sib = SageInputBuilder()
     
    24292513        Return the formatted string value of this expression,
    24302514        and the precedence of the top-level operator in the expression.
    24312515
    2432         EXAMPLES:
     2516        EXAMPLES::
     2517
    24332518            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    24342519
    24352520            sage: sib = SageInputBuilder()
     
    24952580        produce \code{-CC(3)} instead of \code{CC(-3)}.  (This is preferred
    24962581        so that you get \code{x - CC(3)} instead of \code{x + CC(-3)}.)
    24972582
    2498         EXAMPLES:
     2583        EXAMPLES::
     2584
    24992585            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    25002586
    25012587            sage: sib = SageInputBuilder()
     
    25212607    with named generators, optionally using the \sage preparser
    25222608    generators syntax (like \code{K.<x> = QQ[]}).
    25232609
    2524     EXAMPLES:
     2610    EXAMPLES::
     2611
    25252612        sage: from sage.misc.sage_input import SageInputBuilder
    25262613
    25272614        sage: sib = SageInputBuilder()
     
    25452632                for constructing this parent using the \sage preparser
    25462633                generators syntax
    25472634
    2548         EXAMPLES:
     2635        EXAMPLES::
     2636
    25492637            sage: from sage.misc.sage_input import SageInputBuilder
    25502638
    25512639            sage: sib = SageInputBuilder()
     
    25672655        r"""
    25682656        Returns a string representing this \class{SIE_gens_constructor} value.
    25692657
    2570         EXAMPLES:
     2658        EXAMPLES::
     2659
    25712660            sage: from sage.misc.sage_input import SageInputBuilder
    25722661
    25732662            sage: sib = SageInputBuilder()
     
    25852674        \class{SIE_gens_constructor}.
    25862675
    25872676
    2588         EXAMPLES:
     2677        EXAMPLES::
     2678
    25892679            sage: from sage.misc.sage_input import SageInputBuilder
    25902680
    25912681            sage: sib = SageInputBuilder()
     
    26082698        \class{SIE_gens_constructor} is used.  (This means we will actually
    26092699        construct all of the generators.)
    26102700
    2611         EXAMPLES:
     2701        EXAMPLES::
     2702
    26122703            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    26132704
    26142705            sage: sib = SageInputBuilder()
     
    26332724        Build commands to construct this parent and (if necessary)
    26342725        its associated generators.
    26352726
    2636         EXAMPLES:
     2727        EXAMPLES::
     2728
    26372729            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    26382730
    26392731            sage: sib = SageInputBuilder()
     
    27072799        As a side effect, if the generators of this parent are used,
    27082800        this adds commands to assign the generators to names.
    27092801
    2710         EXAMPLES:
     2802        EXAMPLES::
     2803
    27112804            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    27122805
    27132806            sage: sib = SageInputBuilder()
     
    27342827    This class represents a named generator of a parent with named
    27352828    generators.
    27362829
    2737     EXAMPLES:
     2830    EXAMPLES::
     2831
    27382832        sage: from sage.misc.sage_input import SageInputBuilder
    27392833
    27402834        sage: sib = SageInputBuilder()
     
    27512845            parent -- a \class{SIE_gens_constructor}
    27522846            name -- a string with the name of this generator
    27532847
    2754         EXAMPLES:
     2848        EXAMPLES::
     2849
    27552850            sage: from sage.misc.sage_input import SageInputBuilder
    27562851
    27572852            sage: sib = SageInputBuilder()
     
    27662861        r"""
    27672862        Returns a string representing this \class{SIE_gen} value.
    27682863
    2769         EXAMPLES:
     2864        EXAMPLES::
     2865
    27702866            sage: from sage.misc.sage_input import SageInputBuilder
    27712867
    27722868            sage: sib = SageInputBuilder()
     
    27792875        r"""
    27802876        Report that \class{SIE_gen} values are single tokens.
    27812877
    2782         EXAMPLES:
     2878        EXAMPLES::
     2879
    27832880            sage: from sage.misc.sage_input import SageInputBuilder
    27842881
    27852882            sage: sib = SageInputBuilder()
     
    27942891        \class{SageInputExpression} to additionally mark the parent of this
    27952892        generator that the generator names must be assigned.
    27962893
    2797         EXAMPLES:
     2894        EXAMPLES::
     2895
    27982896            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    27992897
    28002898            sage: sib = SageInputBuilder()
     
    28172915        As a side effect, this generates commands to assign the generators
    28182916        of the parent to variables.
    28192917
    2820         EXAMPLES:
     2918        EXAMPLES::
     2919
    28212920            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    28222921
    28232922            sage: sib = SageInputBuilder()
     
    28382937        variable name which is the same as the name of the generator
    28392938        name.
    28402939
    2841         EXAMPLES:
     2940        EXAMPLES::
     2941
    28422942            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    28432943
    28442944        First we verify that if we use two generators with different
     
    28712971    r"""
    28722972    This class represents a name which has been imported from a module.
    28732973
    2874     EXAMPLES:
     2974    EXAMPLES::
     2975
    28752976        sage: from sage.misc.sage_input import SageInputBuilder
    28762977
    28772978        sage: sib = SageInputBuilder()
     
    28922993            alt_name -- an alternate object name, or None (the default)
    28932994                        to use name
    28942995
    2895         EXAMPLES:
     2996        EXAMPLES::
     2997
    28962998            sage: from sage.misc.sage_input import SageInputBuilder
    28972999
    28983000            sage: sib = SageInputBuilder()
     
    29143016        r"""
    29153017        Returns a string representing this \class{SIE_import_name} value.
    29163018
    2917         EXAMPLES:
     3019        EXAMPLES::
     3020
    29183021            sage: from sage.misc.sage_input import SageInputBuilder
    29193022
    29203023            sage: sib = SageInputBuilder()
     
    29303033        r"""
    29313034        Report that \class{SIE_import_name} values are single tokens.
    29323035
    2933         EXAMPLES:
     3036        EXAMPLES::
     3037
    29343038            sage: from sage.misc.sage_input import SageInputBuilder
    29353039
    29363040            sage: sib = SageInputBuilder()
     
    29443048        We override the \method{_sie_prepare} method from
    29453049        \class{SageInputExpression} to request a variable name.
    29463050
    2947         EXAMPLES:
     3051        EXAMPLES::
     3052
    29483053            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    29493054
    29503055            sage: sib = SageInputBuilder()
     
    29643069        Return the formatted string value of this import,
    29653070        and an indication that it is atomic.
    29663071
    2967         EXAMPLES:
     3072        EXAMPLES::
     3073
    29683074            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    29693075
    29703076            sage: sib = SageInputBuilder()
     
    29963102    r"""
    29973103    This class represents an assignment command.
    29983104
    2999     EXAMPLES:
     3105    EXAMPLES::
     3106
    30003107        sage: from sage.misc.sage_input import SageInputBuilder
    30013108
    30023109        sage: sib = SageInputBuilder()
     
    30133120            lhs -- the left-hand side of the assignment
    30143121            rhs -- the right-hand side of the assignment
    30153122
    3016         EXAMPLES:
     3123        EXAMPLES::
     3124
    30173125            sage: from sage.misc.sage_input import SageInputBuilder
    30183126
    30193127            sage: sib = SageInputBuilder()
     
    30283136        r"""
    30293137        Returns a string representing this \class{SIE_assign} command.
    30303138
    3031         EXAMPLES:
     3139        EXAMPLES::
     3140
    30323141            sage: from sage.misc.sage_input import SageInputBuilder
    30333142
    30343143            sage: sib = SageInputBuilder()
     
    30423151        Returns a list of the immediate subexpressions of this
    30433152        \class{SIE_assign}.
    30443153
    3045         EXAMPLES:
     3154        EXAMPLES::
     3155
    30463156            sage: from sage.misc.sage_input import SageInputBuilder
    30473157
    30483158            sage: sib = SageInputBuilder()
     
    30583168        as an expression.  Since an assignment is a statement, not
    30593169        an expression, always raises an error.
    30603170
    3061         EXAMPLES:
     3171        EXAMPLES::
     3172
    30623173            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    30633174
    30643175            sage: sib = SageInputBuilder()
     
    30773188        Return the formatted string of this \class{SIE_assign}
    30783189        as a statement.
    30793190
    3080         EXAMPLES:
     3191        EXAMPLES::
     3192
    30813193            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    30823194
    30833195            sage: sib = SageInputBuilder()
     
    31003212        r"""
    31013213        Initialize an instance of \class{SageInputFormatter}.
    31023214
    3103         EXAMPLES:
     3215        EXAMPLES::
     3216
    31043217            sage: from sage.misc.sage_input import SageInputFormatter
    31053218
    31063219            sage: sif = SageInputFormatter()
     
    31243237        Otherwise, we format the expression by calling its \method{_sie_format}
    31253238        method, and add parentheses if necessary.
    31263239
    3127         EXAMPLES:
     3240        EXAMPLES::
     3241
    31283242            sage: from sage.misc.sage_input import SageInputBuilder, SageInputFormatter
    31293243
    31303244            sage: sib = SageInputBuilder()
     
    31913305        If the input name is \code{None}, then it is treated as a name of
    31923306        \code{'si'}.
    31933307
    3194         EXAMPLES:
     3308        EXAMPLES::
     3309
    31953310            sage: from sage.misc.sage_input import SageInputFormatter
    31963311
    31973312            sage: sif = SageInputFormatter()
     
    32223337        If the input name is \code{None}, then it is treated as a name of
    32233338        \code{'si'}.
    32243339
    3225         EXAMPLES:
     3340        EXAMPLES::
     3341
    32263342            sage: from sage.misc.sage_input import SageInputFormatter
    32273343
    32283344            sage: sif = SageInputFormatter()
     
    32523368    If the values are the same, we return \code{None}; otherwise,
    32533369    we raise an exception.
    32543370
    3255     EXAMPLES:
     3371    EXAMPLES::
     3372
    32563373        sage: from sage.misc.sage_input import verify_same
    32573374        sage: verify_same(1, 1)
    32583375        sage: verify_same(1, 2)
     
    33123429
    33133430    On success, we return \code{None}; on failure, we raise an exception.
    33143431
    3315     EXAMPLES:
     3432    EXAMPLES::
     3433
    33163434        sage: from sage.misc.sage_input import verify_si_answer
    33173435        sage: verify_si_answer(1, '1', True)
    33183436        sage: verify_si_answer(1, '1', False)
     
    33333451    This class inherits from tuple, so it acts like a tuple when passed
    33343452    to \function{sage_eval}; but it prints as a sequence of commands.
    33353453
    3336     EXAMPLES:
     3454    EXAMPLES::
     3455
    33373456        sage: from sage.misc.sage_input import SageInputAnswer
    33383457        sage: v = SageInputAnswer('x = 22\n', 'x/7'); v
    33393458        x = 22
     
    33623481        r"""
    33633482        Construct an instance of \class{SageInputAnswer}.
    33643483
    3365         EXAMPLES:
     3484        EXAMPLES::
     3485
    33663486            sage: from sage.misc.sage_input import SageInputAnswer
    33673487            sage: v = SageInputAnswer('', 'sin(3.14)', {'sin': math.sin}); v
    33683488            LOCALS:
     
    33873507        \sage command line, you get a result in a nice form ready to
    33883508        copy-and-paste.
    33893509
    3390         EXAMPLES:
     3510        EXAMPLES::
     3511
    33913512            sage: from sage.misc.sage_input import SageInputAnswer
    33923513            sage: v = SageInputAnswer('', 'sin(3.14)', {'sin': math.sin}); v
    33933514            LOCALS:
  • sage/modular/modform/j_invariant.py

    diff --git a/sage/modular/modform/j_invariant.py b/sage/modular/modform/j_invariant.py
    a b  
    99
    1010    WARNING: Stupid algorithm -- we divide by Delta, which is slow.
    1111
    12     EXAMPLES:
     12    EXAMPLES::
     13
    1314        sage: j_invariant_qexp(4)
    1415        q^-1 + 744 + 196884*q + 21493760*q^2 + 864299970*q^3 + O(q^4)
    1516        sage: j_invariant_qexp(2)
  • sage/modular/modform/theta.py

    diff --git a/sage/modular/modform/theta.py b/sage/modular/modform/theta.py
    a b  
    2424    OUTPUT:
    2525        a power series over K
    2626       
    27     EXAMPLES:
     27    EXAMPLES::
     28
    2829        sage: theta2_qexp(18)
    2930        q + q^9 + O(q^18)   
    3031        sage: theta2_qexp(49)
     
    7374    OUTPUT:
    7475        a power series over K
    7576   
    76     EXAMPLES:
     77    EXAMPLES::
     78
    7779        sage: theta_qexp(25)
    7880        1 + 2*q + 2*q^4 + 2*q^9 + 2*q^16 + O(q^25)
    7981        sage: theta_qexp(10)
  • sage/modular/overconvergent/hecke_series.py

    diff --git a/sage/modular/overconvergent/hecke_series.py b/sage/modular/overconvergent/hecke_series.py
    a b  
    826826
    827827    - list of q-expansions (to same finite precision), and q-expansion.
    828828
    829     EXAMPLES:
     829    EXAMPLES::
    830830
    831831        sage: from sage.modular.overconvergent.hecke_series import compute_Wi
    832832        sage: p = 17
  • sage/modules/free_quadratic_module.py

    diff --git a/sage/modules/free_quadratic_module.py b/sage/modules/free_quadratic_module.py
    a b  
    1616to create free modules.  \emph{Do not use the FreeModule\_xxx constructors
    1717directly.}
    1818
    19 EXAMPLES:
     19EXAMPLES::
     20
    2021    sage: M = Matrix(QQ,[[2,1,0],[1,2,1],[0,1,2]])
    2122    sage: V = VectorSpace(QQ,3,inner_product_matrix=M)
    2223    sage: type(V)
     
    113114    inner product matrix.}
    114115
    115116
    116     EXAMPLES:
     117    EXAMPLES::
    117118
    118119        sage: M1 = FreeQuadraticModule(ZZ,2,inner_product_matrix=1)
    119120        sage: M1 is FreeModule(ZZ,2,inner_product_matrix=1)
     
    186187def QuadraticSpace(K, dimension, inner_product_matrix, sparse=False):
    187188    """
    188189    EXAMPLES:
    189     The base can be complicated, as long as it is a field.
     190    The base can be complicated, as long as it is a field.::
     191
    190192        sage: F.<x> = FractionField(PolynomialRing(ZZ,'x'))
    191193        sage: D = diagonal_matrix([x,x-1,x+1])
    192194        sage: V = QuadraticSpace(F,3,D)
     
    228230    """
    229231    Returns True if M is a free quadratic module.
    230232
    231     EXAMPLES:
     233    EXAMPLES::
     234
    232235        sage: from sage.modules.free_quadratic_module import is_FreeQuadraticModule
    233236        sage: U = FreeModule(QQ,3)
    234237        sage: is_FreeQuadraticModule(U)
     
    254257            base_ring -- a commutative ring
    255258            rank -- a non-negative integer
    256259           
    257         EXAMPLES:
     260        EXAMPLES::
     261
    258262            sage: R = PolynomialRing(QQ,3,'x')
    259263            sage: FreeModule(R,3,inner_product_matrix=diagonal_matrix(list(R.gens())))
    260264            Ambient free quadratic module of rank 3 over the integral domain Multivariate Polynomial Ring in x0, x1, x2 over Rational Field
     
    273277       
    274278        N.B. This function is for internal use only! See dense_module for use.
    275279
    276         EXAMPLES:
     280        EXAMPLES::
     281
    277282            sage: A = diagonal_matrix([1,2,2])
    278283            sage: M = FreeModule(Integers(8),3,inner_product_matrix=A)
    279284            sage: S = FreeModule(Integers(8),3,inner_product_matrix=A,sparse=True)
     
    289294       
    290295        N.B. This function is for internal use only! See sparse_module for use.
    291296
    292         EXAMPLES:
     297        EXAMPLES::
     298
    293299            sage: A = diagonal_matrix([1,2,2])
    294300            sage: M = FreeModule(Integers(8),3,inner_product_matrix=A)
    295301            sage: S = FreeModule(Integers(8),3,inner_product_matrix=A,sparse=True)
     
    303309        """
    304310        Return the ambient module associated to this module.
    305311       
    306         EXAMPLES:
     312        EXAMPLES::
     313
    307314            sage: R.<x,y> = QQ[]
    308315            sage: M = FreeModule(R,2)
    309316            sage: M.ambient_module()
     
    366373        G = B*A*B.transpose(), where A is the inner product matrix (induced from
    367374        the ambient space), and B the basis matrix.
    368375       
    369         EXAMPLES:
     376        EXAMPLES::
     377
    370378            sage: V = VectorSpace(QQ,4)
    371379            sage: u = V([1/2,1/2,1/2,1/2])
    372380            sage: v = V([0,1,1,0])
     
    404412        the module and/or ambient space.  E.g. On an integral module over ZZ the inner
    405413        product pairing could naturally take values in ZZ, QQ, RR, or CC.
    406414
    407         EXAMPLES:
     415        EXAMPLES::
     416
    408417            sage: M = FreeModule(ZZ, 3)
    409418            sage: M.inner_product_matrix()
    410419            [1 0 0]
     
    448457        the dot product on the ambient vector space.  This is used internally
    449458        by the inner_product function for optimization.
    450459       
    451         EXAMPLES:
     460        EXAMPLES::
     461
    452462            sage: FreeModule(ZZ, 3)._inner_product_is_dot_product()
    453463            True
    454464            sage: FreeModule(ZZ, 3, inner_product_matrix=1)._inner_product_is_dot_product()
     
    474484        while FreeQuadraticModules must have an inner_product_matrix, although
    475485        it can be diagonal.
    476486       
    477         EXAMPLES:
     487        EXAMPLES::
     488
    478489            sage: M0 = FreeModule(ZZ, 3, inner_product_matrix=1)
    479490            sage: M0._inner_product_is_diagonal()
    480491            True
     
    505516        """
    506517        Create a free module over a PID.
    507518       
    508         EXAMPLES:
     519        EXAMPLES::
     520
    509521            sage: FreeModule(ZZ, 2, inner_product_matrix=Matrix([[2,1],[1,2]]))
    510522            Ambient free quadratic module of rank 2 over the principal ideal domain Integer Ring
    511523            Inner product matrix:
     
    525537        It must, however, be contained in the ambient vector space, i.e.,
    526538        the ambient space tensored with the fraction field of R.
    527539       
    528         EXAMPLES:
     540        EXAMPLES::
     541
    529542            sage: V = FreeModule(ZZ,3)
    530543            sage: W = V.submodule([V.gen(0)])
    531544            sage: W.span([V.gen(1)])
     
    549562        must, however, be contained in the ambient vector space, i.e.,
    550563        the ambient space tensored with the fraction field of R.
    551564       
    552         EXAMPLES:
     565        EXAMPLES::
     566
    553567            sage: M = FreeModule(ZZ,3)
    554568            sage: W = M.span_of_basis([M([1,2,3])])
    555569           
     
    583597        """
    584598        Return the zero submodule of this module.
    585599       
    586         EXAMPLES:
     600        EXAMPLES::
     601
    587602            sage: V = FreeModule(ZZ,2)
    588603            sage: V.zero_submodule()
    589604            Free module of degree 2 and rank 0 over Integer Ring
     
    639654            already_echelonized -- bool (default: False): set this if you know the gens
    640655                                   are already in echelon form
    641656       
    642         EXAMPLES:
     657        EXAMPLES::
     658
    643659            sage: V = VectorSpace(GF(7), 3)
    644660            sage: W = V.subspace([[2,3,4]]); W
    645661            Vector space of degree 3 and dimension 1 over Finite Field of size 7
     
    674690            already_echelonized -- bool (default: False): set this if you know the gens
    675691                                   are already in echelon form
    676692       
    677         EXAMPLES:
     693        EXAMPLES::
     694
    678695            sage: V = VectorSpace(GF(7), 3)
    679696            sage: W = V.subspace([[2,3,4]]); W
    680697            Vector space of degree 3 and dimension 1 over Finite Field of size 7
     
    717734            base_ring -- a commutative ring
    718735            rank -- a non-negative integer
    719736           
    720         EXAMPLES:
     737        EXAMPLES::
     738
    721739            sage: FreeModule(ZZ, 4)
    722740            Ambient free module of rank 4 over the principal ideal domain Integer Ring
    723741        """
     
    729747        """
    730748        The printing representation of self.
    731749
    732         EXAMPLES:
     750        EXAMPLES::
     751
    733752            sage: R = ZZ.quo(12)
    734753            sage: M = R^12
    735754            sage: print M
     
    766785        dimension, then in order by their echelon matrices.
    767786       
    768787        EXAMPLES:
    769         We compare rank three free modules over the integers and rationals:
     788        We compare rank three free modules over the integers and rationals::
     789
    770790            sage: QQ^3 < CC^3
    771791            True
    772792            sage: CC^3 < QQ^3
     
    824844        r"""
    825845        Return a latex representation of this ambient free quadratic module.
    826846       
    827         EXAMPLES:
     847        EXAMPLES::
     848
    828849            sage: latex(QQ^3) # indirect doctest
    829850            \Bold{Q}^{3}
    830851           
     
    847868       
    848869        N.B. This function is for internal use only! See dense_module for use.
    849870
    850         EXAMPLES:
     871        EXAMPLES::
     872
    851873            sage: A = diagonal_matrix([1,2,2])
    852874            sage: M = FreeModule(Integers(8),3,inner_product_matrix=A)
    853875            sage: S = FreeModule(Integers(8),3,inner_product_matrix=A,sparse=True)
     
    863885       
    864886        N.B. This function is for internal use only! See sparse_module for use.
    865887
    866         EXAMPLES:
     888        EXAMPLES::
     889
    867890            sage: A = diagonal_matrix([1,2,2])
    868891            sage: M = FreeModule(Integers(8),3,inner_product_matrix=A)
    869892            sage: S = FreeModule(Integers(8),3,inner_product_matrix=A,sparse=True)
     
    886909    """
    887910    def __init__(self, base_ring, rank, inner_product_matrix, sparse=False):
    888911        """
    889         EXAMPLES:
     912        EXAMPLES::
     913
    890914            sage: FreeModule(PolynomialRing(GF(5),'x'), 3)
    891915            Ambient free module of rank 3 over the principal ideal domain
    892916            Univariate Polynomial Ring in x over Finite Field of size 5
     
    899923        """
    900924        The printing representation of self.
    901925
    902         EXAMPLES:
     926        EXAMPLES::
     927
    903928            sage: R = PolynomialRing(ZZ,'x')
    904929            sage: M = FreeModule(R,7)
    905930            sage: print M
     
    947972        Returns the ambient vector space, which is this free module tensored
    948973        with its fraction field.
    949974
    950         EXAMPLES:
     975        EXAMPLES::
     976
    951977            sage: M = ZZ^3;  M.ambient_vector_space()
    952978            Vector space of dimension 3 over Rational Field
    953979        """
     
    9811007            sparse -- bool (default: False)
    9821008            inner_product_matrix -- bool (default: None)
    9831009           
    984         EXAMPLES:
     1010        EXAMPLES::
     1011
    9851012            sage: ZZ^3
    9861013            Ambient free module of rank 3 over the principal ideal domain Integer Ring
    9871014            sage: FreeModule(ZZ,3,inner_product_matrix=Matrix([[2,-1,0],[-1,2,-1],[0,-1,2]]))
     
    9991026        """
    10001027        The printing representation of self.
    10011028
    1002         EXAMPLES:
     1029        EXAMPLES::
     1030
    10031031            sage: M = FreeModule(ZZ, 2, inner_product_matrix=[[2,-1],[-1,2]])
    10041032            sage: M
    10051033            Ambient free quadratic module of rank 2 over the principal ideal domain Integer Ring
     
    10581086            dimension -- a non-negative integer
    10591087            sparse -- bool (default: False)
    10601088
    1061         EXAMPLES:
     1089        EXAMPLES::
     1090
    10621091            sage: VectorSpace(QQ,3,inner_product_matrix=[[2,1,0],[1,2,0],[0,1,2]])
    10631092            Ambient quadratic space of dimension 3 over Rational Field
    10641093            Inner product matrix:
     
    10751104        """
    10761105        The printing representation of self.
    10771106
    1078         EXAMPLES:
     1107        EXAMPLES::
     1108
    10791109            sage: V = FreeModule(QQ,7)
    10801110            sage: print V
    10811111            Vector space of dimension 7 over Rational Field
     
    11201150        """
    11211151        Create a free module with basis over a PID.
    11221152       
    1123         EXAMPLES:
     1153        EXAMPLES::
    11241154
    11251155            sage: A = diagonal_matrix([1,2,2])
    11261156            sage: M = FreeQuadraticModule(ZZ,3,inner_product_matrix=A)
     
    11541184        """
    11551185        The printing representation of self.
    11561186
    1157         EXAMPLES:
     1187        EXAMPLES::
     1188
    11581189            sage: L = ZZ^8
    11591190            sage: E = L.submodule_with_basis([ L.gen(i) - L.gen(0) for i in range(1,8) ])
    11601191            sage: E # indirect doctest
     
    12041235        is a submodule of another.
    12051236       
    12061237        EXAMPLES:
    1207         First we compare two equal vector spaces.
     1238        First we compare two equal vector spaces.::
     1239
    12081240            sage: V = span([[1,2,3], [5,6,7], [8,9,10]], QQ)
    12091241            sage: W = span([[5,6,7], [8,9,10]], QQ)
    12101242            sage: V == W
     
    12461278        r"""
    12471279        Return latex representation of this free module.
    12481280       
    1249         EXAMPLES:
     1281        EXAMPLES::
     1282
    12501283            sage: A = ZZ^3
    12511284            sage: M = A.span_of_basis([[1,2,3],[4,5,6]])
    12521285            sage: M._latex_()
     
    12651298            R -- a principal ideal domain
    12661299
    12671300        EXAMPLES:
    1268             Changing rings preserves the inner product and the user basis:
     1301            Changing rings preserves the inner product and the user basis::
    12691302
    12701303            sage: V = QQ^3
    12711304            sage: W = V.subspace([[2, '1/2', 1]]); W
     
    13041337    An $R$-submodule of $K^n$ where $K$ is the fraction field of a
    13051338    principal ideal domain $R$.
    13061339
    1307     EXAMPLES:
     1340    EXAMPLES::
     1341
    13081342        sage: M = ZZ^3
    13091343        sage: W = M.span_of_basis([[1,2,3],[4,5,19]]); W
    13101344        Free module of degree 3 and rank 2 over Integer Ring
     
    13231357        """
    13241358        Create an embedded free module over a PID.
    13251359       
    1326         EXAMPLES:
     1360        EXAMPLES::
     1361
    13271362            sage: V = ZZ^3
    13281363            sage: W = V.span([[1,2,3],[4,5,6]])
    13291364            sage: W
     
    13411376        """
    13421377        The printing representation of self.
    13431378
    1344         EXAMPLES:
     1379        EXAMPLES::
     1380
    13451381            sage: M = FreeModule(ZZ,8,inner_product_matrix=1)
    13461382            sage: L = M.submodule([ M.gen(i) - M.gen(0) for i in range(1,8) ])
    13471383            sage: print L # indirect doctest
     
    13711407    """
    13721408    An embedded vector subspace with a distinguished user basis.
    13731409
    1374     EXAMPLES:
     1410    EXAMPLES::
     1411
    13751412        sage: M = QQ^3; W = M.submodule_with_basis([[1,2,3], [4,5,19]]); W
    13761413        Vector space of degree 3 and dimension 2 over Rational Field
    13771414        User basis matrix:
     
    14171454        """
    14181455        Create a vector space with given basis.
    14191456       
    1420         EXAMPLES:
     1457        EXAMPLES::
     1458
    14211459            sage: V = QQ^3
    14221460            sage: W = V.span_of_basis([[1,2,3],[4,5,6]])
    14231461            sage: W
     
    14361474        """
    14371475        The printing representation of self.
    14381476
    1439         EXAMPLES:
     1477        EXAMPLES::
     1478
    14401479            sage: V = VectorSpace(QQ,5)
    14411480            sage: U = V.submodule([ V.gen(i) - V.gen(0) for i in range(1,5) ])
    14421481            sage: print U # indirect doctest
     
    14981537    EXAMPLES:
    14991538
    15001539        Since this is an embedded vector subspace with echelonized basis,
    1501         the echelon_coordinates() and user coordinates() agree:
     1540        the echelon_coordinates() and user coordinates() agree::
    15021541
    15031542        sage: V = QQ^3
    15041543        sage: W = V.span([[1,2,3],[4,5,6]])
     
    15241563        """
    15251564        Create an embedded vector subspace with echelonized basis.
    15261565   
    1527         EXAMPLES:
     1566        EXAMPLES::
     1567
    15281568            sage: V = QQ^3
    15291569            sage: W = V.span([[1,2,3],[4,5,6]])
    15301570            sage: W
     
    15421582        """
    15431583        The default printing representation of self.
    15441584
    1545         EXAMPLES:
     1585        EXAMPLES::
     1586
    15461587            sage: V = VectorSpace(QQ,5)
    15471588            sage: U = V.submodule([ V.gen(i) - V.gen(0) for i in range(1,5) ])
    15481589            sage: print U # indirect doctest
  • sage/modules/misc.py

    diff --git a/sage/modules/misc.py b/sage/modules/misc.py
    a b  
    3535        could be.  Instead, see :meth:`sage.matrix.matrix2.Matrix2.gram_schmidt`
    3636        which is safer and more general-purpose.
    3737
    38     EXAMPLES:
     38    EXAMPLES::
    3939
    4040        sage: B = [vector([1,2,1/5]), vector([1,2,3]), vector([-1,0,0])]
    4141        sage: from sage.modules.misc import gram_schmidt
  • sage/modules/quotient_module.py

    diff --git a/sage/modules/quotient_module.py b/sage/modules/quotient_module.py
    a b  
    2525
    2626    To obtain V or W use \code{self.V()} and \code{self.W()}.
    2727
    28     EXAMPLES:
     28    EXAMPLES::
     29
    2930        sage: k.<i> = QuadraticField(-1)
    3031        sage: A = k^3; V = A.span([[1,0,i], [2,i,0]])
    3132        sage: W = A.span([[3,i,i]])
     
    8283        """
    8384        Create this quotient space, from the given domain, sub-module, and quotient_matrix.
    8485
    85         EXAMPLES:
     86        EXAMPLES::
     87
    8688            sage: A = QQ^5; V = A.span_of_basis([[1,0,-1,1,1], [1,-1,0,2/3,3/4]]); V
    8789            Vector space of degree 5 and dimension 2 over Rational Field
    8890            User basis matrix:
     
    126128        Return the rather verbose string representation of this quotient space V/W.
    127129
    128130        EXAMPLES:
    129         We create a quotient vector space over a finite field:
     131        We create a quotient vector space over a finite field::
     132
    130133            sage: k.<a> = GF(9); A = k^3; V = A.span_of_basis([[1,0,a], [a,a,1]]); W = V.span([V.1])
    131134            sage: Q = V/W
    132135
     
    150153        the tuple (V,W).
    151154
    152155        EXAMPLES:
    153         We compute the hash of a certain 0-dimension quotient vector space:
     156        We compute the hash of a certain 0-dimension quotient vector space::
     157
    154158            sage: A = QQ^2; V = A.span_of_basis([[1,0], [1,1]]); W = V.span([V.1, V.0])
    155159            sage: Q = V/W; Q.dimension()
    156160            0
     
    175179        self and other.
    176180
    177181        EXAMPLES:
    178         We create three quotient spaces and compare them:
     182        We create three quotient spaces and compare them::
     183
    179184            sage: A = QQ^2; V = A.span_of_basis([[1,0], [1,1]]);
    180185            sage: W0 = V.span([V.1, V.0]); W1 = V.span([V.1]); W2 = V.span([V.1])
    181186            sage: Q0 = V/W0; Q1 = V/W1; Q2 = V/W2
     
    201206        if it can be made sense of as a list of length the dimension of self.
    202207               
    203208        EXAMPLES:
    204         We create a 2-dimensional quotient of a 3-dimension ambient vector space.
     209        We create a 2-dimensional quotient of a 3-dimension ambient vector space.::
     210
    205211            sage: M = QQ^3 / [[1,2,3]]
    206212
    207213        A list of length 3 coerces into QQ^3, so it coerces into M.
     
    235241        Elements canonically coerce into self if they canonically
    236242        coerce into V.
    237243       
    238         EXAMPLES:
     244        EXAMPLES::
     245
    239246            sage: V = QQ^3; W = V.span([[1,0,0]]); Q = V/W
    240247            sage: Q._coerce_impl(V.0)
    241248            (0, 0)
     
    269276        """
    270277        Given this quotient space $Q = V/W$, return the natural quotient map from V to Q.
    271278
    272         EXAMPLES:
     279        EXAMPLES::
     280
    273281            sage: M = QQ^3 / [[1,2,3]]
    274282            sage: M.quotient_map()
    275283            Vector space morphism represented by the matrix:
     
    293301        Given this quotient space $Q = V/W$, return a fixed choice of linear homomorphism
    294302        (a section) from Q to V.
    295303
    296         EXAMPLES:
     304        EXAMPLES::
     305
    297306            sage: M = QQ^3 / [[1,2,3]]
    298307            sage: M.lift_map()
    299308            Vector space morphism represented by the matrix:
     
    314323
    315324        The lift is a fixed homomorphism. 
    316325
    317         EXAMPLES:
     326        EXAMPLES::
     327
    318328            sage: M = QQ^3 / [[1,2,3]]
    319329            sage: M.lift(M.0)
    320330            (1, 0, 0)
     
    329339        """
    330340        Given this quotient space $Q = V/W$, return W.
    331341
    332         EXAMPLES:
     342        EXAMPLES::
     343
    333344            sage: M = QQ^10 / [range(10), range(2,12)]
    334345            sage: M.W()
    335346            Vector space of degree 10 and dimension 2 over Rational Field
     
    343354        """
    344355        Given this quotient space $Q = V/W$, return $V$.
    345356
    346         EXAMPLES:
     357        EXAMPLES::
     358
    347359            sage: M = QQ^10 / [range(10), range(2,12)]
    348360            sage: M.V()
    349361            Vector space of dimension 10 over Rational Field
     
    354366        """
    355367        Given this quotient space $Q = V/W$, return $V$.  This is the same as self.V().
    356368
    357         EXAMPLES:
     369        EXAMPLES::
     370
    358371            sage: M = QQ^10 / [range(10), range(2,12)]
    359372            sage: M.cover()
    360373            Vector space of dimension 10 over Rational Field
     
    365378        """
    366379        Given this quotient space $Q = V/W$, return $W$.  This is the same as self.W().
    367380
    368         EXAMPLES:
     381        EXAMPLES::
     382
    369383            sage: M = QQ^10 / [range(10), range(2,12)]
    370384            sage: M.relations()
    371385            Vector space of degree 10 and dimension 2 over Rational Field
  • sage/monoids/string_ops.py

    diff --git a/sage/monoids/string_ops.py b/sage/monoids/string_ops.py
    a b  
    1313def strip_encoding(S):
    1414    """
    1515    The upper case string of S stripped of all non-alphabetic characters.
    16     EXAMPLES:
     16    EXAMPLES::
     17
    1718        sage: S = "The cat in the hat."
    1819        sage: strip_encoding(S)
    1920        'THECATINTHEHAT'
     
    5354def coincidence_index(S,n=1):
    5455    """
    5556    The coincidence index of the string S.
    56     EXAMPLES:
     57    EXAMPLES::
     58
    5759        sage: S = strip_encoding("The cat in the hat.")
    5860        sage: coincidence_index(S)
    5961        0.120879120879121
     
    8284    Output: A measure of the difference of probability of association of
    8385    character pairs, relative to their independent one-character probabilities.
    8486
    85     EXAMPLES:
     87    EXAMPLES::
     88
    8689        sage: S = strip_encoding("The cat in the hat.")
    8790        sage: coincidence_discriminant([ S[i:i+2] for i in range(len(S)-1) ])
    8891        0.0827001855677322
  • sage/plot/misc.py

    diff --git a/sage/plot/misc.py b/sage/plot/misc.py
    a b  
    165165
    166166    - A tuple of variables that were "free" in the functions
    167167
    168     EXAMPLES:
     168    EXAMPLES::
    169169
    170170        sage: x,y,z=var('x,y,z')
    171171        sage: f(x,y)=x+y-z
  • sage/quadratic_forms/extras.py

    diff --git a/sage/quadratic_forms/extras.py b/sage/quadratic_forms/extras.py
    a b  
    3232    OUTPUT:
    3333        either False or a non-negative integer
    3434
    35     EXAMPLES:
     35    EXAMPLES::
     36
    3637        sage: is_triangular_number(3)
    3738        2
    3839        sage: is_triangular_number(1)
     
    8384    OUTPUT:
    8485        a square matrix, or a list of n vectors (resp.)
    8586
    86     EXAMPLES:
     87    EXAMPLES::
     88
    8789        sage: A = Matrix(ZZ, 3, 2, range(6))
    8890        sage: extend_to_primitive(A)
    8991        [ 0  1  0]
  • sage/quadratic_forms/genera/genus.py

    diff --git a/sage/quadratic_forms/genera/genus.py b/sage/quadratic_forms/genera/genus.py
    a b  
    2626        A GenusSymbol_global_ring object, encoding the Conway-Sloane
    2727        genus symbol of the quadratic form whose Gram matrix is A.
    2828
    29     EXAMPLES:
     29    EXAMPLES::
     30
    3031        sage: from sage.quadratic_forms.genera.genus import GenusSymbol_global_ring
    3132        sage: from sage.quadratic_forms.genera.genus import Genus
    3233
     
    5152        A Genus_Symbol_p_adic_ring object, encoding the Conway-Sloane
    5253        genus symbol at p of the quadratic form whose Gram matrix is A.
    5354
    54     EXAMPLES:
     55    EXAMPLES::
     56
    5557        sage: from sage.quadratic_forms.genera.genus import LocalGenusSymbol
    5658
    5759        sage: A = Matrix(ZZ, 2, 2, [1,1,1,2])
     
    8385    OUTPUT:
    8486        boolean
    8587
    86     EXAMPLES:
     88    EXAMPLES::
     89
    8790        sage: from sage.quadratic_forms.genera.genus import GenusSymbol_global_ring
    8891        sage: from sage.quadratic_forms.genera.genus import Genus, is_GlobalGenus
    8992
     
    133136    OUTPUT:
    134137        boolean
    135138
    136     EXAMPLES:
     139    EXAMPLES::
     140
    137141        sage: from sage.quadratic_forms.genera.genus import LocalGenusSymbol
    138142
    139143        sage: A = Matrix(ZZ, 2, 2, [1,1,1,2])
     
    195199    OUTPUT:
    196200        a list of lists of integers.
    197201
    198     EXAMPLES:
     202    EXAMPLES::
     203
    199204        sage: from sage.quadratic_forms.genera.genus import LocalGenusSymbol
    200205        sage: from sage.quadratic_forms.genera.genus import canonical_2_adic_compartments
    201206
     
    265270    OUTPUT:
    266271        a list of lists of distinct integers.
    267272
    268     EXAMPLES:
     273    EXAMPLES::
     274
    269275        sage: from sage.quadratic_forms.genera.genus import LocalGenusSymbol
    270276        sage: from sage.quadratic_forms.genera.genus import canonical_2_adic_compartments
    271277        sage: from sage.quadratic_forms.genera.genus import canonical_2_adic_trains
     
    362368    OUTPUT:
    363369        a list of lists of distinct integers.
    364370
    365     EXAMPLES:
     371    EXAMPLES::
     372
    366373        sage: from sage.quadratic_forms.genera.genus import LocalGenusSymbol
    367374        sage: from sage.quadratic_forms.genera.genus import canonical_2_adic_reduction
    368375
     
    443450    OUTPUT:
    444451        a rectangular matrix over a field
    445452
    446     EXAMPLES:
     453    EXAMPLES::
     454
    447455        sage: from sage.quadratic_forms.genera.genus import basis_complement
    448456
    449457        sage: A = Matrix(ZZ, 2, 2, [1,1,1,1])
     
    485493    OUTPUT:
    486494        a pair (tuple) of integers.
    487495
    488     EXAMPLES:
     496    EXAMPLES::
     497
    489498        sage: from sage.quadratic_forms.genera.genus import signature_pair_of_matrix
    490499
    491500        sage: A = Matrix(ZZ, 2, 2, [-1,0,0,3])
     
    541550    OUTPUT:
    542551        a list of lists of integers
    543552
    544     EXAMPLES:
     553    EXAMPLES::
     554
    545555        sage: from sage.quadratic_forms.genera.genus import p_adic_symbol
    546556
    547557        sage: A = DiagonalQuadraticForm(ZZ, [1,2,3,4]).Hessian_matrix()
     
    602612    OUTPUT:
    603613        a pair of the form (boolean, integer)
    604614
    605     EXAMPLES:
     615    EXAMPLES::
     616
    606617        sage: from sage.quadratic_forms.genera.genus import is_even_matrix
    607618
    608619        sage: A = Matrix(ZZ, 2, 2, [1,1,1,1])
     
    633644        a pair (u, B) consisting of an odd integer u and an odd
    634645        integral symmetric matrix B.
    635646
    636     EXAMPLES:
     647    EXAMPLES::
     648
    637649        sage: from sage.quadratic_forms.genera.genus import is_even_matrix
    638650        sage: from sage.quadratic_forms.genera.genus import split_odd
    639651
     
    722734    OUTPUT:
    723735        an integer
    724736
    725     EXAMPLES:
     737    EXAMPLES::
     738
    726739        sage: from sage.quadratic_forms.genera.genus import is_even_matrix
    727740        sage: from sage.quadratic_forms.genera.genus import split_odd
    728741        sage: from sage.quadratic_forms.genera.genus import trace_diag_mod_8
     
    770783    OUTPUT:
    771784        a list of lists of integers (representing a Conway-Sloane 2-adic symbol)
    772785
    773     EXAMPLES:
     786    EXAMPLES::
     787
    774788        sage: from sage.quadratic_forms.genera.genus import two_adic_symbol
    775789
    776790        sage: A = diagonal_matrix(ZZ, [1,2,3,4])
     
    909923        OUTPUT:
    910924            None
    911925
    912         EXAMPLES:
     926        EXAMPLES::
     927
    913928            sage: from sage.quadratic_forms.genera.genus import p_adic_symbol
    914929            sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring
    915930
     
    949964        OUTPUT:
    950965            a string
    951966
    952         EXAMPLES:
     967        EXAMPLES::
     968
    953969            sage: from sage.quadratic_forms.genera.genus import two_adic_symbol
    954970            sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring
    955971
     
    974990        OUTPUT:
    975991            boolean
    976992
    977         EXAMPLES:
     993        EXAMPLES::
     994
    978995            sage: from sage.quadratic_forms.genera.genus import p_adic_symbol
    979996            sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring
    980997
     
    10531070        OUTPUT:
    10541071            a list of lists of integers
    10551072
    1056         EXAMPLES:
     1073        EXAMPLES::
     1074
    10571075            sage: from sage.quadratic_forms.genera.genus import p_adic_symbol
    10581076            sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring
    10591077
     
    11201138        OUTPUT:
    11211139            list of lists of integers
    11221140
    1123         EXAMPLES:
     1141        EXAMPLES::
     1142
    11241143            sage: from sage.quadratic_forms.genera.genus import p_adic_symbol
    11251144            sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring
    11261145
     
    11571176        OUTPUT:
    11581177            integer >= 0
    11591178
    1160         EXAMPLES:
     1179        EXAMPLES::
     1180
    11611181            sage: from sage.quadratic_forms.genera.genus import p_adic_symbol
    11621182            sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring
    11631183
     
    11921212        OUTPUT:
    11931213            an integer
    11941214
    1195         EXAMPLES:
     1215        EXAMPLES::
     1216
    11961217            sage: from sage.quadratic_forms.genera.genus import p_adic_symbol
    11971218            sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring
    11981219
     
    12271248        OUTPUT:
    12281249            an integer >= 0
    12291250
    1230         EXAMPLES:
     1251        EXAMPLES::
     1252
    12311253            sage: from sage.quadratic_forms.genera.genus import p_adic_symbol
    12321254            sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring
    12331255
     
    12591281        OUTPUT:
    12601282            an integer >= 0
    12611283
    1262         EXAMPLES:
     1284        EXAMPLES::
     1285
    12631286            sage: from sage.quadratic_forms.genera.genus import p_adic_symbol
    12641287            sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring
    12651288
     
    13001323        OUTPUT:
    13011324            an integer
    13021325
    1303         EXAMPLES:
     1326        EXAMPLES::
     1327
    13041328            sage: from sage.quadratic_forms.genera.genus import p_adic_symbol
    13051329            sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring
    13061330
     
    13691393        OUTPUT:
    13701394            a list of integers >= 0
    13711395
    1372         EXAMPLES:
     1396        EXAMPLES::
     1397
    13731398            sage: from sage.quadratic_forms.genera.genus import p_adic_symbol
    13741399            sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring
    13751400
     
    14011426        OUTPUT:
    14021427            a list of integers >= 0
    14031428
    1404         EXAMPLES:
     1429        EXAMPLES::
     1430
    14051431            sage: from sage.quadratic_forms.genera.genus import p_adic_symbol
    14061432            sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring
    14071433
     
    14451471        OUTPUT:
    14461472            None
    14471473
    1448         EXAMPLES:       
     1474        EXAMPLES::
     1475       
    14491476            sage: from sage.quadratic_forms.genera.genus import GenusSymbol_global_ring
    14501477
    14511478            sage: A = DiagonalQuadraticForm(ZZ, [1,2,3,4]).Hessian_matrix()
     
    14821509        OUTPUT:
    14831510            a string
    14841511
    1485         EXAMPLES:       
     1512        EXAMPLES::
     1513       
    14861514            sage: from sage.quadratic_forms.genera.genus import GenusSymbol_global_ring
    14871515
    14881516            sage: A = DiagonalQuadraticForm(ZZ, [1,2,3,4]).Hessian_matrix()
     
    15051533        OUTPUT:
    15061534            boolean
    15071535
    1508         EXAMPLES:       
     1536        EXAMPLES::
     1537       
    15091538            sage: from sage.quadratic_forms.genera.genus import GenusSymbol_global_ring
    15101539
    15111540            sage: A1 = DiagonalQuadraticForm(ZZ, [1,2,3,4]).Hessian_matrix()
     
    15481577        OUTPUT:
    15491578            boolean
    15501579
    1551         EXAMPLES:       
     1580        EXAMPLES::
     1581       
    15521582            sage: from sage.quadratic_forms.genera.genus import GenusSymbol_global_ring
    15531583
    15541584            sage: A1 = DiagonalQuadraticForm(ZZ, [1,2,3,4]).Hessian_matrix()
     
    15841614        OUTPUT:
    15851615            a pair of integers (p, n) each >= 0
    15861616
    1587         EXAMPLES:
     1617        EXAMPLES::
     1618
    15881619            sage: from sage.quadratic_forms.genera.genus import GenusSymbol_global_ring
    15891620
    15901621            sage: A = DiagonalQuadraticForm(ZZ, [1,-2,3,4,8,-11]).Hessian_matrix()
     
    16091640        OUTPUT:
    16101641            an integer
    16111642
    1612         EXAMPLES:
     1643        EXAMPLES::
     1644
    16131645            sage: from sage.quadratic_forms.genera.genus import GenusSymbol_global_ring
    16141646
    16151647            sage: A = DiagonalQuadraticForm(ZZ, [1,-2,3,4]).Hessian_matrix()
  • sage/quadratic_forms/quadratic_form__local_field_invariants.py

    diff --git a/sage/quadratic_forms/quadratic_form__local_field_invariants.py b/sage/quadratic_forms/quadratic_form__local_field_invariants.py
    a b  
    224224    OUTPUT:
    225225        an integer
    226226
    227     EXAMPLES:
     227    EXAMPLES::
     228
    228229        sage: Q = DiagonalQuadraticForm(ZZ, [1,0,0,-4,3,11,3])
    229230        sage: Q.signature()
    230231        3
     
    720721    OUTPUT:
    721722        string describing the definiteness
    722723
    723     EXAMPLES:
     724    EXAMPLES::
     725
    724726        sage: Q = DiagonalQuadraticForm(ZZ, [1,1,1,1,1])
    725727        sage: Q.compute_definiteness_string_by_determinants()
    726728        'pos_def'
  • sage/rings/misc.py

    diff --git a/sage/rings/misc.py b/sage/rings/misc.py
    a b  
    1919    OUTPUT:
    2020        field
    2121
    22     EXAMPLES:
     22    EXAMPLES::
     23
    2324        sage: composite_field(QQ,QQbar)
    2425        Algebraic Field
    2526        sage: composite_field(QQ,QQ[sqrt(2)])
  • sage/rings/number_field/totallyreal_phc.py

    diff --git a/sage/rings/number_field/totallyreal_phc.py b/sage/rings/number_field/totallyreal_phc.py
    a b  
    4242    AUTHORS:
    4343    - John Voight (2007-09-19)
    4444
    45     EXAMPLES:
     45    EXAMPLES::
     46
    4647        sage: sage.rings.number_field.totallyreal_phc.coefficients_to_power_sums(3,2,[1,5,7])
    4748        [3, -7, 39]
    4849        sage: sage.rings.number_field.totallyreal_phc.coefficients_to_power_sums(5,4,[1,5,7,9,8])
     
    8384    AUTHORS:
    8485    - John Voight (2007-09-19)
    8586
    86     EXAMPLES:
     87    EXAMPLES::
     88
    8789        sage: from sage.rings.number_field.totallyreal_phc import __lagrange_bounds_phc
    8890        sage: __lagrange_bounds_phc(3,5,[8,1,2,0,1]) # optional
    8991        []
  • sage/rings/pari_ring.py

    diff --git a/sage/rings/pari_ring.py b/sage/rings/pari_ring.py
    a b  
    3333    """
    3434    def __init__(self, x, parent=None):
    3535        """
    36         EXAMPLES:
     36        EXAMPLES::
     37
    3738            sage: R = PariRing()
    3839            sage: f = R('x^3 + 1/2')
    3940            sage: f
     
    8283
    8384class PariRing(UniqueRepresentation, ring.Ring):
    8485    """
    85     EXAMPLES:
     86    EXAMPLES::
     87
    8688        sage: R = PariRing(); R
    8789        Pseudoring of all PARI objects.
    8890        sage: loads(R.dumps()) is R
  • sage/rings/tests.py

    diff --git a/sage/rings/tests.py b/sage/rings/tests.py
    a b  
    2424    OUTPUT:
    2525        a prime finite field
    2626
    27     EXAMPLES:
     27    EXAMPLES::
     28
    2829        sage: sage.rings.tests.prime_finite_field()
    2930        Finite Field of size 64748301524082521489       
    3031    """
     
    3839    OUTPUT:
    3940        a finite field
    4041
    41     EXAMPLES:
     42    EXAMPLES::
     43
    4244        sage: sage.rings.tests.finite_field()
    4345        Finite Field in a of size 161123^4
    4446    """
     
    5456    OUTPUT:
    5557        a finite field
    5658
    57     EXAMPLES:
     59    EXAMPLES::
     60
    5861        sage: sage.rings.tests.small_finite_field()
    5962        Finite Field of size 30029       
    6063    """
     
    6871    """
    6972    Return a random ring of integers modulo n with n at most 50000.
    7073
    71     EXAMPLES:
     74    EXAMPLES::
     75
    7276        sage: sage.rings.tests.integer_mod_ring()
    7377        Ring of integers modulo 30029
    7478    """
     
    8084    """
    8185    Return a quadratic extension of QQ.
    8286
    83     EXAMPLES:
     87    EXAMPLES::
     88
    8489        sage: sage.rings.tests.quadratic_number_field()
    8590        Number Field in a with defining polynomial x^2 - 61099
    8691    """
     
    9499    """
    95100    Return an absolute extension of QQ of degree at most 10.
    96101
    97     EXAMPLES:
     102    EXAMPLES::
     103
    98104        sage: sage.rings.tests.absolute_number_field()
    99105        Number Field in a with defining polynomial x^5 + 82*x^4 - 46*x^3 + 39*x^2 - x - 41       
    100106    """
     
    111117    """
    112118    Return a tower of at most n extensions each of degree at most maxdeg.
    113119
    114     EXAMPLES:
     120    EXAMPLES::
     121
    115122        sage: sage.rings.tests.relative_number_field(3)
    116123        Number Field in aaa with defining polynomial x^2 - 15*x + 17 over its base field
    117124    """
     
    150157       - absolute number fields
    151158       - relative number fields (disabled in the automatic tests for now)
    152159
    153     EXAMPLES:
     160    EXAMPLES::
     161
    154162        sage: type(sage.rings.tests.rings0())
    155163        <type 'list'>       
    156164    """
     
    180188        - polynomial ring over a rings1() ring.
    181189        - multivariate polynomials
    182190
    183     EXAMPLES:
     191    EXAMPLES::
     192
    184193        sage: type(sage.rings.tests.rings0())
    185194        <type 'list'>
    186195    """
     
    198207    """
    199208    Return an iterator over random rings up to the given "level" of complexity.
    200209
    201     EXAMPLES:
     210    EXAMPLES::
     211
    202212        sage: type(sage.rings.tests.random_rings())
    203213        <type 'generator'>
    204214    """
     
    225235                random seed.
    226236        print_seed -- If True (default False), prints the random seed chosen.
    227237
    228     EXAMPLES:
     238    EXAMPLES::
     239
    229240        sage: sage.rings.tests.test_random_elements(trials=2, seed=0)
    230241        survived 0 tests (memory usage = ...)
    231242        Rational Field
     
    268279                random seed.
    269280        print_seed -- If True (default False), prints the random seed chosen.
    270281
    271     EXAMPLES:
     282    EXAMPLES::
     283
    272284        sage: sage.rings.tests.test_random_arith(trials=2, seed=0)
    273285        survived 0 tests (memory usage = ...)
    274286        Rational Field
  • sage/schemes/toric/weierstrass.py

    diff --git a/sage/schemes/toric/weierstrass.py b/sage/schemes/toric/weierstrass.py
    a b  
    577577    polynomial ring. A ``ValueError`` is raised if the polynomial is
    578578    not homogeneous.
    579579
    580     EXAMPLES:
     580    EXAMPLES::
    581581
    582582        sage: from sage.schemes.toric.weierstrass import _check_polynomial_P2
    583583        sage: R.<x,y,z> = QQ[]
     
    734734    polynomial ring. A ``ValueError`` is raised if the polynomial is
    735735    not homogeneous.
    736736
    737     EXAMPLES:
     737    EXAMPLES::
    738738
    739739        sage: from sage.schemes.toric.weierstrass import _check_polynomial_P1xP1
    740740        sage: R.<x0,x1,y0,y1> = QQ[]
     
    918918    polynomial ring. A ``ValueError`` is raised if the polynomial is
    919919    not homogeneous.
    920920
    921     EXAMPLES:
     921    EXAMPLES::
    922922
    923923        sage: from sage.schemes.toric.weierstrass import _check_polynomial_P2_112
    924924        sage: R.<x,y,z,t> = QQ[]
  • sage/server/notebook/worksheet.py

    diff --git a/sage/server/notebook/worksheet.py b/sage/server/notebook/worksheet.py
    a b  
    38833883__internal_test1 = '''
    38843884def foo(x):
    38853885    "
    3886     EXAMPLES:
     3886    EXAMPLES::
     3887
    38873888        sage: 2+2
    38883889        4
    38893890    "
  • sage/structure/proof/all.py

    diff --git a/sage/structure/proof/all.py b/sage/structure/proof/all.py
    a b  
    1010    If t == False, allows integer arithmetic operations to (by default) return results that may depend on unproven conjectures or on probabilistic algorithms.  Such algorithms often have a substantial speed improvement over those requiring proof.
    1111    If t is None, returns the integer arithmetic proof status.
    1212   
    13     EXAMPLES:
     13    EXAMPLES::
     14
    1415    sage: proof.arithmetic()
    1516    True
    1617    sage: proof.arithmetic(False)
     
    3536    If t == False, allows elliptic curve algorithms to (by default) return results that may depend on unproven conjectures or on probabilistic algorithms.  Such algorithms often have a substantial speed improvement over those requiring proof.
    3637    If t is None, returns the current elliptic curve proof status.
    3738   
    38     EXAMPLES:
     39    EXAMPLES::
     40
    3941    sage: proof.elliptic_curve()
    4042    True
    4143    sage: proof.elliptic_curve(False)
     
    6062    If t == False, allows linear algebra algorithms to (by default) return results that may depend on unproven conjectures or on probabilistic algorithms.  Such algorithms often have a substantial speed improvement over those requiring proof.
    6163    If t is None, returns the current linear algebra proof status.
    6264   
    63     EXAMPLES:
     65    EXAMPLES::
     66
    6467    sage: proof.linear_algebra()
    6568    True
    6669    sage: proof.linear_algebra(False)
     
    8588    If t == False, allows number field algorithms to (by default) return results that may depend on unproven conjectures or on probabilistic algorithms.  Such algorithms often have a substantial speed improvement over those requiring proof.
    8689    If t is None, returns the current number field proof status.
    8790   
    88     EXAMPLES:
     91    EXAMPLES::
     92
    8993    sage: proof.number_field()
    9094    True
    9195    sage: proof.number_field(False)
     
    110114        If t == False, allows polynomial algorithms to (by default) return results that may depend on unproven conjectures or on probabilistic algorithms.  Such algorithms often have a substantial speed improvement over those requiring proof.
    111115        If t is None, returns the current polynomial proof status.
    112116           
    113     EXAMPLES:
     117    EXAMPLES::
     118
    114119        sage: proof.polynomial()
    115120        True
    116121        sage: proof.polynomial(False)
     
    135140    If t == False, allows Sage algorithms to (by default) return results that may depend on unproven conjectures or on probabilistic algorithms.  Such algorithms often have a substantial speed improvement over those requiring proof.
    136141    If t is None, returns the current global Sage proof status.
    137142   
    138     EXAMPLES:
     143    EXAMPLES::
     144
    139145    sage: proof.all()
    140146    {'polynomial': True, 'other': True, 'elliptic_curve': True, 'number_field': True, 'linear_algebra': True, 'arithmetic': True}
    141147    sage: proof.number_field(False)
  • sage/structure/proof/proof.py

    diff --git a/sage/structure/proof/proof.py b/sage/structure/proof/proof.py
    a b  
    2727            If t == False, allows integer arithmetic operations to (by default) return results that may depend on unproven conjectures or on probabilistic algorithms.  Such algorithms often have a substantial speed improvement over those requiring proof.
    2828            If t is None, returns the integer arithmetic proof status.
    2929
    30         EXAMPLES:
     30        EXAMPLES::
     31
    3132            sage: proof.arithmetic()
    3233            True
    3334            sage: proof.arithmetic(False)
     
    5354            If t == False, allows elliptic curve algorithms to (by default) return results that may depend on unproven conjectures or on probabilistic algorithms.  Such algorithms often have a substantial speed improvement over those requiring proof.
    5455            If t is None, returns the current elliptic curve proof status.
    5556
    56         EXAMPLES:
     57        EXAMPLES::
     58
    5759            sage: proof.elliptic_curve()
    5860            True
    5961            sage: proof.elliptic_curve(False)
     
    7981            If t == False, allows linear algebra algorithms to (by default) return results that may depend on unproven conjectures or on probabilistic algorithms.  Such algorithms often have a substantial speed improvement over those requiring proof.
    8082            If t is None, returns the current linear algebra proof status.
    8183
    82         EXAMPLES:
     84        EXAMPLES::
     85
    8386            sage: proof.linear_algebra()
    8487            True
    8588            sage: proof.linear_algebra(False)
     
    105108            If t == False, allows number field algorithms to (by default) return results that may depend on unproven conjectures or on probabilistic algorithms.  Such algorithms often have a substantial speed improvement over those requiring proof.
    106109            If t is None, returns the current number field proof status.
    107110           
    108         EXAMPLES:
     111        EXAMPLES::
     112
    109113            sage: proof.number_field()
    110114            True
    111115            sage: proof.number_field(False)
     
    131135            If t == False, allows polynomial algorithms to (by default) return results that may depend on unproven conjectures or on probabilistic algorithms.  Such algorithms often have a substantial speed improvement over those requiring proof.
    132136            If t is None, returns the current polynomial proof status.
    133137           
    134         EXAMPLES:
     138        EXAMPLES::
     139
    135140            sage: proof.polynomial()
    136141            True
    137142            sage: proof.polynomial(False)
     
    152157    """
    153158    Used for easily determining the correct proof flag to use.
    154159
    155     EXAMPLES:
     160    EXAMPLES::
     161
    156162        sage: from sage.structure.proof.proof import get_flag
    157163        sage: get_flag(False)
    158164        False
  • sage/tests/arxiv_0812_2725.py

    diff --git a/sage/tests/arxiv_0812_2725.py b/sage/tests/arxiv_0812_2725.py
    a b  
    1818EXAMPLES:
    1919
    2020The example given in the paper. Note that in this format, we omit fixed
    21 points since they cannot create any sort of crossing.
     21points since they cannot create any sort of crossing.::
    2222
    2323    sage: from sage.tests.arxiv_0812_2725 import *
    2424    sage: dcrossing([(1,5), (2,4), (4,9), (6,12), (7,10), (10,11)])
     
    5353        2-element tuples.
    5454
    5555    EXAMPLES:
    56     There are 3 complete matchings on 4 vertices:
     56    There are 3 complete matchings on 4 vertices::
     57
    5758        sage: from sage.tests.arxiv_0812_2725 import *
    5859        sage: [m for m in CompleteMatchings(4)]
    5960        [[(3, 4), (1, 2)], [(2, 4), (1, 3)], [(2, 3), (1, 4)]]
     
    8889        of L and vertices are labeled by elements of L. Each matching is
    8990        represented by a list of 2-element tuples.
    9091
    91     EXAMPLES:
     92    EXAMPLES::
     93
    9294        sage: from sage.tests.arxiv_0812_2725 import *
    9395        sage: [m for m in matchingsset(('a', 'b', 'c', 'd'))]
    9496        [[('c', 'd'), ('a', 'b')], [('b', 'd'), ('a', 'c')], [('b', 'c'), ('a', 'd')]]
     
    121123       Matchings and set partitions with no crossings at all yield -1.
    122124
    123125    EXAMPLES:
    124     The main example from the paper:
     126    The main example from the paper::
     127
    125128        sage: from sage.tests.arxiv_0812_2725 import *
    126129        sage: dcrossing(setp_to_edges(Set(map(Set, [[1,5],[2,4,9],[3],[6,12],[7,10,11],[8]]))))
    127130        3
     
    207210        d-noncrossing. Because of this, you should not think of the last
    208211        element of the list as having index n-1, but rather -1.
    209212
    210     EXAMPLES:
     213    EXAMPLES::
     214
    211215        sage: from sage.tests.arxiv_0812_2725 import *
    212216        sage: dcrossvec_setp(3)
    213217        [1, 0, 4]
     
    251255
    252256    EXAMPLES:
    253257    The single complete matching on 2 vertices has no crossings, so the
    254     only nonzero entry of the list (the last entry) is 1:
     258    only nonzero entry of the list (the last entry) is 1::
     259
    255260        sage: from sage.tests.arxiv_0812_2725 import *
    256261        sage: dcrossvec_cm(2)
    257262        [0, 1]
     
    291296        probably don't need this function to work through n = 1.
    292297
    293298    EXAMPLES:
    294     Complete matchings:
     299    Complete matchings::
     300
    295301        sage: from sage.tests.arxiv_0812_2725 import *
    296302        sage: tablecolumn(2, 1)
    297303        [1]