code: def test_donation_warning():
      """Test the warning when compiling a function decorated with `filter_jit`"""
  
      @eqx.filter_jit
      def f(x, y):
          return x + jnp.sum(y)
  
      with warnings.catch_warnings():
          warnings.simplefilter("error")
          f(jnp.array(1.0), jnp.ones((10,)))
  
      @eqx.filter_jit(donate="warn")
      def g(x, y):
          return x + jnp.sum(y)
  
      with pytest.warns(
          UserWarning, match=r"Some donated buffers were not usable*"
      ) as record:
          g(jnp.array(1.0), jnp.ones((10,)))
  
      assert len(record) == 1
  
imports: import warnings
  from typing import Union
  import equinox
  import jax
  import jax.numpy
  import jax.random
  import jax.tree_util
  import pytest
  from .helpers import tree_allclose
label_desc: Use image node_id 14 for calling a global function with example usage: test_donation_warning() and returns: unknown, unknown