code: def cond_merge_ifs_true(node):
      op = node.op
      if not isinstance(op, IfElse):
          return False
      t_ins = node.inputs[1:][: op.n_outs]
  
      replace = {}
      for idx, tval in enumerate(t_ins):
          if (
              tval.owner
              and isinstance(tval.owner.op, IfElse)
              and tval.owner.inputs[0] == node.inputs[0]
          ):
              ins_op = tval.owner.op
              ins_t = tval.owner.inputs[1:][: ins_op.n_outs]
              replace[idx + 1] = ins_t[tval.owner.outputs.index(tval)]
  
      if len(replace) == 0:
          return False
  
      old_ins = list(node.inputs)
      for pos, var in iteritems(replace):
          old_ins[pos] = var
      return op(*old_ins, **dict(return_list=True))
  
imports: from __future__ import absolute_import, print_function, division
  from copy import deepcopy
  from theano.compat import izip
  import logging
  import numpy
  import theano.tensor
  from theano.tensor import TensorType
  from theano import gof
  from theano.gof import Op, Apply
  from six import iteritems
  from six.moves import xrange
  from theano.compile import optdb
  from theano.tensor import opt
  from theano.scan_module.scan_utils import clone
label_desc: Use image node_id 4 for calling a global function with example usage: cond_merge_ifs_true(node) and returns: op, False, False