<|file_name|>after_signup.py<|end_file_name|><｜fim▁begin｜>import urllib

from canvas import util


def make_cookie_key(key):
    return 'after_signup_' + str(key)

def _get(request, key):
    key = make_cookie_key(key)
    val = request.COOKIES.get(key)
    if val is not None:
                <|fim_middle|>

    return (key, val,)

def get_posted_comment(request):
    '''
    Gets a comment waiting to be posted, if one exists.

    Returns a pair containing the cookie key used to retrieve it and its deserialized JSON.
    '''
    #TODO use dcramer's django-cookies so that we don't rely on having the response object to mutate cookies.
    # That would make this API much cleaner and isolated.
    return _get(request, 'post_comment')

<｜fim▁end｜>
        val = util.loads(urllib.unquote(val))