parameters: (self, states)
return_statement: return actions[0] if num_states == 1 else actions
docstring: returns action(s),
              - if states contains only a single state then we return the optimal action as an integer,
              - if states contains an array of states then we return the optimal action for each state of the array
docstring_summary: returns action(s),
              - if states contains only a single state then we return the optimal action as an integer,
              - if states contains an array of states then we return the optimal action for each state of the array
docstring_tokens: returns action ( s ) - if states contains only a single state then we return the optimal action as an integer - if states contains an array of states then we return the optimal action for each state of the array
function: def get_action(self, states):
          """
          returns action(s),
              - if states contains only a single state then we return the optimal action as an integer,
              - if states contains an array of states then we return the optimal action for each state of the array
          """
          states = states.reshape(-1, 4, self.height, self.width)
          num_states = states.shape[0]
          actions = self.session.run(self.a, {self.state: states})
          return actions[0] if num_states == 1 else actions
function_tokens: def get_action ( self , states ) : states = states . reshape ( - 1 , 4 , self . height , self . width ) num_states = states . shape [ 0 ] actions = self . session . run ( self . a , { self . state : states } ) return actions [ 0 ] if num_states == 1 else actions