code: def create_deepmind_control_environment(
      domain_name: str = gin.REQUIRED,
      task_name: str = gin.REQUIRED,
      use_image_observations: bool = gin.REQUIRED,
  ) -> gym.Env:
      """Wraps a Deepmind Control Suite environment with some basic preprocessing.
  
      Args:
        domain_name: The name of the environment to run.
        task_name: The name of the task to run.
        use_image_observations: If True, the created environment will return image
          observations. Else, it will return the state vector.
  
      Returns:
        A Gym environment with some standard preprocessing.
      """
      env = suite.load(
          domain_name,
          task_name,
          environment_kwargs={"flat_observation": True},
      )
  
      # Wrap the returned environment in a class which conforms to the API expected
      # by Dopamine.
      if use_image_observations:
          env = DeepmindControlWithImagesPreprocessing(env)
      else:
          env = DeepmindControlPreprocessing(env)
  
      return env
  
imports: import collections
  from typing import Any, Mapping, Tuple
  from dm_control import suite
  from dm_control.rl import control
  import dm_env
  from dm_env import specs
  import gin
  import gym
  from gym import spaces
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: create_deepmind_control_environment(domain_name, task_name, use_image_observations) and returns: env