code: def test_getitem_getitem(num_inputs):
      @make_funsor
      def GetitemGetitem(
          x: Funsor,
          i: Fresh[lambda x: Bint[x.shape[0]]],
          j: Fresh[lambda x: Bint[x.shape[1]]],
      ) -> Fresh[lambda x: Array[x.dtype, x.shape[2:]]]:
          return x[i][j]
  
      inputs = OrderedDict()
      for name in "abc"[:num_inputs]:
          inputs[name] = Bint[2]
      x = random_tensor(inputs, Reals[3, 4])
  
      expected = x["i"]["j"]
      actual = GetitemGetitem(x, "i", "j")
      check_funsor(
          actual, expected.inputs, expected.output, expected.data
      )
  
imports: import math
  from collections import OrderedDict
  import pytest
  import funsor.ops
  from funsor.domains import Array, Bint, Real, Reals
  from funsor.factory import Bound, Fresh, Has, Value, make_funsor, to_funsor
  from funsor.interpretations import reflect
  from funsor.interpreter import reinterpret
  from funsor.tensor import Tensor
  from funsor.terms import Cat, Funsor, Lambda, Number, eager
  from funsor.testing import assert_close, check_funsor, random_tensor, requires_backend
label_desc: Use image node_id 2 for calling a global function with example usage: test_getitem_getitem(num_inputs) and returns: x