code: def test_shared():
      a = shared(np.array([1, 2, 3], dtype=config.floatX))
  
      pytensor_jax_fn = function([], a, mode="JAX")
      jax_res = pytensor_jax_fn()
  
      assert isinstance(jax_res, jax.Array)
      np.testing.assert_allclose(jax_res, a.get_value())
  
      pytensor_jax_fn = function([], a * 2, mode="JAX")
      jax_res = pytensor_jax_fn()
  
      assert isinstance(jax_res, jax.Array)
      np.testing.assert_allclose(jax_res, a.get_value() * 2)
  
      # Changed the shared value and make sure that the JAX-compiled
      # function also changes.
      new_a_value = np.array([3, 4, 5], dtype=config.floatX)
      a.set_value(new_a_value)
  
      jax_res = pytensor_jax_fn()
      assert isinstance(jax_res, jax.Array)
      np.testing.assert_allclose(jax_res, new_a_value * 2)
  
imports: from collections.abc import Iterable
  from functools import partial
  from typing import Callable, Optional
  import numpy
  import pytest
  from pytensor.compile.function import function
  from pytensor.compile.mode import get_mode
  from pytensor.compile.sharedvalue import SharedVariable, shared
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Apply
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.op import Op, get_test_value
  from pytensor.ifelse import ifelse
  from pytensor.raise_op import assert_op
  from pytensor.tensor.type import dscalar, scalar, vector
label_desc: Use image node_id 4 for calling a global function with example usage: test_shared() without return types