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

    """Context processor that provides a CSRF token, or the string \NOTPROVIDED\ if
    it has not been provided by either a view decorator or the middleware
    """
    def _get_val():
        token = get_token(request)
        if (token is None):
            return u'NOTPROVIDED'
        else:
            return smart_text(token)
    _get_val = lazy(_get_val, six.text_type)
    return {u'csrf_token': _get_val()}