'Helper function to pick a desired volume state for given input
operation.
:param NamedConstant operation: Volume operation to pick a
state for. A value from ``VolumeOperations``.
:param NamedConstant state_type: Volume state type request.
:returns: A state from ``VolumeStates`` that will not be part of
a volume\'s states resulting from input operation.
:rtype: ValueConstant'

def _pick_end_state(self, operation, state_type):

    volume_state_table = VolumeStateTable()
    state_flow = volume_state_table.table[operation]
    if (state_type == self.S.ERROR_STATE):
        valid_states = set([state_flow.start_state, state_flow.transient_state, state_flow.end_state])
        err_states = (set(VolumeStates._enumerants.values()) - valid_states)
        err_state = err_states.pop()
        return err_state.value
    elif (state_type == self.S.TRANSIT_STATE):
        return state_flow.transient_state.value
    elif (state_type == self.S.DESTINATION_STATE):
        return state_flow.end_state.value
