code: def ifelse(arg, true_expr, false_expr):
      
      # Result will be the result of promotion of true/false exprs. These
      # might be conflicting types; same type resolution as case expressions
      # must be used.
      case = ops.SearchedCaseBuilder()
      return case.when(arg, true_expr).else_(false_expr).end()
docs: Shorthand for implementing ternary expressions
  
      bool_expr.ifelse(0, 1)
      e.g., in SQL: CASE WHEN bool_expr THEN 0 else 1 END