code: def assert_jit_cache_len(fxn, expected_len):
      assert len(fxn.jit_cache) > 0
      if issubclass(type(fxn.jit_cache[0].prg), JITRunner):
          assert len(fxn.jit_cache) == expected_len
      else:
          assert len(fxn.jit_cache) == 1
          # until we have a better way of typing the prg in JitItem
          assert type(fxn.jit_cache[0].prg).__name__.endswith("Graph")
          assert len(fxn.jit_cache[0].prg.jit_cache) == expected_len
  
imports: from tinygrad.device import JITRunner
  from tinygrad.nn.state import get_parameters
  from tinygrad import Tensor
  from tinygrad.helpers import Context
label_desc: Use image node_id 2 for calling a global function with example usage: assert_jit_cache_len(fxn, expected_len) without return types