code: def test_methods(call, outer):
      class M(eqx.Module):
          increment: Union[int, jax.Array]
  
          if call:
  
              def __call__(self, x):
                  return x + self.increment
  
              if not outer:
                  __call__ = eqx.filter_grad(__call__)
          else:
  
              def method(self, x):
                  return x + self.increment
  
              if not outer:
                  method = eqx.filter_grad(method)
  
      m = M(jnp.array(5.0))
      grad_m = M(jnp.array(1.0))
      y = jnp.array(1.0)
  
      if call:
          if outer:
              assert eqx.filter_grad(m)(y) == 1
          else:
              assert m(y) == grad_m
      else:
          if outer:
              assert eqx.filter_grad(m.method)(y) == 1
          else:
              assert m.method(y) == grad_m
  
imports: import warnings
  from typing import Union
  import equinox
  import jax
  import jax.numpy
  import jax.random
  import jax.tree_util
  import numpy
  import pytest
  from .helpers import tree_allclose
label_desc: Use image node_id 4 for calling a global function with example usage: test_methods(call, outer) and returns: unknown, unknown