code: def make_robotics_env(env_id, seed, rank=0, allow_early_resets=True):
      """
      Create a wrapped, monitored gym.Env for MuJoCo.
  
      :param env_id: (str) the environment ID
      :param seed: (int) the initial seed for RNG
      :param rank: (int) the rank of the environment (for logging)
      :param allow_early_resets: (bool) allows early reset of the environment
      :return: (Gym Environment) The robotic environment
      """
      set_global_seeds(seed)
      env = gym.make(env_id)
      keys = ["observation", "desired_goal"]
      # TODO: remove try-except once most users are running modern Gym
      try:  # for modern Gym (>=0.15.4)
          from gym.wrappers import FilterObservation, FlattenObservation
  
          env = FlattenObservation(FilterObservation(env, keys))
      except ImportError:  # for older gym (<=0.15.3)
          from gym.wrappers import (
              FlattenDictWrapper,
          )  # pytype:disable=import-error
  
          env = FlattenDictWrapper(env, keys)
      env = Monitor(
          env,
          logger.get_dir()
          and os.path.join(logger.get_dir(), str(rank)),
          info_keywords=("is_success",),
          allow_early_resets=allow_early_resets,
      )
      env.seed(seed)
      return env
  
file_path: stable-baselines/stable_baselines/common/cmd_util.py
imports: import os
  import warnings
  import gym
  from stable_baselines import logger
  from stable_baselines.bench import Monitor
  from stable_baselines.common.misc_util import set_global_seeds
  from stable_baselines.common.atari_wrappers import make_atari, wrap_deepmind
  from stable_baselines.common.misc_util import mpi_rank_or_zero
  from stable_baselines.common.vec_env import DummyVecEnv, SubprocVecEnv
label_desc: Use image node_id 4 for calling a global function with example usage: make_robotics_env(env_id, seed, rank, allow_early_resets) and returns: env