class_docstr: A fake environment with a given spec.
class_docstr_tok: ["A","fake","environment","with","a","given","spec","."]
code: def __init__(
      self,
      spec: specs.EnvironmentSpec,
      *,
      episode_length: int = 25,
  ):
      # Assert that the discount spec is a BoundedArray with range [0, 1].
      def check_discount_spec(path, discount_spec):
          if (
              not isinstance(discount_spec, specs.BoundedArray)
              or not np.isclose(discount_spec.minimum, 0)
              or not np.isclose(discount_spec.maximum, 1)
          ):
              if path:
                  path_str = " " + "/".join(str(p) for p in path)
              else:
                  path_str = ""
              raise ValueError(
                  "discount_spec {}isn't a BoundedArray in [0, 1].".format(
                      path_str
                  )
              )
  
      tree.map_structure_with_path(check_discount_spec, spec.discounts)
  
      self._spec = spec
      self._episode_length = episode_length
      self._step = 0
  
imports: import threading
  from typing import List, Mapping, Optional, Sequence, Callable, Iterator
  from acme import core
  from acme import specs
  from acme import types
  from acme import wrappers
  import dm_env
  import numpy
  import reverb
  from rlds import rlds_types
  import tensorflow
  import tree
label_desc: Use image node_id 1 to create a new Environment object from inherited base classes: dm_env with example: obj = Environment(spec)