class_docstr: Base wrapper implementing PyEnvironmentBaseWrapper interface for Gym envs.
  
  Action and observation specs are automatically generated from the action and
  observation spaces. See base class for py_environment.Base details.
class_docstr_tok: ["Base","wrapper","implementing","PyEnvironmentBaseWrapper","interface","for","Gym","envs",".","Action","and","observation","specs","are","automatically","generated","from","the","action","and","observation","spaces",".","See","base","class","for","py_environment.Base","details","."]
code: def _step(self, action):
      # Some environments (e.g. FrozenLake) use the action as a key to the
      # transition probability so it has to be hashable. In the case of discrete
      # actions we have a numpy scalar (e.g array(2)) which is not hashable
      # in this case, we simply pull out the scalar value which will be hashable.
      if self._action_is_discrete and isinstance(action, np.ndarray):
          action = action.item()
  
      # TODO(oars): Figure out how tuple or dict actions will be generated by the
      # agents and if we can pass them through directly to gym.
      observation, reward, self._done, self._info = self._gym_env.step(
          action
      )
  
      if self._match_obs_space_dtype:
          observation = self._to_obs_space_dtype(observation)
  
      if self._done:
          return ts.termination(observation, reward)
      else:
          return ts.transition(observation, reward, self._discount)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from typing import Any, Dict, Optional, Text
  import gym
  import gym.spaces
  import numpy
  import tensorflow
  from tf_agents import specs
  from tf_agents.environments import py_environment
  from tf_agents.trajectories import time_step
  from tf_agents.typing import types
  from tensorflow.python.util import nest
label_desc: Use image node_id 7 for calling the GymWrapper obj's underlying member method code with example usage: obj._step(action) and returns: ts, ts