def act(self, states, deterministic=False, independent=False, fetch_tensors=None, buffered=True, index=<NUM_LIT:0>):
self.current_internals = self.next_internals<EOL>if self.unique_state:<EOL><INDENT>self.current_states = dict(state=np.asarray(states))<EOL><DEDENT>else:<EOL><INDENT>self.current_states = {name: np.asarray(states[name]) for name in sorted(states)}<EOL><DEDENT>if fetch_tensors is not None:<EOL><INDENT>self.current_actions, self.next_internals, self.timestep, self.fetched_tensors = self.model.act(<EOL>states=self.current_states,<EOL>internals=self.current_internals,<EOL>deterministic=deterministic,<EOL>independent=independent,<EOL>fetch_tensors=fetch_tensors,<EOL>index=index<EOL>)<EOL>if self.unique_action:<EOL><INDENT>return self.current_actions['<STR_LIT:action>'], self.fetched_tensors<EOL><DEDENT>else:<EOL><INDENT>return self.current_actions, self.fetched_tensors<EOL><DEDENT><DEDENT>self.current_actions, self.next_internals, self.timestep = self.model.act(<EOL>states=self.current_states,<EOL>internals=self.current_internals,<EOL>deterministic=deterministic,<EOL>independent=independent,<EOL>index=index<EOL>)<EOL>if buffered:<EOL><INDENT>if self.unique_action:<EOL><INDENT>return self.current_actions['<STR_LIT:action>']<EOL><DEDENT>else:<EOL><INDENT>return self.current_actions<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if self.unique_action:<EOL><INDENT>return self.current_actions['<STR_LIT:action>'], self.current_states, self.current_internals<EOL><DEDENT>else:<EOL><INDENT>return self.current_actions, self.current_states, self.current_internals<EOL><DEDENT><DEDENT>
Return action(s) for given state(s). States preprocessing and exploration are applied if
configured accordingly.

Args:
    states (any): One state (usually a value tuple) or dict of states if multiple states are expected.
    deterministic (bool): If true, no exploration and sampling is applied.
    independent (bool): If true, action is not followed by observe (and hence not included
        in updates).
    fetch_tensors (list): Optional String of named tensors to fetch
    buffered (bool): If true (default), states and internals are not returned but buffered
        with observes. Must be false for multi-threaded mode as we need atomic inserts.
Returns:
    Scalar value of the action or dict of multiple actions the agent wants to execute.
    (fetched_tensors) Optional dict() with named tensors fetched