(self, action)
This method is responsible for asserting that an action is valid at the current state and returns the
        capped/changed action if not.

        Args:
            action (iterable):      iterable of 2 ints - [PokerEnv.ACTIONTYPE, _raise_amount_in_chips]

        Returns:            [Poker.FOLD, -1]
                        or  [Poker.CHECK_CALL, total_bet_to_be_placed_in_front_by_player]
                        or  [Poker.BET_RAISE, total_bet_to_be_placed_in_front_by_player]
This method is responsible for asserting that an action is valid at the current state and returns the
        capped/changed action if not.
This method is responsible for asserting that an action is valid at the current state and returns the capped / changed action if not .
def _get_fixed_action(self, action):
        """
        This method is responsible for asserting that an action is valid at the current state and returns the
        capped/changed action if not.

        Args:
            action (iterable):      iterable of 2 ints - [PokerEnv.ACTIONTYPE, _raise_amount_in_chips]

        Returns:            [Poker.FOLD, -1]
                        or  [Poker.CHECK_CALL, total_bet_to_be_placed_in_front_by_player]
                        or  [Poker.BET_RAISE, total_bet_to_be_placed_in_front_by_player]

        """
        _action_idx = action[0]

        total_to_call = self._get_biggest_bet_out_there_aka_total_to_call()

        if _action_idx == Poker.FOLD:
            if total_to_call <= self.current_player.current_bet:
                return self._process_check_call(total_to_call=total_to_call)
            else:
                return [Poker.FOLD, -1]

        elif _action_idx == Poker.CHECK_CALL:
            if (self.FIRST_ACTION_NO_CALL
                and (self.n_actions_this_episode == 0)
                and self.current_round == Poker.PREFLOP):
                return [Poker.FOLD, -1]

            return self._process_check_call(total_to_call=total_to_call)

        elif _action_idx == Poker.BET_RAISE:

            # Limit Poker specific rule
            if self.IS_FIXED_LIMIT_GAME:
                if self.n_raises_this_round >= self.MAX_N_RAISES_PER_ROUND[self.current_round]:
                    return self._process_check_call(total_to_call=total_to_call)

            if ((self.current_player.stack + self.current_player.current_bet <= total_to_call)
                or (self.capped_raise.player_that_cant_reopen is self.current_player)):
                return self._process_check_call(total_to_call=total_to_call)
            else:
                return self._process_raise(raise_total_amount_in_chips=action[1])
        else:
            raise RuntimeError('invalid action ({}) must be fold (0), call (1), or raise (2) '.format(_action_idx))
def _get_fixed_action ( self , action ) : _action_idx = action [ 0 ] total_to_call = self . _get_biggest_bet_out_there_aka_total_to_call ( ) if _action_idx == Poker . FOLD : if total_to_call <= self . current_player . current_bet : return self . _process_check_call ( total_to_call = total_to_call ) else : return [ Poker . FOLD , - 1 ] elif _action_idx == Poker . CHECK_CALL : if ( self . FIRST_ACTION_NO_CALL and ( self . n_actions_this_episode == 0 ) and self . current_round == Poker . PREFLOP ) : return [ Poker . FOLD , - 1 ] return self . _process_check_call ( total_to_call = total_to_call ) elif _action_idx == Poker . BET_RAISE : # Limit Poker specific rule if self . IS_FIXED_LIMIT_GAME : if self . n_raises_this_round >= self . MAX_N_RAISES_PER_ROUND [ self . current_round ] : return self . _process_check_call ( total_to_call = total_to_call ) if ( ( self . current_player . stack + self . current_player . current_bet <= total_to_call ) or ( self . capped_raise . player_that_cant_reopen is self . current_player ) ) : return self . _process_check_call ( total_to_call = total_to_call ) else : return self . _process_raise ( raise_total_amount_in_chips = action [ 1 ] ) else : raise RuntimeError ( 'invalid action ({}) must be fold (0), call (1), or raise (2) ' . format ( _action_idx ) )