<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def action_to_level(action):
 """Map action name to action level."""

    try:
        return ACTION_LEVEL_MAP[action]
    except LookupError:
        raise d1_common.types.exceptions.InvalidRequest(
            0, 'Unknown action. action="{}"'.format(action)
        )