def pages_admin_menu(context, page):
    """Render the admin table of pages."""
    request = context.get('request', None)

    expanded = False
    if request and "tree_expanded" in request.COOKIES:
        cookie_string = urllib.parse.unquote(request.COOKIES['tree_expanded'])
        if cookie_string:
            ids = [int(id) for id in
                urllib.parse.unquote(request.COOKIES['tree_expanded']).split(',')]
            if page.id in ids:
                expanded = True
    context.update({'expanded': expanded, 'page': page})
    return context
dataset/ETHPy150Open batiste/django-page-cms/pages/templatetags/pages_tags.py/pages_admin_menu/original