code: def test_embedding(getkey):
      emb = eqx.nn.Embedding(100, 512, key=getkey())
      x = jnp.array(1)
      assert emb(x).shape == (512,)
  
      emb = eqx.nn.Embedding(
          num_embeddings=10, embedding_size=20, key=getkey()
      )
      x = jnp.array(0)
      assert emb(x).shape == (20,)
  
      emb = eqx.nn.Embedding(
          10,
          10,
          weight=jnp.linspace(0.1, 10, 100).reshape(10, 10),
          key=getkey(),
      )
      x = jnp.array(-1)
      assert jnp.allclose(emb(x), jnp.linspace(9.1, 10.0, 10))
  
      emb = eqx.nn.Embedding(
          weight=jnp.linspace(0.1, 10, 100).reshape(10, 10)
      )
      x = jnp.array(-1)
      assert jnp.allclose(emb(x), jnp.linspace(9.1, 10.0, 10))
  
imports: import warnings
  from typing import Union
  import equinox
  import jax
  import jax.nn
  import jax.numpy
  import jax.random
  import pytest
label_desc: Use image node_id 26 for calling a global function with example usage: test_embedding(getkey) without return types