code: def target_q(
      target_network, next_states, rewards, terminals, cumulative_gamma
  ):
      """Compute the target Q-value."""
      q_vals = jax.vmap(target_network, in_axes=(0))(
          next_states
      ).q_values
      q_vals = jnp.squeeze(q_vals)
      replay_next_qt_max = jnp.max(q_vals, 1)
      # Calculate the Bellman target value.
      #   Q_t = R_t + \gamma^N * Q'_t+1
      # where,
      #   Q'_t+1 = \argmax_a Q(S_t+1, a)
      #          (or) 0 if S_t is a terminal state,
      # and
      #   N is the update horizon (by default, N=1).
      return jax.lax.stop_gradient(
          rewards
          + cumulative_gamma * replay_next_qt_max * (1.0 - terminals)
      )
  
imports: import collections
  import functools
  import inspect
  import math
  import time
  from absl import logging
  from dopamine.agents.dqn import dqn_agent
  from dopamine.jax import losses
  from dopamine.jax import networks
  from dopamine.metrics import statistics_instance
  from dopamine.replay_memory import circular_replay_buffer
  from dopamine.replay_memory import prioritized_replay_buffer
  import gin
  import jax
  import jax.numpy
  import numpy
  import optax
  import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: target_q(target_network, next_states, rewards, terminals, cumulative_gamma) and returns: jax