class_docstr: Dummy Blackjack-like environment that increments `state` by `action`.
  
  The environment resets when state becomes greater or equal than final_state.
  Actions are 1 or 2.
  A reward of 1 for all non restart states.
class_docstr_tok: ["Dummy","Blackjack-like","environment","that","increments","`","state","`","by","`","action","`",".","The","environment","resets","when","state","becomes","greater","or","equal","than","final_state",".","Actions","are","1","or","2",".","A","reward","of","1","for","all","non","restart","states","."]
code: def _step(self, action):
      if (
          action < self._action_spec.minimum
          or action > self._action_spec.maximum
      ):
          raise ValueError(
              "Action should be in [{0}, {1}], but saw: {2}".format(
                  self._action_spec.minimum,
                  self._action_spec.maximum,
                  action,
              )
          )
      if (
          action.shape != ()
      ):  # pylint: disable=g-explicit-bool-comparison
          raise ValueError("Action should be a scalar.")
  
      if self._state >= self._final_state:
          # Start a new episode. Ignore action
          return self.reset()
  
      self._state += action
      self._state = np.int32(self._state)
      if self._state < self._final_state:
          return ts.transition(self._state, 1.0)
      else:
          return ts.termination(self._state, 1.0)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Any
  import numpy
  import tensorflow
  from tf_agents import specs
  from tf_agents.environments import py_environment
  from tf_agents.policies import py_policy
  from tf_agents.policies import tf_policy
  from tf_agents.replay_buffers import tf_uniform_replay_buffer
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
  from tf_agents.utils import common
label_desc: Use image node_id 4 for calling the PyEnvironmentMock obj's underlying member method code with example usage: obj._step(action) and returns: self, ts, ts