Raise an exception that this node is unexpected.
512339
def visit_Return(self, node: ast.Return) -> Any:  # pylint: disable=no-self-use
        """"""
        raise AssertionError("Unexpected return node during the re-computation: {}".format(ast.dump(node)))
34863
def _raise_exception(self, eobj, edata=None):
        """"""
        _, _, tbobj = sys.exc_info()
        if edata:
            emsg = self._format_msg(eobj["msg"], edata)
            _rwtb(eobj["type"], emsg, tbobj)
        else:
            _rwtb(eobj["type"], eobj["msg"], tbobj)
1229737
def is_exception(node):
    
    if (
        node.name in ("Exception", "BaseException")
        and node.root().name == _EXCEPTIONS_MODULE
    ):
        return True

    if not hasattr(node, "ancestors"):
        return False

    return any(is_exception(parent) for parent in node.ancestors(recurs=True))
1131366
def _check_exception(self):
        """"""
        if self._saved_exception is not None:
            x = self._saved_exception
            self._saved_exception = None
            raise x
189294
def append(self, node):
        ""
        if not isinstance(node, self.__class__):
            raise TypeError('Expected Node instance, got %r' % node)
        self.nodes.append(node)
549825
public static XMLStreamException unexpectedElement(final XMLExtendedStreamReader reader, Set<String> possible) {
        final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.unexpectedElement(reader.getName(), asStringList(possible), reader.getLocation());

        return new XMLStreamValidationException(ex.getMessage(),
                                                ValidationError.from(ex, ErrorType.UNEXPECTED_ELEMENT)
                                                        .element(reader.getName())
                                                        .alternatives(possible),
                                                ex);
    }
425011
function (node) {
        if (funcInfo.shouldCheck) {
          funcInfo.hasReturn = true

          if (!node.argument) {
            context.report({
              node: node,
              message: 'Expected a return value'
            })
          }
        }
      }
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
1181725
def _raise_error(self, *args, **kwargs):
        
        log.debug("_raise_error(): %s" % kwargs)
        try:
            error_code = str(kwargs['code'])
        except KeyError as e:
            raise FaultyPayloadError('_raise_error(): %s' % kwargs)

        try:
            raise self._code_handlers[error_code]()
        except KeyError:
            raise UnknownWSSError()
342699
private static XMLStreamException unexpectedAttribute(final XMLStreamReader reader, final int index) {
        return SecurityManagerLogger.ROOT_LOGGER.unexpectedAttribute(reader.getAttributeName(index), reader.getLocation());
    }
603284
@Factory
    public static Matcher<Proc> raisesException(Matcher<? super Exception> matcher) {
        return raises(IsThrowable.exception(matcher));
    }
298976
private final void consumeExpected(String expected)
          throws javax.xml.transform.TransformerException
  {

    if (tokenIs(expected))
    {
      nextToken();
    }
    else
    {
      error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ expected,
                                                                     m_token });  //"Expected "+expected+", but found: "+m_token);

	  // Patch for Christina's gripe. She wants her errorHandler to return from
	  // this error and continue trying to parse, rather than throwing an exception.
	  // Without the patch, that put us into an endless loop.
		throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR);
	}
  }
385667
def raise_exception(self, exception, tup=None):
        
        if tup:
            message = (
                "Python {exception_name} raised while processing Tuple "
                "{tup!r}\n{traceback}"
            )
        else:
            message = "Python {exception_name} raised\n{traceback}"
        message = message.format(
            exception_name=exception.__class__.__name__, tup=tup, traceback=format_exc()
        )
        self.send_message({"command": "error", "msg": str(message)})
        self.send_message({"command": "sync"})
380757
def on_assert(self, node):    # ('test', 'msg')
        """"""
        if not self.run(node.test):
            self.raise_exception(node, exc=AssertionError, msg=node.msg)
        return True
385740
def raises_not_implemented(self):
        
        if not self.exc:
            return False
        for name in self.exc._get_name_nodes():
            if name.name == "NotImplementedError":
                return True
        return False
248130
def _raise_or_append_exception(self):
        
        message = (
            'Connection dead, no heartbeat or data received in >= '
            '%ds' % (
                self._interval * 2
            )
        )
        why = AMQPConnectionError(message)
        if self._exceptions is None:
            raise why
        self._exceptions.append(why)
1345090
def raise_exception(response)
      raise Wanikani::InvalidKey, "The API key used for this request is invalid." and return if response.status == 401

      message = if response.body.is_a?(Hash) and response.body.has_key?("error")
                  response.body["error"]["message"]
                else
                  "Status code: #{response.status}"
                end
      raise Wanikani::Exception, "There was an error fetching the data from WaniKani (#{message})"
    end