python: added function to fetch all rows