code: def single_if_program():
      """Single if program: 'if (input > 1) ans = 2; else ans = 0; return ans;'.
  
      Returns:
        program: `instructions.Program` with a simple conditional.
      """
      entry = instructions.Block()
      then_ = instructions.Block()
      else_ = instructions.Block()
      entry.assign_instructions(
          [
              instructions.prim_op(["input"], "cond", lambda n: n > 1),
              instructions.BranchOp("cond", then_, else_),
          ]
      )
      then_.assign_instructions(
          [
              instructions.prim_op([], "answer", lambda: 2),
              instructions.halt_op(),
          ]
      )
      else_.assign_instructions(
          [
              instructions.prim_op([], "answer", lambda: 0),
              instructions.halt_op(),
          ]
      )
  
      single_if_blocks = [entry, then_, else_]
      # pylint: disable=bad-whitespace
      single_if_vars = {
          "input": instructions.single_type(np.int64, ()),
          "cond": instructions.single_type(np.bool_, ()),
          "answer": instructions.single_type(np.int64, ()),
      }
  
      return instructions.Program(
          instructions.ControlFlowGraph(single_if_blocks),
          [],
          single_if_vars,
          ["input"],
          "answer",
      )
  
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 3 for calling a global function with example usage: single_if_program() and returns: instructions