called after Defintion was loaded to sanity check
        raises on error
438595
def check_definition(self):
        
        if not self.write_codec:
            self.__write_codec = self.defined.data_ext

        # TODO need to add back a class scope target limited for subprojects with sub target sets
        targets = self.get_defined_targets()
        if self.__target_only:
            if self.__target_only not in targets:
                raise RuntimeError("invalid target '%s'" % self.__target_only)

            self.targets = [self.__target_only]
        else:
            self.targets = targets
1176406
def waitForDeferred(d, result=None):
    """"""
    from twisted.internet import reactor
    assert reactor.greenlet != getcurrent(), "can't invoke this in the reactor greenlet"
    if result is None:
        result = AsyncResult()

    def cb(res):
        if isinstance(res, defer.Deferred):
            waitForDeferred(res, result)
        else:
            result.set(res)

    def eb(res):
        result.set_exception(res)

    d.addCallbacks(cb, eb)
    try:
        return result.get()
    except failure.Failure, ex:
        ex.raiseException()
533254
private void error(String expected, String actual) {
        if (!recovering) {
            recovering = true;
            final String outputString = (EOF_STRING.equals(actual) || UNTERMINATED_COMMENT_STRING.equals(actual) || COMMENT_NOT_ALLOWED.equals(actual)) ? actual : "'"
                    + actual + "'";
            errors.add(SyntaxError._UnexpectedToken(expected, outputString,
                    lookahead(1).beginLine));
        }
    }
895406
def check(self, check, member, missing=False):
        """"""
        if missing:
            raise self.baseErrorClass()
        return member
209961
function raise(err, parameters, cause) {
  if(!(err instanceof Error)) {
    err = wrap(err, parameters, cause);
  }
  throw err;
}
410718
def _environment_sanity_check(environment):
    """"""
    assert issubclass(environment.undefined, Undefined), 'undefined must ' \
        'be a subclass of undefined because filters depend on it.'
    assert environment.block_start_string != \
        environment.variable_start_string != \
        environment.comment_start_string, 'block, variable and comment ' \
        'start strings must be different'
    assert environment.newline_sequence in ('\r', '\r\n', '\n'), \
        'newline_sequence set to unknown line ending string.'
    return environment
233156
function( required, startFunc ) {
		if ( required !== render.state ) {
			render._stateError( startFunc || render.requireState );
		}
	}
150796
function _check(err, id) {
        updateProgress(1);
        if (err) {
            alert('Failed to load ' + id + ': ' + err);
        }
        loadc++;
        if (itemc == loadc) callback();
    }
481968
def verify_fun(lazy_obj, fun):
    '''
    
    '''
    if not fun:
        raise salt.exceptions.SaltInvocationError(
            'Must specify a function to run!\n'
            'ex: manage.up'
        )
    if fun not in lazy_obj:
        # If the requested function isn't available, lets say why
        raise salt.exceptions.CommandExecutionError(lazy_obj.missing_fun_string(fun))
1331597
function emittedError(err) {
	// jshint validthis:true
	// If operation in progress, reject its promise
	const state = getState(this);
	if (state) {
		clearState(this);
		return state.reject(err);
	}

	// Store error to be returned on next call to
	// `.readEntry()`, `.close()` or `.openReadStream()`.
	if (!getError(this)) setError(this, err);
}
1309479
function _initComplete(err) {
          if( !isResolved ) {
            isResolved = true;
            if( err ) { def.reject(err); }
            else { def.resolve(wilddogObject); }
          }
        }
1356227
function _initComplete(err, result) {
          if( !isResolved ) {
            isResolved = true;
            if( err ) { def.reject(err); }
            else { def.resolve(result); }
          }
        }
328513
public void assertExactlyOneDefined(final String... params) {
    int definedCount = 0;
    for (final String param : params) {
      if (isPresent(param)) {
        if (++definedCount == 2) {
          // No point in going past two
          break;
        }
      }
    }
    if (definedCount != 1) {
      throw new ParameterException(
          String.format("Exactly one of %s must be defined.",
              StringUtils.CommaSpaceJoiner.join(params)));
    }
  }
945197
void expectValidTypeofName(Node n, String found) {
    report(JSError.make(n, UNKNOWN_TYPEOF_VALUE, found));
  }
1371441
def spiceErrorCheck(f):
    

    @functools.wraps(f)
    def with_errcheck(*args, **kwargs):
        try:
            res = f(*args, **kwargs)
            checkForSpiceError(f)
            return res
        except:
            raise

    return with_errcheck
622387
def check_error(result):
    
    return (result.value != ReturnCode.SUCCESSFUL) and (result.value < ReturnCode.WARNING)
454730
def _raise_deferred_exc(self):
    """"""
    if self._deferred_exception:
      try:
        exc_type, exc_value, exc_traceback = self._deferred_exception
        raise_with_traceback(exc_value, exc_traceback)
      except TypeError:
        # If `_deferred_exception` isn't a 3-item tuple (raising a TypeError on the above
        # destructuring), treat it like a bare exception.
        raise self._deferred_exception