code: def q_values_repeat(model, obs, actions, twin=False):
      action_shape = tf.shape(actions)[0]
      obs_shape = tf.shape(tree.flatten(obs)[0])[0]
      num_repeat = action_shape // obs_shape
      obs_temp = tree.map_structure(
          lambda t: _repeat_tensor(t, num_repeat), obs
      )
      if not twin:
          preds_, _ = model.get_q_values(obs_temp, actions)
      else:
          preds_, _ = model.get_twin_q_values(obs_temp, actions)
      preds = tf.reshape(preds_, [obs_shape, num_repeat, 1])
      return preds
  
imports: from functools import partial
  import numpy
  import gymnasium
  import logging
  import tree
  from typing import Dict, List, Type, Union
  import ray
  import ray.experimental.tf_utils
  from ray.rllib.algorithms.sac.sac_tf_policy import apply_gradients, compute_and_clip_gradients, get_distribution_inputs_and_class, _get_dist_class, build_sac_model, postprocess_trajectory, setup_late_mixins, stats, validate_spaces, ActorCriticOptimizerMixin, ComputeTDErrorMixin
  from ray.rllib.models.modelv2 import ModelV2
  from ray.rllib.models.tf.tf_action_dist import TFActionDistribution
  from ray.rllib.policy.tf_mixins import TargetNetworkMixin
  from ray.rllib.policy.tf_policy_template import build_tf_policy
  from ray.rllib.policy.policy import Policy
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.exploration.random import Random
  from ray.rllib.utils.framework import get_variable, try_import_tf, try_import_tfp
  from ray.rllib.utils.typing import LocalOptimizer, ModelGradients, TensorType, AlgorithmConfigDict
label_desc: Use image node_id 3 for calling a global function with example usage: q_values_repeat(model, obs, actions, twin) and returns: preds