code: def select_action(
      network_def,
      params,
      state,
      rng,
      num_actions,
      eval_mode,
      epsilon_eval,
      epsilon_train,
      epsilon_decay_period,
      training_steps,
      min_replay_history,
      epsilon_fn,
      support,
  ):
      """Select an action from the set of available actions."""
      epsilon = jnp.where(
          eval_mode,
          epsilon_eval,
          epsilon_fn(
              epsilon_decay_period,
              training_steps,
              min_replay_history,
              epsilon_train,
          ),
      )
  
      rng, rng1, rng2, rng3 = jax.random.split(rng, num=4)
      p = jax.random.uniform(rng1)
      best_actions = jnp.argmax(
          network_def.apply(
              params,
              state,
              key=rng2,
              eval_mode=eval_mode,
              support=support,
          ).q_values
      )
      return rng, jnp.where(
          p <= epsilon,
          jax.random.randint(rng3, (), 0, num_actions),
          best_actions,
      )
  
imports: import functools
  from absl import logging
  from dopamine.jax import losses
  from dopamine.jax import networks
  from dopamine.jax.agents.dqn import dqn_agent
  from dopamine.jax.agents.rainbow import rainbow_agent
  from dopamine.metrics import statistics_instance
  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 2 for calling a global function with example usage: select_action(network_def, params, state, rng, num_actions, eval_mode, epsilon_eval, epsilon_train, epsilon_decay_period, training_steps, min_replay_history, epsilon_fn, support) and returns: rng,  jnp