human
Complete the below
def file_exists(site, function):

    ''''Check if the given file exists.'
    '''
 What is a the Python code you requested?
assistant
#Here is the Python code you requested.
    def decorator(request, *args, **kwargs):
        file_path = get_file(request.GET.get('dir', ''), request.GET.get('filename', ''), site=site)
        if (file_path is None):
            msg = _('The    requested    File    does    not    exist.')
            messages.add_message(request, messages.ERROR, msg)
            redirect_url = (reverse('filebrowser:fb_browse', current_app=site.name) + query_helper(request.GET, u'', 'dir'))
            return HttpResponseRedirect(redirect_url)
        return function(request, *args, **kwargs)
    return decorator