code: def __init__(
      self,
      domain_name,
      task_name,
      task_kwargs=None,
      visualize_reward=False,
      from_pixels=False,
      height=64,
      width=64,
      camera_id=0,
      frame_skip=2,
      environment_kwargs=None,
      channels_first=True,
      preprocess=True,
  ):
      self._from_pixels = from_pixels
      self._height = height
      self._width = width
      self._camera_id = camera_id
      self._frame_skip = frame_skip
      self._channels_first = channels_first
      self.preprocess = preprocess
  
      if specs is None:
          raise RuntimeError(
              (
                  "The `specs` module from `dm_env` was not imported. Make sure "
                  "`dm_env` is installed and visible in the current python "
                  "environment."
              )
          )
      if suite is None:
          raise RuntimeError(
              (
                  "The `suite` module from `dm_control` was not imported. Make "
                  "sure `dm_control` is installed and visible in the current "
                  "python enviornment."
              )
          )
  
      # create task
      self._env = suite.load(
          domain_name=domain_name,
          task_name=task_name,
          task_kwargs=task_kwargs,
          visualize_reward=visualize_reward,
          environment_kwargs=environment_kwargs,
      )
  
      # true and normalized action spaces
      self._true_action_space = _spec_to_box([self._env.action_spec()])
      self._norm_action_space = spaces.Box(
          low=-1.0,
          high=1.0,
          shape=self._true_action_space.shape,
          dtype=np.float32,
      )
  
      # create observation space
      if from_pixels:
          shape = (
              [3, height, width]
              if channels_first
              else [height, width, 3]
          )
          self._observation_space = spaces.Box(
              low=0, high=255, shape=shape, dtype=np.uint8
          )
          if preprocess:
              self._observation_space = spaces.Box(
                  low=-0.5, high=0.5, shape=shape, dtype=np.float32
              )
      else:
          self._observation_space = _spec_to_box(
              self._env.observation_spec().values()
          )
  
      self._state_space = _spec_to_box(
          self._env.observation_spec().values()
      )
  
      self.current_state = None
  
file_path: ray/python/ray/rllib/env/wrappers/dm_control_wrapper.py
imports: from gymnasium import core, spaces
  import numpy
  from ray.rllib.utils.annotations import PublicAPI
label_desc: Use image node_id 1 to create a new DMCEnv object from inherited base classes: core with example: obj = DMCEnv(domain_name, task_name, task_kwargs, visualize_reward, from_pixels, height, width, camera_id, frame_skip, environment_kwargs, channels_first, preprocess)