returns null if 404
329888
protected HttpEntity get(HttpClient httpClient, String url) throws IOException {
        logger.debug("Doing GET request on " + url);
        HttpGet get = new HttpGet(url);
        try {
            HttpResponse response = execute(httpClient, get);
            int responseCode = response.getStatusLine().getStatusCode();
            if (responseCode == 404) {
                return null;
            } else if (responseCode != 200) {
                throw new RuntimeException("Unexpected response code (" + responseCode + ") getting " + url);
            }
            return response.getEntity();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
889097
function (index) {
            var carousel = this;

            if (index < 0 || index >= carousel.get("numItems")) {
                YAHOO.log("Index out of bounds", "error", WidgetName);
                return null;
            }

            if (carousel._itemsTable.items[index]) {
                return Dom.get(carousel._itemsTable.items[index].id);
            }

            return null;
        }
96271
function notfoundUnit (server) {
  var regexes = [];
  var callbacks = [];

  function notfound (paths, literalCall) {
    regexes.push(RegExp(paths));
    callbacks.push(literalCall);
  }

  server.notfound = notfound;

  return function notfoundLayer (req, res) {
    res.statusCode = 404;
    var matched = null;
    var cbindex = -1;
    for (var i = 0; i < regexes.length; i++) {
      matched = req.path.match (regexes[i]);
      if (matched !== null) { cbindex = i; break; }
    }
    if (cbindex >= 0) {
      catchpath(req, res, matched, callbacks[cbindex], server.templateReader);
    } else {
      res.end('Not Found\n');
    }
  };
}
60639
function(i) {

		var result = null;

		while (i < this._count) {
			if (this._content[i].isView) {
				result = this._content[i];
				break;
			}
			i++;
		}

		return result;

	}
901886
def on_view_not_found(
            self, environ: Dict[str, Any],
            start_response: Callable[[str, List[Tuple[str, str]]], None],
    ) -> Iterable[bytes]:
        
        start_response(
            "404 Not Found",
            [('Content-type', 'text/plain')])
        return [b"Not Found ", application_uri(environ).encode('utf-8')]
1053972
def get(self, request, pk):
        
        self.forum = get_object_or_404(Forum, pk=pk)
        return super().get(request, pk)
1162455
function() {
        if (this.path === null) {
            return null;
        } else {
            var i = this.path.lastIndexOf('/');
            return (i < 0 || this.path === '/') ? null
                                                : new URI(this.scheme,
                                                          this.host,
                                                          this.port,
                                                          this.path.substring(0, i),
                                                          this.qs);
        }
    }
1314353
def no_route_found(self, request):
        
        response_obj = OrderedDict()
        response_obj["status"] = False
        response_obj["exceptions"] = {
            "message": "No route found for {0} {1}".format(self.__method, self.__uri),
        }
        response_obj["request"] = {
            "method": self.__method,
            "path_info": self.__uri,
            "content": request.body.decode("utf-8")
        }
        response_obj["message"] = "We are sorry, but something went terribly wrong."

        return Response(response_obj, content_type="application/json", status=404, charset="utf-8")
975914
def may_be_null_is_nullable():
    

    repo = GIRepository()
    repo.require("GLib", "2.0", 0)
    info = repo.find_by_name("GLib", "spawn_sync")
    # this argument is (allow-none) and can never be (nullable)
    return not info.get_arg(8).may_be_null
679932
def technical_404_response(request, exception):
    ""
    try:
        error_url = exception.args[0]['path']
    except (IndexError, TypeError, KeyError):
        error_url = request.path_info[1:]  # Trim leading slash

    try:
        tried = exception.args[0]['tried']
    except (IndexError, TypeError, KeyError):
        tried = []
    else:
        if (not tried                           # empty URLconf
            or (request.path == '/'
                and len(tried) == 1             # default URLconf
                and len(tried[0]) == 1
                and getattr(tried[0][0], 'app_name', '') == getattr(tried[0][0], 'namespace', '') == 'admin')):
            return default_urlconf(request)

    urlconf = getattr(request, 'urlconf', settings.ROOT_URLCONF)
    if isinstance(urlconf, types.ModuleType):
        urlconf = urlconf.__name__

    caller = ''
    try:
        resolver_match = resolve(request.path)
    except Resolver404:
        pass
    else:
        obj = resolver_match.func

        if hasattr(obj, '__name__'):
            caller = obj.__name__
        elif hasattr(obj, '__class__') and hasattr(obj.__class__, '__name__'):
            caller = obj.__class__.__name__

        if hasattr(obj, '__module__'):
            module = obj.__module__
            caller = '%s.%s' % (module, caller)

    feincms_page = slug = template = None

    try:
        from leonardo.module.web.models import Page
        feincms_page = Page.objects.for_request(request, best_match=True)
        template = feincms_page.theme.template
    except:
        if Page.objects.exists():
            feincms_page = Page.objects.filter(parent=None).first()
            template = feincms_page.theme.template
    else:
        # nested path is not allowed for this time
        try:
            slug = request.path_info.split("/")[-2:-1][0]
        except KeyError:
            raise Exception("Nested path is not allowed !")

    c = RequestContext(request, {
        'urlconf': urlconf,
        'root_urlconf': settings.ROOT_URLCONF,
        'request_path': error_url,
        'urlpatterns': tried,
        'reason': force_bytes(exception, errors='replace'),
        'request': request,
        'settings': get_safe_settings(),
        'raising_view_name': caller,
        'feincms_page': feincms_page,
        'template': template or 'base.html',
        'standalone': True,
        'slug': slug,
    })

    try:
        t = render_to_string('404_technical.html', c)
    except:
        from django.views.debug import TECHNICAL_404_TEMPLATE
        t = Template(TECHNICAL_404_TEMPLATE).render(c)
    return HttpResponseNotFound(t, content_type='text/html')
1216964
def not_found(cls, errors=None):
        
        if cls.expose_status:  # pragma: no cover
            cls.response.content_type = 'application/json'
            cls.response._status_line = '404 Not Found'

        return cls(404, None, errors).to_json
259548
def error_handler_404(request):
    
    from django.template import Context, loader
    from django.http import HttpResponseServerError

    t = loader.get_template('404.html')
    return HttpResponseServerError(t.render(Context({
        'request': request,
        'settings': settings,
    })))
6764
static private function _getDefaultPageNotFound() {
        return [
            'path' => '404',
            'callback' => function(\Lollipop\HTTP\Request $req, \Lollipop\HTTP\Response $res, $args = []) {
                // Create a default 404 page
                $pagenotfound = '<!DOCTYPE html>'
                        . '<!-- Lollipop for PHP by John Aldrich Bernardo -->'
                        . '<html>'
                        . '<head><title>404 Not Found</title></head>'
                        . '<meta name="viewport" content="width=device-width, initial-scale=1">'
                        . '<body>'
                        . '<h1>404 Not Found</h1>'
                        . '<p>The page that you have requested could not be found.</p>'
                        . '</body>'
                        . '</html>';
        
                // Create a new 404 Page Not Found Response
                $response = new Response($pagenotfound);
                // Set header for 404
                $response->header('HTTP/1.0 404 Not Found');
        
                // Execute
                return $response;
            },
            'arguments' => []
        ];
    }
794393
void get(
    Object rootValue, 
    MatchSpaceKey msg,
    EvalCache cache,
    Object contextValue,
    SearchResults result)
    throws MatchingException, BadMessageFormatMatchingException
  {
      vacantChildGet(null, msg, cache, contextValue, result);
  }
1175470
def handler404(request, template_name='404.html'):
    
    t = loader.get_template(template_name) # You need to create a 404.html template.
    return http.HttpResponseNotFound(t.render(Context({
        'MEDIA_URL': settings.MEDIA_URL,
        'STATIC_URL': settings.STATIC_URL
    })))
249087
function notFound(req, res) {

    var ext = ppath.extname(req.path);
    if ((!ext || /\.htm|\.html/i.test(ext)) && !u.size(req.query)) return error(404, req, res);

    debug('404 %s', req.originalUrl);
    res.status(404).end();
  }
1174469
def view_404(request, url=None):
    
    res = render_to_response("404.html", {"PAGE_URL": request.get_full_path()},
                             context_instance=RequestContext(request))
    res.status_code = 404
    return res