human
Complete this python program:
def get_website_rules():
assistant
#Here is the Python program you requested.

    """Get website route rules from hooks and DocType route
    """
    def _get():
        rules = frappe.get_hooks(u'website_route_rules')
        for d in frappe.get_all(u'DocType', u'name,    route', dict(has_web_view=1)):
            if d.route:
                rules.append(dict(from_route=(u'/' + d.route.strip(u'/')), to_route=d.name))
        return rules
    return frappe.cache().get_value(u'website_route_rules', _get)