Sets the not_found handler for the specified version of the api
354244
def set_not_found_handler(self, handler, version=None):
        """"""
        if not self.not_found_handlers:
            self._not_found_handlers = {}

        self.not_found_handlers[version] = handler
1209299
def raise_on_major_version_mismatch(work_request, local_version):
    
    request_major_version = get_major_version(work_request.version)
    local_major_version = get_major_version(local_version)
    if request_major_version != local_major_version:
        raise ValueError("Received major version mismatch. request:{} local:{}".format(
            work_request.version, local_version
        ))
    else:
        logging.info("Ignoring non-major version mismatch request:{} local:{}".format(
            work_request.version, local_version))
1071736
def setup_versioned_routes(routes, version=None):
    """"""
    prefix = '/' + version if version else ""
    for r in routes:
        path, method = r
        route(prefix + path, method, routes[r])
415694
def _update_handler(self, handler_class, level):
        """"""
        handler = self._get_handler(handler_class)
        handler.setLevel(level)
1281906
def version(request):
    
    version_json = import_string(version_callback)(settings.BASE_DIR)
    if version_json is None:
        return HttpResponseNotFound('version.json not found')
    else:
        return JsonResponse(version_json)
830007
def set_version(self, version):
        
        self.parser.add_argument(
            "--version",
            action="version",
            version="%(prog)s {} (core {})".format(
                version, devpipeline_core.version.STRING
            ),
        )
781251
private function setNotFound()
    {
        $this->config['controller_name'] = class_exists('\App\Controller\ErrorController') ? '\App\Controller\ErrorController' : '\Bone\Mvc\Controller';
        $this->config['action_name'] = 'notFoundAction';
        $this->config['controller'] = 'error';
        $this->config['action'] = 'not-found';
        $this->controller = new $this->config['controller_name']($this->request);
        $this->controller->setServerEnvironment($this->getEnv());
        $this->response = $this->response->withStatus(404);
    }
1210381
function notFound( req, res, next ) {
        var err = new Error( 'Not Found' );
        err.status = 404;

        next( err );
    }
297746
def set_version(portal_type, legacy_version, td):
    """"""
    modified = 'OK'
    legacy_major, legacy_minor = legacy_version.split('.')

    if portal_type == 'Collection':
        # For collections, both major and minor needs to be set
        modified = 'MODIFY'
        td['new']['major_version'] = int(legacy_minor)
        if td['new']['minor_version'] is None:
            td['new']['minor_version'] = 1

    elif portal_type == 'Module':
        # For modules, major should be set and minor should be None
        # N.B. a very few older modules had major=2 and minor zero-based.
        # The odd math below adds one to the minor for those
        modified = 'MODIFY'
        td['new']['major_version'] = int(legacy_minor)+(int(legacy_major)-1)
        td['new']['minor_version'] = None

    return modified
753832
def version_router(self, request, response, api_version=None, versions={}, not_found=None, **kwargs):
        """"""
        request_version = self.determine_version(request, api_version)
        if request_version:
            request_version = int(request_version)
        versions.get(request_version or False, versions.get(None, not_found))(request, response,
                                                                              api_version=api_version,
                                                                              **kwargs)
541688
function httpNotFound(req, res) {
    console.log(`No request handler found for ${req.url}`);
    res.writeHead(404, { 'Content-Type': 'text/plain' });
    res.write('404 Not found');
    res.end();
}
1343776
def determine_version(self, request, api_version=None):
        """"""
        if api_version is False:
            api_version = None
            for version in self.versions:
                if version and "v{0}".format(version) in request.path:
                    api_version = version
                    break

        request_version = set()
        if api_version is not None:
            request_version.add(api_version)

        version_header = request.get_header("X-API-VERSION")
        if version_header:
            request_version.add(version_header)

        version_param = request.get_param('api_version')
        if version_param is not None:
            request_version.add(version_param)

        if len(request_version) > 1:
            raise ValueError('You are requesting conflicting versions')

        return next(iter(request_version or (None, )))
879741
def _set_ignored_version(version):
    
    data = {'version': version}
    with open(filepath, 'w') as data_file:
        json.dump(data, data_file)
382845
def upgrade_api(request, client, version):
    """"""

    min_ver, max_ver = api_versions._get_server_version_range(client)
    if min_ver <= api_versions.APIVersion(version) <= max_ver:
        client = _nova.novaclient(request, version)
    return client
943948
def set_version_info(self, api_version=None):
        
        if (api_version is None):
            api_version = self.api_version
        if (api_version not in CONF):
            raise IIIFInfoError("Unknown API version %s" % (api_version))
        self.params = CONF[api_version]['params']
        self.array_params = CONF[api_version]['array_params']
        self.complex_params = CONF[api_version]['complex_params']
        for a in ('context', 'compliance_prefix', 'compliance_suffix',
                  'protocol', 'required_params'):
            if (a in CONF[api_version]):
                self._setattr(a, CONF[api_version][a])
1195662
def HandleVersion(self, payload):
        """"""
        self.Version = IOHelper.AsSerializableWithType(payload, "neo.Network.Payloads.VersionPayload.VersionPayload")

        if not self.Version:
            return

        if self.incoming_client:
            if self.Version.Nonce == self.nodeid:
                self.Disconnect()
            self.SendVerack()
        else:
            self.nodeid = self.Version.Nonce
            self.SendVersion()
744092
def delete(self, version_name):
    
    name = ('%s/versions/%s' % (self._full_model_name, version_name))
    response = self._api.projects().models().versions().delete(name=name).execute()
    if 'name' not in response:
      raise Exception('Invalid response from service. "name" is not found.')
    _util.wait_for_long_running_operation(response['name'])