code: def global_seed_generator():
      if jax_utils.is_in_jax_tracing_scope():
          raise ValueError(
              "[JAX RNG] When tracing a JAX function, "
              "you should only use seeded random ops, e.g. "
              "you should create a `SeedGenerator` instance, attach it "
              "to your layer/model, and pass the instance as the `seed` "
              "argument when calling random ops. Unseeded random ops "
              "would get incorrectly traced by JAX and would become constant "
              "after tracing. Example:\n\n"
              "```\n"
              "# Make sure to set the seed generator as a layer attribute\n"
              "self.seed_generator = keras.random.SeedGenerator(seed=1337)\n"
              "...\n"
              "out = keras.random.normal(shape=(1,), seed=self.seed_generator)\n"
              "```"
          )
      gen = global_state.get_global_attribute("global_seed_generator")
      if gen is None:
          gen = SeedGenerator()
          global_state.set_global_attribute(
              "global_seed_generator", gen
          )
      return gen
  
file_path: keras/keras/random/seed_generator.py
imports: import random
  import numpy
  from keras import backend
  from keras.api_export import keras_export
  from keras.backend.common import global_state
  from keras.utils import jax_utils
label_desc: Use image node_id 1 for calling a global function with example usage: global_seed_generator() and returns: gen