code: def box_random_state(typ, val, c):
      """Convert a native `RandomStateNumbaModel` structure to an `RandomState` object
      using Numba's internal state array.
  
      Note that `RandomStateNumbaModel` is just a placeholder structure with no
      inherent information about Numba internal random state, all that information
      is instead retrieved from Numba using ``_helperlib.rnd_get_state()`` and a new
      `RandomState` is constructed using the Numba's current internal state.
      """
      pos, state_list = _helperlib.rnd_get_state(
          _helperlib.rnd_get_np_state_ptr()
      )
      rng = RandomState()
      rng.set_state(("MT19937", state_list, pos))
      class_obj = c.pyapi.unserialize(c.pyapi.serialize_object(rng))
      return class_obj
  
imports: from textwrap import dedent, indent
  from typing import Any, Callable, Optional
  import numba.np.unsafe.ndarray
  import numpy
  from numba import _helperlib, types
  from numba.core import cgutils
  from numba.extending import NativeValue, box, models, register_model, typeof_impl, unbox
  from numpy.random import RandomState
  import pytensor.tensor.random.basic
  from pytensor.graph.basic import Apply
  from pytensor.graph.op import Op
  from pytensor.link.numba.dispatch import basic
  from pytensor.link.numba.dispatch.basic import numba_funcify, numba_typify
  from pytensor.link.utils import compile_function_src, get_name_for_object, unique_name_generator
  from pytensor.tensor.basic import get_vector_length
  from pytensor.tensor.random.type import RandomStateType
label_desc: Use image node_id 3 for calling a global function with example usage: box_random_state(typ, val, c) and returns: class_obj