def from_dict(action_dict):
    action_type = action_dict.get("action_type", None)
    target_class = None
    for action_class in DICTIFIABLE_ACTION_CLASSES:
        if action_type == action_class.action_type:
            target_class = action_class
    if not target_class:
        message = "Failed to recover action from dictionary - invalid action type specified %s." % action_type
        raise Exception(message)
    return target_class.from_dict(action_dict)
dataset/ETHPy150Open galaxyproject/pulsar/pulsar/client/action_mapper.py/from_dict/original