code: def clip_mpo_params(
      params: MPOParams, per_dim_constraining: bool
  ) -> MPOParams:
      clipped_params = MPOParams(
          log_temperature=jnp.maximum(
              _MIN_LOG_TEMPERATURE, params.log_temperature
          ),
          log_alpha_mean=jnp.maximum(
              _MIN_LOG_ALPHA, params.log_alpha_mean
          ),
          log_alpha_stddev=jnp.maximum(
              _MIN_LOG_ALPHA, params.log_alpha_stddev
          ),
      )
      if not per_dim_constraining:
          return clipped_params
      else:
          return clipped_params._replace(
              log_penalty_temperature=jnp.maximum(
                  _MIN_LOG_TEMPERATURE, params.log_penalty_temperature
              )
          )
  
file_path: acme/acme/jax/losses/mpo.py
imports: from typing import NamedTuple, Optional, Tuple, Union
  import jax
  import jax.numpy
  import tensorflow_probability
label_desc: Use image node_id 5 for calling a global function with example usage: clip_mpo_params(params, per_dim_constraining) and returns: clipped_params, clipped_params