Make a TypeError explaining why ``t`` doesn't implement our interface.
16219
def _invalid_implementation(self, t, missing, mistyped, mismatched):
        
        assert missing or mistyped or mismatched, "Implementation wasn't invalid."

        message = "\nclass {C} failed to implement interface {I}:".format(
            C=getname(t),
            I=getname(self),
        )
        if missing:
            message += dedent(
                """

                The following methods of {I} were not implemented:
                {missing_methods}"""
            ).format(
                I=getname(self),
                missing_methods=self._format_missing_methods(missing)
            )

        if mistyped:
            message += dedent(
                """

                The following methods of {I} were implemented with incorrect types:
                {mismatched_types}"""
            ).format(
                I=getname(self),
                mismatched_types=self._format_mismatched_types(mistyped),
            )

        if mismatched:
            message += dedent(
                """

                The following methods of {I} were implemented with invalid signatures:
                {mismatched_methods}"""
            ).format(
                I=getname(self),
                mismatched_methods=self._format_mismatched_methods(mismatched),
            )
        return InvalidImplementation(message)
750607
def check_typ(helper, typ):
    
    if typ != "tcp" and typ != "udp":
        helper.exit(summary="Type (-t) must be udp or tcp.", exit_code=unknown, perfdata='')
462801
private synchronized String printTargetError( Throwable t ) {
            StringBuilder msgs = new StringBuilder(t.toString());
            while ( null != (t = t.getCause()) )
                msgs.append("\n").append(t.toString());
            return msgs.toString();
    }
106174
def _infer_type_impl(self, partial, *args, **kwargs):
        """"""
        # pylint: disable=too-many-locals
        if len(args) != 0 and len(kwargs) != 0:
            raise ValueError('Can only specify known argument \
                    types either by positional or kwargs way.')
        sdata = []
        if len(args) != 0:
            keys = c_array(ctypes.c_char_p, [])
            for s in args:
                if s is not None:
                    s = _numpy.dtype(s).type
                    if s not in _DTYPE_NP_TO_MX:
                        raise TypeError('Argument need to be one of ' + str(_DTYPE_NP_TO_MX))
                    sdata.append(_DTYPE_NP_TO_MX[s])
                else:
                    sdata.append(-1)
        else:
            str_keys = []
            for k, v in kwargs.items():
                v = _numpy.dtype(v).type
                if v in _DTYPE_NP_TO_MX:
                    str_keys.append(k)
                    sdata.append(_DTYPE_NP_TO_MX[v])
            keys = c_str_array(str_keys)
        arg_type_size = mx_uint()
        arg_type_data = ctypes.POINTER(ctypes.c_int)()
        out_type_size = mx_uint()
        out_type_data = ctypes.POINTER(ctypes.c_int)()
        aux_type_size = mx_uint()
        aux_type_data = ctypes.POINTER(ctypes.c_int)()
        complete = ctypes.c_int()
        if partial:
            infer_func = _LIB.MXSymbolInferTypePartial
        else:
            infer_func = _LIB.MXSymbolInferType
        check_call(infer_func(
            self.handle,
            mx_uint(len(sdata)),
            keys,
            c_array_buf(ctypes.c_int, array('i', sdata)),
            ctypes.byref(arg_type_size),
            ctypes.byref(arg_type_data),
            ctypes.byref(out_type_size),
            ctypes.byref(out_type_data),
            ctypes.byref(aux_type_size),
            ctypes.byref(aux_type_data),
            ctypes.byref(complete)))
        if complete.value != 0:
            arg_types = [
                _DTYPE_MX_TO_NP[arg_type_data[i]] for i in range(arg_type_size.value)]
            out_types = [
                _DTYPE_MX_TO_NP[out_type_data[i]] for i in range(out_type_size.value)]
            aux_types = [
                _DTYPE_MX_TO_NP[aux_type_data[i]] for i in range(aux_type_size.value)]
            return (arg_types, out_types, aux_types)
        else:
            return (None, None, None)
719403
def wrapply(func, *args, **kwargs):
    ''
    val = args[0]
    if val is None:
        return TypedWrapper(func, None)
    elif isinstance(val, TypedExceptionWrapper):
        tew = copy(val)
        tew.forwarded = True
        return tew
    elif isinstance(val, TypedWrapper):
        return val
    elif isinstance(val, Exception):
        return TypedWrapper(func, *args)

    try:
        return func(*args, **kwargs)
    except Exception as e:
        e.stacktrace = stacktrace()
        return TypedExceptionWrapper(func, *args, exception=e)
129960
def typecast(self, type_):
        
        self.value = SymbolTYPECAST.make_node(type_, self.value, self.lineno)
        return self.value is not None
1186939
def _wrap_type_instantiation(self, type_cls):
        """"""
        def wrapper(*args, **kwargs):
            # use args for struct arguments??
            return type_cls(stream=self._null_stream)
        return wrapper
563472
function assert(t) {
	if (!t.result) {
		errorMessages.push(t.message);

		var errorDetail;
		if (t.expected === undefined && t.actual === undefined) {
			errorDetail = 'Test "' + testName + '" assertion failed' + (t.message ? ': "' + t.message + '"' : '');
		} else {
			errorDetail = 'Test "' + testName + '" assertion failed. Expected <' + t.expected + '> Actual <' + t.actual + '>' + (t.message ? ': "' + t.message + '"' : '');
		}

		errorDetails.push(errorDetail);
	}
}
1164161
def not_implemented(self, func_name):
        '''
        
        '''
        msg = '%s is not overridden by %s' % (func_name, type(self).__name__)
        self.logger.error(msg)
        raise NotImplementedError(msg)
55003
function wrapError(err) {
	if (err && !(err instanceof gutil.PluginError)) {
		err = new PluginError(err.plugin || PLUGIN_NAME, err, {
			showStack: (err.showStack !== false)
		});
	}
	return err;
}
1095233
private void intError(String message,Throwable t) {
        logHandler.error(message, t);
        debugStore.log(message, t);
    }
1126645
def validate_type(self, type_):
        
        if type_ is not None and type_ not in self.types_set:
            raise ValueError('Invalid type for %s:%s' % (self.__class__, type_))
416068
public static void exception(TraceComponent tc, Throwable t) {
    if(isTracing()) SibTr.exception(tc, t);

  }
239941
def raise_type_error(key, type)
      raise_error(type: "type", key: key, supposed: type, found: key.class)
    end
279925
def invalid_type_error(method_name, arg_name, got_value, expected_type,
                       version='0.13.0'):
    
    got_type = type(got_value)
    msg = ("As of {version}, 'adapter.{method_name}' expects argument "
           "'{arg_name}' to be of type '{expected_type}', instead got "
           "{got_value} ({got_type})")
    raise_compiler_error(msg.format(version=version, method_name=method_name,
                         arg_name=arg_name, expected_type=expected_type,
                         got_value=got_value, got_type=got_type))
408934
def _validate_interface_option(attr, value, addrfam='inet'):
    '''
    '''
    valid, _value, errmsg = False, value, 'Unknown validator'
    attrmaps = ATTRMAPS.get(addrfam, [])
    for attrmap in attrmaps:
        if attr in attrmap:
            validate_func = attrmap[attr]
            (valid, _value, errmsg) = validate_func(value)
            break
    return (valid, _value, errmsg)
1066643
def raise_(tp, value=None, tb=None):
    
    if value is not None and isinstance(tp, Exception):
        raise TypeError("instance exception may not have a separate value")
    if value is not None:
        exc = tp(value)
    else:
        exc = tp
    if exc.__traceback__ is not tb:
        raise exc.with_traceback(tb)
    raise exc