docstr: Identity environment for testing purposes
  
  :param dim: the size of the action and observation dimension you want
      to learn. Provide at most one of `dim` and `space`. If both are
      None, then initialization proceeds with `dim=1` and `space=None`.
  :param space: the action and observation space. Provide at most one of
      `dim` and `space`.
  :param ep_length: the length of each episode in timesteps
docstr_tok: ["Identity","environment","for","testing","purposes",":","param","dim",":","the","size","of","the","action","and","observation","dimension","you","want","to","learn",".","Provide","at","most","one","of","`","dim","`","and","`","space","`",".","If","both","are","None",",","then","initialization","proceeds","with","`","dim=1","`","and","`","space=None","`",".",":","param","space",":","the","action","and","observation","space",".","Provide","at","most","one","of","`","dim","`","and","`","space","`",".",":","param","ep_length",":","the","length","of","each","episode","in","timesteps"]
code: def __init__(
      self,
      dim: Optional[int] = None,
      space: Optional[Space] = None,
      ep_length: int = 100,
  ):
      """
      Identity environment for testing purposes
  
      :param dim: the size of the action and observation dimension you want
          to learn. Provide at most one of `dim` and `space`. If both are
          None, then initialization proceeds with `dim=1` and `space=None`.
      :param space: the action and observation space. Provide at most one of
          `dim` and `space`.
      :param ep_length: the length of each episode in timesteps
      """
      if space is None:
          if dim is None:
              dim = 1
          space = Discrete(dim)
      else:
          assert (
              dim is None
          ), "arguments for both 'dim' and 'space' provided: at most one allowed"
  
      self.action_space = self.observation_space = space
      self.ep_length = ep_length
      self.current_step = 0
      self.num_resets = -1  # Becomes 0 after __init__ exits.
      self.reset()
  
imports: import numpy
  from typing import Optional
  from gym import Env, Space
  from gym.spaces import Discrete, MultiDiscrete, MultiBinary, Box
label_desc: Use image node_id 1 to create a new IdentityEnv object from inherited base classes: Env with example: obj = IdentityEnv(dim, space, ep_length)