def METHOD_NAME(mpijob_state):
    if mpijob_state not in MPIJobV1Alpha1States.all():
        raise ValueError(f"Invalid MPI job state: {mpijob_state}")
    return {
        MPIJobV1Alpha1States.succeeded: RunStates.completed,
        SparkApplicationStates.failed: RunStates.error,
        MPIJobV1Alpha1States.active: RunStates.running,
    }[mpijob_state]