human
Complete the below
def get_pages(app=None):

    ''''Get all pages. Called for docs / sitemap'
    '''
assistant
#Here is the Python program you requested.
    def _build(app):
        pages = {}
        if app:
            apps = [app]
        else:
            apps = (frappe.local.flags.web_pages_apps or frappe.get_installed_apps())
        for app in apps:
            app_path = frappe.get_app_path(app)
            for start in get_start_folders():
                pages.update(get_pages_from_path(start, app, app_path))
        return pages
    return frappe.cache().get_value(u'website_pages', (lambda : _build(app)))