code: def sample_her_params(
      trial: optuna.Trial, hyperparams: dict[str, Any]
  ) -> dict[str, Any]:
      """
      Sampler for HerReplayBuffer hyperparams.
  
      :param trial:
      :parma hyperparams:
      :return:
      """
      her_kwargs = trial.her_kwargs.copy()
      her_kwargs["n_sampled_goal"] = trial.suggest_int(
          "n_sampled_goal", 1, 5
      )
      her_kwargs["goal_selection_strategy"] = trial.suggest_categorical(
          "goal_selection_strategy", ["final", "episode", "future"]
      )
      her_kwargs["online_sampling"] = trial.suggest_categorical(
          "online_sampling", [True, False]
      )
      hyperparams["replay_buffer_kwargs"] = her_kwargs
      return hyperparams
  
file_path: FinRL/finrl/agents/stablebaselines3/hyperparams_opt.py
imports: from __future__ import annotations
  from typing import Any
  from typing import Dict
  import numpy
  import optuna
  from stable_baselines3.common.noise import NormalActionNoise
  from stable_baselines3.common.noise import OrnsteinUhlenbeckActionNoise
  from torch import nn
  from utils import linear_schedule
label_desc: Use image node_id 8 for calling a global function with example usage: sample_her_params(trial, hyperparams) and returns: hyperparams