def get_profile(user):
    if user.is_anonymous():
        return None

    try:
        key = key_profile_getprofile(user)
        profile = cache.get(key)
        if profile is not None:
            return profile
        profile = user.get_profile()
        cache.set(key, profile, settings.CACHE_TIMEOUT)
        return profile
    except Profile.DoesNotExist:
        return None
Properly encodes the multipart body of the request
dataset/ETHPy150Open pydanny/django-easy-profiles/easy_profiles/utils.py/get_profile--crossover with--dataset/ETHPy150Open tumblr/pytumblr/pytumblr/request.py/TumblrRequest.encode_multipart_formdata