Assert that expr is not None.

    :param expr: expression.
    :param message: Message set to raised Exception
    :raises: TestStepFail if expr is None.
771701
def assertNotNone(expr, message=None):
    
    if expr is None:
        raise TestStepFail(
            format_message(message) if message is not None else "Assert: %s == None" % str(expr))
779779
def verify_is_not_instance(self, obj, cls, msg=""):
        
        try:
            self.assert_is_not_instance(obj, cls, msg)
        except AssertionError, e:
            if msg:
                m = "%s:\n%s" % (msg, str(e))
            else:
                m = str(e)
            self.verification_erorrs.append(m)
1233982
def assert_is_not(self, actual_val, unexpected_type,
                      failure_message='Expected type not to be "{1}," but was "{0}"'):
        
        assertion = lambda: unexpected_type is not actual_val
        self.webdriver_assert(assertion, unicode(failure_message).format(actual_val, unexpected_type))
817851
def assertEqual(cls, first, second, msg=None):
        
        asserter = None
        if type(first) is type(second):
            asserter = cls.equality_type_funcs.get(type(first))

            try:              basestring = basestring # Python 2
            except NameError: basestring = str        # Python 3

            if asserter is not None:
                if isinstance(asserter, basestring):
                    asserter = getattr(cls, asserter)

        if asserter is None:
            asserter = cls.simple_equality

        if msg is None:
            asserter(first, second)
        else:
            asserter(first, second, msg=msg)
404188
protected void diagnoseLineNumber(Expression expr)
  {
    ElemTemplateElement e = getElemFromExpression(expr);
    System.err.println("   " + e.getSystemId() + " Line " + e.getLineNumber());
  }
116154
public static Boolean assertFalse(Boolean value, String message) {
        if (Boolean.valueOf(value))
            throw new IllegalArgumentException(message);
        return value;
    }
28871
public static void assertTrue(boolean condition, String message, Object... args) {
		verify(condition, message, args);
	}
622075
def _notin(expr, values):
    

    if isinstance(expr, SequenceExpr):
        return NotIn(_input=expr, _values=values, _data_type=types.boolean)
    elif isinstance(expr, Scalar):
        return NotIn(_input=expr, _values=values, _value_type=types.boolean)
417091
def _validate(self, msg):
    
    if not isinstance(msg, self._message_type):
      raise TypeError('Expected a %s instance for %s property',
                      self._message_type.__name__,
                      self._code_name or self._name)
251441
public static Boolean assertFalse(Boolean value, String message) {
        if (Boolean.valueOf(value))
            throw new IllegalStateException(message);
        return value;
    }
922261
def checkMessageSignature(self, message):
        
        message_sig = message.getArg(OPENID_NS, 'sig')
        if not message_sig:
            raise ValueError("%s has no sig." % (message,))
        calculated_sig = self.getMessageSignature(message)
        return cryptutil.const_eq(calculated_sig, message_sig)
1032211
def verify(expr, params=None):
    
    try:
        compile(expr, params=params)
        return True
    except com.TranslationError:
        return False
694104
def assert_in_with_tolerance(obj, seq, tolerance, message=None, extra=None):
    """"""
    for i in seq:
        try:
            assert_eq(obj, i, tolerance=tolerance, message=message, extra=extra)
            return
        except AssertionError:
            pass
    assert False, _assert_fail_message(message, obj, seq, "is not in", extra)
317743
def assert_not_in(obj, seq, message=None, extra=None):
    """"""
    # for very long strings, provide a truncated error
    if isinstance(seq, six.string_types) and obj in seq and len(seq) > 200:
        index = seq.find(obj)
        start_index = index - 50
        if start_index > 0:
            truncated = "(truncated) ..."
        else:
            truncated = ""
            start_index = 0
        end_index = index + len(obj) + 50
        truncated += seq[start_index:end_index]
        if end_index < len(seq):
            truncated += "... (truncated)"
        assert False, _assert_fail_message(message, obj, truncated, "is in", extra)
    assert obj not in seq, _assert_fail_message(message, obj, seq, "is in", extra)
493710
private void assertNotNull(Object value, String message) throws IllegalArgumentException {
        if (value == null) {
            throw new IllegalArgumentException(message);
        }
    }
992714
function isNotEmpty(value, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled &&
        ((typeof value === 'string' && value.length !== 0) ||
            (typeof value === 'number' && value !== 0))) {
        throw LogicException.throw(assertionTypes.IS_NOT_EMPTY, value, message, id);
    }
}
718213
def regexp_error_msg(pattern):
    
    try:
        re.compile(pattern)
    except re.error as e:
        return str(e)
    return None