repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java | TheMovieDbApi.checkItemStatus | public boolean checkItemStatus(String listId, Integer mediaId) throws MovieDbException {
"""
Check to see if an item is already on a list.
@param listId listId
@param mediaId mediaId
@return true if the item is on the list
@throws MovieDbException exception
"""
return tmdbList.checkItemStatus(lis... | java | public boolean checkItemStatus(String listId, Integer mediaId) throws MovieDbException {
return tmdbList.checkItemStatus(listId, mediaId);
} | [
"public",
"boolean",
"checkItemStatus",
"(",
"String",
"listId",
",",
"Integer",
"mediaId",
")",
"throws",
"MovieDbException",
"{",
"return",
"tmdbList",
".",
"checkItemStatus",
"(",
"listId",
",",
"mediaId",
")",
";",
"}"
] | Check to see if an item is already on a list.
@param listId listId
@param mediaId mediaId
@return true if the item is on the list
@throws MovieDbException exception | [
"Check",
"to",
"see",
"if",
"an",
"item",
"is",
"already",
"on",
"a",
"list",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L800-L802 |
openxc/openxc-android | library/src/main/java/com/openxc/VehicleManager.java | VehicleManager.removeListener | public void removeListener(MessageKey key, VehicleMessage.Listener listener) {
"""
Unregister a previously registered key listener.
@param key The key this listener was previously registered to
receive updates on.
@param listener The listener to remove.
"""
removeListener(ExactKeyMatcher.buildExac... | java | public void removeListener(MessageKey key, VehicleMessage.Listener listener) {
removeListener(ExactKeyMatcher.buildExactMatcher(key), listener);
} | [
"public",
"void",
"removeListener",
"(",
"MessageKey",
"key",
",",
"VehicleMessage",
".",
"Listener",
"listener",
")",
"{",
"removeListener",
"(",
"ExactKeyMatcher",
".",
"buildExactMatcher",
"(",
"key",
")",
",",
"listener",
")",
";",
"}"
] | Unregister a previously registered key listener.
@param key The key this listener was previously registered to
receive updates on.
@param listener The listener to remove. | [
"Unregister",
"a",
"previously",
"registered",
"key",
"listener",
"."
] | train | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/VehicleManager.java#L474-L476 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.notEquals | @Throws(IllegalEqualException.class)
public static boolean notEquals(final boolean expected, final boolean check) {
"""
Ensures that a passed boolean is not equal to another boolean. The comparison is made using
<code>expected == check</code>.
<p>
We recommend to use the overloaded method {@link Check#notEqu... | java | @Throws(IllegalEqualException.class)
public static boolean notEquals(final boolean expected, final boolean check) {
if (expected == check) {
throw new IllegalEqualException(check);
}
return check;
} | [
"@",
"Throws",
"(",
"IllegalEqualException",
".",
"class",
")",
"public",
"static",
"boolean",
"notEquals",
"(",
"final",
"boolean",
"expected",
",",
"final",
"boolean",
"check",
")",
"{",
"if",
"(",
"expected",
"==",
"check",
")",
"{",
"throw",
"new",
"Il... | Ensures that a passed boolean is not equal to another boolean. The comparison is made using
<code>expected == check</code>.
<p>
We recommend to use the overloaded method {@link Check#notEquals(boolean, boolean, String)} and pass as second
argument the name of the parameter to enhance the exception message.
@param exp... | [
"Ensures",
"that",
"a",
"passed",
"boolean",
"is",
"not",
"equal",
"to",
"another",
"boolean",
".",
"The",
"comparison",
"is",
"made",
"using",
"<code",
">",
"expected",
"==",
"check<",
"/",
"code",
">",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L2247-L2254 |
jeevatkm/excelReader | src/main/java/com/myjeeva/poi/ExcelReader.java | ExcelReader.readSheet | private void readSheet(StylesTable styles, ReadOnlySharedStringsTable sharedStringsTable,
InputStream sheetInputStream) throws IOException, ParserConfigurationException, SAXException {
"""
Parses the content of one sheet using the specified styles and shared-strings tables.
@param styles a {@link StylesTa... | java | private void readSheet(StylesTable styles, ReadOnlySharedStringsTable sharedStringsTable,
InputStream sheetInputStream) throws IOException, ParserConfigurationException, SAXException {
SAXParserFactory saxFactory = SAXParserFactory.newInstance();
XMLReader sheetParser = saxFactory.newSAXParser().getXMLRe... | [
"private",
"void",
"readSheet",
"(",
"StylesTable",
"styles",
",",
"ReadOnlySharedStringsTable",
"sharedStringsTable",
",",
"InputStream",
"sheetInputStream",
")",
"throws",
"IOException",
",",
"ParserConfigurationException",
",",
"SAXException",
"{",
"SAXParserFactory",
"s... | Parses the content of one sheet using the specified styles and shared-strings tables.
@param styles a {@link StylesTable} object
@param sharedStringsTable a {@link ReadOnlySharedStringsTable} object
@param sheetInputStream a {@link InputStream} object
@throws IOException
@throws ParserConfigurationException
@throws SA... | [
"Parses",
"the",
"content",
"of",
"one",
"sheet",
"using",
"the",
"specified",
"styles",
"and",
"shared",
"-",
"strings",
"tables",
"."
] | train | https://github.com/jeevatkm/excelReader/blob/87f451474e3e8863688d19269bcd2bcc56873e87/src/main/java/com/myjeeva/poi/ExcelReader.java#L188-L199 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/managers/GuildController.java | GuildController.createRole | @CheckReturnValue
public RoleAction createRole() {
"""
Creates a new {@link net.dv8tion.jda.core.entities.Role Role} in this Guild.
<br>It will be placed at the bottom (just over the Public Role) to avoid permission hierarchy conflicts.
<br>For this to be successful, the logged in account has to have the {@l... | java | @CheckReturnValue
public RoleAction createRole()
{
checkPermission(Permission.MANAGE_ROLES);
Route.CompiledRoute route = Route.Roles.CREATE_ROLE.compile(getGuild().getId());
return new RoleAction(route, getGuild());
} | [
"@",
"CheckReturnValue",
"public",
"RoleAction",
"createRole",
"(",
")",
"{",
"checkPermission",
"(",
"Permission",
".",
"MANAGE_ROLES",
")",
";",
"Route",
".",
"CompiledRoute",
"route",
"=",
"Route",
".",
"Roles",
".",
"CREATE_ROLE",
".",
"compile",
"(",
"get... | Creates a new {@link net.dv8tion.jda.core.entities.Role Role} in this Guild.
<br>It will be placed at the bottom (just over the Public Role) to avoid permission hierarchy conflicts.
<br>For this to be successful, the logged in account has to have the {@link net.dv8tion.jda.core.Permission#MANAGE_ROLES MANAGE_ROLES} Per... | [
"Creates",
"a",
"new",
"{",
"@link",
"net",
".",
"dv8tion",
".",
"jda",
".",
"core",
".",
"entities",
".",
"Role",
"Role",
"}",
"in",
"this",
"Guild",
".",
"<br",
">",
"It",
"will",
"be",
"placed",
"at",
"the",
"bottom",
"(",
"just",
"over",
"the",... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/managers/GuildController.java#L1920-L1927 |
virgo47/javasimon | core/src/main/java/org/javasimon/callback/quantiles/FixedQuantilesCallback.java | FixedQuantilesCallback.createBuckets | @Override
protected Buckets createBuckets(Stopwatch stopwatch) {
"""
Create buckets using callback attributes
@param stopwatch Target stopwatch
@return Created buckets
"""
return createBuckets(stopwatch, min * SimonClock.NANOS_IN_MILLIS, max * SimonClock.NANOS_IN_MILLIS, bucketNb);
} | java | @Override
protected Buckets createBuckets(Stopwatch stopwatch) {
return createBuckets(stopwatch, min * SimonClock.NANOS_IN_MILLIS, max * SimonClock.NANOS_IN_MILLIS, bucketNb);
} | [
"@",
"Override",
"protected",
"Buckets",
"createBuckets",
"(",
"Stopwatch",
"stopwatch",
")",
"{",
"return",
"createBuckets",
"(",
"stopwatch",
",",
"min",
"*",
"SimonClock",
".",
"NANOS_IN_MILLIS",
",",
"max",
"*",
"SimonClock",
".",
"NANOS_IN_MILLIS",
",",
"bu... | Create buckets using callback attributes
@param stopwatch Target stopwatch
@return Created buckets | [
"Create",
"buckets",
"using",
"callback",
"attributes"
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/callback/quantiles/FixedQuantilesCallback.java#L49-L52 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocEnv.java | DocEnv.makeMethodDoc | protected void makeMethodDoc(MethodSymbol meth, TreePath treePath) {
"""
Create a MethodDoc for this MethodSymbol.
Should be called only on symbols representing methods.
"""
MethodDocImpl result = (MethodDocImpl)methodMap.get(meth);
if (result != null) {
if (treePath != null) resul... | java | protected void makeMethodDoc(MethodSymbol meth, TreePath treePath) {
MethodDocImpl result = (MethodDocImpl)methodMap.get(meth);
if (result != null) {
if (treePath != null) result.setTreePath(treePath);
} else {
result = new MethodDocImpl(this, meth, treePath);
... | [
"protected",
"void",
"makeMethodDoc",
"(",
"MethodSymbol",
"meth",
",",
"TreePath",
"treePath",
")",
"{",
"MethodDocImpl",
"result",
"=",
"(",
"MethodDocImpl",
")",
"methodMap",
".",
"get",
"(",
"meth",
")",
";",
"if",
"(",
"result",
"!=",
"null",
")",
"{"... | Create a MethodDoc for this MethodSymbol.
Should be called only on symbols representing methods. | [
"Create",
"a",
"MethodDoc",
"for",
"this",
"MethodSymbol",
".",
"Should",
"be",
"called",
"only",
"on",
"symbols",
"representing",
"methods",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocEnv.java#L661-L669 |
apache/groovy | subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java | AstBuilder.visitCatchClause | @Override
public List<CatchStatement> visitCatchClause(CatchClauseContext ctx) {
"""
Multi-catch(1..*) clause will be unpacked to several normal catch clauses, so the return type is List
@param ctx the parse tree
@return a list of CatchStatement instances
"""
// FIXME Groovy will ignore variabl... | java | @Override
public List<CatchStatement> visitCatchClause(CatchClauseContext ctx) {
// FIXME Groovy will ignore variableModifier of parameter in the catch clause
// In order to make the new parser behave same with the old one, we do not process variableModifier*
return this.visitCatchType(ctx.... | [
"@",
"Override",
"public",
"List",
"<",
"CatchStatement",
">",
"visitCatchClause",
"(",
"CatchClauseContext",
"ctx",
")",
"{",
"// FIXME Groovy will ignore variableModifier of parameter in the catch clause",
"// In order to make the new parser behave same with the old one, we do not proc... | Multi-catch(1..*) clause will be unpacked to several normal catch clauses, so the return type is List
@param ctx the parse tree
@return a list of CatchStatement instances | [
"Multi",
"-",
"catch",
"(",
"1",
"..",
"*",
")",
"clause",
"will",
"be",
"unpacked",
"to",
"several",
"normal",
"catch",
"clauses",
"so",
"the",
"return",
"type",
"is",
"List"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java#L875-L891 |
m-m-m/util | event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java | AbstractEventBus.getEventDispatcherOptional | @SuppressWarnings("unchecked")
protected <E> EventDispatcher<? super E> getEventDispatcherOptional(Class<E> eventType) {
"""
Gets the most specific {@link EventDispatcher} responsible the given {@code eventType}.
@param <E> is the generic type of {@code eventType}.
@param eventType is the {@link Class} refle... | java | @SuppressWarnings("unchecked")
protected <E> EventDispatcher<? super E> getEventDispatcherOptional(Class<E> eventType) {
return getEventDispatcher(eventType, false);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"<",
"E",
">",
"EventDispatcher",
"<",
"?",
"super",
"E",
">",
"getEventDispatcherOptional",
"(",
"Class",
"<",
"E",
">",
"eventType",
")",
"{",
"return",
"getEventDispatcher",
"(",
"eventType",
... | Gets the most specific {@link EventDispatcher} responsible the given {@code eventType}.
@param <E> is the generic type of {@code eventType}.
@param eventType is the {@link Class} reflecting the {@link net.sf.mmm.util.event.api.Event event}.
@return the most specific {@link EventDispatcher} responsible for the given {@... | [
"Gets",
"the",
"most",
"specific",
"{",
"@link",
"EventDispatcher",
"}",
"responsible",
"the",
"given",
"{",
"@code",
"eventType",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java#L194-L198 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.collectNested | public static Collection collectNested(Iterable self, Collection collector, Closure transform) {
"""
Recursively iterates through this Iterable transforming each non-Collection value
into a new value using the <code>transform</code> closure. Returns a potentially nested
collection of transformed values.
<pre cl... | java | public static Collection collectNested(Iterable self, Collection collector, Closure transform) {
for (Object item : self) {
if (item instanceof Collection) {
Collection c = (Collection) item;
collector.add(collectNested((Iterable)c, createSimilarCollection(collector, ... | [
"public",
"static",
"Collection",
"collectNested",
"(",
"Iterable",
"self",
",",
"Collection",
"collector",
",",
"Closure",
"transform",
")",
"{",
"for",
"(",
"Object",
"item",
":",
"self",
")",
"{",
"if",
"(",
"item",
"instanceof",
"Collection",
")",
"{",
... | Recursively iterates through this Iterable transforming each non-Collection value
into a new value using the <code>transform</code> closure. Returns a potentially nested
collection of transformed values.
<pre class="groovyTestCase">
def x = [1,[2,3],[4],[]].collectNested(new Vector()) { it * 2 }
assert x == [2,[4,6],[8... | [
"Recursively",
"iterates",
"through",
"this",
"Iterable",
"transforming",
"each",
"non",
"-",
"Collection",
"value",
"into",
"a",
"new",
"value",
"using",
"the",
"<code",
">",
"transform<",
"/",
"code",
">",
"closure",
".",
"Returns",
"a",
"potentially",
"nest... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L3744-L3757 |
square/phrase | src/main/java/com/squareup/phrase/Phrase.java | Phrase.fromPlural | public static Phrase fromPlural(Resources r, @PluralsRes int patternResourceId, int quantity) {
"""
Entry point into this API.
@throws IllegalArgumentException if pattern contains any syntax errors.
"""
return from(r.getQuantityText(patternResourceId, quantity));
} | java | public static Phrase fromPlural(Resources r, @PluralsRes int patternResourceId, int quantity) {
return from(r.getQuantityText(patternResourceId, quantity));
} | [
"public",
"static",
"Phrase",
"fromPlural",
"(",
"Resources",
"r",
",",
"@",
"PluralsRes",
"int",
"patternResourceId",
",",
"int",
"quantity",
")",
"{",
"return",
"from",
"(",
"r",
".",
"getQuantityText",
"(",
"patternResourceId",
",",
"quantity",
")",
")",
... | Entry point into this API.
@throws IllegalArgumentException if pattern contains any syntax errors. | [
"Entry",
"point",
"into",
"this",
"API",
"."
] | train | https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/Phrase.java#L132-L134 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toQueryColumn | public static QueryColumn toQueryColumn(Object o, PageContext pc) throws PageException {
"""
converts a object to a QueryColumn, if possible, also variable declarations are allowed. this
method is used within the generated bytecode
@param o
@return
@throws PageException
@info used in bytecode generation
... | java | public static QueryColumn toQueryColumn(Object o, PageContext pc) throws PageException {
if (o instanceof QueryColumn) return (QueryColumn) o;
if (o instanceof String) {
o = VariableInterpreter.getVariableAsCollection(pc, (String) o);
if (o instanceof QueryColumn) return (QueryColumn) o;
}
throw new Cast... | [
"public",
"static",
"QueryColumn",
"toQueryColumn",
"(",
"Object",
"o",
",",
"PageContext",
"pc",
")",
"throws",
"PageException",
"{",
"if",
"(",
"o",
"instanceof",
"QueryColumn",
")",
"return",
"(",
"QueryColumn",
")",
"o",
";",
"if",
"(",
"o",
"instanceof"... | converts a object to a QueryColumn, if possible, also variable declarations are allowed. this
method is used within the generated bytecode
@param o
@return
@throws PageException
@info used in bytecode generation | [
"converts",
"a",
"object",
"to",
"a",
"QueryColumn",
"if",
"possible",
"also",
"variable",
"declarations",
"are",
"allowed",
".",
"this",
"method",
"is",
"used",
"within",
"the",
"generated",
"bytecode"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L3004-L3012 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Transaction.java | Transaction.addSignedInput | public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey, SigHash sigHash, boolean anyoneCanPay) {
"""
Adds an input that points to the given output and contains a valid signature for it, calculated using the
signing key.
"""
return addSignedInput(output.getOutPointFor(), outp... | java | public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey, SigHash sigHash, boolean anyoneCanPay) {
return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey, sigHash, anyoneCanPay);
} | [
"public",
"TransactionInput",
"addSignedInput",
"(",
"TransactionOutput",
"output",
",",
"ECKey",
"signingKey",
",",
"SigHash",
"sigHash",
",",
"boolean",
"anyoneCanPay",
")",
"{",
"return",
"addSignedInput",
"(",
"output",
".",
"getOutPointFor",
"(",
")",
",",
"o... | Adds an input that points to the given output and contains a valid signature for it, calculated using the
signing key. | [
"Adds",
"an",
"input",
"that",
"points",
"to",
"the",
"given",
"output",
"and",
"contains",
"a",
"valid",
"signature",
"for",
"it",
"calculated",
"using",
"the",
"signing",
"key",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Transaction.java#L1009-L1011 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java | AuthenticationAPIClient.loginWithOTP | @SuppressWarnings("WeakerAccess")
public AuthenticationRequest loginWithOTP(@NonNull String mfaToken, @NonNull String otp) {
"""
Log in a user using the One Time Password code after they have received the 'mfa_required' error.
The MFA token tells the server the username or email, password and realm values sen... | java | @SuppressWarnings("WeakerAccess")
public AuthenticationRequest loginWithOTP(@NonNull String mfaToken, @NonNull String otp) {
Map<String, Object> parameters = ParameterBuilder.newBuilder()
.setGrantType(GRANT_TYPE_MFA_OTP)
.set(MFA_TOKEN_KEY, mfaToken)
.set(ONE... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"AuthenticationRequest",
"loginWithOTP",
"(",
"@",
"NonNull",
"String",
"mfaToken",
",",
"@",
"NonNull",
"String",
"otp",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
"=",
"P... | Log in a user using the One Time Password code after they have received the 'mfa_required' error.
The MFA token tells the server the username or email, password and realm values sent on the first request.
Requires your client to have the <b>MFA</b> Grant Type enabled. See <a href="https://auth0.com/docs/clients/client-... | [
"Log",
"in",
"a",
"user",
"using",
"the",
"One",
"Time",
"Password",
"code",
"after",
"they",
"have",
"received",
"the",
"mfa_required",
"error",
".",
"The",
"MFA",
"token",
"tells",
"the",
"server",
"the",
"username",
"or",
"email",
"password",
"and",
"re... | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java#L268-L277 |
infinispan/infinispan | core/src/main/java/org/infinispan/factories/InternalCacheFactory.java | InternalCacheFactory.createCache | public Cache<K, V> createCache(Configuration configuration, GlobalComponentRegistry globalComponentRegistry,
String cacheName) throws CacheConfigurationException {
"""
This implementation clones the configuration passed in before using it.
@param configuration to use
... | java | public Cache<K, V> createCache(Configuration configuration, GlobalComponentRegistry globalComponentRegistry,
String cacheName) throws CacheConfigurationException {
try {
if (configuration.compatibility().enabled()) {
log.warnCompatibilityDeprecated(cacheName)... | [
"public",
"Cache",
"<",
"K",
",",
"V",
">",
"createCache",
"(",
"Configuration",
"configuration",
",",
"GlobalComponentRegistry",
"globalComponentRegistry",
",",
"String",
"cacheName",
")",
"throws",
"CacheConfigurationException",
"{",
"try",
"{",
"if",
"(",
"config... | This implementation clones the configuration passed in before using it.
@param configuration to use
@param globalComponentRegistry global component registry to attach the cache to
@param cacheName name of the cache
@return a cache
@throws CacheConfigurationException if there are problems with t... | [
"This",
"implementation",
"clones",
"the",
"configuration",
"passed",
"in",
"before",
"using",
"it",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/factories/InternalCacheFactory.java#L83-L99 |
DDTH/ddth-tsc | ddth-tsc-core/src/main/java/com/github/ddth/tsc/redis/ShardedRedisCounterFactory.java | ShardedRedisCounterFactory.newJedisPool | public static ShardedJedisPool newJedisPool(String hostsAndPorts, String password,
long timeoutMs) {
"""
Creates a new {@link ShardedJedisPool}.
@param hostsAndPorts
format {@code host1:port1,host2:port2...}
@param password
@param timeoutMs
@return
"""
final int maxTotal = Runtime.ge... | java | public static ShardedJedisPool newJedisPool(String hostsAndPorts, String password,
long timeoutMs) {
final int maxTotal = Runtime.getRuntime().availableProcessors();
final int maxIdle = maxTotal / 2;
JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setMaxTotal(... | [
"public",
"static",
"ShardedJedisPool",
"newJedisPool",
"(",
"String",
"hostsAndPorts",
",",
"String",
"password",
",",
"long",
"timeoutMs",
")",
"{",
"final",
"int",
"maxTotal",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"availableProcessors",
"(",
")",
... | Creates a new {@link ShardedJedisPool}.
@param hostsAndPorts
format {@code host1:port1,host2:port2...}
@param password
@param timeoutMs
@return | [
"Creates",
"a",
"new",
"{",
"@link",
"ShardedJedisPool",
"}",
"."
] | train | https://github.com/DDTH/ddth-tsc/blob/d233c304c8fed2f3c069de42a36b7bbd5c8be01b/ddth-tsc-core/src/main/java/com/github/ddth/tsc/redis/ShardedRedisCounterFactory.java#L52-L78 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/ScreenSteps.java | ScreenSteps.saveWebElementInScreenshot | @Conditioned
@Et("Je sauvegarde une capture d'écran de '(.*)-(.*)' dans '(.*)'[\\.|\\?]")
@And("I save a screenshot of '(.*)-(.*)' in '(.*)'[\\.|\\?]")
public void saveWebElementInScreenshot(String page, String element, String screenName, List<GherkinStepCondition> conditions) throws IOException, FailureExc... | java | @Conditioned
@Et("Je sauvegarde une capture d'écran de '(.*)-(.*)' dans '(.*)'[\\.|\\?]")
@And("I save a screenshot of '(.*)-(.*)' in '(.*)'[\\.|\\?]")
public void saveWebElementInScreenshot(String page, String element, String screenName, List<GherkinStepCondition> conditions) throws IOException, FailureExc... | [
"@",
"Conditioned",
"@",
"Et",
"(",
"\"Je sauvegarde une capture d'écran de '(.*)-(.*)' dans '(.*)'[\\\\.|\\\\?]\")",
"",
"@",
"And",
"(",
"\"I save a screenshot of '(.*)-(.*)' in '(.*)'[\\\\.|\\\\?]\"",
")",
"public",
"void",
"saveWebElementInScreenshot",
"(",
"String",
"page",
... | Save a screenshot of one element only and add to DOWNLOAD_FILES_FOLDER folder.
@param page
The concerned page of field
@param element
is key of PageElement concerned
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}). * list of 'expected' ... | [
"Save",
"a",
"screenshot",
"of",
"one",
"element",
"only",
"and",
"add",
"to",
"DOWNLOAD_FILES_FOLDER",
"folder",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/ScreenSteps.java#L92-L102 |
tupilabs/tap4j | tap4j/src/main/java/org/tap4j/representer/Tap13Representer.java | Tap13Representer.printDiagnostic | protected void printDiagnostic(PrintWriter pw, TapElement tapElement) {
"""
Prints diagnostic of the TAP Element into the Print Writer.
@param pw Print Writer
@param tapElement TAP element
"""
if (this.yaml != null) {
Map<String, Object> diagnostic = tapElement.getDiagnostic();
... | java | protected void printDiagnostic(PrintWriter pw, TapElement tapElement) {
if (this.yaml != null) {
Map<String, Object> diagnostic = tapElement.getDiagnostic();
if (diagnostic != null && !diagnostic.isEmpty()) {
String diagnosticText = yaml.dump(diagnostic);
... | [
"protected",
"void",
"printDiagnostic",
"(",
"PrintWriter",
"pw",
",",
"TapElement",
"tapElement",
")",
"{",
"if",
"(",
"this",
".",
"yaml",
"!=",
"null",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"diagnostic",
"=",
"tapElement",
".",
"getDiagnos... | Prints diagnostic of the TAP Element into the Print Writer.
@param pw Print Writer
@param tapElement TAP element | [
"Prints",
"diagnostic",
"of",
"the",
"TAP",
"Element",
"into",
"the",
"Print",
"Writer",
"."
] | train | https://github.com/tupilabs/tap4j/blob/1793b653ce7f3a06a7b5c9557cdf601e28dd1f55/tap4j/src/main/java/org/tap4j/representer/Tap13Representer.java#L260-L271 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getMoveRequest | public BoxRequestsFile.UpdateFile getMoveRequest(String id, String parentId) {
"""
Gets a request that moves a file to another folder
@param id id of file to move
@param parentId id of parent folder to move file into
@return request to move a file
"""
BoxRequestsFile.UpdateFile reques... | java | public BoxRequestsFile.UpdateFile getMoveRequest(String id, String parentId) {
BoxRequestsFile.UpdateFile request = new BoxRequestsFile.UpdateFile(id, getFileInfoUrl(id), mSession);
request.setParentId(parentId);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"UpdateFile",
"getMoveRequest",
"(",
"String",
"id",
",",
"String",
"parentId",
")",
"{",
"BoxRequestsFile",
".",
"UpdateFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"UpdateFile",
"(",
"id",
",",
"getFileInfoUrl",
"(",
... | Gets a request that moves a file to another folder
@param id id of file to move
@param parentId id of parent folder to move file into
@return request to move a file | [
"Gets",
"a",
"request",
"that",
"moves",
"a",
"file",
"to",
"another",
"folder"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L234-L238 |
talsma-ict/umldoclet | src/main/java/nl/talsmasoftware/umldoclet/util/UriUtils.java | UriUtils.addPathComponent | public static URI addPathComponent(URI uri, String component) {
"""
This method adds a 'component' to the path of an URI.
@param uri The URI to add a path component to
@param component The component to add to the end of the uri path, separated by a slash ({@code '/'}) character
@return The new URI
"... | java | public static URI addPathComponent(URI uri, String component) {
if (uri != null && component != null) try {
return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(),
Optional.ofNullable(uri.getPath()).map(path -> join(path, component, '/')).orElse(component... | [
"public",
"static",
"URI",
"addPathComponent",
"(",
"URI",
"uri",
",",
"String",
"component",
")",
"{",
"if",
"(",
"uri",
"!=",
"null",
"&&",
"component",
"!=",
"null",
")",
"try",
"{",
"return",
"new",
"URI",
"(",
"uri",
".",
"getScheme",
"(",
")",
... | This method adds a 'component' to the path of an URI.
@param uri The URI to add a path component to
@param component The component to add to the end of the uri path, separated by a slash ({@code '/'}) character
@return The new URI | [
"This",
"method",
"adds",
"a",
"component",
"to",
"the",
"path",
"of",
"an",
"URI",
"."
] | train | https://github.com/talsma-ict/umldoclet/blob/373b23f2646603fddca4a495e9eccbb4a4491fdf/src/main/java/nl/talsmasoftware/umldoclet/util/UriUtils.java#L44-L54 |
elki-project/elki | addons/tutorial/src/main/java/tutorial/clustering/SameSizeKMeansAlgorithm.java | SameSizeKMeansAlgorithm.updateDistances | protected void updateDistances(Relation<V> relation, double[][] means, final WritableDataStore<Meta> metas, NumberVectorDistanceFunction<? super V> df) {
"""
Compute the distances of each object to all means. Update
{@link Meta#secondary} to point to the best cluster number except the
current cluster assignment
... | java | protected void updateDistances(Relation<V> relation, double[][] means, final WritableDataStore<Meta> metas, NumberVectorDistanceFunction<? super V> df) {
for(DBIDIter id = relation.iterDBIDs(); id.valid(); id.advance()) {
Meta c = metas.get(id);
V fv = relation.get(id);
// Update distances to mean... | [
"protected",
"void",
"updateDistances",
"(",
"Relation",
"<",
"V",
">",
"relation",
",",
"double",
"[",
"]",
"[",
"]",
"means",
",",
"final",
"WritableDataStore",
"<",
"Meta",
">",
"metas",
",",
"NumberVectorDistanceFunction",
"<",
"?",
"super",
"V",
">",
... | Compute the distances of each object to all means. Update
{@link Meta#secondary} to point to the best cluster number except the
current cluster assignment
@param relation Data relation
@param means Means
@param metas Metadata storage
@param df Distance function | [
"Compute",
"the",
"distances",
"of",
"each",
"object",
"to",
"all",
"means",
".",
"Update",
"{",
"@link",
"Meta#secondary",
"}",
"to",
"point",
"to",
"the",
"best",
"cluster",
"number",
"except",
"the",
"current",
"cluster",
"assignment"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/tutorial/src/main/java/tutorial/clustering/SameSizeKMeansAlgorithm.java#L232-L248 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java | BootstrapConfig.getOutputFile | public File getOutputFile(String relativeServerPath) {
"""
Allocate a file in the server output directory, e.g.
server-data/serverName/relativeServerPath
@param relativeServerPath
relative path of file to create in the server directory
@return File object for relative path, or for the server directory itself... | java | public File getOutputFile(String relativeServerPath) {
if (relativeServerPath == null)
return outputDir;
else
return new File(outputDir, relativeServerPath);
} | [
"public",
"File",
"getOutputFile",
"(",
"String",
"relativeServerPath",
")",
"{",
"if",
"(",
"relativeServerPath",
"==",
"null",
")",
"return",
"outputDir",
";",
"else",
"return",
"new",
"File",
"(",
"outputDir",
",",
"relativeServerPath",
")",
";",
"}"
] | Allocate a file in the server output directory, e.g.
server-data/serverName/relativeServerPath
@param relativeServerPath
relative path of file to create in the server directory
@return File object for relative path, or for the server directory itself
if the relative path argument is null | [
"Allocate",
"a",
"file",
"in",
"the",
"server",
"output",
"directory",
"e",
".",
"g",
".",
"server",
"-",
"data",
"/",
"serverName",
"/",
"relativeServerPath"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java#L628-L633 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/math/SparseVector.java | SparseVector.put | public void put(int i, double value) {
"""
Setter method (should it be renamed to set?)
@param i set symbolTable[i]
@param value
"""
if (i < 0 || i >= N) throw new IllegalArgumentException("Illegal index " + i + " should be > 0 and < " + N);
if (value == 0.0) symbolTable.delete(i);
else ... | java | public void put(int i, double value) {
if (i < 0 || i >= N) throw new IllegalArgumentException("Illegal index " + i + " should be > 0 and < " + N);
if (value == 0.0) symbolTable.delete(i);
else symbolTable.put(i, value);
} | [
"public",
"void",
"put",
"(",
"int",
"i",
",",
"double",
"value",
")",
"{",
"if",
"(",
"i",
"<",
"0",
"||",
"i",
">=",
"N",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Illegal index \"",
"+",
"i",
"+",
"\" should be > 0 and < \"",
"+",
"N",
... | Setter method (should it be renamed to set?)
@param i set symbolTable[i]
@param value | [
"Setter",
"method",
"(",
"should",
"it",
"be",
"renamed",
"to",
"set?",
")"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/math/SparseVector.java#L65-L69 |
b3dgs/lionengine | lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/MouseAwt.java | MouseAwt.setResolution | public void setResolution(Resolution output, Resolution source) {
"""
Set the resolution used. This will compute mouse horizontal and vertical ratio.
@param output The resolution output (must not be <code>null</code>).
@param source The resolution source (must not be <code>null</code>).
@throws LionEngineExce... | java | public void setResolution(Resolution output, Resolution source)
{
Check.notNull(output);
Check.notNull(source);
xRatio = output.getWidth() / (double) source.getWidth();
yRatio = output.getHeight() / (double) source.getHeight();
} | [
"public",
"void",
"setResolution",
"(",
"Resolution",
"output",
",",
"Resolution",
"source",
")",
"{",
"Check",
".",
"notNull",
"(",
"output",
")",
";",
"Check",
".",
"notNull",
"(",
"source",
")",
";",
"xRatio",
"=",
"output",
".",
"getWidth",
"(",
")",... | Set the resolution used. This will compute mouse horizontal and vertical ratio.
@param output The resolution output (must not be <code>null</code>).
@param source The resolution source (must not be <code>null</code>).
@throws LionEngineException If invalid argument. | [
"Set",
"the",
"resolution",
"used",
".",
"This",
"will",
"compute",
"mouse",
"horizontal",
"and",
"vertical",
"ratio",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/MouseAwt.java#L93-L100 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.order_orderId_debt_operation_operationId_GET | public OvhOperation order_orderId_debt_operation_operationId_GET(Long orderId, Long operationId) throws IOException {
"""
Get this object properties
REST: GET /me/order/{orderId}/debt/operation/{operationId}
@param orderId [required]
@param operationId [required]
"""
String qPath = "/me/order/{orderId}/... | java | public OvhOperation order_orderId_debt_operation_operationId_GET(Long orderId, Long operationId) throws IOException {
String qPath = "/me/order/{orderId}/debt/operation/{operationId}";
StringBuilder sb = path(qPath, orderId, operationId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(r... | [
"public",
"OvhOperation",
"order_orderId_debt_operation_operationId_GET",
"(",
"Long",
"orderId",
",",
"Long",
"operationId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/order/{orderId}/debt/operation/{operationId}\"",
";",
"StringBuilder",
"sb",
"=",
... | Get this object properties
REST: GET /me/order/{orderId}/debt/operation/{operationId}
@param orderId [required]
@param operationId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2001-L2006 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/format/impl/MediaFormatHandlerImpl.java | MediaFormatHandlerImpl.detectMediaFormat | @Override
public MediaFormat detectMediaFormat(@Nullable String extension, long fileSize, long width, long height) {
"""
Detect matching media format.
@param extension File extension
@param fileSize File size
@param width Image width (or 0 if not image)
@param height Image height (or 0 if not image)
@return... | java | @Override
public MediaFormat detectMediaFormat(@Nullable String extension, long fileSize, long width, long height) {
SortedSet<MediaFormat> matchingFormats = detectMediaFormats(extension, fileSize, width, height);
return !matchingFormats.isEmpty() ? matchingFormats.first() : null;
} | [
"@",
"Override",
"public",
"MediaFormat",
"detectMediaFormat",
"(",
"@",
"Nullable",
"String",
"extension",
",",
"long",
"fileSize",
",",
"long",
"width",
",",
"long",
"height",
")",
"{",
"SortedSet",
"<",
"MediaFormat",
">",
"matchingFormats",
"=",
"detectMedia... | Detect matching media format.
@param extension File extension
@param fileSize File size
@param width Image width (or 0 if not image)
@param height Image height (or 0 if not image)
@return Media format or null if no matching media format found | [
"Detect",
"matching",
"media",
"format",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/format/impl/MediaFormatHandlerImpl.java#L260-L264 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/exceptions/ExceptionUtil.java | ExceptionUtil.getCausedBy | @SuppressWarnings("unchecked")
public static Throwable getCausedBy(Throwable throwable, Class<? extends Exception>... causeClasses) {
"""
获取由指定异常类引起的异常
@param throwable 异常
@param causeClasses 定义的引起异常的类
@return 是否由指定异常类引起
@since 4.1.13
"""
Throwable cause = throwable;
while (cause != null) {
for (... | java | @SuppressWarnings("unchecked")
public static Throwable getCausedBy(Throwable throwable, Class<? extends Exception>... causeClasses) {
Throwable cause = throwable;
while (cause != null) {
for (Class<? extends Exception> causeClass : causeClasses) {
if (causeClass.isInstance(cause)) {
return cause;
}... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Throwable",
"getCausedBy",
"(",
"Throwable",
"throwable",
",",
"Class",
"<",
"?",
"extends",
"Exception",
">",
"...",
"causeClasses",
")",
"{",
"Throwable",
"cause",
"=",
"throwable",
";",
... | 获取由指定异常类引起的异常
@param throwable 异常
@param causeClasses 定义的引起异常的类
@return 是否由指定异常类引起
@since 4.1.13 | [
"获取由指定异常类引起的异常"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/exceptions/ExceptionUtil.java#L234-L246 |
apereo/cas | support/cas-server-support-saml-googleapps-core/src/main/java/org/apereo/cas/support/saml/authentication/principal/GoogleAccountsServiceResponseBuilder.java | GoogleAccountsServiceResponseBuilder.createGoogleAppsPrivateKey | protected void createGoogleAppsPrivateKey() throws Exception {
"""
Create the private key.
@throws Exception if key creation ran into an error
"""
if (!isValidConfiguration()) {
LOGGER.debug("Google Apps private key bean will not be created, because it's not configured");
ret... | java | protected void createGoogleAppsPrivateKey() throws Exception {
if (!isValidConfiguration()) {
LOGGER.debug("Google Apps private key bean will not be created, because it's not configured");
return;
}
val bean = new PrivateKeyFactoryBean();
if (this.privateKeyLoca... | [
"protected",
"void",
"createGoogleAppsPrivateKey",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"isValidConfiguration",
"(",
")",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Google Apps private key bean will not be created, because it's not configured\"",
")",
";",... | Create the private key.
@throws Exception if key creation ran into an error | [
"Create",
"the",
"private",
"key",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-googleapps-core/src/main/java/org/apereo/cas/support/saml/authentication/principal/GoogleAccountsServiceResponseBuilder.java#L143-L165 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPlot.java | SVGPlot.saveAsJPEG | public void saveAsJPEG(File file, int width, int height) throws IOException, TranscoderException {
"""
Transcode file to JPEG.
@param file Output filename
@param width Width
@param height Height
@throws IOException On write errors
@throws TranscoderException On input/parsing errors.
"""
saveAsJPEG(f... | java | public void saveAsJPEG(File file, int width, int height) throws IOException, TranscoderException {
saveAsJPEG(file, width, height, DEFAULT_QUALITY);
} | [
"public",
"void",
"saveAsJPEG",
"(",
"File",
"file",
",",
"int",
"width",
",",
"int",
"height",
")",
"throws",
"IOException",
",",
"TranscoderException",
"{",
"saveAsJPEG",
"(",
"file",
",",
"width",
",",
"height",
",",
"DEFAULT_QUALITY",
")",
";",
"}"
] | Transcode file to JPEG.
@param file Output filename
@param width Width
@param height Height
@throws IOException On write errors
@throws TranscoderException On input/parsing errors. | [
"Transcode",
"file",
"to",
"JPEG",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPlot.java#L550-L552 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photos/SearchParameters.java | SearchParameters.setBBox | public void setBBox(String minimum_longitude, String minimum_latitude, String maximum_longitude, String maximum_latitude) {
"""
4 values defining the Bounding Box of the area that will be searched.
<p>
The 4 values represent the bottom-left corner of the box and the top-right corner, minimum_longitude, minimum_l... | java | public void setBBox(String minimum_longitude, String minimum_latitude, String maximum_longitude, String maximum_latitude) {
this.bbox = new String[] { minimum_longitude, minimum_latitude, maximum_longitude, maximum_latitude };
} | [
"public",
"void",
"setBBox",
"(",
"String",
"minimum_longitude",
",",
"String",
"minimum_latitude",
",",
"String",
"maximum_longitude",
",",
"String",
"maximum_latitude",
")",
"{",
"this",
".",
"bbox",
"=",
"new",
"String",
"[",
"]",
"{",
"minimum_longitude",
",... | 4 values defining the Bounding Box of the area that will be searched.
<p>
The 4 values represent the bottom-left corner of the box and the top-right corner, minimum_longitude, minimum_latitude, maximum_longitude,
maximum_latitude.
<p>
Longitude has a range of -180 to 180, latitude of -90 to 90. Defaults to -180, -90, ... | [
"4",
"values",
"defining",
"the",
"Bounding",
"Box",
"of",
"the",
"area",
"that",
"will",
"be",
"searched",
".",
"<p",
">",
"The",
"4",
"values",
"represent",
"the",
"bottom",
"-",
"left",
"corner",
"of",
"the",
"box",
"and",
"the",
"top",
"-",
"right"... | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/SearchParameters.java#L345-L347 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/Mapper.java | Mapper.mapValues | public static Map mapValues(Mapper mapper, Map map, boolean includeNull) {
"""
Create a new Map by mapping all values from the original map and maintaining the original key.
@param mapper a Mapper to map the values
@param map an Map
@param includeNull true to include null
@return a new Map with values ... | java | public static Map mapValues(Mapper mapper, Map map, boolean includeNull) {
HashMap h = new HashMap();
for (Object e : map.keySet()) {
Map.Entry entry = (Map.Entry) e;
Object v = entry.getValue();
Object o = mapper.map(v);
if (includeNull || o != null) {
... | [
"public",
"static",
"Map",
"mapValues",
"(",
"Mapper",
"mapper",
",",
"Map",
"map",
",",
"boolean",
"includeNull",
")",
"{",
"HashMap",
"h",
"=",
"new",
"HashMap",
"(",
")",
";",
"for",
"(",
"Object",
"e",
":",
"map",
".",
"keySet",
"(",
")",
")",
... | Create a new Map by mapping all values from the original map and maintaining the original key.
@param mapper a Mapper to map the values
@param map an Map
@param includeNull true to include null
@return a new Map with values mapped | [
"Create",
"a",
"new",
"Map",
"by",
"mapping",
"all",
"values",
"from",
"the",
"original",
"map",
"and",
"maintaining",
"the",
"original",
"key",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Mapper.java#L427-L438 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java | PAbstractObject.optString | @Override
public final String optString(final String key, final String defaultValue) {
"""
Get a property as a string or defaultValue.
@param key the property name
@param defaultValue the default value
"""
String result = optString(key);
return result == null ? defaultValue : result;
... | java | @Override
public final String optString(final String key, final String defaultValue) {
String result = optString(key);
return result == null ? defaultValue : result;
} | [
"@",
"Override",
"public",
"final",
"String",
"optString",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"defaultValue",
")",
"{",
"String",
"result",
"=",
"optString",
"(",
"key",
")",
";",
"return",
"result",
"==",
"null",
"?",
"defaultValue",
"... | Get a property as a string or defaultValue.
@param key the property name
@param defaultValue the default value | [
"Get",
"a",
"property",
"as",
"a",
"string",
"or",
"defaultValue",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java#L39-L43 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/util/ScriptUtil.java | ScriptUtil.getScriptFormSource | public static ExecutableScript getScriptFormSource(String language, String source, ExpressionManager expressionManager, ScriptFactory scriptFactory) {
"""
Creates a new {@link ExecutableScript} from a source. It excepts static and dynamic sources.
Dynamic means that the source is an expression which will be evalu... | java | public static ExecutableScript getScriptFormSource(String language, String source, ExpressionManager expressionManager, ScriptFactory scriptFactory) {
ensureNotEmpty(NotValidException.class, "Script language", language);
ensureNotNull(NotValidException.class, "Script source", source);
if (isDynamicScriptExp... | [
"public",
"static",
"ExecutableScript",
"getScriptFormSource",
"(",
"String",
"language",
",",
"String",
"source",
",",
"ExpressionManager",
"expressionManager",
",",
"ScriptFactory",
"scriptFactory",
")",
"{",
"ensureNotEmpty",
"(",
"NotValidException",
".",
"class",
"... | Creates a new {@link ExecutableScript} from a source. It excepts static and dynamic sources.
Dynamic means that the source is an expression which will be evaluated during execution.
@param language the language of the script
@param source the source code of the script or an expression which evaluates to the source cod... | [
"Creates",
"a",
"new",
"{",
"@link",
"ExecutableScript",
"}",
"from",
"a",
"source",
".",
"It",
"excepts",
"static",
"and",
"dynamic",
"sources",
".",
"Dynamic",
"means",
"that",
"the",
"source",
"is",
"an",
"expression",
"which",
"will",
"be",
"evaluated",
... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/ScriptUtil.java#L88-L98 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java | AmazonDynamoDBClient.createTable | public CreateTableResult createTable(CreateTableRequest createTableRequest)
throws AmazonServiceException, AmazonClientException {
"""
<p>
Adds a new table to your account.
</p>
<p>
The table name must be unique among those associated with the AWS
Account issuing the request, and the AWS Region th... | java | public CreateTableResult createTable(CreateTableRequest createTableRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createTableRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
... | [
"public",
"CreateTableResult",
"createTable",
"(",
"CreateTableRequest",
"createTableRequest",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
"{",
"ExecutionContext",
"executionContext",
"=",
"createExecutionContext",
"(",
"createTableRequest",
")",
";",... | <p>
Adds a new table to your account.
</p>
<p>
The table name must be unique among those associated with the AWS
Account issuing the request, and the AWS Region that receives the
request (e.g. <code>us-east-1</code> ).
</p>
<p>
The <code>CreateTable</code> operation triggers an asynchronous
workflow to begin creating t... | [
"<p",
">",
"Adds",
"a",
"new",
"table",
"to",
"your",
"account",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"table",
"name",
"must",
"be",
"unique",
"among",
"those",
"associated",
"with",
"the",
"AWS",
"Account",
"issuing",
"the",
"request",
"and",
... | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java#L679-L691 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/wan/merkletree/MerkleTreeUtil.java | MerkleTreeUtil.getLeftMostLeafUnderNode | static int getLeftMostLeafUnderNode(int nodeOrder, int depth) {
"""
Returns the breadth-first order of the leftmost leaf in the
subtree selected by {@code nodeOrder} as the root of the subtree
@param nodeOrder The order of the node as the root of the subtree
@param depth The depth of the tree
@return the... | java | static int getLeftMostLeafUnderNode(int nodeOrder, int depth) {
if (isLeaf(nodeOrder, depth)) {
return nodeOrder;
}
int leafLevel = depth - 1;
int levelOfNode = getLevelOfNode(nodeOrder);
int distanceFromLeafLevel = depth - levelOfNode - 1;
int leftMostNodeOr... | [
"static",
"int",
"getLeftMostLeafUnderNode",
"(",
"int",
"nodeOrder",
",",
"int",
"depth",
")",
"{",
"if",
"(",
"isLeaf",
"(",
"nodeOrder",
",",
"depth",
")",
")",
"{",
"return",
"nodeOrder",
";",
"}",
"int",
"leafLevel",
"=",
"depth",
"-",
"1",
";",
"... | Returns the breadth-first order of the leftmost leaf in the
subtree selected by {@code nodeOrder} as the root of the subtree
@param nodeOrder The order of the node as the root of the subtree
@param depth The depth of the tree
@return the breadth-first order of the leftmost leaf under the
provided node | [
"Returns",
"the",
"breadth",
"-",
"first",
"order",
"of",
"the",
"leftmost",
"leaf",
"in",
"the",
"subtree",
"selected",
"by",
"{",
"@code",
"nodeOrder",
"}",
"as",
"the",
"root",
"of",
"the",
"subtree"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/wan/merkletree/MerkleTreeUtil.java#L270-L283 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsUndoChanges.java | CmsUndoChanges.resourceOriginalPath | public static String resourceOriginalPath(CmsObject cms, String resourceName) {
"""
Returns the original path of given resource, that is the online path for the resource.
If it differs from the offline path, the resource has been moved.<p>
@param cms the cms context
@param resourceName a site relative resourc... | java | public static String resourceOriginalPath(CmsObject cms, String resourceName) {
CmsProject proj = cms.getRequestContext().getCurrentProject();
try {
CmsResource resource = cms.readResource(resourceName, CmsResourceFilter.ALL);
String result = cms.getSitePath(resource);
... | [
"public",
"static",
"String",
"resourceOriginalPath",
"(",
"CmsObject",
"cms",
",",
"String",
"resourceName",
")",
"{",
"CmsProject",
"proj",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getCurrentProject",
"(",
")",
";",
"try",
"{",
"CmsResource",
"r... | Returns the original path of given resource, that is the online path for the resource.
If it differs from the offline path, the resource has been moved.<p>
@param cms the cms context
@param resourceName a site relative resource name
@return the online path, or <code>null</code> if resource has not been published | [
"Returns",
"the",
"original",
"path",
"of",
"given",
"resource",
"that",
"is",
"the",
"online",
"path",
"for",
"the",
"resource",
".",
"If",
"it",
"differs",
"from",
"the",
"offline",
"path",
"the",
"resource",
"has",
"been",
"moved",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsUndoChanges.java#L128-L148 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/StratifiedSampling.java | StratifiedSampling.weightedProbabilitySampling | public static TransposeDataCollection weightedProbabilitySampling(AssociativeArray2D strataFrequencyTable, AssociativeArray nh, boolean withReplacement) {
"""
Samples nh ids from each strata based on their Frequency Table
@param strataFrequencyTable
@param nh
@param withReplacement
@return
"""
Tr... | java | public static TransposeDataCollection weightedProbabilitySampling(AssociativeArray2D strataFrequencyTable, AssociativeArray nh, boolean withReplacement) {
TransposeDataCollection sampledIds = new TransposeDataCollection();
for(Map.Entry<Object, AssociativeArray> entry : strataFrequencyTable.entryS... | [
"public",
"static",
"TransposeDataCollection",
"weightedProbabilitySampling",
"(",
"AssociativeArray2D",
"strataFrequencyTable",
",",
"AssociativeArray",
"nh",
",",
"boolean",
"withReplacement",
")",
"{",
"TransposeDataCollection",
"sampledIds",
"=",
"new",
"TransposeDataCollec... | Samples nh ids from each strata based on their Frequency Table
@param strataFrequencyTable
@param nh
@param withReplacement
@return | [
"Samples",
"nh",
"ids",
"from",
"each",
"strata",
"based",
"on",
"their",
"Frequency",
"Table"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/StratifiedSampling.java#L38-L53 |
elki-project/elki | addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/UKMeans.java | UKMeans.updateAssignment | protected boolean updateAssignment(DBIDIter iditer, List<? extends ModifiableDBIDs> clusters, WritableIntegerDataStore assignment, int newA) {
"""
Update the cluster assignment.
@param iditer Object id
@param clusters Cluster list
@param assignment Assignment storage
@param newA New assignment.
@return {@co... | java | protected boolean updateAssignment(DBIDIter iditer, List<? extends ModifiableDBIDs> clusters, WritableIntegerDataStore assignment, int newA) {
final int oldA = assignment.intValue(iditer);
if(oldA == newA) {
return false;
}
clusters.get(newA).add(iditer);
assignment.putInt(iditer, newA);
i... | [
"protected",
"boolean",
"updateAssignment",
"(",
"DBIDIter",
"iditer",
",",
"List",
"<",
"?",
"extends",
"ModifiableDBIDs",
">",
"clusters",
",",
"WritableIntegerDataStore",
"assignment",
",",
"int",
"newA",
")",
"{",
"final",
"int",
"oldA",
"=",
"assignment",
"... | Update the cluster assignment.
@param iditer Object id
@param clusters Cluster list
@param assignment Assignment storage
@param newA New assignment.
@return {@code true} if the assignment has changed. | [
"Update",
"the",
"cluster",
"assignment",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/UKMeans.java#L223-L234 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAvatar.java | GVRAvatar.loadModel | public void loadModel(GVRAndroidResource avatarResource, String attachBone) {
"""
Load a model to attach to the avatar
@param avatarResource resource with avatar model
@param attachBone name of bone to attach model to
"""
EnumSet<GVRImportSettings> settings = GVRImportSettings.getRecommende... | java | public void loadModel(GVRAndroidResource avatarResource, String attachBone)
{
EnumSet<GVRImportSettings> settings = GVRImportSettings.getRecommendedSettingsWith(EnumSet.of(GVRImportSettings.OPTIMIZE_GRAPH, GVRImportSettings.NO_ANIMATION));
GVRContext ctx = mAvatarRoot.getGVRContext();
GVRRes... | [
"public",
"void",
"loadModel",
"(",
"GVRAndroidResource",
"avatarResource",
",",
"String",
"attachBone",
")",
"{",
"EnumSet",
"<",
"GVRImportSettings",
">",
"settings",
"=",
"GVRImportSettings",
".",
"getRecommendedSettingsWith",
"(",
"EnumSet",
".",
"of",
"(",
"GVR... | Load a model to attach to the avatar
@param avatarResource resource with avatar model
@param attachBone name of bone to attach model to | [
"Load",
"a",
"model",
"to",
"attach",
"to",
"the",
"avatar"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAvatar.java#L207-L233 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java | BugInstance.addSourceLine | @Nonnull
public BugInstance addSourceLine(ClassContext classContext, Method method, InstructionHandle handle) {
"""
Add source line annotation for given Location in a method.
@param classContext
the ClassContext
@param method
the Method
@param handle
InstructionHandle of an instruction in the method
@... | java | @Nonnull
public BugInstance addSourceLine(ClassContext classContext, Method method, InstructionHandle handle) {
SourceLineAnnotation sourceLineAnnotation = SourceLineAnnotation.fromVisitedInstruction(classContext, method,
handle.getPosition());
if (sourceLineAnnotation != null) {
... | [
"@",
"Nonnull",
"public",
"BugInstance",
"addSourceLine",
"(",
"ClassContext",
"classContext",
",",
"Method",
"method",
",",
"InstructionHandle",
"handle",
")",
"{",
"SourceLineAnnotation",
"sourceLineAnnotation",
"=",
"SourceLineAnnotation",
".",
"fromVisitedInstruction",
... | Add source line annotation for given Location in a method.
@param classContext
the ClassContext
@param method
the Method
@param handle
InstructionHandle of an instruction in the method
@return this BugInstance | [
"Add",
"source",
"line",
"annotation",
"for",
"given",
"Location",
"in",
"a",
"method",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1747-L1755 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/fingerprint/FingerprinterTool.java | FingerprinterTool.makeBitFingerprint | public static IBitFingerprint makeBitFingerprint(final Map<String,Integer> features, int len, int bits) {
"""
Convert a mapping of features and their counts to a binary fingerprint. Each feature
can set 1-n hashes, the amount is modified by the {@code bits} operand.
@param features features to include
@param ... | java | public static IBitFingerprint makeBitFingerprint(final Map<String,Integer> features, int len, int bits) {
final BitSetFingerprint fingerprint = new BitSetFingerprint(len);
final Random rand = new Random();
for (String feature : features.keySet()) {
int hash = feature.hashCode();
... | [
"public",
"static",
"IBitFingerprint",
"makeBitFingerprint",
"(",
"final",
"Map",
"<",
"String",
",",
"Integer",
">",
"features",
",",
"int",
"len",
",",
"int",
"bits",
")",
"{",
"final",
"BitSetFingerprint",
"fingerprint",
"=",
"new",
"BitSetFingerprint",
"(",
... | Convert a mapping of features and their counts to a binary fingerprint. Each feature
can set 1-n hashes, the amount is modified by the {@code bits} operand.
@param features features to include
@param len fingerprint length
@param bits number of bits to set for each pattern
@return the continuous fingerprint | [
"Convert",
"a",
"mapping",
"of",
"features",
"and",
"their",
"counts",
"to",
"a",
"binary",
"fingerprint",
".",
"Each",
"feature",
"can",
"set",
"1",
"-",
"n",
"hashes",
"the",
"amount",
"is",
"modified",
"by",
"the",
"{",
"@code",
"bits",
"}",
"operand"... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/fingerprint/FingerprinterTool.java#L157-L169 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.zero | public SDVariable zero(String name, org.nd4j.linalg.api.buffer.DataType dataType, int... shape) {
"""
Create a new variable with the specified shape, with all values initialized to 0
@param name the name of the variable to create
@param shape the shape of the array to be created
@return the created variable
... | java | public SDVariable zero(String name, org.nd4j.linalg.api.buffer.DataType dataType, int... shape) {
return var(name, new ZeroInitScheme(), dataType, ArrayUtil.toLongArray(shape));
} | [
"public",
"SDVariable",
"zero",
"(",
"String",
"name",
",",
"org",
".",
"nd4j",
".",
"linalg",
".",
"api",
".",
"buffer",
".",
"DataType",
"dataType",
",",
"int",
"...",
"shape",
")",
"{",
"return",
"var",
"(",
"name",
",",
"new",
"ZeroInitScheme",
"("... | Create a new variable with the specified shape, with all values initialized to 0
@param name the name of the variable to create
@param shape the shape of the array to be created
@return the created variable | [
"Create",
"a",
"new",
"variable",
"with",
"the",
"specified",
"shape",
"with",
"all",
"values",
"initialized",
"to",
"0"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L1989-L1991 |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java | AbsSetting.getInt | public Integer getInt(String key, String group, Integer defaultValue) {
"""
获取数字型型属性值
@param key 属性名
@param group 分组名
@param defaultValue 默认值
@return 属性值
"""
return Convert.toInt(getByGroup(key, group), defaultValue);
} | java | public Integer getInt(String key, String group, Integer defaultValue) {
return Convert.toInt(getByGroup(key, group), defaultValue);
} | [
"public",
"Integer",
"getInt",
"(",
"String",
"key",
",",
"String",
"group",
",",
"Integer",
"defaultValue",
")",
"{",
"return",
"Convert",
".",
"toInt",
"(",
"getByGroup",
"(",
"key",
",",
"group",
")",
",",
"defaultValue",
")",
";",
"}"
] | 获取数字型型属性值
@param key 属性名
@param group 分组名
@param defaultValue 默认值
@return 属性值 | [
"获取数字型型属性值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java#L164-L166 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedClient.java | MemcachedClient.waitForQueues | @Override
public boolean waitForQueues(long timeout, TimeUnit unit) {
"""
Wait for the queues to die down.
@param timeout the amount of time time for shutdown
@param unit the TimeUnit for the timeout
@return result of the request for the wait
@throws IllegalStateException in the rare circumstance where que... | java | @Override
public boolean waitForQueues(long timeout, TimeUnit unit) {
CountDownLatch blatch = broadcastOp(new BroadcastOpFactory() {
@Override
public Operation newOp(final MemcachedNode n,
final CountDownLatch latch) {
return opFact.noop(new OperationCallback() {
@Override
... | [
"@",
"Override",
"public",
"boolean",
"waitForQueues",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"CountDownLatch",
"blatch",
"=",
"broadcastOp",
"(",
"new",
"BroadcastOpFactory",
"(",
")",
"{",
"@",
"Override",
"public",
"Operation",
"newOp",
... | Wait for the queues to die down.
@param timeout the amount of time time for shutdown
@param unit the TimeUnit for the timeout
@return result of the request for the wait
@throws IllegalStateException in the rare circumstance where queue is too
full to accept any more requests | [
"Wait",
"for",
"the",
"queues",
"to",
"die",
"down",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedClient.java#L2533-L2560 |
qspin/qtaste | plugins_src/javagui/src/main/java/com/qspin/qtaste/javagui/server/ComponentCommander.java | ComponentCommander.lookForComponent | protected Component lookForComponent(String name, Component[] components) {
"""
Browses recursively the components in order to find components with the name.
@param name the component's name.
@param components components to browse.
@return the first component with the name.
"""
for (int i = 0; i <... | java | protected Component lookForComponent(String name, Component[] components) {
for (int i = 0; i < components.length && !mFindWithEqual; i++) {
//String componentName = ComponentNamer.getInstance().getNameForComponent(components[c]);
Component c = components[i];
checkName(name, ... | [
"protected",
"Component",
"lookForComponent",
"(",
"String",
"name",
",",
"Component",
"[",
"]",
"components",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"components",
".",
"length",
"&&",
"!",
"mFindWithEqual",
";",
"i",
"++",
")",
"{"... | Browses recursively the components in order to find components with the name.
@param name the component's name.
@param components components to browse.
@return the first component with the name. | [
"Browses",
"recursively",
"the",
"components",
"in",
"order",
"to",
"find",
"components",
"with",
"the",
"name",
"."
] | train | https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/plugins_src/javagui/src/main/java/com/qspin/qtaste/javagui/server/ComponentCommander.java#L97-L112 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/query/PartitionScanRunner.java | PartitionScanRunner.run | public QueryableEntriesSegment run(String mapName, Predicate predicate, int partitionId, int tableIndex, int fetchSize) {
"""
Executes the predicate on a partition chunk. The offset in the partition is defined by the {@code tableIndex}
and the soft limit is defined by the {@code fetchSize}. The method returns the... | java | public QueryableEntriesSegment run(String mapName, Predicate predicate, int partitionId, int tableIndex, int fetchSize) {
int lastIndex = tableIndex;
final List<QueryableEntry> resultList = new LinkedList<>();
final PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(... | [
"public",
"QueryableEntriesSegment",
"run",
"(",
"String",
"mapName",
",",
"Predicate",
"predicate",
",",
"int",
"partitionId",
",",
"int",
"tableIndex",
",",
"int",
"fetchSize",
")",
"{",
"int",
"lastIndex",
"=",
"tableIndex",
";",
"final",
"List",
"<",
"Quer... | Executes the predicate on a partition chunk. The offset in the partition is defined by the {@code tableIndex}
and the soft limit is defined by the {@code fetchSize}. The method returns the matched entries and an
index from which new entries can be fetched which allows for efficient iteration of query results.
<p>
<b>NO... | [
"Executes",
"the",
"predicate",
"on",
"a",
"partition",
"chunk",
".",
"The",
"offset",
"in",
"the",
"partition",
"is",
"defined",
"by",
"the",
"{",
"@code",
"tableIndex",
"}",
"and",
"the",
"soft",
"limit",
"is",
"defined",
"by",
"the",
"{",
"@code",
"fe... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/query/PartitionScanRunner.java#L135-L157 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.getDeltaCWithPathPrefix | public <C> DbxDeltaC<C> getDeltaCWithPathPrefix(Collector<DbxDeltaC.Entry<DbxEntry>, C> collector,
/*@Nullable*/String cursor, String pathPrefix,
boolean includeMediaInfo)
throws DbxException {
"""
A mor... | java | public <C> DbxDeltaC<C> getDeltaCWithPathPrefix(Collector<DbxDeltaC.Entry<DbxEntry>, C> collector,
/*@Nullable*/String cursor, String pathPrefix,
boolean includeMediaInfo)
throws DbxException
{
Db... | [
"public",
"<",
"C",
">",
"DbxDeltaC",
"<",
"C",
">",
"getDeltaCWithPathPrefix",
"(",
"Collector",
"<",
"DbxDeltaC",
".",
"Entry",
"<",
"DbxEntry",
">",
",",
"C",
">",
"collector",
",",
"/*@Nullable*/",
"String",
"cursor",
",",
"String",
"pathPrefix",
",",
... | A more generic version of {@link #getDeltaWithPathPrefix}. You provide a <em>collector</em>,
which lets you process the delta entries as they arrive over the network. | [
"A",
"more",
"generic",
"version",
"of",
"{"
] | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1550-L1557 |
leancloud/java-sdk-all | android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/pay/GetPurchaseInfoApi.java | GetPurchaseInfoApi.onConnect | @Override
public void onConnect(int rst, HuaweiApiClient client) {
"""
Huawei Api Client 连接回调
@param rst 结果码
@param client HuaweiApiClient 实例
"""
HMSAgentLog.d("onConnect:" + rst);
if (client == null || !ApiClientMgr.INST.isConnect(client)) {
HMSAgentLog.e("client not ... | java | @Override
public void onConnect(int rst, HuaweiApiClient client) {
HMSAgentLog.d("onConnect:" + rst);
if (client == null || !ApiClientMgr.INST.isConnect(client)) {
HMSAgentLog.e("client not connted");
onPurchaseInfoResult(rst, null);
return;
}
... | [
"@",
"Override",
"public",
"void",
"onConnect",
"(",
"int",
"rst",
",",
"HuaweiApiClient",
"client",
")",
"{",
"HMSAgentLog",
".",
"d",
"(",
"\"onConnect:\"",
"+",
"rst",
")",
";",
"if",
"(",
"client",
"==",
"null",
"||",
"!",
"ApiClientMgr",
".",
"INST"... | Huawei Api Client 连接回调
@param rst 结果码
@param client HuaweiApiClient 实例 | [
"Huawei",
"Api",
"Client",
"连接回调"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/pay/GetPurchaseInfoApi.java#L52-L94 |
Sciss/abc4j | abc/src/main/java/abc/ui/swing/JScoreComponent.java | JScoreComponent.setTuneAndTemplate | public void setTuneAndTemplate(Tune tune, ScoreTemplate template) {
"""
Sets tune and template in one shot, this is optimized version,
it avoid 2 calculation (first at setTemplate and second at setTune).
"""
//from setTemplate(template)
if (m_template != null)
m_template.removeListener(this);
m_t... | java | public void setTuneAndTemplate(Tune tune, ScoreTemplate template) {
//from setTemplate(template)
if (m_template != null)
m_template.removeListener(this);
m_template = template;
m_template.setGraphics(getGraphics2D());
m_template.addListener(this);
//from refresh()
initGfx();
setTune(tune);
... | [
"public",
"void",
"setTuneAndTemplate",
"(",
"Tune",
"tune",
",",
"ScoreTemplate",
"template",
")",
"{",
"//from setTemplate(template)\r",
"if",
"(",
"m_template",
"!=",
"null",
")",
"m_template",
".",
"removeListener",
"(",
"this",
")",
";",
"m_template",
"=",
... | Sets tune and template in one shot, this is optimized version,
it avoid 2 calculation (first at setTemplate and second at setTune). | [
"Sets",
"tune",
"and",
"template",
"in",
"one",
"shot",
"this",
"is",
"optimized",
"version",
"it",
"avoid",
"2",
"calculation",
"(",
"first",
"at",
"setTemplate",
"and",
"second",
"at",
"setTune",
")",
"."
] | train | https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/JScoreComponent.java#L237-L247 |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/compat/hadoop/TextSerializer.java | TextSerializer.writeStringAsText | public static void writeStringAsText(DataOutput stream, String str) throws IOException {
"""
Serialize a String using the same logic as a Hadoop Text object
"""
byte[] utf8Encoded = str.getBytes(StandardCharsets.UTF_8);
writeVLong(stream, utf8Encoded.length);
stream.write(utf8Encoded);
} | java | public static void writeStringAsText(DataOutput stream, String str) throws IOException {
byte[] utf8Encoded = str.getBytes(StandardCharsets.UTF_8);
writeVLong(stream, utf8Encoded.length);
stream.write(utf8Encoded);
} | [
"public",
"static",
"void",
"writeStringAsText",
"(",
"DataOutput",
"stream",
",",
"String",
"str",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"utf8Encoded",
"=",
"str",
".",
"getBytes",
"(",
"StandardCharsets",
".",
"UTF_8",
")",
";",
"writeVLong",
... | Serialize a String using the same logic as a Hadoop Text object | [
"Serialize",
"a",
"String",
"using",
"the",
"same",
"logic",
"as",
"a",
"Hadoop",
"Text",
"object"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/compat/hadoop/TextSerializer.java#L33-L37 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/Validate.java | Validate.isFalse | public static void isFalse(final boolean expression, final String message, final Object... values) {
"""
<p>Validate that the argument condition is {@code false}; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary boolean
expression, such as... | java | public static void isFalse(final boolean expression, final String message, final Object... values) {
INSTANCE.isFalse(expression, message, values);
} | [
"public",
"static",
"void",
"isFalse",
"(",
"final",
"boolean",
"expression",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"INSTANCE",
".",
"isFalse",
"(",
"expression",
",",
"message",
",",
"values",
")",
";",
"}"
... | <p>Validate that the argument condition is {@code false}; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary boolean
expression, such as validating a primitive number or using your own custom validation expression.</p>
@param expression
the boole... | [
"<p",
">",
"Validate",
"that",
"the",
"argument",
"condition",
"is",
"{",
"@code",
"false",
"}",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"This",
"method",
"is",
"useful",
"when",
"validating",
"according",
... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/Validate.java#L624-L626 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/http/AbstractMappingHTTPResponseHandler.java | AbstractMappingHTTPResponseHandler.updateFaxJob | public void updateFaxJob(FaxJob faxJob,HTTPResponse httpResponse,FaxActionType faxActionType) {
"""
Updates the fax job based on the data from the HTTP response data.
@param faxJob
The fax job object
@param httpResponse
The HTTP response
@param faxActionType
The fax action type
"""
//get ... | java | public void updateFaxJob(FaxJob faxJob,HTTPResponse httpResponse,FaxActionType faxActionType)
{
//get path
String path=this.getPathToResponseData(faxActionType);
//get fax job ID
String id=this.findValue(httpResponse,path);
if(id!=null)
{
faxJob.... | [
"public",
"void",
"updateFaxJob",
"(",
"FaxJob",
"faxJob",
",",
"HTTPResponse",
"httpResponse",
",",
"FaxActionType",
"faxActionType",
")",
"{",
"//get path",
"String",
"path",
"=",
"this",
".",
"getPathToResponseData",
"(",
"faxActionType",
")",
";",
"//get fax job... | Updates the fax job based on the data from the HTTP response data.
@param faxJob
The fax job object
@param httpResponse
The HTTP response
@param faxActionType
The fax action type | [
"Updates",
"the",
"fax",
"job",
"based",
"on",
"the",
"data",
"from",
"the",
"HTTP",
"response",
"data",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/AbstractMappingHTTPResponseHandler.java#L172-L184 |
innoq/LiQID | ldap-connector/src/main/java/com/innoq/ldap/connector/LdapHelper.java | LdapHelper.setUserAsUser | @Override
public boolean setUserAsUser(Node node, String uid, String password) throws Exception {
"""
Writes the modifications on an user object back to the LDAP using a
specific context.
@param node the LDAP Node with User Content.
@param uid the uid of the User that adds the Node.
@param password the p... | java | @Override
public boolean setUserAsUser(Node node, String uid, String password) throws Exception {
boolean status = false;
StringBuilder sb = new StringBuilder(userIdentifyer + "=").append(uid).append(",");
sb.append(Configuration.getProperty(instanceName + LdapKeys.ATTR_OU_PEOPLE)).append(",");
sb.append(ba... | [
"@",
"Override",
"public",
"boolean",
"setUserAsUser",
"(",
"Node",
"node",
",",
"String",
"uid",
",",
"String",
"password",
")",
"throws",
"Exception",
"{",
"boolean",
"status",
"=",
"false",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"us... | Writes the modifications on an user object back to the LDAP using a
specific context.
@param node the LDAP Node with User Content.
@param uid the uid of the User that adds the Node.
@param password the password of the User that adds the Node.
@return true if the user was set correct, false otherwise.
@throws Exception... | [
"Writes",
"the",
"modifications",
"on",
"an",
"user",
"object",
"back",
"to",
"the",
"LDAP",
"using",
"a",
"specific",
"context",
"."
] | train | https://github.com/innoq/LiQID/blob/ae3de2c1fd78c40219780d510eba57c931901279/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapHelper.java#L153-L173 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.rotateAround | public Matrix4d rotateAround(Quaterniondc quat, double ox, double oy, double oz) {
"""
Apply the rotation transformation of the given {@link Quaterniondc} to this matrix while using <code>(ox, oy, oz)</code> as the rotation origin.
<p>
When used with a right-handed coordinate system, the produced rotation will r... | java | public Matrix4d rotateAround(Quaterniondc quat, double ox, double oy, double oz) {
return rotateAround(quat, ox, oy, oz, this);
} | [
"public",
"Matrix4d",
"rotateAround",
"(",
"Quaterniondc",
"quat",
",",
"double",
"ox",
",",
"double",
"oy",
",",
"double",
"oz",
")",
"{",
"return",
"rotateAround",
"(",
"quat",
",",
"ox",
",",
"oy",
",",
"oz",
",",
"this",
")",
";",
"}"
] | Apply the rotation transformation of the given {@link Quaterniondc} to this matrix while using <code>(ox, oy, oz)</code> as the rotation origin.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise around the rotation axis, when viewing along the negative axi... | [
"Apply",
"the",
"rotation",
"transformation",
"of",
"the",
"given",
"{",
"@link",
"Quaterniondc",
"}",
"to",
"this",
"matrix",
"while",
"using",
"<code",
">",
"(",
"ox",
"oy",
"oz",
")",
"<",
"/",
"code",
">",
"as",
"the",
"rotation",
"origin",
".",
"<... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L5005-L5007 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java | AutoRegisterActionServlet.ensureModuleRegistered | public ModuleConfig ensureModuleRegistered( String modulePath, ServletRequest request )
throws IOException, ServletException {
"""
Ensures that the Struts module for the given path is registered (dynamically, if necessary).
@deprecated Use #ensureModuleRegistered(String) instead.
@param modulePath the ... | java | public ModuleConfig ensureModuleRegistered( String modulePath, ServletRequest request )
throws IOException, ServletException
{
return ensureModuleRegistered(modulePath);
} | [
"public",
"ModuleConfig",
"ensureModuleRegistered",
"(",
"String",
"modulePath",
",",
"ServletRequest",
"request",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"return",
"ensureModuleRegistered",
"(",
"modulePath",
")",
";",
"}"
] | Ensures that the Struts module for the given path is registered (dynamically, if necessary).
@deprecated Use #ensureModuleRegistered(String) instead.
@param modulePath the module path, from the request URI.
@param request the current ServletRequest
@throws IOException
@throws ServletException | [
"Ensures",
"that",
"the",
"Struts",
"module",
"for",
"the",
"given",
"path",
"is",
"registered",
"(",
"dynamically",
"if",
"necessary",
")",
".",
"@deprecated",
"Use",
"#ensureModuleRegistered",
"(",
"String",
")",
"instead",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java#L739-L743 |
ozimov/cirneco | hamcrest/hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/base/IsBetweenLowerBoundInclusive.java | IsBetweenLowerBoundInclusive.betweenLowerBoundInclusive | public static <T extends Comparable<T>> Matcher<T> betweenLowerBoundInclusive(final T from, final T to) {
"""
Creates a matcher for {@code T}s that matches when the <code>compareTo()</code> method returns a value between
<code>from</code> and <code>to</code>, both included.
<p>
<p>
<p>
<p>
<p>For example:
<... | java | public static <T extends Comparable<T>> Matcher<T> betweenLowerBoundInclusive(final T from, final T to) {
return new IsBetweenLowerBoundInclusive(from, to);
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"T",
">",
">",
"Matcher",
"<",
"T",
">",
"betweenLowerBoundInclusive",
"(",
"final",
"T",
"from",
",",
"final",
"T",
"to",
")",
"{",
"return",
"new",
"IsBetweenLowerBoundInclusive",
"(",
"from",
"... | Creates a matcher for {@code T}s that matches when the <code>compareTo()</code> method returns a value between
<code>from</code> and <code>to</code>, both included.
<p>
<p>
<p>
<p>
<p>For example:
<p>
<p>
<p>
<p>
<pre>assertThat(10, betweenLowerBoundInclusive(10, 11))</pre>
will return true. while:
<pre>assertThat(11... | [
"Creates",
"a",
"matcher",
"for",
"{",
"@code",
"T",
"}",
"s",
"that",
"matches",
"when",
"the",
"<code",
">",
"compareTo",
"()",
"<",
"/",
"code",
">",
"method",
"returns",
"a",
"value",
"between",
"<code",
">",
"from<",
"/",
"code",
">",
"and",
"<c... | train | https://github.com/ozimov/cirneco/blob/78ad782da0a2256634cfbebb2f97ed78c993b999/hamcrest/hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/base/IsBetweenLowerBoundInclusive.java#L53-L55 |
aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.convertToJavaIdentifier | public static String convertToJavaIdentifier( String key, JsonConfig jsonConfig ) {
"""
Transforms the string into a valid Java Identifier.<br>
The default strategy is JavaIdentifierTransformer.NOOP
@throws JSONException if the string can not be transformed.
"""
try{
return jsonConfig.getJav... | java | public static String convertToJavaIdentifier( String key, JsonConfig jsonConfig ) {
try{
return jsonConfig.getJavaIdentifierTransformer()
.transformToJavaIdentifier( key );
}catch( JSONException jsone ){
throw jsone;
}catch( Exception e ){
throw new JSONExcept... | [
"public",
"static",
"String",
"convertToJavaIdentifier",
"(",
"String",
"key",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"try",
"{",
"return",
"jsonConfig",
".",
"getJavaIdentifierTransformer",
"(",
")",
".",
"transformToJavaIdentifier",
"(",
"key",
")",
";",
"}"... | Transforms the string into a valid Java Identifier.<br>
The default strategy is JavaIdentifierTransformer.NOOP
@throws JSONException if the string can not be transformed. | [
"Transforms",
"the",
"string",
"into",
"a",
"valid",
"Java",
"Identifier",
".",
"<br",
">",
"The",
"default",
"strategy",
"is",
"JavaIdentifierTransformer",
".",
"NOOP"
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L84-L93 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/FirewallRulesInner.java | FirewallRulesInner.listByRedisResourceAsync | public Observable<Page<RedisFirewallRuleInner>> listByRedisResourceAsync(final String resourceGroupName, final String cacheName) {
"""
Gets all firewall rules in the specified redis cache.
@param resourceGroupName The name of the resource group.
@param cacheName The name of the Redis cache.
@throws IllegalArg... | java | public Observable<Page<RedisFirewallRuleInner>> listByRedisResourceAsync(final String resourceGroupName, final String cacheName) {
return listByRedisResourceWithServiceResponseAsync(resourceGroupName, cacheName)
.map(new Func1<ServiceResponse<Page<RedisFirewallRuleInner>>, Page<RedisFirewallRuleInne... | [
"public",
"Observable",
"<",
"Page",
"<",
"RedisFirewallRuleInner",
">",
">",
"listByRedisResourceAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"cacheName",
")",
"{",
"return",
"listByRedisResourceWithServiceResponseAsync",
"(",
"resourceGro... | Gets all firewall rules in the specified redis cache.
@param resourceGroupName The name of the resource group.
@param cacheName The name of the Redis cache.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<RedisFirewallRuleInner> object | [
"Gets",
"all",
"firewall",
"rules",
"in",
"the",
"specified",
"redis",
"cache",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/FirewallRulesInner.java#L136-L144 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.typeTextInWebElement | public void typeTextInWebElement(By by, String text, int match) {
"""
Types text in a WebElement matching the specified By object.
@param by the By object. Examples are: {@code By.id("id")} and {@code By.name("name")}
@param text the text to enter in the {@link WebElement} field
@param match if multiple objec... | java | public void typeTextInWebElement(By by, String text, int match){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "typeTextInWebElement("+by+", \""+text+"\", "+match+")");
}
clicker.clickOnWebElement(by, match, true, false);
dialogUtils.hideSoftKeyboard(null, true, true);
instrumentation.sendS... | [
"public",
"void",
"typeTextInWebElement",
"(",
"By",
"by",
",",
"String",
"text",
",",
"int",
"match",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"typeTextInWebElement(\"",... | Types text in a WebElement matching the specified By object.
@param by the By object. Examples are: {@code By.id("id")} and {@code By.name("name")}
@param text the text to enter in the {@link WebElement} field
@param match if multiple objects match, this determines which one will be typed in | [
"Types",
"text",
"in",
"a",
"WebElement",
"matching",
"the",
"specified",
"By",
"object",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2760-L2768 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/style/StyleSheetBuilder.java | StyleSheetBuilder.buildUrl | private URL buildUrl(final String styleSheetPath, final boolean skipStylesFolder) {
"""
Get a style sheet URL.
@param styleSheetPath the path of the style sheet, path must be separated by '/'
@param skipStylesFolder skip stylesFolder usage
@return the stylesheet url
"""
URL cssResource = nu... | java | private URL buildUrl(final String styleSheetPath, final boolean skipStylesFolder) {
URL cssResource = null;
final List<String> stylePaths = skipStylesFolder ? Collections.singletonList("") : ResourceParameters.STYLE_FOLDER.get();
for (int i = 0; i < stylePaths.size() && cssResource == n... | [
"private",
"URL",
"buildUrl",
"(",
"final",
"String",
"styleSheetPath",
",",
"final",
"boolean",
"skipStylesFolder",
")",
"{",
"URL",
"cssResource",
"=",
"null",
";",
"final",
"List",
"<",
"String",
">",
"stylePaths",
"=",
"skipStylesFolder",
"?",
"Collections",... | Get a style sheet URL.
@param styleSheetPath the path of the style sheet, path must be separated by '/'
@param skipStylesFolder skip stylesFolder usage
@return the stylesheet url | [
"Get",
"a",
"style",
"sheet",
"URL",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/style/StyleSheetBuilder.java#L95-L114 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/archaius/cache/ConfigCache.java | ConfigCache.getProperty | private TypeContainer getProperty(String propName) {
"""
Gets the cached property container or make a new one, cache it and return it
@param propName
@return the property's container
"""
TypeContainer container = cache.get(propName);
if (container == null) {
container = new Type... | java | private TypeContainer getProperty(String propName) {
TypeContainer container = cache.get(propName);
if (container == null) {
container = new TypeContainer(propName, config, version);
TypeContainer existing = cache.putIfAbsent(propName, container);
if (existing != null... | [
"private",
"TypeContainer",
"getProperty",
"(",
"String",
"propName",
")",
"{",
"TypeContainer",
"container",
"=",
"cache",
".",
"get",
"(",
"propName",
")",
";",
"if",
"(",
"container",
"==",
"null",
")",
"{",
"container",
"=",
"new",
"TypeContainer",
"(",
... | Gets the cached property container or make a new one, cache it and return it
@param propName
@return the property's container | [
"Gets",
"the",
"cached",
"property",
"container",
"or",
"make",
"a",
"new",
"one",
"cache",
"it",
"and",
"return",
"it"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/archaius/cache/ConfigCache.java#L63-L74 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.formatChineseDate | public static String formatChineseDate(Date date, boolean isUppercase) {
"""
格式化为中文日期格式,如果isUppercase为false,则返回类似:2018年10月24日,否则返回二〇一八年十月二十四日
@param date 被格式化的日期
@param isUppercase 是否采用大写形式
@return 中文日期字符串
@since 4.1.19
"""
if (null == date) {
return null;
}
String format = DatePattern.CHI... | java | public static String formatChineseDate(Date date, boolean isUppercase) {
if (null == date) {
return null;
}
String format = DatePattern.CHINESE_DATE_FORMAT.format(date);
if (isUppercase) {
final StringBuilder builder = StrUtil.builder(format.length());
builder.append(Convert.numberToChinese(In... | [
"public",
"static",
"String",
"formatChineseDate",
"(",
"Date",
"date",
",",
"boolean",
"isUppercase",
")",
"{",
"if",
"(",
"null",
"==",
"date",
")",
"{",
"return",
"null",
";",
"}",
"String",
"format",
"=",
"DatePattern",
".",
"CHINESE_DATE_FORMAT",
".",
... | 格式化为中文日期格式,如果isUppercase为false,则返回类似:2018年10月24日,否则返回二〇一八年十月二十四日
@param date 被格式化的日期
@param isUppercase 是否采用大写形式
@return 中文日期字符串
@since 4.1.19 | [
"格式化为中文日期格式,如果isUppercase为false,则返回类似:2018年10月24日,否则返回二〇一八年十月二十四日"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L565-L585 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/CmsAttributeHandler.java | CmsAttributeHandler.insertNewAttributeValue | public void insertNewAttributeValue(CmsEntity value, int index, Panel container) {
"""
Adds a new attribute value and adds the required widgets to the editor DOM.<p>
@param value the value entity
@param index the position in which to insert the new value
@param container the widget containing the attribute va... | java | public void insertNewAttributeValue(CmsEntity value, int index, Panel container) {
// make sure not to add more values than allowed
int maxOccurrence = getEntityType().getAttributeMaxOccurrence(m_attributeName);
CmsEntityAttribute attribute = m_entity.getAttribute(m_attributeName);
... | [
"public",
"void",
"insertNewAttributeValue",
"(",
"CmsEntity",
"value",
",",
"int",
"index",
",",
"Panel",
"container",
")",
"{",
"// make sure not to add more values than allowed\r",
"int",
"maxOccurrence",
"=",
"getEntityType",
"(",
")",
".",
"getAttributeMaxOccurrence"... | Adds a new attribute value and adds the required widgets to the editor DOM.<p>
@param value the value entity
@param index the position in which to insert the new value
@param container the widget containing the attribute value views | [
"Adds",
"a",
"new",
"attribute",
"value",
"and",
"adds",
"the",
"required",
"widgets",
"to",
"the",
"editor",
"DOM",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsAttributeHandler.java#L605-L639 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/EnforcementJobRest.java | EnforcementJobRest.getEnforcements | @GET
@Produces(MediaType.APPLICATION_XML)
public Response getEnforcements() {
"""
Get the list of available enforcements
<pre>
GET /enforcements
Request:
GET /enforcements HTTP/1.1
Accept: application/xml
Response:
{@code
<?xml version="1.0" encoding="UTF-8"?>
<collection href="/enforcemen... | java | @GET
@Produces(MediaType.APPLICATION_XML)
public Response getEnforcements() {
logger.debug("StartOf getEnforcements - REQUEST for /enforcements");
EnforcementJobHelper enforcementJobService = getHelper();
String serializedEnforcements = null;
try{
serialized... | [
"@",
"GET",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_XML",
")",
"public",
"Response",
"getEnforcements",
"(",
")",
"{",
"logger",
".",
"debug",
"(",
"\"StartOf getEnforcements - REQUEST for /enforcements\"",
")",
";",
"EnforcementJobHelper",
"enforcementJobS... | Get the list of available enforcements
<pre>
GET /enforcements
Request:
GET /enforcements HTTP/1.1
Accept: application/xml
Response:
{@code
<?xml version="1.0" encoding="UTF-8"?>
<collection href="/enforcements">
<items offset="0" total="1">
<enforcement_job>
<agreement_id>agreement04</agreement_id>
<enabled>false... | [
"Get",
"the",
"list",
"of",
"available",
"enforcements"
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/EnforcementJobRest.java#L101-L117 |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java | CachingXmlDataStore.isEmpty | private static boolean isEmpty(@Nonnull final File file, @Nonnull final Charset charset) {
"""
Checks if the given file is empty.
@param file
the file that could be empty
@return {@code true} when the file is accessible and empty otherwise {@code false}
@throws net.sf.qualitycheck.exception.IllegalStateOfArg... | java | private static boolean isEmpty(@Nonnull final File file, @Nonnull final Charset charset) {
try {
return FileUtil.isEmpty(file, charset);
} catch (final IOException e) {
throw new IllegalStateOfArgumentException("The given file could not be read.", e);
}
} | [
"private",
"static",
"boolean",
"isEmpty",
"(",
"@",
"Nonnull",
"final",
"File",
"file",
",",
"@",
"Nonnull",
"final",
"Charset",
"charset",
")",
"{",
"try",
"{",
"return",
"FileUtil",
".",
"isEmpty",
"(",
"file",
",",
"charset",
")",
";",
"}",
"catch",
... | Checks if the given file is empty.
@param file
the file that could be empty
@return {@code true} when the file is accessible and empty otherwise {@code false}
@throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
if an I/O error occurs | [
"Checks",
"if",
"the",
"given",
"file",
"is",
"empty",
"."
] | train | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java#L262-L268 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/query/KunderaQuery.java | KunderaQuery.parseOrdering | private void parseOrdering(String ordering) {
"""
Parses the ordering @See Order By Clause.
@param ordering
the ordering
"""
final String comma = ",";
final String space = " ";
StringTokenizer tokenizer = new StringTokenizer(ordering, comma);
sortOrders = new ArrayList<Kun... | java | private void parseOrdering(String ordering) {
final String comma = ",";
final String space = " ";
StringTokenizer tokenizer = new StringTokenizer(ordering, comma);
sortOrders = new ArrayList<KunderaQuery.SortOrdering>();
while (tokenizer.hasMoreTokens()) {
String or... | [
"private",
"void",
"parseOrdering",
"(",
"String",
"ordering",
")",
"{",
"final",
"String",
"comma",
"=",
"\",\"",
";",
"final",
"String",
"space",
"=",
"\" \"",
";",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"ordering",
",",
"comma",... | Parses the ordering @See Order By Clause.
@param ordering
the ordering | [
"Parses",
"the",
"ordering",
"@See",
"Order",
"By",
"Clause",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/query/KunderaQuery.java#L1195-L1223 |
Azure/azure-sdk-for-java | compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/SnapshotsInner.java | SnapshotsInner.beginUpdate | public SnapshotInner beginUpdate(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) {
"""
Updates (patches) a snapshot.
@param resourceGroupName The name of the resource group.
@param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot ... | java | public SnapshotInner beginUpdate(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot).toBlocking().single().body();
} | [
"public",
"SnapshotInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"snapshotName",
",",
"SnapshotUpdate",
"snapshot",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"snapshotName",
",",
"snapshot",
")",
... | Updates (patches) a snapshot.
@param resourceGroupName The name of the resource group.
@param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
@param sna... | [
"Updates",
"(",
"patches",
")",
"a",
"snapshot",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/SnapshotsInner.java#L393-L395 |
apereo/cas | support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/DelegatedClientWebflowManager.java | DelegatedClientWebflowManager.getDelegatedClientId | protected String getDelegatedClientId(final WebContext webContext, final BaseClient client) {
"""
Gets delegated client id.
@param webContext the web context
@param client the client
@return the delegated client id
"""
var clientId = webContext.getRequestParameter(PARAMETER_CLIENT_ID);
... | java | protected String getDelegatedClientId(final WebContext webContext, final BaseClient client) {
var clientId = webContext.getRequestParameter(PARAMETER_CLIENT_ID);
if (StringUtils.isBlank(clientId)) {
if (client instanceof SAML2Client) {
LOGGER.debug("Client identifier could no... | [
"protected",
"String",
"getDelegatedClientId",
"(",
"final",
"WebContext",
"webContext",
",",
"final",
"BaseClient",
"client",
")",
"{",
"var",
"clientId",
"=",
"webContext",
".",
"getRequestParameter",
"(",
"PARAMETER_CLIENT_ID",
")",
";",
"if",
"(",
"StringUtils",... | Gets delegated client id.
@param webContext the web context
@param client the client
@return the delegated client id | [
"Gets",
"delegated",
"client",
"id",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/DelegatedClientWebflowManager.java#L205-L225 |
alkacon/opencms-core | src/org/opencms/relations/CmsRelation.java | CmsRelation.getTarget | public CmsResource getTarget(CmsObject cms, CmsResourceFilter filter) throws CmsException {
"""
Returns the target resource when possible to read with the given filter.<p>
@param cms the current user context
@param filter the filter to use
@return the target resource
@throws CmsException if something goe... | java | public CmsResource getTarget(CmsObject cms, CmsResourceFilter filter) throws CmsException {
try {
// first look up by id
return cms.readResource(getTargetId(), filter);
} catch (CmsVfsResourceNotFoundException e) {
// then look up by name, but from the root site
... | [
"public",
"CmsResource",
"getTarget",
"(",
"CmsObject",
"cms",
",",
"CmsResourceFilter",
"filter",
")",
"throws",
"CmsException",
"{",
"try",
"{",
"// first look up by id",
"return",
"cms",
".",
"readResource",
"(",
"getTargetId",
"(",
")",
",",
"filter",
")",
"... | Returns the target resource when possible to read with the given filter.<p>
@param cms the current user context
@param filter the filter to use
@return the target resource
@throws CmsException if something goes wrong | [
"Returns",
"the",
"target",
"resource",
"when",
"possible",
"to",
"read",
"with",
"the",
"given",
"filter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsRelation.java#L195-L210 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/execution/scheduler/SourcePartitionedScheduler.java | SourcePartitionedScheduler.newSourcePartitionedSchedulerAsSourceScheduler | public static SourceScheduler newSourcePartitionedSchedulerAsSourceScheduler(
SqlStageExecution stage,
PlanNodeId partitionedNode,
SplitSource splitSource,
SplitPlacementPolicy splitPlacementPolicy,
int splitBatchSize,
boolean groupedExecution) {
... | java | public static SourceScheduler newSourcePartitionedSchedulerAsSourceScheduler(
SqlStageExecution stage,
PlanNodeId partitionedNode,
SplitSource splitSource,
SplitPlacementPolicy splitPlacementPolicy,
int splitBatchSize,
boolean groupedExecution)
... | [
"public",
"static",
"SourceScheduler",
"newSourcePartitionedSchedulerAsSourceScheduler",
"(",
"SqlStageExecution",
"stage",
",",
"PlanNodeId",
"partitionedNode",
",",
"SplitSource",
"splitSource",
",",
"SplitPlacementPolicy",
"splitPlacementPolicy",
",",
"int",
"splitBatchSize",
... | Obtains a {@code SourceScheduler} suitable for use in FixedSourcePartitionedScheduler.
<p>
This returns a {@code SourceScheduler} that can be used for a pipeline
that is either ungrouped or grouped. However, the caller is responsible initializing
the driver groups in this scheduler accordingly.
<p>
Besides, the caller ... | [
"Obtains",
"a",
"{"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/execution/scheduler/SourcePartitionedScheduler.java#L167-L176 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.createIndiceBuffer | protected static DataBuffer createIndiceBuffer(long[][] indices, long[] shape) {
"""
Create a DataBuffer for indices of given arrays of indices.
@param indices
@param shape
@return
"""
checkNotNull(indices);
checkNotNull(shape);
if(indices.length == 0){
return Nd4j.getDat... | java | protected static DataBuffer createIndiceBuffer(long[][] indices, long[] shape){
checkNotNull(indices);
checkNotNull(shape);
if(indices.length == 0){
return Nd4j.getDataBufferFactory().createLong(shape.length);
}
if (indices.length == shape.length) {
retur... | [
"protected",
"static",
"DataBuffer",
"createIndiceBuffer",
"(",
"long",
"[",
"]",
"[",
"]",
"indices",
",",
"long",
"[",
"]",
"shape",
")",
"{",
"checkNotNull",
"(",
"indices",
")",
";",
"checkNotNull",
"(",
"shape",
")",
";",
"if",
"(",
"indices",
".",
... | Create a DataBuffer for indices of given arrays of indices.
@param indices
@param shape
@return | [
"Create",
"a",
"DataBuffer",
"for",
"indices",
"of",
"given",
"arrays",
"of",
"indices",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java#L202-L214 |
JM-Lab/utils-elasticsearch | src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchIndex.java | JMElasticsearchIndex.sendDataWithObjectMapper | public String sendDataWithObjectMapper(Object sourceObject, String index,
String type) {
"""
Send data with object mapper string.
@param sourceObject the source object
@param index the index
@param type the type
@return the string
"""
return sendDataWithObjectMapper(sou... | java | public String sendDataWithObjectMapper(Object sourceObject, String index,
String type) {
return sendDataWithObjectMapper(sourceObject, index, type, null)
.getId();
} | [
"public",
"String",
"sendDataWithObjectMapper",
"(",
"Object",
"sourceObject",
",",
"String",
"index",
",",
"String",
"type",
")",
"{",
"return",
"sendDataWithObjectMapper",
"(",
"sourceObject",
",",
"index",
",",
"type",
",",
"null",
")",
".",
"getId",
"(",
"... | Send data with object mapper string.
@param sourceObject the source object
@param index the index
@param type the type
@return the string | [
"Send",
"data",
"with",
"object",
"mapper",
"string",
"."
] | train | https://github.com/JM-Lab/utils-elasticsearch/blob/6ccec90e1e51d65d2af5efbb6d7b9f9bad90e638/src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchIndex.java#L276-L280 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.catchException | public Binder catchException(Class<? extends Throwable> throwable, MethodHandle function) {
"""
Catch the given exception type from the downstream chain and handle it with the
given function.
@param throwable the exception type to catch
@param function the function to use for handling the exception
@return ... | java | public Binder catchException(Class<? extends Throwable> throwable, MethodHandle function) {
return new Binder(this, new Catch(throwable, function));
} | [
"public",
"Binder",
"catchException",
"(",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"throwable",
",",
"MethodHandle",
"function",
")",
"{",
"return",
"new",
"Binder",
"(",
"this",
",",
"new",
"Catch",
"(",
"throwable",
",",
"function",
")",
")",
";"... | Catch the given exception type from the downstream chain and handle it with the
given function.
@param throwable the exception type to catch
@param function the function to use for handling the exception
@return a new Binder | [
"Catch",
"the",
"given",
"exception",
"type",
"from",
"the",
"downstream",
"chain",
"and",
"handle",
"it",
"with",
"the",
"given",
"function",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1073-L1075 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/job_monitor/AvroJobSpecKafkaJobMonitor.java | Factory.forConfig | public JobSpecMonitor forConfig(Config localScopeConfig, MutableJobCatalog jobCatalog) throws IOException {
"""
Create a {@link AvroJobSpecKafkaJobMonitor} from an input {@link Config}. Useful for multiple monitors, where
the configuration of each monitor is scoped.
@param localScopeConfig The sub-{@link Config}... | java | public JobSpecMonitor forConfig(Config localScopeConfig, MutableJobCatalog jobCatalog) throws IOException {
Preconditions.checkArgument(localScopeConfig.hasPath(TOPIC_KEY));
Config config = localScopeConfig.withFallback(DEFAULTS);
String topic = config.getString(TOPIC_KEY);
SchemaVersionWriter... | [
"public",
"JobSpecMonitor",
"forConfig",
"(",
"Config",
"localScopeConfig",
",",
"MutableJobCatalog",
"jobCatalog",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"localScopeConfig",
".",
"hasPath",
"(",
"TOPIC_KEY",
")",
")",
";",
"C... | Create a {@link AvroJobSpecKafkaJobMonitor} from an input {@link Config}. Useful for multiple monitors, where
the configuration of each monitor is scoped.
@param localScopeConfig The sub-{@link Config} for this monitor without any namespacing (e.g. the key for
topic should simply be "topic").
@throws IOException | [
"Create",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/job_monitor/AvroJobSpecKafkaJobMonitor.java#L78-L93 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java | DiSHPreferenceVectorIndex.determinePreferenceVector | private long[] determinePreferenceVector(Relation<V> relation, ModifiableDBIDs[] neighborIDs, StringBuilder msg) {
"""
Determines the preference vector according to the specified neighbor ids.
@param relation the database storing the objects
@param neighborIDs the list of ids of the neighbors in each dimension... | java | private long[] determinePreferenceVector(Relation<V> relation, ModifiableDBIDs[] neighborIDs, StringBuilder msg) {
if(strategy.equals(Strategy.APRIORI)) {
return determinePreferenceVectorByApriori(relation, neighborIDs, msg);
}
if(strategy.equals(Strategy.MAX_INTERSECTION)) {
return determinePre... | [
"private",
"long",
"[",
"]",
"determinePreferenceVector",
"(",
"Relation",
"<",
"V",
">",
"relation",
",",
"ModifiableDBIDs",
"[",
"]",
"neighborIDs",
",",
"StringBuilder",
"msg",
")",
"{",
"if",
"(",
"strategy",
".",
"equals",
"(",
"Strategy",
".",
"APRIORI... | Determines the preference vector according to the specified neighbor ids.
@param relation the database storing the objects
@param neighborIDs the list of ids of the neighbors in each dimension
@param msg a string buffer for debug messages
@return the preference vector | [
"Determines",
"the",
"preference",
"vector",
"according",
"to",
"the",
"specified",
"neighbor",
"ids",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java#L197-L205 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.setAtt | public static void setAtt(Element el, String name, double d) {
"""
Set a SVG attribute
@param el element
@param name attribute name
@param d double value
"""
el.setAttribute(name, fmt(d));
} | java | public static void setAtt(Element el, String name, double d) {
el.setAttribute(name, fmt(d));
} | [
"public",
"static",
"void",
"setAtt",
"(",
"Element",
"el",
",",
"String",
"name",
",",
"double",
"d",
")",
"{",
"el",
".",
"setAttribute",
"(",
"name",
",",
"fmt",
"(",
"d",
")",
")",
";",
"}"
] | Set a SVG attribute
@param el element
@param name attribute name
@param d double value | [
"Set",
"a",
"SVG",
"attribute"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L294-L296 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/sql/gen/BytecodeGeneratorContext.java | BytecodeGeneratorContext.generateCall | public BytecodeNode generateCall(
String name,
ScalarFunctionImplementation function,
List<BytecodeNode> arguments,
Optional<OutputBlockVariableAndType> outputBlockVariableAndType) {
"""
Generates a function call with null handling, automatic binding of session param... | java | public BytecodeNode generateCall(
String name,
ScalarFunctionImplementation function,
List<BytecodeNode> arguments,
Optional<OutputBlockVariableAndType> outputBlockVariableAndType)
{
Optional<BytecodeNode> instance = Optional.empty();
if (function.getI... | [
"public",
"BytecodeNode",
"generateCall",
"(",
"String",
"name",
",",
"ScalarFunctionImplementation",
"function",
",",
"List",
"<",
"BytecodeNode",
">",
"arguments",
",",
"Optional",
"<",
"OutputBlockVariableAndType",
">",
"outputBlockVariableAndType",
")",
"{",
"Option... | Generates a function call with null handling, automatic binding of session parameter, etc. | [
"Generates",
"a",
"function",
"call",
"with",
"null",
"handling",
"automatic",
"binding",
"of",
"session",
"parameter",
"etc",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/sql/gen/BytecodeGeneratorContext.java#L94-L106 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java | MarshallUtil.unmarshallCollection | public static <E, T extends Collection<E>> T unmarshallCollection(ObjectInput in, CollectionBuilder<E, T> builder) throws IOException, ClassNotFoundException {
"""
Unmarshal a {@link Collection}.
@param in {@link ObjectInput} to read.
@param builder {@link CollectionBuilder} builds the concrete {@link Col... | java | public static <E, T extends Collection<E>> T unmarshallCollection(ObjectInput in, CollectionBuilder<E, T> builder) throws IOException, ClassNotFoundException {
return unmarshallCollection(in, builder, input -> (E) input.readObject());
} | [
"public",
"static",
"<",
"E",
",",
"T",
"extends",
"Collection",
"<",
"E",
">",
">",
"T",
"unmarshallCollection",
"(",
"ObjectInput",
"in",
",",
"CollectionBuilder",
"<",
"E",
",",
"T",
">",
"builder",
")",
"throws",
"IOException",
",",
"ClassNotFoundExcepti... | Unmarshal a {@link Collection}.
@param in {@link ObjectInput} to read.
@param builder {@link CollectionBuilder} builds the concrete {@link Collection} based on size.
@param <E> Collection's element type.
@param <T> {@link Collection} implementation.
@return The concrete {@link Collection} implementation.
... | [
"Unmarshal",
"a",
"{",
"@link",
"Collection",
"}",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java#L292-L294 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/callsite/BooleanClosureWrapper.java | BooleanClosureWrapper.callForMap | public <K,V> boolean callForMap(Map.Entry<K, V> entry) {
"""
Bridge for a call based on a map entry. If the call is done on a {@link Closure}
taking one argument, then we give in the {@link Entry}, otherwise we will
give in the key and value.
"""
if (numberOfArguments==2) {
return call(en... | java | public <K,V> boolean callForMap(Map.Entry<K, V> entry) {
if (numberOfArguments==2) {
return call(entry.getKey(), entry.getValue());
} else {
return call(entry);
}
} | [
"public",
"<",
"K",
",",
"V",
">",
"boolean",
"callForMap",
"(",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
"entry",
")",
"{",
"if",
"(",
"numberOfArguments",
"==",
"2",
")",
"{",
"return",
"call",
"(",
"entry",
".",
"getKey",
"(",
")",
",",
... | Bridge for a call based on a map entry. If the call is done on a {@link Closure}
taking one argument, then we give in the {@link Entry}, otherwise we will
give in the key and value. | [
"Bridge",
"for",
"a",
"call",
"based",
"on",
"a",
"map",
"entry",
".",
"If",
"the",
"call",
"is",
"done",
"on",
"a",
"{"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/callsite/BooleanClosureWrapper.java#L60-L66 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/ImplBinaryNaiveOps.java | ImplBinaryNaiveOps.getF | public static boolean getF(GrayU8 image, int x, int y) {
"""
If a point is inside the image true is returned if its value is not zero, otherwise false is returned.
"""
if (image.isInBounds(x, y)) {
return image.get(x, y) != 0;
} else {
return false;
}
} | java | public static boolean getF(GrayU8 image, int x, int y) {
if (image.isInBounds(x, y)) {
return image.get(x, y) != 0;
} else {
return false;
}
} | [
"public",
"static",
"boolean",
"getF",
"(",
"GrayU8",
"image",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"image",
".",
"isInBounds",
"(",
"x",
",",
"y",
")",
")",
"{",
"return",
"image",
".",
"get",
"(",
"x",
",",
"y",
")",
"!=",
... | If a point is inside the image true is returned if its value is not zero, otherwise false is returned. | [
"If",
"a",
"point",
"is",
"inside",
"the",
"image",
"true",
"is",
"returned",
"if",
"its",
"value",
"is",
"not",
"zero",
"otherwise",
"false",
"is",
"returned",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/ImplBinaryNaiveOps.java#L194-L200 |
dyu/protostuff-1.0.x | protostuff-yaml/src/main/java/com/dyuproject/protostuff/YamlIOUtil.java | YamlIOUtil.writeListTo | public static <T> int writeListTo(OutputStream out, List<T> messages,
Schema<T> schema, LinkedBuffer buffer) throws IOException {
"""
Serializes the {@code messages} into an {@link OutputStream}
using the given schema with the supplied buffer.
@return the total bytes written to the output.
""... | java | public static <T> int writeListTo(OutputStream out, List<T> messages,
Schema<T> schema, LinkedBuffer buffer) throws IOException
{
if(buffer.start != buffer.offset)
throw new IllegalArgumentException("Buffer previously used and had not been reset.");
final Yaml... | [
"public",
"static",
"<",
"T",
">",
"int",
"writeListTo",
"(",
"OutputStream",
"out",
",",
"List",
"<",
"T",
">",
"messages",
",",
"Schema",
"<",
"T",
">",
"schema",
",",
"LinkedBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"buffer",
... | Serializes the {@code messages} into an {@link OutputStream}
using the given schema with the supplied buffer.
@return the total bytes written to the output. | [
"Serializes",
"the",
"{",
"@code",
"messages",
"}",
"into",
"an",
"{",
"@link",
"OutputStream",
"}",
"using",
"the",
"given",
"schema",
"with",
"the",
"supplied",
"buffer",
"."
] | train | https://github.com/dyu/protostuff-1.0.x/blob/d7c964ec20da3fe44699d86ee95c2677ddffde96/protostuff-yaml/src/main/java/com/dyuproject/protostuff/YamlIOUtil.java#L181-L207 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/csskit/antlr4/CSSErrorStrategy.java | CSSErrorStrategy.consumeUntilGreedy | protected void consumeUntilGreedy(Parser recognizer, IntervalSet follow) {
"""
Consumes token until lexer state is balanced and
token from follow is matched. Matched token is also consumed
"""
logger.trace("CONSUME UNTIL GREEDY {}", follow.toString());
for (int ttype = recognizer.getInputStrea... | java | protected void consumeUntilGreedy(Parser recognizer, IntervalSet follow) {
logger.trace("CONSUME UNTIL GREEDY {}", follow.toString());
for (int ttype = recognizer.getInputStream().LA(1); ttype != -1 && !follow.contains(ttype); ttype = recognizer.getInputStream().LA(1)) {
Token t = recognizer... | [
"protected",
"void",
"consumeUntilGreedy",
"(",
"Parser",
"recognizer",
",",
"IntervalSet",
"follow",
")",
"{",
"logger",
".",
"trace",
"(",
"\"CONSUME UNTIL GREEDY {}\"",
",",
"follow",
".",
"toString",
"(",
")",
")",
";",
"for",
"(",
"int",
"ttype",
"=",
"... | Consumes token until lexer state is balanced and
token from follow is matched. Matched token is also consumed | [
"Consumes",
"token",
"until",
"lexer",
"state",
"is",
"balanced",
"and",
"token",
"from",
"follow",
"is",
"matched",
".",
"Matched",
"token",
"is",
"also",
"consumed"
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/csskit/antlr4/CSSErrorStrategy.java#L57-L66 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.setSettings | public JSONObject setSettings(JSONObject settings, RequestOptions requestOptions) throws AlgoliaException {
"""
Set settings for this index
@param settings the settings for an index
@param requestOptions Options to pass to this request
"""
return setSettings(settings, false, requestOptions);
} | java | public JSONObject setSettings(JSONObject settings, RequestOptions requestOptions) throws AlgoliaException {
return setSettings(settings, false, requestOptions);
} | [
"public",
"JSONObject",
"setSettings",
"(",
"JSONObject",
"settings",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"return",
"setSettings",
"(",
"settings",
",",
"false",
",",
"requestOptions",
")",
";",
"}"
] | Set settings for this index
@param settings the settings for an index
@param requestOptions Options to pass to this request | [
"Set",
"settings",
"for",
"this",
"index"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L940-L942 |
kiegroup/drools | drools-core/src/main/java/org/drools/core/util/DroolsStreamUtils.java | DroolsStreamUtils.streamIn | public static Object streamIn(byte[] bytes, boolean compressed) throws IOException, ClassNotFoundException {
"""
This method reads the contents from the given byte array and returns the object. The contents in the given
buffer could be compressed or uncompressed depending on the given flag. It is assumed that t... | java | public static Object streamIn(byte[] bytes, boolean compressed) throws IOException, ClassNotFoundException {
return streamIn(new ByteArrayInputStream(bytes), null, compressed);
} | [
"public",
"static",
"Object",
"streamIn",
"(",
"byte",
"[",
"]",
"bytes",
",",
"boolean",
"compressed",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"return",
"streamIn",
"(",
"new",
"ByteArrayInputStream",
"(",
"bytes",
")",
",",
"null",
... | This method reads the contents from the given byte array and returns the object. The contents in the given
buffer could be compressed or uncompressed depending on the given flag. It is assumed that the content
stream was written by the corresponding streamOut methods of this class.
@param bytes
@param compressed
@ret... | [
"This",
"method",
"reads",
"the",
"contents",
"from",
"the",
"given",
"byte",
"array",
"and",
"returns",
"the",
"object",
".",
"The",
"contents",
"in",
"the",
"given",
"buffer",
"could",
"be",
"compressed",
"or",
"uncompressed",
"depending",
"on",
"the",
"gi... | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/util/DroolsStreamUtils.java#L144-L146 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java | SynchronousRequest.getContinentFloorInfo | public List<ContinentFloor> getContinentFloorInfo(int continentID, int[] ids) throws GuildWars2Exception {
"""
For more info on continents API go <a href="https://wiki.guildwars2.com/wiki/API:2/continents">here</a><br/>
Get continent info for the given continent floor id(s)
@param continentID {@link Continent#... | java | public List<ContinentFloor> getContinentFloorInfo(int continentID, int[] ids) throws GuildWars2Exception {
isParamValid(new ParamChecker(ids));
try {
Response<List<ContinentFloor>> response = gw2API.getContinentFloorInfo(Integer.toString(continentID), processIds(ids), GuildWars2.lang.getValue()).execute();
if... | [
"public",
"List",
"<",
"ContinentFloor",
">",
"getContinentFloorInfo",
"(",
"int",
"continentID",
",",
"int",
"[",
"]",
"ids",
")",
"throws",
"GuildWars2Exception",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ids",
")",
")",
";",
"try",
"{",
"Resp... | For more info on continents API go <a href="https://wiki.guildwars2.com/wiki/API:2/continents">here</a><br/>
Get continent info for the given continent floor id(s)
@param continentID {@link Continent#id}
@param ids list of continent floor id
@return list of continent floor info
@throws GuildWars2Exception see {@link E... | [
"For",
"more",
"info",
"on",
"continents",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"continents",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Get",
"cont... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L1412-L1421 |
alkacon/opencms-core | src/org/opencms/ade/sitemap/CmsVfsSitemapService.java | CmsVfsSitemapService.createNewResourceInfo | private CmsNewResourceInfo createNewResourceInfo(CmsObject cms, CmsResource modelResource, Locale locale)
throws CmsException {
"""
Creates a new resource info to a given model page resource.<p>
@param cms the current CMS context
@param modelResource the model page resource
@param locale the locale used f... | java | private CmsNewResourceInfo createNewResourceInfo(CmsObject cms, CmsResource modelResource, Locale locale)
throws CmsException {
// if model page got overwritten by another resource, reread from site path
if (!cms.existsResource(modelResource.getStructureId(), CmsResourceFilter.ONLY_VISIBLE_NO_DELET... | [
"private",
"CmsNewResourceInfo",
"createNewResourceInfo",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"modelResource",
",",
"Locale",
"locale",
")",
"throws",
"CmsException",
"{",
"// if model page got overwritten by another resource, reread from site path",
"if",
"(",
"!",
... | Creates a new resource info to a given model page resource.<p>
@param cms the current CMS context
@param modelResource the model page resource
@param locale the locale used for retrieving descriptions/titles
@return the new resource info
@throws CmsException if something goes wrong | [
"Creates",
"a",
"new",
"resource",
"info",
"to",
"a",
"given",
"model",
"page",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/CmsVfsSitemapService.java#L1914-L1976 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java | AttributesImpl.getType | public String getType (String uri, String localName) {
"""
Look up an attribute's type by Namespace-qualified name.
@param uri The Namespace URI, or the empty string for a name
with no explicit Namespace URI.
@param localName The local name.
@return The attribute's type, or null if there is no
matching attr... | java | public String getType (String uri, String localName)
{
int max = length * 5;
for (int i = 0; i < max; i += 5) {
if (data[i].equals(uri) && data[i+1].equals(localName)) {
return data[i+3];
}
}
return null;
} | [
"public",
"String",
"getType",
"(",
"String",
"uri",
",",
"String",
"localName",
")",
"{",
"int",
"max",
"=",
"length",
"*",
"5",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"max",
";",
"i",
"+=",
"5",
")",
"{",
"if",
"(",
"data",
"... | Look up an attribute's type by Namespace-qualified name.
@param uri The Namespace URI, or the empty string for a name
with no explicit Namespace URI.
@param localName The local name.
@return The attribute's type, or null if there is no
matching attribute.
@see org.xml.sax.Attributes#getType(java.lang.String,java.lang.... | [
"Look",
"up",
"an",
"attribute",
"s",
"type",
"by",
"Namespace",
"-",
"qualified",
"name",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java#L240-L249 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.friends_areFriends | public T friends_areFriends(int userId1, int userId2)
throws FacebookException, IOException {
"""
Retrieves whether two users are friends.
@param userId1
@param userId2
@return T
@see <a href="http://wiki.developers.facebook.com/index.php/Friends.areFriends">
Developers Wiki: Friends.areFriends</a>
""... | java | public T friends_areFriends(int userId1, int userId2)
throws FacebookException, IOException {
return this.callMethod(FacebookMethod.FRIENDS_ARE_FRIENDS,
new Pair<String, CharSequence>("uids1", Integer.toString(userId1)),
new Pair<String, CharSequence>("uids2... | [
"public",
"T",
"friends_areFriends",
"(",
"int",
"userId1",
",",
"int",
"userId2",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"return",
"this",
".",
"callMethod",
"(",
"FacebookMethod",
".",
"FRIENDS_ARE_FRIENDS",
",",
"new",
"Pair",
"<",
"Stri... | Retrieves whether two users are friends.
@param userId1
@param userId2
@return T
@see <a href="http://wiki.developers.facebook.com/index.php/Friends.areFriends">
Developers Wiki: Friends.areFriends</a> | [
"Retrieves",
"whether",
"two",
"users",
"are",
"friends",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L166-L171 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/api/Table.java | Table.replaceColumn | public Table replaceColumn(final int colIndex, final Column<?> newColumn) {
"""
Replaces an existing column (by index) in this table with the given new column
@param colIndex Zero-based index of the column to be replaced
@param newColumn Column to be added
"""
removeColumns(column(colIndex));
... | java | public Table replaceColumn(final int colIndex, final Column<?> newColumn) {
removeColumns(column(colIndex));
return insertColumn(colIndex, newColumn);
} | [
"public",
"Table",
"replaceColumn",
"(",
"final",
"int",
"colIndex",
",",
"final",
"Column",
"<",
"?",
">",
"newColumn",
")",
"{",
"removeColumns",
"(",
"column",
"(",
"colIndex",
")",
")",
";",
"return",
"insertColumn",
"(",
"colIndex",
",",
"newColumn",
... | Replaces an existing column (by index) in this table with the given new column
@param colIndex Zero-based index of the column to be replaced
@param newColumn Column to be added | [
"Replaces",
"an",
"existing",
"column",
"(",
"by",
"index",
")",
"in",
"this",
"table",
"with",
"the",
"given",
"new",
"column"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/api/Table.java#L257-L260 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java | ApplicationSession.getUserAttribute | public Object getUserAttribute(String key, Object defaultValue) {
"""
Get a value from the user attributes map.
@param key
name of the attribute
@param defaultValue
a default value to return if no value is found.
@return the attribute value
"""
Object attributeValue = this.userAttributes.get(key... | java | public Object getUserAttribute(String key, Object defaultValue)
{
Object attributeValue = this.userAttributes.get(key);
if (attributeValue == null)
attributeValue = defaultValue;
return attributeValue;
} | [
"public",
"Object",
"getUserAttribute",
"(",
"String",
"key",
",",
"Object",
"defaultValue",
")",
"{",
"Object",
"attributeValue",
"=",
"this",
".",
"userAttributes",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"attributeValue",
"==",
"null",
")",
"attribut... | Get a value from the user attributes map.
@param key
name of the attribute
@param defaultValue
a default value to return if no value is found.
@return the attribute value | [
"Get",
"a",
"value",
"from",
"the",
"user",
"attributes",
"map",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java#L201-L207 |
jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/Precision.java | Precision.equalsIncludingNaN | public static boolean equalsIncludingNaN(double x, double y, double eps) {
"""
Returns true if both arguments are NaN or are equal or within the range
of allowed error (inclusive).
@param x first value
@param y second value
@param eps the amount of absolute error to allow.
@return {@code true} if the values... | java | public static boolean equalsIncludingNaN(double x, double y, double eps) {
return equalsIncludingNaN(x, y) || (FastMath.abs(y - x) <= eps);
} | [
"public",
"static",
"boolean",
"equalsIncludingNaN",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"eps",
")",
"{",
"return",
"equalsIncludingNaN",
"(",
"x",
",",
"y",
")",
"||",
"(",
"FastMath",
".",
"abs",
"(",
"y",
"-",
"x",
")",
"<=",
"e... | Returns true if both arguments are NaN or are equal or within the range
of allowed error (inclusive).
@param x first value
@param y second value
@param eps the amount of absolute error to allow.
@return {@code true} if the values are equal or within range of each other,
or both are NaN.
@since 2.2 | [
"Returns",
"true",
"if",
"both",
"arguments",
"are",
"NaN",
"or",
"are",
"equal",
"or",
"within",
"the",
"range",
"of",
"allowed",
"error",
"(",
"inclusive",
")",
"."
] | train | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/Precision.java#L325-L327 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/Document.java | Document.setEntities | public void setEntities(int i, Entity v) {
"""
indexed setter for entities - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_entities == null)
jcasType.jcas.throwFeatMis... | java | public void setEntities(int i, Entity v) {
if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_entities == null)
jcasType.jcas.throwFeatMissing("entities", "de.julielab.jules.types.ace.Document");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).c... | [
"public",
"void",
"setEntities",
"(",
"int",
"i",
",",
"Entity",
"v",
")",
"{",
"if",
"(",
"Document_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Document_Type",
")",
"jcasType",
")",
".",
"casFeat_entities",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",... | indexed setter for entities - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"entities",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/Document.java#L138-L142 |
netty/netty | common/src/main/java/io/netty/util/internal/StringUtil.java | StringUtil.indexOfNonWhiteSpace | public static int indexOfNonWhiteSpace(CharSequence seq, int offset) {
"""
Find the index of the first non-white space character in {@code s} starting at {@code offset}.
@param seq The string to search.
@param offset The offset to start searching at.
@return the index of the first non-white space character... | java | public static int indexOfNonWhiteSpace(CharSequence seq, int offset) {
for (; offset < seq.length(); ++offset) {
if (!Character.isWhitespace(seq.charAt(offset))) {
return offset;
}
}
return -1;
} | [
"public",
"static",
"int",
"indexOfNonWhiteSpace",
"(",
"CharSequence",
"seq",
",",
"int",
"offset",
")",
"{",
"for",
"(",
";",
"offset",
"<",
"seq",
".",
"length",
"(",
")",
";",
"++",
"offset",
")",
"{",
"if",
"(",
"!",
"Character",
".",
"isWhitespac... | Find the index of the first non-white space character in {@code s} starting at {@code offset}.
@param seq The string to search.
@param offset The offset to start searching at.
@return the index of the first non-white space character or <{@code 0} if none was found. | [
"Find",
"the",
"index",
"of",
"the",
"first",
"non",
"-",
"white",
"space",
"character",
"in",
"{",
"@code",
"s",
"}",
"starting",
"at",
"{",
"@code",
"offset",
"}",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/StringUtil.java#L546-L553 |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsFrameset.java | CmsFrameset.getPreferencesButton | public String getPreferencesButton() {
"""
Returns the html for the "preferences" button depending on the current users permissions and
the default workplace settings.<p>
@return the html for the "preferences" button
"""
int buttonStyle = getSettings().getUserSettings().getWorkplaceButtonStyle();
... | java | public String getPreferencesButton() {
int buttonStyle = getSettings().getUserSettings().getWorkplaceButtonStyle();
if (!getCms().getRequestContext().getCurrentUser().isManaged()) {
return button(
"../commons/preferences.jsp",
"body",
"prefere... | [
"public",
"String",
"getPreferencesButton",
"(",
")",
"{",
"int",
"buttonStyle",
"=",
"getSettings",
"(",
")",
".",
"getUserSettings",
"(",
")",
".",
"getWorkplaceButtonStyle",
"(",
")",
";",
"if",
"(",
"!",
"getCms",
"(",
")",
".",
"getRequestContext",
"(",... | Returns the html for the "preferences" button depending on the current users permissions and
the default workplace settings.<p>
@return the html for the "preferences" button | [
"Returns",
"the",
"html",
"for",
"the",
"preferences",
"button",
"depending",
"on",
"the",
"current",
"users",
"permissions",
"and",
"the",
"default",
"workplace",
"settings",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsFrameset.java#L177-L190 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/user/UserClient.java | UserClient.getAdminListByAppkey | public UserListResult getAdminListByAppkey(int start, int count)
throws APIConnectionException, APIRequestException {
"""
Get admins by appkey
@param start The start index of the list
@param count The number that how many you want to get from list
@return admin user info list
@throws APIConnectio... | java | public UserListResult getAdminListByAppkey(int start, int count)
throws APIConnectionException, APIRequestException {
if (start < 0 || count <= 0 || count > 500) {
throw new IllegalArgumentException("negative index or count must more than 0 and less than 501");
}
Response... | [
"public",
"UserListResult",
"getAdminListByAppkey",
"(",
"int",
"start",
",",
"int",
"count",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"if",
"(",
"start",
"<",
"0",
"||",
"count",
"<=",
"0",
"||",
"count",
">",
"500",
")",
"{... | Get admins by appkey
@param start The start index of the list
@param count The number that how many you want to get from list
@return admin user info list
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Get",
"admins",
"by",
"appkey"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/user/UserClient.java#L230-L238 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java | SslContextBuilder.trustManager | public SslContextBuilder trustManager(InputStream trustCertCollectionInputStream) {
"""
Trusted certificates for verifying the remote endpoint's certificate. The input stream should
contain an X.509 certificate collection in PEM format. {@code null} uses the system default.
"""
try {
retur... | java | public SslContextBuilder trustManager(InputStream trustCertCollectionInputStream) {
try {
return trustManager(SslContext.toX509Certificates(trustCertCollectionInputStream));
} catch (Exception e) {
throw new IllegalArgumentException("Input stream does not contain valid certificat... | [
"public",
"SslContextBuilder",
"trustManager",
"(",
"InputStream",
"trustCertCollectionInputStream",
")",
"{",
"try",
"{",
"return",
"trustManager",
"(",
"SslContext",
".",
"toX509Certificates",
"(",
"trustCertCollectionInputStream",
")",
")",
";",
"}",
"catch",
"(",
... | Trusted certificates for verifying the remote endpoint's certificate. The input stream should
contain an X.509 certificate collection in PEM format. {@code null} uses the system default. | [
"Trusted",
"certificates",
"for",
"verifying",
"the",
"remote",
"endpoint",
"s",
"certificate",
".",
"The",
"input",
"stream",
"should",
"contain",
"an",
"X",
".",
"509",
"certificate",
"collection",
"in",
"PEM",
"format",
".",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java#L191-L197 |
rapidoid/rapidoid | rapidoid-rest/src/main/java/org/rapidoid/setup/App.java | App.run | public static synchronized void run(String[] args, String... extraArgs) {
"""
Initializes the app in non-atomic way.
Then starts serving requests immediately when routes are configured.
"""
AppStarter.startUp(args, extraArgs);
// no implicit classpath scanning here
boot();
// finish initialization a... | java | public static synchronized void run(String[] args, String... extraArgs) {
AppStarter.startUp(args, extraArgs);
// no implicit classpath scanning here
boot();
// finish initialization and start the application
onAppReady();
boot();
} | [
"public",
"static",
"synchronized",
"void",
"run",
"(",
"String",
"[",
"]",
"args",
",",
"String",
"...",
"extraArgs",
")",
"{",
"AppStarter",
".",
"startUp",
"(",
"args",
",",
"extraArgs",
")",
";",
"// no implicit classpath scanning here",
"boot",
"(",
")",
... | Initializes the app in non-atomic way.
Then starts serving requests immediately when routes are configured. | [
"Initializes",
"the",
"app",
"in",
"non",
"-",
"atomic",
"way",
".",
"Then",
"starts",
"serving",
"requests",
"immediately",
"when",
"routes",
"are",
"configured",
"."
] | train | https://github.com/rapidoid/rapidoid/blob/1775344bcf4abbee289d474b34d553ff6bc821b0/rapidoid-rest/src/main/java/org/rapidoid/setup/App.java#L90-L100 |
kiswanij/jk-util | src/main/java/com/jk/util/JKDateTimeUtil.java | JKDateTimeUtil.parseDate | public static java.util.Date parseDate(String strDate, String pattern) {
"""
Parses the date.
@param strDate the str date
@param pattern the pattern
@return the java.util. date
"""
try {
SimpleDateFormat parser = new SimpleDateFormat(pattern, Locale.US);
return parser.parse(strDate);
} catch... | java | public static java.util.Date parseDate(String strDate, String pattern) {
try {
SimpleDateFormat parser = new SimpleDateFormat(pattern, Locale.US);
return parser.parse(strDate);
} catch (ParseException e) {
throw new JKException(e);
}
} | [
"public",
"static",
"java",
".",
"util",
".",
"Date",
"parseDate",
"(",
"String",
"strDate",
",",
"String",
"pattern",
")",
"{",
"try",
"{",
"SimpleDateFormat",
"parser",
"=",
"new",
"SimpleDateFormat",
"(",
"pattern",
",",
"Locale",
".",
"US",
")",
";",
... | Parses the date.
@param strDate the str date
@param pattern the pattern
@return the java.util. date | [
"Parses",
"the",
"date",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKDateTimeUtil.java#L61-L68 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.setTableType | public boolean setTableType(Session session, int newType) {
"""
Changes the type of a table
@param session Session
@param newType int
@return boolean
"""
int currentType = table.getTableType();
if (currentType == newType) {
return false;
}
switch (newType) {
... | java | public boolean setTableType(Session session, int newType) {
int currentType = table.getTableType();
if (currentType == newType) {
return false;
}
switch (newType) {
case TableBase.CACHED_TABLE :
break;
case TableBase.MEMORY_TABLE :... | [
"public",
"boolean",
"setTableType",
"(",
"Session",
"session",
",",
"int",
"newType",
")",
"{",
"int",
"currentType",
"=",
"table",
".",
"getTableType",
"(",
")",
";",
"if",
"(",
"currentType",
"==",
"newType",
")",
"{",
"return",
"false",
";",
"}",
"sw... | Changes the type of a table
@param session Session
@param newType int
@return boolean | [
"Changes",
"the",
"type",
"of",
"a",
"table"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L1082-L1122 |
pdef/pdef-java | pdef/src/main/java/io/pdef/rpc/HttpUrlConnectionRpcSession.java | HttpUrlConnectionRpcSession.readString | protected String readString(final HttpURLConnection connection, final InputStream input)
throws IOException {
"""
Reads a string from an input stream, gets the charset from the content-type header.
"""
Charset charset = guessContentTypeCharset(connection);
StringBuilder sb = new StringBuilder();
Buff... | java | protected String readString(final HttpURLConnection connection, final InputStream input)
throws IOException {
Charset charset = guessContentTypeCharset(connection);
StringBuilder sb = new StringBuilder();
BufferedReader reader = new BufferedReader(new InputStreamReader(input, charset));
try {
boolean fir... | [
"protected",
"String",
"readString",
"(",
"final",
"HttpURLConnection",
"connection",
",",
"final",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"Charset",
"charset",
"=",
"guessContentTypeCharset",
"(",
"connection",
")",
";",
"StringBuilder",
"sb",
"... | Reads a string from an input stream, gets the charset from the content-type header. | [
"Reads",
"a",
"string",
"from",
"an",
"input",
"stream",
"gets",
"the",
"charset",
"from",
"the",
"content",
"-",
"type",
"header",
"."
] | train | https://github.com/pdef/pdef-java/blob/7776c44d1aab0f3dbf7267b0c32b8f9282fe6167/pdef/src/main/java/io/pdef/rpc/HttpUrlConnectionRpcSession.java#L205-L225 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.