

@classmethod
def _get_task_data(cls, slug):
    game = _get_game(slug)
    user = _get_user_name()
    try:
        data = _json_decoder.decode(request.POST['data'])
    except KeyError:
        raise BadRequest('Missing parameter "data"')
    except JSONDecodeError as e:
        raise BadRequest(('Data-parameter JSON error: %s' % str(e)))
    if (not isinstance(data, dict)):
        raise BadRequest('Data-parameter is not a dict')
    get_data = data.get
    key = get_data('key')
    if (not key):
        raise BadRequest('No notification-key given')
    if (key not in GameNotificationKeysList.get(game).to_dict()):
        raise BadRequest((('Unknown key "' + cls) + '" given.'))
    msg = get_data('msg')
    if (not msg):
        raise BadRequest('No message given')
    if (not msg.get('text')):
        raise BadRequest('No text-attribute in msg')
    try:
        delay = int((get_data('time') or 0))
    except ValueError:
        raise BadRequest('Incorrect format for time')
    recipient = (get_data('recipient', '').strip() or user)
    return (create_id(), key, user, recipient, msg, game, delay)

dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/controllers/apiv1/gamenotifications.py GamenotificationsController._get_task_data/VarMisuse@154/235 `key`->`cls`