docstr: return binary action space: either Discrete(n)/MultiDiscrete([2,]*num_binary_buttons)
docstr_tok: ["return","binary","action","space",":","either","Discrete","(","n",")","\/MultiDiscrete","(","[","2",",","]","*","num_binary_buttons",")"]
code: def __get_binary_action_space(self):
      """
      return binary action space: either Discrete(n)/MultiDiscrete([2,]*num_binary_buttons)
      """
      if self.max_buttons_pressed == 0:
          button_space = gym.spaces.MultiDiscrete(
              [
                  2,
              ]
              * self.num_binary_buttons
          )
      else:
          self.button_map = [
              np.array(list(action))
              for action in itertools.product(
                  (0, 1), repeat=self.num_binary_buttons
              )
              if (self.max_buttons_pressed >= sum(action) >= 0)
          ]
          button_space = gym.spaces.Discrete(len(self.button_map))
      return button_space
  
imports: import itertools
  import warnings
  from typing import Optional
  import gym
  import numpy
  import pygame
  from gym.utils import EzPickle
  import vizdoom.vizdoom
label_desc: Use image node_id 12 for calling the VizdoomEnv obj's underlying member method code with example usage: obj.__get_binary_action_space() and returns: button_space