code: def test_unflatten_dependent():
      @make_funsor
      def Unflatten(
          k: Value[int],
          x: Funsor,
          i: Bound,
          i_over_k: Fresh[lambda k, i: Bint[i.size // k]],
          i_mod_k: Fresh[lambda k: Bint[k]],
      ) -> Fresh[lambda x: x]:
          assert i.output.size % k == 0
          return x(**{i.name: i_over_k * Number(k, k + 1) + i_mod_k})
  
      inputs = OrderedDict()
      inputs["a"] = Bint[5]
      inputs["b"] = Bint[6]
      data = random_tensor(inputs, Real)
      x = Unflatten(2, data, "b", "c", "d")
      assert isinstance(x, Tensor)
  
      check_funsor(
          x,
          {"a": Bint[5], "c": Bint[3], "d": Bint[2]},
          Real,
          data.data.reshape(5, 3, 2),
      )
  
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 5 for calling a global function with example usage: test_unflatten_dependent() and returns: x