Return the node or raise a 404 if the node is unknown
761419
def get_node(self, node_id):
        
        try:
            return self._nodes[node_id]
        except KeyError:
            raise aiohttp.web.HTTPNotFound(text="Node ID {} doesn't exist".format(node_id))
107492
def get_node_by_name(self, nodename):
        
        for kind, nodes in self.nodes.items():
            for node in nodes:
                if node.name == nodename:
                    return node
        else:
            raise NodeNotFound(
                "Node `{0}` not found in cluster `{1}`"
                .format(nodename, self.name))
305409
def handle_not_found(exception, **extra):
    """"""
    assert isinstance(exception, NotFound)

    page = Page.query.filter(db.or_(Page.url == request.path,
                                    Page.url == request.path + "/")).first()

    if page:
        _add_url_rule(page.url)
        return render_template(
            [
                page.template_name,
                current_app.config['PAGES_DEFAULT_TEMPLATE']
            ],
            page=page
        )
    elif 'wrapped' in extra:
        return extra['wrapped'](exception)
    else:
        return exception
900135
def get_node_at_path(query_path, context):
    """"""
    if query_path not in context.query_path_to_node:
        raise AssertionError(
            u'Unable to find SqlNode for query path {} with context {}.'.format(
                query_path, context))
    node = context.query_path_to_node[query_path]
    return node
363737
def _get_node(template, context, name):
    '''
    
    '''
    for node in template:
        if isinstance(node, BlockNode) and node.name == name:
            return node.nodelist.render(context)
        elif isinstance(node, ExtendsNode):
            return _get_node(node.nodelist, context, name)

    # raise Exception("Node '%s' could not be found in template." % name)
    return ""
713074
def documentation_404(self, base_url=None):
        """"""
        base_url = self.base_url if base_url is None else base_url

        def handle_404(request, response, *args, **kwargs):
            url_prefix = request.forwarded_uri[:-1]
            if request.path and request.path != "/":
                url_prefix = request.forwarded_uri.split(request.path)[0]

            to_return = OrderedDict()
            to_return['404'] = ("The API call you tried to make was not defined. "
                                "Here's a definition of the API to help you get going :)")
            to_return['documentation'] = self.documentation(base_url, self.determine_version(request, False),
                                                            prefix=url_prefix)

            if self.output_format == hug.output_format.json:
                response.data = hug.output_format.json(to_return, indent=4, separators=(',', ': '))
                response.content_type = 'application/json; charset=utf-8'
            else:
                response.data = self.output_format(to_return, request=request, response=response)
                response.content_type = self.output_format.content_type

            response.status = falcon.HTTP_NOT_FOUND

        handle_404.interface = True
        return handle_404
485152
def get_node(api_url=None, node_name=None, verify=False, cert=list()):
    
    return utils._make_api_request(api_url, '/nodes/{0}'.format(node_name), verify, cert)
112569
def get_node(self, name, memory=False, binary=False):
        
        return self._api_get(
            url='/api/nodes/{0}'.format(name),
            params=dict(
                binary=binary,
                memory=memory,
            ),
        )
79830
def search!(path, node = doc)
      node.search(path) or raise Error::NodeNotFound, "node for `#{path}` not found"
    end
1045705
def get_node(conn, name):
    '''
    
    '''
    for node in conn.list_servers(per_page=1000):
        if node['name'] == name:
            return node
838219
def get_node(self, node_id):
        """"""
        try:
            node_object = self.nodes[node_id]
        except KeyError:
            raise NonexistentNodeError(node_id)
        return node_object
1328562
def _handle_unknown_method(self, method, remainder, request=None):
        '''
        
        '''
        if request is None:
            self._raise_method_deprecation_warning(self._handle_unknown_method)

        # try finding a post_{custom} or {custom} method first
        controller = self._find_controller('post_%s' % method, method)
        if controller:
            return controller, remainder

        # if no controller exists, try routing to a sub-controller; note that
        # since this isn't a safe GET verb, any local exposes are 405'd
        if remainder:
            if self._find_controller(remainder[0]):
                abort(405)
            sub_controller = self._lookup_child(remainder[0])
            if sub_controller:
                return lookup_controller(sub_controller, remainder[1:],
                                         request)

        abort(405)
868253
def _get_node(self):
        """"""
        data = self.meta.read(self.node_size)
        return PFSNode(data, self.endianness)
1294117
def resource_exists?(relative_path)
      rest.get_rest(relative_path)
      true
    rescue Net::HTTPServerException => e
      raise unless e.response.code == '404'
      false
    end
886181
def at!(path, node = doc)
      node.at(path) or raise Error::NodeNotFound, "node for `#{path}` not found"
    end
629442
def get_node_by_name(self, nodename):
        
        nodes = dict((n.name, n) for n in self.get_all_nodes())
        try:
            return nodes[nodename]
        except KeyError:
            raise NodeNotFound("Node %s not found" % nodename)
38651
def get_object_or_404(queryset, *filter_args, **filter_kwargs):
    
    try:
        return _get_object_or_404(queryset, *filter_args, **filter_kwargs)
    except (TypeError, ValueError, ValidationError):
        raise Http404