Implements the `if` built-in helper.
776634
function(expr, options) {
                    var value;
                    // if it's a function, wrap its value in a compute
                    // that will only change values from true to false
                    if (can.isFunction(expr)) {
                        value = can.compute.truthy(expr)();
                    } else {
                        value = !! Mustache.resolve(expr);
                    }

                    if (value) {
                        return options.fn(options.contexts || this);
                    } else {
                        return options.inverse(options.contexts || this);
                    }
                }
1030459
def unless_node(node, indent)
      # Check if we have any condition met, or an else branch
      node[@value].each_with_index do |value, index|
        # If we have a branch that meets the condition, generate code for the
        # children related to that specific branch
        case value
        when node[@value].first then buffer_eval "unless #{value}"
        else buffer_eval "else"
        end

        # Evaluate child nodes
        node[@children][index].each do |child|
          root child, indent
        end
      end

      # End
      buffer_eval "end"
    end
473567
public static <T> T check(T value, T elseValue, IChecker checker) {
        return check(value, elseValue, checker.check());
    }
871939
def ifelse(self, node):
        ''
        _, cond, _, cons, _, alt = node
        return self.eval(cons) if self.eval(cond) else self.eval(alt)
1099722
def generate_checker(value):
    """"""
    @property
    @wraps(can_be_)
    def checker(self):
        return self.can_be_(value)

    return checker
494288
def p_generate_if(self, p):
        ''
        p[0] = IfStatement(p[3], p[5], p[7], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
796253
def _raise_if_null(self, other):
        
        if self.is_null():
            raise ValueError("Cannot compare null Intervals!")
        if hasattr(other, 'is_null') and other.is_null():
            raise ValueError("Cannot compare null Intervals!")
1259499
def _if(ctx, logical_test, value_if_true=0, value_if_false=False):
    
    return value_if_true if conversions.to_boolean(logical_test, ctx) else value_if_false
904368
def __compare_helper(self, other, condition, notimpl_target):
        
        if not isinstance(other, self.__class__):
            return NotImplemented

        cmp_res = self.__cmp__(other)
        if cmp_res is NotImplemented:
            return notimpl_target

        return condition(cmp_res)
212173
def Maybe(validator):
    
    @wraps(Maybe)
    def built(value):
        if value != None:
            return validator(value)
    return built
1127305
def _handle_if(self, node, scope, ctxt, stream):
        
        self._dlog("handling if/ternary_op")
        cond = self._handle_node(node.cond, scope, ctxt, stream)
        if cond:
            # there should always be an iftrue
            return self._handle_node(node.iftrue, scope, ctxt, stream)
        else:
            if node.iffalse is not None:
                return self._handle_node(node.iffalse, scope, ctxt, stream)
412687
def if_match(self, values):
        
        assert isinstance(values, list)
        for v in values:
            option = Option()
            option.number = defines.OptionRegistry.IF_MATCH.number
            option.value = v
            self.add_option(option)
262987
function shouldSkip(name, value) {
  var attrType = properties[name];
  return value == null ||
    (attrType === types.BOOLEAN && !value) ||
    (attrType === types.OVERLOADED_BOOLEAN && value === false);
}
92366
def ifi_flags(self, value):
        """"""
        self.bytearray[self._get_slicers(4)] = bytearray(c_uint(value or 0))
501298
def check(ty, val):
    ""
    
    if isinstance(ty, basestring):
        ty = Parser().parse(ty)

    return ty.enforce(val)
1150114
def p_if_statement_1(self, p):
        """"""
        p[0] = ast.If(predicate=p[3], consequent=p[5])
899029
def set_if_missing(cfg,section,option,value):
    """"""
    try:
        cfg.get(section,option)
    except NoSectionError:
        cfg.add_section(section)
        cfg.set(section,option,value)
    except NoOptionError:
        cfg.set(section,option,value)