---------------- OLD API ----------------
517349
public org.apache.hadoop.mapred.InputSplit[]
        getSplits(JobConf job, int numSplits) throws IOException {
        try {

            String oper = AerospikeConfigUtil.getInputOperation(job);
            String host = AerospikeConfigUtil.getInputHost(job);
            int port = AerospikeConfigUtil.getInputPort(job);
            String namespace = AerospikeConfigUtil.getInputNamespace(job);
            String setName = AerospikeConfigUtil.getInputSetName(job);
            String[] binNames = AerospikeConfigUtil.getInputBinNames(job);
            String numrangeBin = "";
            long numrangeBegin = 0;
            long numrangeEnd = 0;
            if (oper.equals("numrange")) {
                numrangeBin = AerospikeConfigUtil.getInputNumRangeBin(job);
                numrangeBegin = AerospikeConfigUtil.getInputNumRangeBegin(job);
                numrangeEnd = AerospikeConfigUtil.getInputNumRangeEnd(job);
            }
            
            log.info(String.format("using: %s %d %s %s",
                                   host, port, namespace, setName));

            AerospikeClient client =
                AerospikeClientSingleton.getInstance(new ClientPolicy(),
                                                     host, port);
            Node[] nodes = client.getNodes();
            int nsplits = nodes.length;
            if (nsplits == 0) {
                throw new IOException("no Aerospike nodes found");
            }
            log.info(String.format("found %d nodes", nsplits));
            AerospikeSplit[] splits = new AerospikeSplit[nsplits];
            for (int ii = 0; ii < nsplits; ii++) {
                Node node = nodes[ii];
                String nodeName = node.getName();

                // We want to avoid 127.0.0.1 as a hostname
                // because this value will be transferred to a
                // different hadoop node to be processed.
                //
                Host[] aliases = node.getAliases();
                Host nodehost = aliases[0];
                if (aliases.length > 1) {
                    for (int jj = 0; jj < aliases.length; ++jj) {
                        if (!aliases[jj].name.equals("127.0.0.1")) {
                            nodehost = aliases[jj];
                            break;
                        }
                    }
                }
                splits[ii] = new AerospikeSplit(oper, nodeName,
                                                nodehost.name, nodehost.port,
                                                namespace, setName, binNames,
                                                numrangeBin, numrangeBegin,
                                                numrangeEnd);
                log.info("split: " + splits[ii]);
            }
            return splits;
        }
        catch (Exception ex) {
            throw new IOException("exception in getSplits", ex);
        }
    }
76440
function getAllApis( apiDir ) {
	var localApiDir    = apiDir,
		apis = {},
		apiDirPath = getAbsolutePath(apiDir);

	var	apiFiles = fs.readdirSync(apiDirPath);

	apiFiles.forEach( function( possibleFile ) {

		var alteredPath = path.resolve(apiDirPath,possibleFile);

		if( fs.statSync(alteredPath).isFile() ) {
			var api = require(getAbsolutePath("."+path.sep+localApiDir+path.sep+possibleFile));
			
			var funcs = Object.getOwnPropertyNames(api).filter(function isApiFunc(property){
				return typeof api[property] === 'function';
			});

			var funcObj = funcs.reduce( function reduceToMap( previous, current, index, array) {
				previous[current] = api[current];
				return previous;
			},{});

			// Strip out the extension
			var apiName = getExtensionlessFilename( possibleFile );
			
			templateWithArgs( apiDir, apiName, funcs );
			apis[apiName] = { funcs: funcObj, 
								  api: api };
		}
	});

	return apis;
}
455063
@SuppressWarnings("ShortCircuitBoolean")
  boolean hasExpired(Node<K, V> node, long now) {
    return (expiresAfterAccess() && (now - node.getAccessTime() >= expiresAfterAccessNanos()))
        | (expiresAfterWrite() && (now - node.getWriteTime() >= expiresAfterWriteNanos()))
        | (expiresVariable() && (now - node.getVariableTime() >= 0));
  }
1225452
public static final ApiVersionAlreadyExistsException apiVersionAlreadyExistsException(String apiName, String version) {
        return new ApiVersionAlreadyExistsException(Messages.i18n.format("ApiVersionAlreadyExists", apiName, version)); //$NON-NLS-1$
    }
305082
@Deprecated
    public void changeApiToken() throws IOException {
        // just to keep the same level of security
        user.checkPermission(Jenkins.ADMINISTER);

        LOGGER.log(Level.FINE, "Deprecated usage of changeApiToken");

        ApiTokenStore.HashedToken existingLegacyToken = tokenStore.getLegacyToken();
        _changeApiToken();
        tokenStore.regenerateTokenFromLegacy(apiToken);
    
        if(existingLegacyToken != null){
            tokenStats.removeId(existingLegacyToken.getUuid());
        }
        user.save();
    }
534174
def deprecated(since_or_msg, old=None, new=None, extra=None):
    

    if isinstance(since_or_msg, tuple):
        if old is None or new is None:
            raise ValueError("deprecated entity and a replacement are required")

        if len(since_or_msg) != 3 or not all(isinstance(x, int) and x >=0 for x in since_or_msg):
            raise ValueError("invalid version tuple: %r" % (since_or_msg,))

        since = "%d.%d.%d" % since_or_msg
        message = "%(old)s was deprecated in Bokeh %(since)s and will be removed, use %(new)s instead."
        message = message % dict(old=old, since=since, new=new)
        if extra is not None:
            message += " " + extra.strip()
    elif isinstance(since_or_msg, six.string_types):
        if not (old is None and new is None and extra is None):
            raise ValueError("deprecated(message) signature doesn't allow extra arguments")

        message = since_or_msg
    else:
        raise ValueError("expected a version tuple or string message")

    warn(message)
537598
def get_api(version: str, ui_version: str=None) -> API_1:
    
    ui_version = ui_version if ui_version else "~1.0"
    return _get_api_with_app(version, ui_version, ApplicationModule.app)
510252
def prune_old_authorization_codes():
    

    from .compat import now
    from .models import AuthorizationCode
    
    AuthorizationCode.objects.with_expiration_before(now()).delete()
190931
function(apiVersion) {
    if (!apiVersion) {
      return undefined;
    }
    var parts = apiVersion.split("/");
    if (parts.length === 1) {
      if (parts[0] === "v1") {
        return {group: '', version: parts[0]};
      }
      return {group: parts[0], version: ''};
    }
    if (parts.length === 2) {
      return {group:parts[0], version: parts[1]};
    }
    Logger.warn('Invalid apiVersion "' + apiVersion + '"');
    return undefined;
  }
643859
def lint_api(api_name, old, new, locations):
    """"""
    is_new_api = not old
    api_location = locations['api']
    changelog = new.get('changelog', {})
    changelog_location = api_location

    if locations['changelog']:
        changelog_location = list(locations['changelog'].values())[0]

    # apis must have documentation if they are new
    if not new.get('doc'):
        msg_type = LintError if is_new_api else LintWarning
        yield msg_type(
            'doc',
            'missing docstring documentation',
            api_name=api_name,
            location=locations.get('view', api_location)
        )

    introduced_at = new.get('introduced_at')
    if introduced_at is None:
        yield LintError(
            'introduced_at',
            'missing introduced_at field',
            location=api_location,
        )

    if not is_new_api:
        # cannot change introduced_at if we already have it
        old_introduced_at = old.get('introduced_at')
        if old_introduced_at is not None:
            if old_introduced_at != introduced_at:
                yield LintError(
                    'introduced_at',
                    'introduced_at changed from {} to {}',
                    old_introduced_at,
                    introduced_at,
                    api_name=api_name,
                    location=api_location,
                )

    # cannot change url
    if new['url'] != old.get('url', new['url']):
        yield LintError(
            'url',
            'url changed from {} to {}',
            old['url'],
            new['url'],
            api_name=api_name,
            location=api_location,
        )

    # cannot add required fields
    for removed in set(old.get('methods', [])) - set(new['methods']):
        yield LintError(
            'methods',
            'HTTP method {} removed',
            removed,
            api_name=api_name,
            location=api_location,
        )

    for schema in ['request_schema', 'response_schema']:
        new_schema = new.get(schema)
        if new_schema is None:
            continue

        schema_location = locations[schema]
        old_schema = old.get(schema, {})

        for message in walk_schema(
                schema, old_schema, new_schema, root=True, new_api=is_new_api):
            if isinstance(message, CheckChangelog):
                if message.revision not in changelog:
                    yield LintFixit(
                        message.name,
                        'No changelog entry for revision {}',
                        message.revision,
                        location=changelog_location,
                    )
            else:
                # add in here, saves passing it down the recursive call
                message.location = schema_location
                yield message
487442
@Test
    public void outdated_scenario() throws JSONException {
        httpPost("keys", jsonKey.toString(), 201);

        try {
            // Add two outdated translations
            sendTranslationUpdate("zztranslation", EN, true);
            sendTranslationUpdate("translation", FR, true);

            // Update the default translation
            jsonKey.put("translation", "updated translation");
            httpPut("keys/" + keyName, jsonKey.toString(), 200);

            // The key should remain outdated
            assertOutdatedStatus(true);

            // Update English translations
            sendTranslationUpdate("updated translation", EN, false);

            // The key should remain outdated
            assertOutdatedStatus(true);

            // Update French translations
            sendTranslationUpdate("updated translation", FR, false);

            // Now, all the translation have been updated
            assertOutdatedStatus(false);

        } finally {
            // clean the repo
            httpDelete("keys/" + keyName, 204);
        }
    }
622164
def get_old_value(self, args, kwargs, default=None):
        # type: (List[Any], Dict[str, Any], Any) -> Any
        
        if self.arg_pos is not None and len(args) > self.arg_pos:
            return args[self.arg_pos]
        else:
            return kwargs.get(self.name, default)
316035
def _api_history(self, plugin, nb=0):
        
        response.content_type = 'application/json; charset=utf-8'

        if plugin not in self.plugins_list:
            abort(400, "Unknown plugin %s (available plugins: %s)" % (plugin, self.plugins_list))

        # Update the stat
        self.__update__()

        try:
            # Get the JSON value of the stat ID
            statval = self.stats.get_plugin(plugin).get_stats_history(nb=int(nb))
        except Exception as e:
            abort(404, "Cannot get plugin history %s (%s)" % (plugin, str(e)))
        return statval
1009412
def comittoapi(api):
    
    global USED_API
    assert USED_API is None, "committoapi called again!"
    check = ["PyQt4", "PyQt5", "PySide", "PySide2"]
    assert api in [QT_API_PYQT5, QT_API_PYQT4, QT_API_PYSIDE, QT_API_PYSIDE2]
    for name in check:
        if name.lower() != api and name in sys.modules:
            raise RuntimeError(
                "{} was already imported. Cannot commit to {}!"
                .format(name, api)
            )
    else:
        api = _intern(api)
        USED_API = api
        AnyQt.__SELECTED_API = api
        AnyQt.USED_API = api
628176
def upgradeParentHook3to4(old):
    
    new = old.upgradeVersion(
        old.typeName, 3, 4, subStore=old.loginAccount)
    uninstallFrom(new, new.store)
    return new
913311
def index_old(user_id, repo_name):
    """"""
    pid = get_pid_of_latest_release_or_404(name=repo_name)
    return redirect(get_badge_image_url(pid))
814499
private String getApiIdx(String orgId, String apiId, String version) {
        return "API::" + orgId + "|" + apiId + "|" + version; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }