def METHOD_NAME():
    # Test recursive select that returns tuple of outputs (due to the ops having 2 outputs).
    # Without supporting nested structures it encountered a ((DataNode, DataNode),) branch output
    # and crashed.
    def _select_fwd(op_range_lo, op_range_hi, ops, selected_op_idx, op_args, op_kwargs):
        assert op_range_lo <= op_range_hi
        if op_range_lo == op_range_hi:
            return ops[op_range_lo](*op_args, **op_kwargs)
        mid = (op_range_lo + op_range_hi) // 2
        if selected_op_idx <= mid:
            ret = _select_fwd(op_range_lo, mid, ops, selected_op_idx, op_args, op_kwargs)
        else:
            ret = _select_fwd(mid + 1, op_range_hi, ops, selected_op_idx, op_args, op_kwargs)
        return ret
    def _select_unpack(op_range_lo, op_range_hi, ops, selected_op_idx, op_args, op_kwargs):
        assert op_range_lo <= op_range_hi
        if op_range_lo == op_range_hi:
            return ops[op_range_lo](*op_args, **op_kwargs)
        mid = (op_range_lo + op_range_hi) // 2
        if selected_op_idx <= mid:
            a, b = _select_unpack(op_range_lo, mid, ops, selected_op_idx, op_args, op_kwargs)
        else:
            a, b = _select_unpack(mid + 1, op_range_hi, ops, selected_op_idx, op_args, op_kwargs)
        return a, b
    def select(ops, selected_op_idx, *op_args, unpacking_select=False, **op_kwargs):
        if unpacking_select:
            return _select_unpack(0, len(ops) - 1, ops, selected_op_idx, op_args, op_kwargs)
        else:
            return _select_fwd(0, len(ops) - 1, ops, selected_op_idx, op_args, op_kwargs)
    def rotate(image, label):
        image = fn.rotate(image, angle=42)
        return image, label
    def color(image, label):
        image = fn.color_twist(image, saturation=0)
        return image, label
    @pipeline_def(enable_conditionals=True, num_threads=4, batch_size=8, device_id=0)
    def pipeline(unpacking_select):
        image = types.Constant(np.full((200, 300, 3), 42, dtype=np.uint8), device="cpu")
        label = types.Constant(np.array(1), device="cpu")
        ops = [rotate, color]
        op_idx = fn.random.uniform(values=list(range(len(ops))))
        image, label = select(ops, op_idx, image=image, label=label,
                              unpacking_select=unpacking_select)
        return image, label
    pipe_unpacking = pipeline(unpacking_select=True)
    pipe_unpacking.build()
    pipe_unpacking.run()
    pipe_forwarding = pipeline(unpacking_select=False)
    pipe_forwarding.build()
    pipe_forwarding.run()