#NEWLINE# def sample( self , n = 10 ) : #NEWLINE# #INDENT# "\n        Returns random sample of n rows as a DataFrame. This is executing:\n            SELECT\n                *\n            FROM\n                <name_of_the_table>\n            ORDER BY\n                RANDOM()\n            LIMIT <n>\n\n        Parameters\n        ----------\n        n: int\n            number of rows to sample\n\n        Examples\n        --------\n        from db import DemoDB\n        db = DemoDB()\n        Not in doctest : can't predict sample        \n        db.tables.Track.sample(10)\n           TrackId                                               Name  AlbumId          0      274                                      Samba Makossa       25\n        1     1971                                Girls, Girls, Girls      162\n        2      843                                               Otay       68\n        3     3498  Concerto for Violin, Strings and Continuo in G...      342\n        4     3004                        Pride (In The Name Of Love)      238\n        5     2938                                      Beautiful Day      233\n        6     2023                          O Braco Da Minha Guitarra      165\n        7     1920                                            Caxanga      158\n        8     3037                                       The Wanderer      240\n        9     1487                           Third Stone From The Sun      120\n\n           MediaTypeId  GenreId                                           Composer          0            1        7                                               None\n        1            1        3                     Mick Mars/Nikki Sixx/Tommy Lee\n        2            1        2  John Scofield, Robert Aries, Milton Chambers a...\n        3            4       24                           Pietro Antonio Locatelli\n        4            1        1                                                 U2\n        5            1        1         Adam Clayton, Bono, Larry Mullen, The Edge\n        6            1        1                                               None\n        7            1        7                  Milton Nascimento, Fernando Brant\n        8            1        1                                           U2; Bono\n        9            1        1                                       Jimi Hendrix\n\n           Milliseconds     Bytes  UnitPrice\n        0        271856   9095410       0.99\n        1        270288   8874814       0.99\n        2        423653  14176083       0.99\n        3        493573  16454937       0.99\n        4        230243   7549085       0.99\n        5        248163   8056723       0.99\n        6        258351   8469531       0.99\n        7        245551   8144179       0.99\n        8        283951   9258717       0.99\n        9        404453  13186975       0.99\n        " #NEWLINE# q = self . _query_templates [ 'table' ] [ 'sample' ] . format ( schema = self . schema , table = self . name , n = n ) #NEWLINE# return pd . read_sql ( q , q . _con )