'Transition from any of the given `from_states` to the given `to_state`.'

def transition_any(self, from_states, to_state, wait=0.0, func=None, args=None, kwargs=None):

    if (not args):
        args = []
    if (not kwargs):
        kwargs = {}
    if (not isinstance(from_states, (tuple, list, set))):
        raise ValueError('from_states    should    be    a    list,    tuple,    or    set')
    for state in from_states:
        if (not (state in self.__states)):
            raise ValueError(('StateMachine    does    not    contain    from_state    %s.' % state))
    if (not (to_state in self.__states)):
        raise ValueError(('StateMachine    does    not    contain    to_state    %s.' % to_state))
    if (self.__current_state == to_state):
        return True
    start = time.time()
    while (not self.lock.acquire(False)):
        time.sleep(0.001)
        if (((start + wait) - time.time()) <= 0.0):
            log.debug('====    Could    not    acquire    lock    in    %s    sec:    %s    ->    %s    ', wait, self.__current_state, to_state)
            return False
    while (not (self.__current_state in from_states)):
        remainder = ((start + wait) - time.time())
        if (remainder > 0):
            self.lock.wait(remainder)
        else:
            log.debug('State    was    not    ready')
            self.lock.release()
            return False
    try:
        if (self.__current_state in from_states):
            return_val = (func(*args, **kwargs) if (func is not None) else True)
            if (not return_val):
                return return_val
            log.debug('    ====    TRANSITION    %s    ->    %s', self.__current_state, to_state)
            self._set_state(to_state)
            return return_val
        else:
            log.error("StateMachine    bug!!        The    lock    should    ensure    this    doesn't    happen!")
            return False
    finally:
        self.lock.notify_all()
        self.lock.release()
