class_docstr: Wrapper for gym CartPole environment where reward is accumulated to the end.
class_docstr_tok: ["Wrapper","for","gym","CartPole","environment","where","reward","is","accumulated","to","the","end","."]
code: def step(self, action):
      obs, rew, terminated, truncated, info = self.env.step(action)
      self.running_reward += rew
      score = self.running_reward if terminated else 0
      return (
          {"obs": obs, "action_mask": np.array([1, 1], dtype=np.int8)},
          score,
          terminated,
          truncated,
          info,
      )
  
file_path: ray/rllib/examples/env/cartpole_sparse_rewards.py
imports: from copy import deepcopy
  import gymnasium
  import numpy
  from gymnasium.spaces import Box, Dict, Discrete
label_desc: Use image node_id 3 for calling the CartPoleSparseRewards obj's underlying member method code with example usage: obj.step(action) and returns: dict,  score,  terminated,  truncated,  info