def METHOD_NAME(shelf_id=None, since_days=1, limit=20, page=1):
    def get_cachable_trending_books(shelf_id=None, since_days=1, limit=20, page=1):
        # enable to work w/ cached
        if 'env' not in web.ctx:
            delegate.fakeload()
        # Return as dict to enable cache serialization
        return [
            dict(book)
            for book in Bookshelves.most_logged_books(
                shelf_id=shelf_id,
                since=dateutil.date_n_days_ago(since_days),
                limit=limit,
                page=page,
            )
        ]
    return cache.memcache_memoize(
        get_cachable_trending_books, 'stats.trending', timeout=dateutil.HOUR_SECS
    )(shelf_id=shelf_id, since_days=since_days, limit=limit, page=page)