def create_sample_bookstore():
 store = bookstore.Bookstore()
 shelf = bookstore_pb2.Shelf()
 shelf.theme = 'Fiction'
 (_, fiction) = store.create_shelf(shelf)
 book = bookstore_pb2.Book()
 book.title = 'README'
 book.author = 'Neal Stephenson'
 store.create_book(fiction, book)
 shelf = bookstore_pb2.Shelf()
 shelf.theme = 'Fantasy'
 (_, fantasy) = store.create_shelf(shelf)
 book = bookstore_pb2.Book()
 book.title = 'A Game of Thrones'
 book.author = 'George R.R. Martin'
 store.create_book(fantasy, book)
 return store

def create_sample_bookstore ( ) : store = bookstore . Bookstore ( ) shelf = bookstore_pb2 . Shelf ( ) shelf . theme = 'Fiction' ( _ , fiction ) = store . create_shelf ( shelf ) book = bookstore_pb2 . Book ( ) book . title = 'README' book . author = 'Neal Stephenson' store . create_book ( fiction , book ) shelf = bookstore_pb2 . Shelf ( ) shelf . theme = 'Fantasy' ( _ , fantasy ) = store . create_shelf ( shelf ) book = bookstore_pb2 . Book ( ) book . title = 'A Game of Thrones' book . author = 'George R.R. Martin' store . create_book ( fantasy , book ) return store
creates a bookstore with some initial sample data .