def upload_emoji(request, user_profile):
    emoji_name = request.POST.get('name', None)
    emoji_url = request.POST.get('url', None)
    try:
        check_add_realm_emoji(user_profile.realm, emoji_name, emoji_url)
    except __HOLE__ as e:
        return json_error(e.message_dict)
    return json_success()
dataset/ETHPy150Open zulip/zulip/zerver/views/realm_emoji.py/upload_emoji