class_docstr: Hindsight Experience Replay (HER) https://arxiv.org/abs/1707.01495
  
  :param policy: (BasePolicy or str) The policy model to use (MlpPolicy, CnnPolicy, CnnLstmPolicy, ...)
  :param env: (Gym environment or str) The environment to learn from (if registered in Gym, can be str)
  :param model_class: (OffPolicyRLModel) The off policy RL model to apply Hindsight Experience Replay
      currently supported: DQN, DDPG, SAC
  :param n_sampled_goal: (int)
  :param goal_selection_strategy: (GoalSelectionStrategy or str)
docstr: Wrap the environment in a HERGoalEnvWrapper
  if needed and create the replay buffer wrapper.
docstr_tok: ["Wrap","the","environment","in","a","HERGoalEnvWrapper","if","needed","and","create","the","replay","buffer","wrapper","."]
code: def _create_replay_wrapper(self, env):
      """
      Wrap the environment in a HERGoalEnvWrapper
      if needed and create the replay buffer wrapper.
      """
      if not isinstance(env, HERGoalEnvWrapper):
          env = HERGoalEnvWrapper(env)
  
      self.env = env
      # NOTE: we cannot do that check directly with VecEnv
      # maybe we can try calling `compute_reward()` ?
      # assert isinstance(self.env, gym.GoalEnv), "HER only supports gym.GoalEnv"
  
      self.replay_wrapper = functools.partial(
          HindsightExperienceReplayWrapper,
          n_sampled_goal=self.n_sampled_goal,
          goal_selection_strategy=self.goal_selection_strategy,
          wrapped_env=self.env,
      )
  
imports: import functools
  from stable_baselines.common import BaseRLModel
  from stable_baselines.common import OffPolicyRLModel
  from stable_baselines.common.base_class import _UnvecWrapper
  from stable_baselines.common.vec_env import VecEnvWrapper
  from .replay_buffer import HindsightExperienceReplayWrapper, KEY_TO_GOAL_STRATEGY
  from .utils import HERGoalEnvWrapper
label_desc: Use image node_id 2 for calling the HER obj's underlying member method code with example usage: obj._create_replay_wrapper(env) without return types