code: def is_even_function_calls(include_types=True, dtype=np.int64):
      """The is-even program, via "even-odd" recursion.
  
      Computes True if the input is even, False if the input is odd, by a pair of
      mutually recursive functions is_even and is_odd, which return True and False
      respectively for <1-valued inputs.
  
      Tests out mutual recursion.
  
      Args:
        include_types: If False, we omit types on the variables, requiring a type
            inference pass.
        dtype: The dtype to use for `n`-like internal state variables.
  
      Returns:
        program: Full-powered `instructions.Program` that computes is_even(n).
      """
  
      def pred_type(t):
          return instructions.TensorType(np.bool_, t[0].shape)
  
      # Forward declaration of is_odd.
      is_odd_func = instructions.Function(None, ["n"], "ans", pred_type)
  
      enter_is_even = instructions.Block()
      finish_is_even = instructions.Block()
      recur_is_even = instructions.Block()
      is_even_func = instructions.Function(
          None, ["n"], "ans", pred_type
      )
      # pylint: disable=bad-whitespace
      # Definition of is_even function
      enter_is_even.assign_instructions(
          [
              instructions.prim_op(
                  ["n"], "cond", lambda n: n < 1
              ),  # cond = n < 1
              instructions.BranchOp(
                  "cond", finish_is_even, recur_is_even
              ),  # if cond
          ]
      )
      finish_is_even.assign_instructions(
          [
              instructions.PopOp(["n", "cond"]),  #   done with n, cond
              instructions.prim_op(
                  [], "ans", lambda: True
              ),  #   ans = True
              instructions.halt_op(),  #   return ans
          ]
      )
      recur_is_even.assign_instructions(
          [  # else
              instructions.PopOp(["cond"]),  #   done with cond now
              instructions.prim_op(
                  ["n"], "nm1", lambda n: n - 1
              ),  #   nm1 = n - 1
              instructions.PopOp(["n"]),  #   done with n
              instructions.FunctionCallOp(
                  is_odd_func, ["nm1"], "ans"
              ),  #   ans = is_odd(nm1)
              instructions.PopOp(["nm1"]),  #   done with nm1
              instructions.halt_op(),  #   return ans
          ]
      )
      is_even_blocks = [enter_is_even, finish_is_even, recur_is_even]
      is_even_func.graph = instructions.ControlFlowGraph(is_even_blocks)
  
      enter_is_odd = instructions.Block()
      finish_is_odd = instructions.Block()
      recur_is_odd = instructions.Block()
      # pylint: disable=bad-whitespace
      # Definition of is_odd function
      enter_is_odd.assign_instructions(
          [
              instructions.prim_op(
                  ["n"], "cond", lambda n: n < 1
              ),  # cond = n < 1
              instructions.BranchOp(
                  "cond", finish_is_odd, recur_is_odd
              ),  # if cond
          ]
      )
      finish_is_odd.assign_instructions(
          [
              instructions.PopOp(["n", "cond"]),  #   done with n, cond
              instructions.prim_op(
                  [], "ans", lambda: False
              ),  #   ans = False
              instructions.halt_op(),  #   return ans
          ]
      )
      recur_is_odd.assign_instructions(
          [  # else
              instructions.PopOp(["cond"]),  #   done with cond now
              instructions.prim_op(
                  ["n"], "nm1", lambda n: n - 1
              ),  #   nm1 = n - 1
              instructions.PopOp(["n"]),  #   done with n
              instructions.FunctionCallOp(
                  is_even_func, ["nm1"], "ans"
              ),  #   ans = is_even(nm1)
              instructions.PopOp(["nm1"]),  #   done with nm1
              instructions.halt_op(),  #   return ans
          ]
      )
      is_odd_blocks = [enter_is_odd, finish_is_odd, recur_is_odd]
      is_odd_func.graph = instructions.ControlFlowGraph(is_odd_blocks)
  
      is_even_main_blocks = [
          instructions.Block(
              [
                  instructions.FunctionCallOp(
                      is_even_func, ["n1"], "ans"
                  ),
              ],
              instructions.halt_op(),
          ),
      ]
      # pylint: disable=bad-whitespace
      is_even_vars = {
          "n": instructions.single_type(dtype, ()),
          "n1": instructions.single_type(dtype, ()),
          "cond": instructions.single_type(np.bool_, ()),
          "nm1": instructions.single_type(dtype, ()),
          "ans": instructions.single_type(np.bool_, ()),
      }
      if not include_types:
          _strip_types(is_even_vars)
  
      return instructions.Program(
          instructions.ControlFlowGraph(is_even_main_blocks),
          [is_even_func, is_odd_func],
          is_even_vars,
          ["n1"],
          "ans",
      )
  
file_path: probability/tensorflow_probability/python/experimental/auto_batching/test_programs.py
imports: import numpy
  from tensorflow_probability.python.experimental.auto_batching import instructions
label_desc: Use image node_id 7 for calling a global function with example usage: is_even_function_calls(include_types, dtype) and returns: instructions, instructions