human
Complete the below
@simple_decorator
def check_localsite_admin(view_func):

    ''''Checks if a user is an admin on a Local Site.
    This checks whether or not the logged-in user is marked as an admin for the
    given local site. If not, this shows a permission denied page.'
    '''
 Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    def _check(request, local_site_name=None, *args, **kwargs):
        if local_site_name:
            if (not request.local_site):
                raise Http404
            local_site = request.local_site
            if (not local_site.is_mutable_by(request.user)):
                response = render_to_response('permission_denied.html', RequestContext(request))
                response.status_code = 403
                return response
        else:
            local_site = None
        return view_func(request, local_site_name=local_site_name, local_site=local_site, *args, **kwargs)
    return _check