code: def set_rng_state(rng_state: Dict[str, Any]) -> None:
      np.random.set_state(rng_state["np_rng_state"])
      random.setstate(rng_state["random_rng_state"])
  
      if "tf_rng_global_seed" in rng_state:
          tf.compat.v1.random.set_random_seed(
              rng_state["tf_rng_global_seed"]
          )
      if (
          "tf2_rng_global_algorithm" in rng_state
          and "tf2_rng_global_state" in rng_state
      ):
          algorithm = rng_state["tf2_rng_global_algorithm"]
          state = rng_state["tf2_rng_global_state"]
          generator = tf.random.Generator.from_state(state, algorithm)
          tf.random.set_global_generator(generator)
  
imports: import random
  from typing import Any, Dict
  import numpy
  import tensorflow
  from packaging import version
label_desc: Use image node_id 2 for calling a global function with example usage: set_rng_state(rng_state) without return types