code: def jax_funcify_RandomVariable(op, node, **kwargs):
      """JAX implementation of random variables."""
      rv = node.outputs[1]
      out_dtype = rv.type.dtype
      out_size = rv.type.shape
  
      if op.ndim_supp > 0:
          out_size = node.outputs[1].type.shape[: -op.ndim_supp]
  
      # If one dimension has unknown size, either the size is determined
      # by a `Shape` operator in which case JAX will compile, or it is
      # not and we fail gracefully.
      if None in out_size:
          assert_size_argument_jax_compatible(node)
  
          def sample_fn(rng, size, dtype, *parameters):
              return jax_sample_fn(op)(
                  rng, size, out_dtype, *parameters
              )
  
      else:
  
          def sample_fn(rng, size, dtype, *parameters):
              return jax_sample_fn(op)(
                  rng, out_size, out_dtype, *parameters
              )
  
      return sample_fn
  
imports: from functools import singledispatch
  import jax
  import numpy
  from numpy.random import Generator, RandomState
  from numpy.random.bit_generator import _coerce_to_uint32_array
  import pytensor.tensor.random.basic
  from pytensor.link.jax.dispatch.basic import jax_funcify, jax_typify
  from pytensor.link.jax.dispatch.shape import JAXShapeTuple
  from pytensor.tensor.shape import Shape, Shape_i
label_desc: Use image node_id 4 for calling a global function with example usage: jax_funcify_RandomVariable(op, node) and returns: sample_fn, jax_sample_fn, jax_sample_fn