def METHOD_NAME(self, action):
    """Steps through the environment, recording the episode statistics."""
    (
        observations,
        rewards,
        terminations,
        truncations,
        infos,
    ) = self.env.METHOD_NAME(action)
    assert isinstance(
        infos, dict
    ), f"`info` dtype is {type(infos)} while supported dtype is `dict`. This may be due to usage of other wrappers in the wrong order."
    self.episode_returns += rewards
    self.episode_lengths += 1
    dones = np.logical_or(terminations, truncations)
    num_dones = np.sum(dones)
    if num_dones:
        if "episode" in infos or "_episode" in infos:
            raise ValueError(
                "Attempted to add episode stats when they already exist"
            )
        else:
            infos["episode"] = {
                "r": np.where(dones, self.episode_returns, 0.0),
                "l": np.where(dones, self.episode_lengths, 0),
                "t": np.where(
                    dones,
                    np.round(time.perf_counter() - self.episode_start_times, 6),
                    0.0,
                ),
            }
            if self.is_vector_env:
                infos["_episode"] = np.where(dones, True, False)
        self.return_queue.extend(self.episode_returns[dones])
        self.length_queue.extend(self.episode_lengths[dones])
        self.episode_count += num_dones
        self.episode_lengths[dones] = 0
        self.episode_returns[dones] = 0
        self.episode_start_times[dones] = time.perf_counter()
    return (
        observations,
        rewards,
        terminations,
        truncations,
        infos,
    )