code: def test_equality():
      class A(eqxi.Enumeration):
          x = "foo"
          y = "bar"
  
      class B(eqxi.Enumeration):
          z = "qux"
  
      assert A.x == A.x
      assert A.x != A.y
      with pytest.raises(ValueError):
          A.x == 0  # pyright: ignore
      with pytest.raises(ValueError):
          A.x == B.z  # pyright: ignore
      assert not A.x.is_traced()
  
      @jax.jit
      def run1():
          return A.x == A.y
  
      @jax.jit
      def run2():
          return A.x == A.x
  
      @jax.jit
      def run3(a):
          assert a.is_traced()
          return a == A.x
  
      assert tree_allclose(run1(), jnp.array(False))
      assert tree_allclose(run2(), jnp.array(True))
      assert tree_allclose(run3(A.x), jnp.array(True))
      assert tree_allclose(run3(A.y), jnp.array(False))
  
file_path: equinox/tests/test_enum.py
imports: import equinox
  import equinox.internal
  import jax
  import jax.numpy
  import jax.tree_util
  import pytest
  from .helpers import tree_allclose
label_desc: Use image node_id 1 for calling a global function with example usage: test_equality() and returns: unknown, unknown, unknown