code: def select(predicate, if_true, if_false):
      true_shape = dali.fn.shapes(
          if_true, dtype=dali.types.DALIDataType.INT32
      )
      false_shape = dali.fn.shapes(
          if_false, dtype=dali.types.DALIDataType.INT32
      )
  
      joined = dali.fn.cat(if_true, if_false)
      sh = predicate * true_shape + (1 - predicate) * false_shape
  
      st = dali.fn.stack(true_shape[0] * (1 - predicate), 0)
  
      return dali.fn.slice(
          joined,
          start=st,
          shape=sh,
          axes=[0, 1],
          out_of_bounds_policy="trim_to_shape",
      )
  
imports: import nvidia.dali
label_desc: Use image node_id 4 for calling a global function with example usage: select(predicate, if_true, if_false) and returns: dali