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 |
|---|---|---|---|---|---|---|---|---|---|---|
deeplearning4j/deeplearning4j | arbiter/arbiter-deeplearning4j/src/main/java/org/deeplearning4j/arbiter/scoring/util/ScoreUtil.java | ScoreUtil.getEvaluation | public static Evaluation getEvaluation(ComputationGraph model, MultiDataSetIterator testData) {
"""
Get the evaluation
for the given model and test dataset
@param model the model to get the evaluation from
@param testData the test data to do the evaluation on
@return the evaluation object with accumulated stat... | java | public static Evaluation getEvaluation(ComputationGraph model, MultiDataSetIterator testData) {
if (model.getNumOutputArrays() != 1)
throw new IllegalStateException("GraphSetSetAccuracyScoreFunction cannot be "
+ "applied to ComputationGraphs with more than one output. Nu... | [
"public",
"static",
"Evaluation",
"getEvaluation",
"(",
"ComputationGraph",
"model",
",",
"MultiDataSetIterator",
"testData",
")",
"{",
"if",
"(",
"model",
".",
"getNumOutputArrays",
"(",
")",
"!=",
"1",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"GraphS... | Get the evaluation
for the given model and test dataset
@param model the model to get the evaluation from
@param testData the test data to do the evaluation on
@return the evaluation object with accumulated statistics
for the current test data | [
"Get",
"the",
"evaluation",
"for",
"the",
"given",
"model",
"and",
"test",
"dataset"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/arbiter/arbiter-deeplearning4j/src/main/java/org/deeplearning4j/arbiter/scoring/util/ScoreUtil.java#L105-L112 |
pravega/pravega | segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/SegmentChunk.java | SegmentChunk.withNewOffset | SegmentChunk withNewOffset(long newOffset) {
"""
Creates a new instance of the SegmentChunk class with the same information as this one, but with a new offset.
@param newOffset The new offset.
@return A new SegmentChunk.
"""
SegmentChunk ns = new SegmentChunk(this.name, newOffset);
ns.setLe... | java | SegmentChunk withNewOffset(long newOffset) {
SegmentChunk ns = new SegmentChunk(this.name, newOffset);
ns.setLength(getLength());
if (isSealed()) {
ns.markSealed();
}
if (!exists()) {
ns.markInexistent();
}
return ns;
} | [
"SegmentChunk",
"withNewOffset",
"(",
"long",
"newOffset",
")",
"{",
"SegmentChunk",
"ns",
"=",
"new",
"SegmentChunk",
"(",
"this",
".",
"name",
",",
"newOffset",
")",
";",
"ns",
".",
"setLength",
"(",
"getLength",
"(",
")",
")",
";",
"if",
"(",
"isSeale... | Creates a new instance of the SegmentChunk class with the same information as this one, but with a new offset.
@param newOffset The new offset.
@return A new SegmentChunk. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"SegmentChunk",
"class",
"with",
"the",
"same",
"information",
"as",
"this",
"one",
"but",
"with",
"a",
"new",
"offset",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/SegmentChunk.java#L76-L88 |
mediathekview/MLib | src/main/java/de/mediathekview/mlib/tool/FilenameUtils.java | FilenameUtils.convertToASCIIEncoding | private static String convertToASCIIEncoding(String fileName, boolean isPath) {
"""
Convert a filename from Java´s native UTF-16 to US-ASCII character encoding.
@param fileName The UTF-16 filename string.
@return US-ASCII encoded string for the OS.
"""
String ret = fileName;
ret = ret.repl... | java | private static String convertToASCIIEncoding(String fileName, boolean isPath) {
String ret = fileName;
ret = ret.replace("ä", "ae");
ret = ret.replace("ö", "oe");
ret = ret.replace("ü", "ue");
ret = ret.replace("Ä", "Ae");
ret = ret.replace("Ö", "Oe");
ret = ret.... | [
"private",
"static",
"String",
"convertToASCIIEncoding",
"(",
"String",
"fileName",
",",
"boolean",
"isPath",
")",
"{",
"String",
"ret",
"=",
"fileName",
";",
"ret",
"=",
"ret",
".",
"replace",
"(",
"\"ä\",",
" ",
"ae\")",
";",
"",
"ret",
"=",
"ret",
"."... | Convert a filename from Java´s native UTF-16 to US-ASCII character encoding.
@param fileName The UTF-16 filename string.
@return US-ASCII encoded string for the OS. | [
"Convert",
"a",
"filename",
"from",
"Java´s",
"native",
"UTF",
"-",
"16",
"to",
"US",
"-",
"ASCII",
"character",
"encoding",
"."
] | train | https://github.com/mediathekview/MLib/blob/01fd5791d87390fea7536275b8a2d4407fc00908/src/main/java/de/mediathekview/mlib/tool/FilenameUtils.java#L156-L191 |
albfernandez/itext2 | src/main/java/com/lowagie/text/xml/xmp/XmpSchema.java | XmpSchema.setProperty | public Object setProperty(String key, LangAlt value) {
"""
@see java.util.Properties#setProperty(java.lang.String, java.lang.String)
@param key
@param value
@return the previous property (null if there wasn't one)
"""
return super.setProperty(key, value.toString());
} | java | public Object setProperty(String key, LangAlt value) {
return super.setProperty(key, value.toString());
} | [
"public",
"Object",
"setProperty",
"(",
"String",
"key",
",",
"LangAlt",
"value",
")",
"{",
"return",
"super",
".",
"setProperty",
"(",
"key",
",",
"value",
".",
"toString",
"(",
")",
")",
";",
"}"
] | @see java.util.Properties#setProperty(java.lang.String, java.lang.String)
@param key
@param value
@return the previous property (null if there wasn't one) | [
"@see",
"java",
".",
"util",
".",
"Properties#setProperty",
"(",
"java",
".",
"lang",
".",
"String",
"java",
".",
"lang",
".",
"String",
")"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/xml/xmp/XmpSchema.java#L138-L140 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/event/EventSubscriptions.java | EventSubscriptions.removeSubscriber | public synchronized int removeSubscriber(String eventName, IGenericEvent<T> subscriber) {
"""
Removes a subscriber from the specified event.
@param eventName Name of the event.
@param subscriber Subscriber to remove.
@return Count of subscribers after the operation, or -1 no subscriber list existed.
"""
... | java | public synchronized int removeSubscriber(String eventName, IGenericEvent<T> subscriber) {
List<IGenericEvent<T>> subscribers = getSubscribers(eventName, false);
if (subscribers != null) {
subscribers.remove(subscriber);
if (subscribers.isEmpty()) {
... | [
"public",
"synchronized",
"int",
"removeSubscriber",
"(",
"String",
"eventName",
",",
"IGenericEvent",
"<",
"T",
">",
"subscriber",
")",
"{",
"List",
"<",
"IGenericEvent",
"<",
"T",
">>",
"subscribers",
"=",
"getSubscribers",
"(",
"eventName",
",",
"false",
")... | Removes a subscriber from the specified event.
@param eventName Name of the event.
@param subscriber Subscriber to remove.
@return Count of subscribers after the operation, or -1 no subscriber list existed. | [
"Removes",
"a",
"subscriber",
"from",
"the",
"specified",
"event",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/event/EventSubscriptions.java#L69-L83 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/ResourceLoader.java | ResourceLoader.getResourceAsSAXInputSource | public static InputSource getResourceAsSAXInputSource(Class<?> requestingClass, String resource)
throws ResourceMissingException, IOException {
"""
Returns the requested resource as a SAX input source.
@param requestingClass the java.lang.Class object of the class that is attempting to load the
res... | java | public static InputSource getResourceAsSAXInputSource(Class<?> requestingClass, String resource)
throws ResourceMissingException, IOException {
URL url = getResourceAsURL(requestingClass, resource);
InputSource source = new InputSource(url.openStream());
source.setPublicId(url.toExte... | [
"public",
"static",
"InputSource",
"getResourceAsSAXInputSource",
"(",
"Class",
"<",
"?",
">",
"requestingClass",
",",
"String",
"resource",
")",
"throws",
"ResourceMissingException",
",",
"IOException",
"{",
"URL",
"url",
"=",
"getResourceAsURL",
"(",
"requestingClas... | Returns the requested resource as a SAX input source.
@param requestingClass the java.lang.Class object of the class that is attempting to load the
resource
@param resource a String describing the full or partial URL of the resource to load
@return the requested resource as a SAX input source
@throws ResourceMissingEx... | [
"Returns",
"the",
"requested",
"resource",
"as",
"a",
"SAX",
"input",
"source",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/ResourceLoader.java#L227-L233 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java | VelocityUtil.getContent | public static String getContent(String templateDir, String templateFileName, VelocityContext context, String charset) {
"""
获得指定模板填充后的内容
@param templateDir 模板所在目录,绝对路径
@param templateFileName 模板名称
@param context 上下文(变量值的容器)
@param charset 字符集
@return 模板和内容匹配后的内容
"""
// 初始化模板引擎
final VelocityEngine... | java | public static String getContent(String templateDir, String templateFileName, VelocityContext context, String charset) {
// 初始化模板引擎
final VelocityEngine ve = newEngine(templateDir, charset);
return getContent(ve, templateFileName, context);
} | [
"public",
"static",
"String",
"getContent",
"(",
"String",
"templateDir",
",",
"String",
"templateFileName",
",",
"VelocityContext",
"context",
",",
"String",
"charset",
")",
"{",
"// 初始化模板引擎\r",
"final",
"VelocityEngine",
"ve",
"=",
"newEngine",
"(",
"templateDir",... | 获得指定模板填充后的内容
@param templateDir 模板所在目录,绝对路径
@param templateFileName 模板名称
@param context 上下文(变量值的容器)
@param charset 字符集
@return 模板和内容匹配后的内容 | [
"获得指定模板填充后的内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java#L99-L104 |
pravega/pravega | common/src/main/java/io/pravega/common/util/DelimitedStringParser.java | DelimitedStringParser.extractLong | public DelimitedStringParser extractLong(String key, Consumer<Long> consumer) {
"""
Associates the given consumer with the given key. This consumer will be invoked every time a Key-Value pair with
the given key is encountered (argument is the Value of the pair). Note that this may be invoked multiple times or
no... | java | public DelimitedStringParser extractLong(String key, Consumer<Long> consumer) {
this.extractors.put(key, new Extractor<>(consumer, Long::parseLong));
return this;
} | [
"public",
"DelimitedStringParser",
"extractLong",
"(",
"String",
"key",
",",
"Consumer",
"<",
"Long",
">",
"consumer",
")",
"{",
"this",
".",
"extractors",
".",
"put",
"(",
"key",
",",
"new",
"Extractor",
"<>",
"(",
"consumer",
",",
"Long",
"::",
"parseLon... | Associates the given consumer with the given key. This consumer will be invoked every time a Key-Value pair with
the given key is encountered (argument is the Value of the pair). Note that this may be invoked multiple times or
not at all, based on the given input.
@param key The key for which to invoke the consum... | [
"Associates",
"the",
"given",
"consumer",
"with",
"the",
"given",
"key",
".",
"This",
"consumer",
"will",
"be",
"invoked",
"every",
"time",
"a",
"Key",
"-",
"Value",
"pair",
"with",
"the",
"given",
"key",
"is",
"encountered",
"(",
"argument",
"is",
"the",
... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/DelimitedStringParser.java#L101-L104 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.getAdvertisedRoutesAsync | public Observable<GatewayRouteListResultInner> getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) {
"""
This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.
@param resourceGroupName The name of the resource gro... | java | public Observable<GatewayRouteListResultInner> getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) {
return getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1<ServiceResponse<GatewayRouteListResultInner>, Ga... | [
"public",
"Observable",
"<",
"GatewayRouteListResultInner",
">",
"getAdvertisedRoutesAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"String",
"peer",
")",
"{",
"return",
"getAdvertisedRoutesWithServiceResponseAsync",
"(",
"resourc... | This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param peer The IP address of the peer
@throws IllegalArgumentException thrown i... | [
"This",
"operation",
"retrieves",
"a",
"list",
"of",
"routes",
"the",
"virtual",
"network",
"gateway",
"is",
"advertising",
"to",
"the",
"specified",
"peer",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L2520-L2527 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.getParent | public static File getParent(File file, int level) {
"""
获取指定层级的父路径
<pre>
getParent(file("d:/aaa/bbb/cc/ddd", 0)) -> "d:/aaa/bbb/cc/ddd"
getParent(file("d:/aaa/bbb/cc/ddd", 2)) -> "d:/aaa/bbb"
getParent(file("d:/aaa/bbb/cc/ddd", 4)) -> "d:/"
getParent(file("d:/aaa/bbb/cc/ddd", 5)) -> null
</pre>
@param ... | java | public static File getParent(File file, int level) {
if (level < 1 || null == file) {
return file;
}
File parentFile;
try {
parentFile = file.getCanonicalFile().getParentFile();
} catch (IOException e) {
throw new IORuntimeException(e);
}
if (1 == level) {
return parentFile;
}
... | [
"public",
"static",
"File",
"getParent",
"(",
"File",
"file",
",",
"int",
"level",
")",
"{",
"if",
"(",
"level",
"<",
"1",
"||",
"null",
"==",
"file",
")",
"{",
"return",
"file",
";",
"}",
"File",
"parentFile",
";",
"try",
"{",
"parentFile",
"=",
"... | 获取指定层级的父路径
<pre>
getParent(file("d:/aaa/bbb/cc/ddd", 0)) -> "d:/aaa/bbb/cc/ddd"
getParent(file("d:/aaa/bbb/cc/ddd", 2)) -> "d:/aaa/bbb"
getParent(file("d:/aaa/bbb/cc/ddd", 4)) -> "d:/"
getParent(file("d:/aaa/bbb/cc/ddd", 5)) -> null
</pre>
@param file 目录或文件
@param level 层级
@return 路径File,如果不存在返回null
@since 4.1.2 | [
"获取指定层级的父路径"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L3357-L3372 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/massindex/impl/Executors.java | Executors.newFixedThreadPool | public static ThreadPoolExecutor newFixedThreadPool(int threads, String groupname, int queueSize) {
"""
Creates a new fixed size ThreadPoolExecutor
@param threads
the number of threads
@param groupname
a label to identify the threadpool; useful for profiling.
@param queueSize
the size of the queue to store... | java | public static ThreadPoolExecutor newFixedThreadPool(int threads, String groupname, int queueSize) {
return new ThreadPoolExecutor( threads, threads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(
queueSize ), new SearchThreadFactory( groupname ), new BlockPolicy() );
} | [
"public",
"static",
"ThreadPoolExecutor",
"newFixedThreadPool",
"(",
"int",
"threads",
",",
"String",
"groupname",
",",
"int",
"queueSize",
")",
"{",
"return",
"new",
"ThreadPoolExecutor",
"(",
"threads",
",",
"threads",
",",
"0L",
",",
"TimeUnit",
".",
"MILLISE... | Creates a new fixed size ThreadPoolExecutor
@param threads
the number of threads
@param groupname
a label to identify the threadpool; useful for profiling.
@param queueSize
the size of the queue to store Runnables when all threads are busy
@return the new ExecutorService | [
"Creates",
"a",
"new",
"fixed",
"size",
"ThreadPoolExecutor"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/massindex/impl/Executors.java#L61-L64 |
aoindustries/aocode-public | src/main/java/com/aoindustries/util/StringUtility.java | StringUtility.countOccurrences | public static int countOccurrences(byte[] buff, int len, String word) {
"""
Counts how many times a word appears in a line. Case insensitive matching.
"""
int wordlen=word.length();
int end=len-wordlen;
int count=0;
Loop:
for(int c=0;c<=end;c++) {
for(int d=0;d<wordlen;d++) {
char ch1=(char)b... | java | public static int countOccurrences(byte[] buff, int len, String word) {
int wordlen=word.length();
int end=len-wordlen;
int count=0;
Loop:
for(int c=0;c<=end;c++) {
for(int d=0;d<wordlen;d++) {
char ch1=(char)buff[c+d];
if(ch1<='Z' && ch1>='A') ch1+='a'-'A';
char ch2=word.charAt(d);
if(ch2<... | [
"public",
"static",
"int",
"countOccurrences",
"(",
"byte",
"[",
"]",
"buff",
",",
"int",
"len",
",",
"String",
"word",
")",
"{",
"int",
"wordlen",
"=",
"word",
".",
"length",
"(",
")",
";",
"int",
"end",
"=",
"len",
"-",
"wordlen",
";",
"int",
"co... | Counts how many times a word appears in a line. Case insensitive matching. | [
"Counts",
"how",
"many",
"times",
"a",
"word",
"appears",
"in",
"a",
"line",
".",
"Case",
"insensitive",
"matching",
"."
] | train | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L307-L324 |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java | MailService.findMessage | public MailMessage findMessage(final MailAccount mailAccount, final Predicate<MailMessage> condition) {
"""
<p>
Tries to find a message for the specified mail account applying the specified
{@code condition} until it times out using the default timeout (
{@link EmailConstants#MAIL_TIMEOUT_SECONDS} and {@link Em... | java | public MailMessage findMessage(final MailAccount mailAccount, final Predicate<MailMessage> condition) {
return findMessage(mailAccount, condition, defaultTimeoutSeconds);
} | [
"public",
"MailMessage",
"findMessage",
"(",
"final",
"MailAccount",
"mailAccount",
",",
"final",
"Predicate",
"<",
"MailMessage",
">",
"condition",
")",
"{",
"return",
"findMessage",
"(",
"mailAccount",
",",
"condition",
",",
"defaultTimeoutSeconds",
")",
";",
"}... | <p>
Tries to find a message for the specified mail account applying the specified
{@code condition} until it times out using the default timeout (
{@link EmailConstants#MAIL_TIMEOUT_SECONDS} and {@link EmailConstants#MAIL_SLEEP_MILLIS}).
</p>
<b>Note:</b><br />
This method uses the specified mail account independently ... | [
"<p",
">",
"Tries",
"to",
"find",
"a",
"message",
"for",
"the",
"specified",
"mail",
"account",
"applying",
"the",
"specified",
"{",
"@code",
"condition",
"}",
"until",
"it",
"times",
"out",
"using",
"the",
"default",
"timeout",
"(",
"{",
"@link",
"EmailCo... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java#L100-L102 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_database_name_dump_GET | public ArrayList<Long> serviceName_database_name_dump_GET(String serviceName, String name, Date creationDate, Date deletionDate, OvhDateEnum type) throws IOException {
"""
Dump available for your databases
REST: GET /hosting/web/{serviceName}/database/{name}/dump
@param type [required] Filter the value of type... | java | public ArrayList<Long> serviceName_database_name_dump_GET(String serviceName, String name, Date creationDate, Date deletionDate, OvhDateEnum type) throws IOException {
String qPath = "/hosting/web/{serviceName}/database/{name}/dump";
StringBuilder sb = path(qPath, serviceName, name);
query(sb, "creationDate", cre... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_database_name_dump_GET",
"(",
"String",
"serviceName",
",",
"String",
"name",
",",
"Date",
"creationDate",
",",
"Date",
"deletionDate",
",",
"OvhDateEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"... | Dump available for your databases
REST: GET /hosting/web/{serviceName}/database/{name}/dump
@param type [required] Filter the value of type property (=)
@param deletionDate [required] Filter the value of deletionDate property (like)
@param creationDate [required] Filter the value of creationDate property (like)
@param... | [
"Dump",
"available",
"for",
"your",
"databases"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1179-L1187 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/ValueMap.java | ValueMap.getBoolean | public boolean getBoolean(String key, boolean defaultValue) {
"""
Returns the value mapped by {@code key} if it exists and is a boolean or can be coerced to a
boolean. Returns {@code defaultValue} otherwise.
"""
Object value = get(key);
if (value instanceof Boolean) {
return (boolean) value;
... | java | public boolean getBoolean(String key, boolean defaultValue) {
Object value = get(key);
if (value instanceof Boolean) {
return (boolean) value;
} else if (value instanceof String) {
return Boolean.valueOf((String) value);
}
return defaultValue;
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"Object",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"instanceof",
"Boolean",
")",
"{",
"return",
"(",
"boolean",
")",
"value",
";",
... | Returns the value mapped by {@code key} if it exists and is a boolean or can be coerced to a
boolean. Returns {@code defaultValue} otherwise. | [
"Returns",
"the",
"value",
"mapped",
"by",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/ValueMap.java#L278-L286 |
weld/core | impl/src/main/java/org/jboss/weld/util/collections/Iterators.java | Iterators.addAll | public static <T> boolean addAll(Collection<T> target, Iterator<? extends T> iterator) {
"""
Add all elements in the iterator to the collection.
@param target
@param iterator
@return true if the target was modified, false otherwise
"""
Preconditions.checkArgumentNotNull(target, "target");
... | java | public static <T> boolean addAll(Collection<T> target, Iterator<? extends T> iterator) {
Preconditions.checkArgumentNotNull(target, "target");
boolean modified = false;
while (iterator.hasNext()) {
modified |= target.add(iterator.next());
}
return modified;
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"addAll",
"(",
"Collection",
"<",
"T",
">",
"target",
",",
"Iterator",
"<",
"?",
"extends",
"T",
">",
"iterator",
")",
"{",
"Preconditions",
".",
"checkArgumentNotNull",
"(",
"target",
",",
"\"target\"",
")",
... | Add all elements in the iterator to the collection.
@param target
@param iterator
@return true if the target was modified, false otherwise | [
"Add",
"all",
"elements",
"in",
"the",
"iterator",
"to",
"the",
"collection",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/collections/Iterators.java#L46-L53 |
OpenTSDB/opentsdb | src/tsd/TreeRpc.java | TreeRpc.parseTreeId | private int parseTreeId(HttpQuery query, final boolean required) {
"""
Parses the tree ID from a query
Used often so it's been broken into it's own method
@param query The HTTP query to work with
@param required Whether or not the ID is required for the given call
@return The tree ID or 0 if not provided
"... | java | private int parseTreeId(HttpQuery query, final boolean required) {
try{
if (required) {
return Integer.parseInt(query.getRequiredQueryStringParam("treeid"));
} else {
if (query.hasQueryStringParam("treeid")) {
return Integer.parseInt(query.getQueryStringParam("treeid"));
... | [
"private",
"int",
"parseTreeId",
"(",
"HttpQuery",
"query",
",",
"final",
"boolean",
"required",
")",
"{",
"try",
"{",
"if",
"(",
"required",
")",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"query",
".",
"getRequiredQueryStringParam",
"(",
"\"treeid\"",
... | Parses the tree ID from a query
Used often so it's been broken into it's own method
@param query The HTTP query to work with
@param required Whether or not the ID is required for the given call
@return The tree ID or 0 if not provided | [
"Parses",
"the",
"tree",
"ID",
"from",
"a",
"query",
"Used",
"often",
"so",
"it",
"s",
"been",
"broken",
"into",
"it",
"s",
"own",
"method"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/TreeRpc.java#L692-L706 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/operators/Ordering.java | Ordering.appendOrdering | public Ordering appendOrdering(Integer index, Class<? extends Comparable<?>> type, Order order) {
"""
Extends this ordering by appending an additional order requirement.
If the index has been previously appended then the unmodified Ordering
is returned.
@param index Field index of the appended order requireme... | java | public Ordering appendOrdering(Integer index, Class<? extends Comparable<?>> type, Order order) {
if (index < 0) {
throw new IllegalArgumentException("The key index must not be negative.");
}
if (order == null) {
throw new NullPointerException();
}
if (order == Order.NONE) {
throw new IllegalArgument... | [
"public",
"Ordering",
"appendOrdering",
"(",
"Integer",
"index",
",",
"Class",
"<",
"?",
"extends",
"Comparable",
"<",
"?",
">",
">",
"type",
",",
"Order",
"order",
")",
"{",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentExcepti... | Extends this ordering by appending an additional order requirement.
If the index has been previously appended then the unmodified Ordering
is returned.
@param index Field index of the appended order requirement.
@param type Type of the appended order requirement.
@param order Order of the appended order requirement.
... | [
"Extends",
"this",
"ordering",
"by",
"appending",
"an",
"additional",
"order",
"requirement",
".",
"If",
"the",
"index",
"has",
"been",
"previously",
"appended",
"then",
"the",
"unmodified",
"Ordering",
"is",
"returned",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/Ordering.java#L67-L85 |
docker-java/docker-java | src/main/java/com/github/dockerjava/core/command/BuildImageResultCallback.java | BuildImageResultCallback.awaitImageId | public String awaitImageId(long timeout, TimeUnit timeUnit) {
"""
Awaits the image id from the response stream.
@throws DockerClientException
if the build fails or the timeout occurs.
"""
try {
awaitCompletion(timeout, timeUnit);
} catch (InterruptedException e) {
th... | java | public String awaitImageId(long timeout, TimeUnit timeUnit) {
try {
awaitCompletion(timeout, timeUnit);
} catch (InterruptedException e) {
throw new DockerClientException("Awaiting image id interrupted: ", e);
}
return getImageId();
} | [
"public",
"String",
"awaitImageId",
"(",
"long",
"timeout",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"try",
"{",
"awaitCompletion",
"(",
"timeout",
",",
"timeUnit",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"throw",
"new",
"DockerClie... | Awaits the image id from the response stream.
@throws DockerClientException
if the build fails or the timeout occurs. | [
"Awaits",
"the",
"image",
"id",
"from",
"the",
"response",
"stream",
"."
] | train | https://github.com/docker-java/docker-java/blob/c5c89327108abdc50aa41d7711d4743b8bac75fe/src/main/java/com/github/dockerjava/core/command/BuildImageResultCallback.java#L60-L68 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/interpolation2d/core/TPSInterpolator.java | TPSInterpolator.fillPsubMatrix | private void fillPsubMatrix( Coordinate[] controlPoints, GeneralMatrix L ) {
"""
Fill L submatrix (<a href="http://elonen.iki.fi/code/tpsdemo/index.html"> see more here</a>)
"""
int controlPointsNum = controlPoints.length;
for( int i = 0; i < controlPointsNum; i++ ) {
L.setElement(i... | java | private void fillPsubMatrix( Coordinate[] controlPoints, GeneralMatrix L ) {
int controlPointsNum = controlPoints.length;
for( int i = 0; i < controlPointsNum; i++ ) {
L.setElement(i, i, 0);
L.setElement(i, controlPointsNum + 0, 1);
L.setElement(i, controlPointsNum +... | [
"private",
"void",
"fillPsubMatrix",
"(",
"Coordinate",
"[",
"]",
"controlPoints",
",",
"GeneralMatrix",
"L",
")",
"{",
"int",
"controlPointsNum",
"=",
"controlPoints",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"controlPointsNum",
... | Fill L submatrix (<a href="http://elonen.iki.fi/code/tpsdemo/index.html"> see more here</a>) | [
"Fill",
"L",
"submatrix",
"(",
"<a",
"href",
"=",
"http",
":",
"//",
"elonen",
".",
"iki",
".",
"fi",
"/",
"code",
"/",
"tpsdemo",
"/",
"index",
".",
"html",
">",
"see",
"more",
"here<",
"/",
"a",
">",
")"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/interpolation2d/core/TPSInterpolator.java#L137-L150 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java | CommerceNotificationTemplatePersistenceImpl.fetchByUUID_G | @Override
public CommerceNotificationTemplate fetchByUUID_G(String uuid, long groupId) {
"""
Returns the commerce notification template where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return... | java | @Override
public CommerceNotificationTemplate fetchByUUID_G(String uuid, long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CommerceNotificationTemplate",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the commerce notification template where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce notification template, or <code>null</code> if a matching commerce notification ... | [
"Returns",
"the",
"commerce",
"notification",
"template",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"f... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java#L716-L719 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/core/CaptureSearchResults.java | CaptureSearchResults.addSearchResult | public void addSearchResult(CaptureSearchResult result, boolean append) {
"""
Add a result to this results, at either the beginning or the end,
depending on the append argument
@param result SearchResult to add to this set
@param append
"""
String resultDate = result.getCaptureTimestamp();
if ((firstRes... | java | public void addSearchResult(CaptureSearchResult result, boolean append) {
String resultDate = result.getCaptureTimestamp();
if ((firstResultTimestamp == null) ||
(firstResultTimestamp.compareTo(resultDate) > 0)) {
firstResultTimestamp = resultDate;
}
if ((lastResultTimestamp == null) ||
(lastResultTi... | [
"public",
"void",
"addSearchResult",
"(",
"CaptureSearchResult",
"result",
",",
"boolean",
"append",
")",
"{",
"String",
"resultDate",
"=",
"result",
".",
"getCaptureTimestamp",
"(",
")",
";",
"if",
"(",
"(",
"firstResultTimestamp",
"==",
"null",
")",
"||",
"(... | Add a result to this results, at either the beginning or the end,
depending on the append argument
@param result SearchResult to add to this set
@param append | [
"Add",
"a",
"result",
"to",
"this",
"results",
"at",
"either",
"the",
"beginning",
"or",
"the",
"end",
"depending",
"on",
"the",
"append",
"argument"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/core/CaptureSearchResults.java#L98-L125 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/strategy/properties/HystrixPropertiesStrategy.java | HystrixPropertiesStrategy.getCommandProperties | public HystrixCommandProperties getCommandProperties(HystrixCommandKey commandKey, HystrixCommandProperties.Setter builder) {
"""
Construct an implementation of {@link HystrixCommandProperties} for {@link HystrixCommand} instances with {@link HystrixCommandKey}.
<p>
<b>Default Implementation</b>
<p>
Constructs... | java | public HystrixCommandProperties getCommandProperties(HystrixCommandKey commandKey, HystrixCommandProperties.Setter builder) {
return new HystrixPropertiesCommandDefault(commandKey, builder);
} | [
"public",
"HystrixCommandProperties",
"getCommandProperties",
"(",
"HystrixCommandKey",
"commandKey",
",",
"HystrixCommandProperties",
".",
"Setter",
"builder",
")",
"{",
"return",
"new",
"HystrixPropertiesCommandDefault",
"(",
"commandKey",
",",
"builder",
")",
";",
"}"
... | Construct an implementation of {@link HystrixCommandProperties} for {@link HystrixCommand} instances with {@link HystrixCommandKey}.
<p>
<b>Default Implementation</b>
<p>
Constructs instance of {@link HystrixPropertiesCommandDefault}.
@param commandKey
{@link HystrixCommandKey} representing the name or type of {@link ... | [
"Construct",
"an",
"implementation",
"of",
"{",
"@link",
"HystrixCommandProperties",
"}",
"for",
"{",
"@link",
"HystrixCommand",
"}",
"instances",
"with",
"{",
"@link",
"HystrixCommandKey",
"}",
".",
"<p",
">",
"<b",
">",
"Default",
"Implementation<",
"/",
"b",
... | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/properties/HystrixPropertiesStrategy.java#L53-L55 |
cdapio/tigon | tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java | DatumWriterGenerator.generateConstructor | private void generateConstructor() {
"""
Generates the constructor. The constructor generated has signature {@code (Schema, FieldAccessorFactory)}.
"""
Method constructor = getMethod(void.class, "<init>", Schema.class, FieldAccessorFactory.class);
// Constructor(Schema schema, FieldAccessorFactory acc... | java | private void generateConstructor() {
Method constructor = getMethod(void.class, "<init>", Schema.class, FieldAccessorFactory.class);
// Constructor(Schema schema, FieldAccessorFactory accessorFactory)
GeneratorAdapter mg = new GeneratorAdapter(Opcodes.ACC_PUBLIC, constructor, null, null, classWriter);
... | [
"private",
"void",
"generateConstructor",
"(",
")",
"{",
"Method",
"constructor",
"=",
"getMethod",
"(",
"void",
".",
"class",
",",
"\"<init>\"",
",",
"Schema",
".",
"class",
",",
"FieldAccessorFactory",
".",
"class",
")",
";",
"// Constructor(Schema schema, Field... | Generates the constructor. The constructor generated has signature {@code (Schema, FieldAccessorFactory)}. | [
"Generates",
"the",
"constructor",
".",
"The",
"constructor",
"generated",
"has",
"signature",
"{"
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java#L180-L228 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiClient.java | JsiiClient.completeCallback | public void completeCallback(final Callback callback, final String error, final JsonNode result) {
"""
Completes a callback.
@param callback The callback to complete.
@param error Error information (or null).
@param result Result (or null).
"""
ObjectNode req = makeRequest("complete");
req.p... | java | public void completeCallback(final Callback callback, final String error, final JsonNode result) {
ObjectNode req = makeRequest("complete");
req.put("cbid", callback.getCbid());
req.put("err", error);
req.set("result", result);
this.runtime.requestResponse(req);
} | [
"public",
"void",
"completeCallback",
"(",
"final",
"Callback",
"callback",
",",
"final",
"String",
"error",
",",
"final",
"JsonNode",
"result",
")",
"{",
"ObjectNode",
"req",
"=",
"makeRequest",
"(",
"\"complete\"",
")",
";",
"req",
".",
"put",
"(",
"\"cbid... | Completes a callback.
@param callback The callback to complete.
@param error Error information (or null).
@param result Result (or null). | [
"Completes",
"a",
"callback",
"."
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiClient.java#L249-L256 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.clearCaches | public void clearCaches() throws Exception {
"""
Clears all OpenCms internal caches.<p>
@throws Exception if something goes wrong
"""
OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_CLEAR_CACHES, new HashMap<String, Object>()));
} | java | public void clearCaches() throws Exception {
OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_CLEAR_CACHES, new HashMap<String, Object>()));
} | [
"public",
"void",
"clearCaches",
"(",
")",
"throws",
"Exception",
"{",
"OpenCms",
".",
"fireCmsEvent",
"(",
"new",
"CmsEvent",
"(",
"I_CmsEventListener",
".",
"EVENT_CLEAR_CACHES",
",",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
")",
")",... | Clears all OpenCms internal caches.<p>
@throws Exception if something goes wrong | [
"Clears",
"all",
"OpenCms",
"internal",
"caches",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L262-L265 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java | TypeAnnotationPosition.methodThrows | public static TypeAnnotationPosition
methodThrows(final List<TypePathEntry> location,
final int type_index) {
"""
Create a {@code TypeAnnotationPosition} for a throws clause.
@param location The type path.
@param type_index The index of the exception.
"""
return methodT... | java | public static TypeAnnotationPosition
methodThrows(final List<TypePathEntry> location,
final int type_index) {
return methodThrows(location, null, type_index, -1);
} | [
"public",
"static",
"TypeAnnotationPosition",
"methodThrows",
"(",
"final",
"List",
"<",
"TypePathEntry",
">",
"location",
",",
"final",
"int",
"type_index",
")",
"{",
"return",
"methodThrows",
"(",
"location",
",",
"null",
",",
"type_index",
",",
"-",
"1",
")... | Create a {@code TypeAnnotationPosition} for a throws clause.
@param location The type path.
@param type_index The index of the exception. | [
"Create",
"a",
"{",
"@code",
"TypeAnnotationPosition",
"}",
"for",
"a",
"throws",
"clause",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java#L1037-L1041 |
couchbase/couchbase-lite-java-core | vendor/sqlite/src/java/com/couchbase/lite/internal/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.openDatabase | public static SQLiteDatabase openDatabase(
String path, CursorFactory factory, int flags,
int walConnectionPoolSize,
DatabaseErrorHandler errorHandler,
com.couchbase.lite.internal.database.sqlite.SQLiteConnectionListener connectionListener) {
"""
Open the database ac... | java | public static SQLiteDatabase openDatabase(
String path, CursorFactory factory, int flags,
int walConnectionPoolSize,
DatabaseErrorHandler errorHandler,
com.couchbase.lite.internal.database.sqlite.SQLiteConnectionListener connectionListener) {
SQLiteDatabase db = n... | [
"public",
"static",
"SQLiteDatabase",
"openDatabase",
"(",
"String",
"path",
",",
"CursorFactory",
"factory",
",",
"int",
"flags",
",",
"int",
"walConnectionPoolSize",
",",
"DatabaseErrorHandler",
"errorHandler",
",",
"com",
".",
"couchbase",
".",
"lite",
".",
"in... | Open the database according to the flags {@link #OPEN_READWRITE}
{@link #OPEN_READONLY} {@link #CREATE_IF_NECESSARY}.
<p>Accepts input param: a concrete instance of {@link DatabaseErrorHandler} to be
used to handle corruption when sqlite reports database corruption.</p>
@param path to database file to open and/or cre... | [
"Open",
"the",
"database",
"according",
"to",
"the",
"flags",
"{",
"@link",
"#OPEN_READWRITE",
"}",
"{",
"@link",
"#OPEN_READONLY",
"}",
"{",
"@link",
"#CREATE_IF_NECESSARY",
"}",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/vendor/sqlite/src/java/com/couchbase/lite/internal/database/sqlite/SQLiteDatabase.java#L692-L700 |
thelinmichael/spotify-web-api-java | src/main/java/com/wrapper/spotify/SpotifyApi.java | SpotifyApi.authorizationCode | public AuthorizationCodeRequest.Builder authorizationCode(String client_id, String client_secret, String code, URI redirect_uri) {
"""
Returns a builder that can be used to build requests for authorization code grants. <br>
Requires client ID, client secret, and redirect URI to be set.
@param client_id Whe... | java | public AuthorizationCodeRequest.Builder authorizationCode(String client_id, String client_secret, String code, URI redirect_uri) {
return new AuthorizationCodeRequest.Builder(clientId, clientSecret)
.setDefaults(httpManager, scheme, host, port)
.grant_type("authorization_code")
.... | [
"public",
"AuthorizationCodeRequest",
".",
"Builder",
"authorizationCode",
"(",
"String",
"client_id",
",",
"String",
"client_secret",
",",
"String",
"code",
",",
"URI",
"redirect_uri",
")",
"{",
"return",
"new",
"AuthorizationCodeRequest",
".",
"Builder",
"(",
"cli... | Returns a builder that can be used to build requests for authorization code grants. <br>
Requires client ID, client secret, and redirect URI to be set.
@param client_id When you register your application, Spotify provides you a Client ID.
@param client_secret When you register your application, Spotify provides yo... | [
"Returns",
"a",
"builder",
"that",
"can",
"be",
"used",
"to",
"build",
"requests",
"for",
"authorization",
"code",
"grants",
".",
"<br",
">",
"Requires",
"client",
"ID",
"client",
"secret",
"and",
"redirect",
"URI",
"to",
"be",
"set",
"."
] | train | https://github.com/thelinmichael/spotify-web-api-java/blob/c06b8512344c0310d0c1df362fa267879021da2e/src/main/java/com/wrapper/spotify/SpotifyApi.java#L356-L362 |
Squarespace/cldr | compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java | CalendarCodeGenerator.buildSkeletonType | private MethodSpec.Builder buildSkeletonType(Set<String> dateSkeletons, Set<String> timeSkeletons) {
"""
Constructs a method to indicate if the skeleton is a DATE or TIME, or null if unsupported.
"""
MethodSpec.Builder method = MethodSpec.methodBuilder("skeletonType")
.addJavadoc("Indicates whether... | java | private MethodSpec.Builder buildSkeletonType(Set<String> dateSkeletons, Set<String> timeSkeletons) {
MethodSpec.Builder method = MethodSpec.methodBuilder("skeletonType")
.addJavadoc("Indicates whether a given skeleton pattern is a DATE or TIME.\n")
.addModifiers(PUBLIC, STATIC)
.addParameter... | [
"private",
"MethodSpec",
".",
"Builder",
"buildSkeletonType",
"(",
"Set",
"<",
"String",
">",
"dateSkeletons",
",",
"Set",
"<",
"String",
">",
"timeSkeletons",
")",
"{",
"MethodSpec",
".",
"Builder",
"method",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"\"s... | Constructs a method to indicate if the skeleton is a DATE or TIME, or null if unsupported. | [
"Constructs",
"a",
"method",
"to",
"indicate",
"if",
"the",
"skeleton",
"is",
"a",
"DATE",
"or",
"TIME",
"or",
"null",
"if",
"unsupported",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java#L538-L562 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/logs/Log4jConfigurationHelper.java | Log4jConfigurationHelper.updateLog4jConfiguration | public static void updateLog4jConfiguration(Class<?> targetClass, String log4jPath, String log4jFileName)
throws IOException {
"""
Update the log4j configuration.
@param targetClass the target class used to get the original log4j configuration file as a resource
@param log4jPath the custom log4j configur... | java | public static void updateLog4jConfiguration(Class<?> targetClass, String log4jPath, String log4jFileName)
throws IOException {
Closer closer = Closer.create();
try {
InputStream fileInputStream = closer.register(new FileInputStream(log4jPath));
InputStream inputStream = closer.register(targetC... | [
"public",
"static",
"void",
"updateLog4jConfiguration",
"(",
"Class",
"<",
"?",
">",
"targetClass",
",",
"String",
"log4jPath",
",",
"String",
"log4jFileName",
")",
"throws",
"IOException",
"{",
"Closer",
"closer",
"=",
"Closer",
".",
"create",
"(",
")",
";",
... | Update the log4j configuration.
@param targetClass the target class used to get the original log4j configuration file as a resource
@param log4jPath the custom log4j configuration properties file path
@param log4jFileName the custom log4j configuration properties file name
@throws IOException if there's something wron... | [
"Update",
"the",
"log4j",
"configuration",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/logs/Log4jConfigurationHelper.java#L47-L69 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.generateThumbnailWithServiceResponseAsync | public Observable<ServiceResponse<InputStream>> generateThumbnailWithServiceResponseAsync(int width, int height, String url, GenerateThumbnailOptionalParameter generateThumbnailOptionalParameter) {
"""
This operation generates a thumbnail image with the user-specified width and height. By default, the service anal... | java | public Observable<ServiceResponse<InputStream>> generateThumbnailWithServiceResponseAsync(int width, int height, String url, GenerateThumbnailOptionalParameter generateThumbnailOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoi... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"InputStream",
">",
">",
"generateThumbnailWithServiceResponseAsync",
"(",
"int",
"width",
",",
"int",
"height",
",",
"String",
"url",
",",
"GenerateThumbnailOptionalParameter",
"generateThumbnailOptionalParameter",
")",
... | This operation generates a thumbnail image with the user-specified width and height. By default, the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the input i... | [
"This",
"operation",
"generates",
"a",
"thumbnail",
"image",
"with",
"the",
"user",
"-",
"specified",
"width",
"and",
"height",
".",
"By",
"default",
"the",
"service",
"analyzes",
"the",
"image",
"identifies",
"the",
"region",
"of",
"interest",
"(",
"ROI",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L2114-L2124 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newNoSuchFileException | public static NoSuchFileException newNoSuchFileException(String message, Object... args) {
"""
Constructs and initializes a new {@link NoSuchFileException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link NoSuchFileEx... | java | public static NoSuchFileException newNoSuchFileException(String message, Object... args) {
return newNoSuchFileException(null, message, args);
} | [
"public",
"static",
"NoSuchFileException",
"newNoSuchFileException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newNoSuchFileException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link NoSuchFileException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link NoSuchFileException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the {... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"NoSuchFileException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L213-L215 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/TransactionWriteRequest.java | TransactionWriteRequest.addConditionCheck | public TransactionWriteRequest addConditionCheck(Object key,
DynamoDBTransactionWriteExpression transactionWriteExpression,
ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure) {
"""
Adds c... | java | public TransactionWriteRequest addConditionCheck(Object key,
DynamoDBTransactionWriteExpression transactionWriteExpression,
ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure) {
transac... | [
"public",
"TransactionWriteRequest",
"addConditionCheck",
"(",
"Object",
"key",
",",
"DynamoDBTransactionWriteExpression",
"transactionWriteExpression",
",",
"ReturnValuesOnConditionCheckFailure",
"returnValuesOnConditionCheckFailure",
")",
"{",
"transactionWriteOperations",
".",
"ad... | Adds conditionCheck operation (to be executed on the object represented by key) to the list of transaction write operations.
transactionWriteExpression is used to condition check on the object represented by key.
returnValuesOnConditionCheckFailure specifies which attributes values (of existing item) should be returned... | [
"Adds",
"conditionCheck",
"operation",
"(",
"to",
"be",
"executed",
"on",
"the",
"object",
"represented",
"by",
"key",
")",
"to",
"the",
"list",
"of",
"transaction",
"write",
"operations",
".",
"transactionWriteExpression",
"is",
"used",
"to",
"condition",
"chec... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/TransactionWriteRequest.java#L141-L146 |
DavidPizarro/PinView | library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java | PinViewBaseHelper.onTextChanged | @Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
"""
Check if you have written or have deleted (in the latter case, there would be to do nothing).
If you have written, you have to move to the following free PinBox {@link EditText} or to do other
action if there are no e... | java | @Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (findFocus() != null) {
currentFocus = Integer.parseInt(findFocus().getTag().toString());
}
if (count == 1 && s.length() == mNumberCharacters) {
if (currentFocus == (mNumberPi... | [
"@",
"Override",
"public",
"void",
"onTextChanged",
"(",
"CharSequence",
"s",
",",
"int",
"start",
",",
"int",
"before",
",",
"int",
"count",
")",
"{",
"if",
"(",
"findFocus",
"(",
")",
"!=",
"null",
")",
"{",
"currentFocus",
"=",
"Integer",
".",
"pars... | Check if you have written or have deleted (in the latter case, there would be to do nothing).
If you have written, you have to move to the following free PinBox {@link EditText} or to do other
action if there are no empty values. | [
"Check",
"if",
"you",
"have",
"written",
"or",
"have",
"deleted",
"(",
"in",
"the",
"latter",
"case",
"there",
"would",
"be",
"to",
"do",
"nothing",
")",
".",
"If",
"you",
"have",
"written",
"you",
"have",
"to",
"move",
"to",
"the",
"following",
"free"... | train | https://github.com/DavidPizarro/PinView/blob/b171a89694921475b5442585810b8475ef1cfe35/library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java#L424-L439 |
cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java | AtomPlacer3D.getPlacedHeavyAtoms | public IAtomContainer getPlacedHeavyAtoms(IAtomContainer molecule, IAtom atom) {
"""
Gets the placed Heavy Atoms connected to an atom.
@param molecule
@param atom The atom the atoms must be connected to.
@return The placed heavy atoms.
"""
List<IBond> bonds = molecule.getConnectedBondsLis... | java | public IAtomContainer getPlacedHeavyAtoms(IAtomContainer molecule, IAtom atom) {
List<IBond> bonds = molecule.getConnectedBondsList(atom);
IAtomContainer connectedAtoms = molecule.getBuilder().newInstance(IAtomContainer.class);
IAtom connectedAtom = null;
for (IBond bond : bonds) {
... | [
"public",
"IAtomContainer",
"getPlacedHeavyAtoms",
"(",
"IAtomContainer",
"molecule",
",",
"IAtom",
"atom",
")",
"{",
"List",
"<",
"IBond",
">",
"bonds",
"=",
"molecule",
".",
"getConnectedBondsList",
"(",
"atom",
")",
";",
"IAtomContainer",
"connectedAtoms",
"=",... | Gets the placed Heavy Atoms connected to an atom.
@param molecule
@param atom The atom the atoms must be connected to.
@return The placed heavy atoms. | [
"Gets",
"the",
"placed",
"Heavy",
"Atoms",
"connected",
"to",
"an",
"atom",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L558-L570 |
arquillian/arquillian-algeron | common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java | GitOperations.isRemoteBranch | public boolean isRemoteBranch(final Git git, final String branch, final String remote) {
"""
Checks if given branch is remote.
@param git
instance.
@param branch
to check.
@param remote
name.
@return True if it is remote, false otherwise.
"""
try {
final List<Ref> refs = git.bran... | java | public boolean isRemoteBranch(final Git git, final String branch, final String remote) {
try {
final List<Ref> refs = git.branchList()
.setListMode(ListBranchCommand.ListMode.REMOTE).call();
final String remoteBranch = remote + "/" + branch;
return refs.strea... | [
"public",
"boolean",
"isRemoteBranch",
"(",
"final",
"Git",
"git",
",",
"final",
"String",
"branch",
",",
"final",
"String",
"remote",
")",
"{",
"try",
"{",
"final",
"List",
"<",
"Ref",
">",
"refs",
"=",
"git",
".",
"branchList",
"(",
")",
".",
"setLis... | Checks if given branch is remote.
@param git
instance.
@param branch
to check.
@param remote
name.
@return True if it is remote, false otherwise. | [
"Checks",
"if",
"given",
"branch",
"is",
"remote",
"."
] | train | https://github.com/arquillian/arquillian-algeron/blob/ec79372defdafe99ab2f7bb696f1c1eabdbbacb6/common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java#L119-L129 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/permission/PermissionsBuilder.java | PermissionsBuilder.setState | public PermissionsBuilder setState(PermissionType type, PermissionState state) {
"""
Sets the new state of the given type.
@param type The type to change.
@param state The state to set.
@return The current instance in order to chain call methods.
"""
delegate.setState(type, state);
return ... | java | public PermissionsBuilder setState(PermissionType type, PermissionState state) {
delegate.setState(type, state);
return this;
} | [
"public",
"PermissionsBuilder",
"setState",
"(",
"PermissionType",
"type",
",",
"PermissionState",
"state",
")",
"{",
"delegate",
".",
"setState",
"(",
"type",
",",
"state",
")",
";",
"return",
"this",
";",
"}"
] | Sets the new state of the given type.
@param type The type to change.
@param state The state to set.
@return The current instance in order to chain call methods. | [
"Sets",
"the",
"new",
"state",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/permission/PermissionsBuilder.java#L39-L42 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/BeanELResolver.java | BeanELResolver.toBeanProperty | private final BeanProperty toBeanProperty(Object base, Object property) {
"""
Lookup BeanProperty for the given (base, property) pair.
@param base
The bean to analyze.
@param property
The name of the property to analyze. Will be coerced to a String.
@return The BeanProperty representing (base, property).
@... | java | private final BeanProperty toBeanProperty(Object base, Object property) {
BeanProperties beanProperties = cache.get(base.getClass());
if (beanProperties == null) {
BeanProperties newBeanProperties = new BeanProperties(base.getClass());
beanProperties = cache.putIfAbsent(base.getClass(), newBeanProperties);
... | [
"private",
"final",
"BeanProperty",
"toBeanProperty",
"(",
"Object",
"base",
",",
"Object",
"property",
")",
"{",
"BeanProperties",
"beanProperties",
"=",
"cache",
".",
"get",
"(",
"base",
".",
"getClass",
"(",
")",
")",
";",
"if",
"(",
"beanProperties",
"==... | Lookup BeanProperty for the given (base, property) pair.
@param base
The bean to analyze.
@param property
The name of the property to analyze. Will be coerced to a String.
@return The BeanProperty representing (base, property).
@throws PropertyNotFoundException
if no BeanProperty can be found. | [
"Lookup",
"BeanProperty",
"for",
"the",
"given",
"(",
"base",
"property",
")",
"pair",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/BeanELResolver.java#L610-L624 |
shekhargulati/strman-java | src/main/java/strman/Strman.java | Strman.isEnclosedBetween | public static boolean isEnclosedBetween(final String input, final String leftEncloser, String rightEncloser) {
"""
Verifies whether String is enclosed by encloser
@param input The input String
@param leftEncloser String which encloses input String at left start
@param rightEncloser String which enclo... | java | public static boolean isEnclosedBetween(final String input, final String leftEncloser, String rightEncloser) {
if (input == null) {
throw new IllegalArgumentException("input can't be null");
}
if (leftEncloser == null) {
throw new IllegalArgumentException("leftEncloser ca... | [
"public",
"static",
"boolean",
"isEnclosedBetween",
"(",
"final",
"String",
"input",
",",
"final",
"String",
"leftEncloser",
",",
"String",
"rightEncloser",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
... | Verifies whether String is enclosed by encloser
@param input The input String
@param leftEncloser String which encloses input String at left start
@param rightEncloser String which encloses input String at the right end
@return true if enclosed false otherwise | [
"Verifies",
"whether",
"String",
"is",
"enclosed",
"by",
"encloser"
] | train | https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L1203-L1214 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java | ComponentSupport.getViewRoot | public static UIViewRoot getViewRoot(FaceletContext ctx, UIComponent parent) {
"""
Tries to walk up the parent to find the UIViewRoot, if not found, then go to FaceletContext's FacesContext for
the view root.
@param ctx
FaceletContext
@param parent
UIComponent to search from
@return UIViewRoot instance for... | java | public static UIViewRoot getViewRoot(FaceletContext ctx, UIComponent parent)
{
UIComponent c = parent;
do
{
if (c instanceof UIViewRoot)
{
return (UIViewRoot) c;
}
else
{
c = c.getParent();
... | [
"public",
"static",
"UIViewRoot",
"getViewRoot",
"(",
"FaceletContext",
"ctx",
",",
"UIComponent",
"parent",
")",
"{",
"UIComponent",
"c",
"=",
"parent",
";",
"do",
"{",
"if",
"(",
"c",
"instanceof",
"UIViewRoot",
")",
"{",
"return",
"(",
"UIViewRoot",
")",
... | Tries to walk up the parent to find the UIViewRoot, if not found, then go to FaceletContext's FacesContext for
the view root.
@param ctx
FaceletContext
@param parent
UIComponent to search from
@return UIViewRoot instance for this evaluation | [
"Tries",
"to",
"walk",
"up",
"the",
"parent",
"to",
"find",
"the",
"UIViewRoot",
"if",
"not",
"found",
"then",
"go",
"to",
"FaceletContext",
"s",
"FacesContext",
"for",
"the",
"view",
"root",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java#L448-L469 |
linkhub-sdk/popbill.sdk.java | src/main/java/com/popbill/api/fax/FaxServiceImp.java | FaxServiceImp.resendFAX | @Override
public String resendFAX(String corpNum, String receiptNum, String sendNum,
String senderName, Receiver[] receivers, Date reserveDT) throws PopbillException {
"""
/*
(non-Javadoc)
@see com.popbill.api.FaxService#resendFAX(java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.po... | java | @Override
public String resendFAX(String corpNum, String receiptNum, String sendNum,
String senderName, Receiver[] receivers, Date reserveDT) throws PopbillException {
return resendFAX(corpNum, receiptNum, sendNum, senderName, receivers, reserveDT, null, null);
} | [
"@",
"Override",
"public",
"String",
"resendFAX",
"(",
"String",
"corpNum",
",",
"String",
"receiptNum",
",",
"String",
"sendNum",
",",
"String",
"senderName",
",",
"Receiver",
"[",
"]",
"receivers",
",",
"Date",
"reserveDT",
")",
"throws",
"PopbillException",
... | /*
(non-Javadoc)
@see com.popbill.api.FaxService#resendFAX(java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.popbill.api.fax.Receiver[], java.util.Date) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/linkhub-sdk/popbill.sdk.java/blob/63a341fefe96d60a368776638f3d4c81888238b7/src/main/java/com/popbill/api/fax/FaxServiceImp.java#L824-L829 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/rest/RESTRegistry.java | RESTRegistry.registerCommand | private void registerCommand(String cmdOwner, RegisteredCommand cmd) {
"""
Register the given command and throw if is a duplicate name or command.
"""
// Add to owner map in RESTCatalog.
Map<String, RESTCommand> nameMap = getCmdNameMap(cmdOwner);
String cmdName = cmd.getName();
... | java | private void registerCommand(String cmdOwner, RegisteredCommand cmd) {
// Add to owner map in RESTCatalog.
Map<String, RESTCommand> nameMap = getCmdNameMap(cmdOwner);
String cmdName = cmd.getName();
RESTCommand oldCmd = nameMap.put(cmdName, cmd);
if (oldCmd != null) {
... | [
"private",
"void",
"registerCommand",
"(",
"String",
"cmdOwner",
",",
"RegisteredCommand",
"cmd",
")",
"{",
"// Add to owner map in RESTCatalog.\r",
"Map",
"<",
"String",
",",
"RESTCommand",
">",
"nameMap",
"=",
"getCmdNameMap",
"(",
"cmdOwner",
")",
";",
"String",
... | Register the given command and throw if is a duplicate name or command. | [
"Register",
"the",
"given",
"command",
"and",
"throw",
"if",
"is",
"a",
"duplicate",
"name",
"or",
"command",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/rest/RESTRegistry.java#L220-L245 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java | BugInstance.addSourceLine | @Nonnull
public BugInstance addSourceLine(ClassContext classContext, PreorderVisitor visitor, int pc) {
"""
Add a source line annotation for instruction whose PC is given in the
method that the given visitor is currently visiting. Note that if the
method does not have line number information, then no source ... | java | @Nonnull
public BugInstance addSourceLine(ClassContext classContext, PreorderVisitor visitor, int pc) {
SourceLineAnnotation sourceLineAnnotation = SourceLineAnnotation.fromVisitedInstruction(classContext, visitor, pc);
if (sourceLineAnnotation != null) {
add(sourceLineAnnotation);
... | [
"@",
"Nonnull",
"public",
"BugInstance",
"addSourceLine",
"(",
"ClassContext",
"classContext",
",",
"PreorderVisitor",
"visitor",
",",
"int",
"pc",
")",
"{",
"SourceLineAnnotation",
"sourceLineAnnotation",
"=",
"SourceLineAnnotation",
".",
"fromVisitedInstruction",
"(",
... | Add a source line annotation for instruction whose PC is given in the
method that the given visitor is currently visiting. Note that if the
method does not have line number information, then no source line
annotation will be added.
@param classContext
the ClassContext
@param visitor
a PreorderVisitor that is currently... | [
"Add",
"a",
"source",
"line",
"annotation",
"for",
"instruction",
"whose",
"PC",
"is",
"given",
"in",
"the",
"method",
"that",
"the",
"given",
"visitor",
"is",
"currently",
"visiting",
".",
"Note",
"that",
"if",
"the",
"method",
"does",
"not",
"have",
"lin... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1631-L1638 |
pushtorefresh/storio | storio-content-resolver/src/main/java/com/pushtorefresh/storio3/contentresolver/operations/put/PutResult.java | PutResult.newInsertResult | @NonNull
public static PutResult newInsertResult(@NonNull Uri insertedUri, @NonNull Uri affectedUri) {
"""
Creates {@link PutResult} for insert.
@param insertedUri Uri of inserted row.
@param affectedUri Uri that was affected by insert.
@return new {@link PutResult} instance.
"""
checkNotNull(... | java | @NonNull
public static PutResult newInsertResult(@NonNull Uri insertedUri, @NonNull Uri affectedUri) {
checkNotNull(insertedUri, "insertedUri must not be null");
return new PutResult(insertedUri, null, affectedUri);
} | [
"@",
"NonNull",
"public",
"static",
"PutResult",
"newInsertResult",
"(",
"@",
"NonNull",
"Uri",
"insertedUri",
",",
"@",
"NonNull",
"Uri",
"affectedUri",
")",
"{",
"checkNotNull",
"(",
"insertedUri",
",",
"\"insertedUri must not be null\"",
")",
";",
"return",
"ne... | Creates {@link PutResult} for insert.
@param insertedUri Uri of inserted row.
@param affectedUri Uri that was affected by insert.
@return new {@link PutResult} instance. | [
"Creates",
"{",
"@link",
"PutResult",
"}",
"for",
"insert",
"."
] | train | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-content-resolver/src/main/java/com/pushtorefresh/storio3/contentresolver/operations/put/PutResult.java#L42-L46 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/media/MediaClient.java | MediaClient.getTranscodingJob | public GetTranscodingJobResponse getTranscodingJob(GetTranscodingJobRequest request) {
"""
Retrieve the status of a job.
@param request The request object containing all options for retrieving job status.
@return The status of a job.
"""
checkNotNull(request, "The parameter request should NOT be ... | java | public GetTranscodingJobResponse getTranscodingJob(GetTranscodingJobRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getJobId(), "The parameter jobId should NOT be null or empty string.");
InternalRequest internalRequest = createR... | [
"public",
"GetTranscodingJobResponse",
"getTranscodingJob",
"(",
"GetTranscodingJobRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getJobId",
"(",
")"... | Retrieve the status of a job.
@param request The request object containing all options for retrieving job status.
@return The status of a job. | [
"Retrieve",
"the",
"status",
"of",
"a",
"job",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L488-L494 |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/GenTask.java | GenTask.mergeTemplate | protected String mergeTemplate (String template, Object... data)
throws IOException {
"""
Merges the specified template using the supplied mapping of keys to objects.
@param data a series of key, value pairs where the keys must be strings and the values can
be any object.
"""
return mergeTe... | java | protected String mergeTemplate (String template, Object... data)
throws IOException
{
return mergeTemplate(template, createMap(data));
} | [
"protected",
"String",
"mergeTemplate",
"(",
"String",
"template",
",",
"Object",
"...",
"data",
")",
"throws",
"IOException",
"{",
"return",
"mergeTemplate",
"(",
"template",
",",
"createMap",
"(",
"data",
")",
")",
";",
"}"
] | Merges the specified template using the supplied mapping of keys to objects.
@param data a series of key, value pairs where the keys must be strings and the values can
be any object. | [
"Merges",
"the",
"specified",
"template",
"using",
"the",
"supplied",
"mapping",
"of",
"keys",
"to",
"objects",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/GenTask.java#L206-L210 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/ServerCommandClient.java | ServerCommandClient.createServerCommand | private ServerCommandID createServerCommand(String command) throws IOException {
"""
Create a new server command instance: read from the
.sCommand file, obtain the UUID and the port from that file,
and construct a new command (to be sent to that port) containing
the UUID and the command string.
@param comman... | java | private ServerCommandID createServerCommand(String command) throws IOException {
FileInputStream fis = null;
BufferedReader reader = null;
try {
fis = new FileInputStream(commandFile);
reader = new BufferedReader(new InputStreamReader(fis));
String line = rea... | [
"private",
"ServerCommandID",
"createServerCommand",
"(",
"String",
"command",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"fis",
"=",
"null",
";",
"BufferedReader",
"reader",
"=",
"null",
";",
"try",
"{",
"fis",
"=",
"new",
"FileInputStream",
"(",
"co... | Create a new server command instance: read from the
.sCommand file, obtain the UUID and the port from that file,
and construct a new command (to be sent to that port) containing
the UUID and the command string.
@param command
@return
@throws Exception | [
"Create",
"a",
"new",
"server",
"command",
"instance",
":",
"read",
"from",
"the",
".",
"sCommand",
"file",
"obtain",
"the",
"UUID",
"and",
"the",
"port",
"from",
"that",
"file",
"and",
"construct",
"a",
"new",
"command",
"(",
"to",
"be",
"sent",
"to",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/ServerCommandClient.java#L68-L85 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/AttributeService.java | AttributeService.setInitialAttributes | public void setInitialAttributes(File file, FileAttribute<?>... attrs) {
"""
Sets all initial attributes for the given file, including the given attributes if possible.
"""
// default values should already be sanitized by their providers
for (int i = 0; i < defaultValues.size(); i++) {
FileAttrib... | java | public void setInitialAttributes(File file, FileAttribute<?>... attrs) {
// default values should already be sanitized by their providers
for (int i = 0; i < defaultValues.size(); i++) {
FileAttribute<?> attribute = defaultValues.get(i);
int separatorIndex = attribute.name().indexOf(':');
Str... | [
"public",
"void",
"setInitialAttributes",
"(",
"File",
"file",
",",
"FileAttribute",
"<",
"?",
">",
"...",
"attrs",
")",
"{",
"// default values should already be sanitized by their providers",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"defaultValues",
".",... | Sets all initial attributes for the given file, including the given attributes if possible. | [
"Sets",
"all",
"initial",
"attributes",
"for",
"the",
"given",
"file",
"including",
"the",
"given",
"attributes",
"if",
"possible",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AttributeService.java#L155-L169 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/Rect.java | Rect.setRect | public final void setRect(double xMin, double xMax, double yMin, double yMax) {
"""
Sets the visible rectangle of translated coordinates.
@param xMin
@param xMax
@param yMin
@param yMax
"""
this.xMin = xMin;
this.xMax = xMax;
this.yMin = yMin;
this.yMax = yMax;
} | java | public final void setRect(double xMin, double xMax, double yMin, double yMax)
{
this.xMin = xMin;
this.xMax = xMax;
this.yMin = yMin;
this.yMax = yMax;
} | [
"public",
"final",
"void",
"setRect",
"(",
"double",
"xMin",
",",
"double",
"xMax",
",",
"double",
"yMin",
",",
"double",
"yMax",
")",
"{",
"this",
".",
"xMin",
"=",
"xMin",
";",
"this",
".",
"xMax",
"=",
"xMax",
";",
"this",
".",
"yMin",
"=",
"yMi... | Sets the visible rectangle of translated coordinates.
@param xMin
@param xMax
@param yMin
@param yMax | [
"Sets",
"the",
"visible",
"rectangle",
"of",
"translated",
"coordinates",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/Rect.java#L115-L121 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/Validator.java | Validator.mergeMultiValuePropertyForKey | ValidationResult mergeMultiValuePropertyForKey(JSONArray currentValues, JSONArray newValues, String action, String key) {
"""
Merges a multi-value property JSONArray.
<p/>
trims to max length currently 100 items, on a FIFO basis
<p/>
please clean the key and newValues values before calling this
@param curre... | java | ValidationResult mergeMultiValuePropertyForKey(JSONArray currentValues, JSONArray newValues, String action, String key) {
ValidationResult vr = new ValidationResult();
Boolean remove = REMOVE_VALUES_OPERATION.equals(action);
vr = _mergeListInternalForKey(key, currentValues, newValues, remove, vr... | [
"ValidationResult",
"mergeMultiValuePropertyForKey",
"(",
"JSONArray",
"currentValues",
",",
"JSONArray",
"newValues",
",",
"String",
"action",
",",
"String",
"key",
")",
"{",
"ValidationResult",
"vr",
"=",
"new",
"ValidationResult",
"(",
")",
";",
"Boolean",
"remov... | Merges a multi-value property JSONArray.
<p/>
trims to max length currently 100 items, on a FIFO basis
<p/>
please clean the key and newValues values before calling this
@param currentValues current JSONArray property value
@param newValues JSONArray of new values
@param action String the action to take rel... | [
"Merges",
"a",
"multi",
"-",
"value",
"property",
"JSONArray",
".",
"<p",
"/",
">",
"trims",
"to",
"max",
"length",
"currently",
"100",
"items",
"on",
"a",
"FIFO",
"basis",
"<p",
"/",
">",
"please",
"clean",
"the",
"key",
"and",
"newValues",
"values",
... | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/Validator.java#L177-L182 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/FieldCriteria.java | FieldCriteria.buildNotGreaterCriteria | static FieldCriteria buildNotGreaterCriteria(Object anAttribute, Object aValue, UserAlias anAlias) {
"""
static FieldCriteria buildNotGreaterCriteria(Object anAttribute, Object aValue, String anAlias)
"""
return new FieldCriteria(anAttribute, aValue, NOT_GREATER, anAlias);
} | java | static FieldCriteria buildNotGreaterCriteria(Object anAttribute, Object aValue, UserAlias anAlias)
{
return new FieldCriteria(anAttribute, aValue, NOT_GREATER, anAlias);
} | [
"static",
"FieldCriteria",
"buildNotGreaterCriteria",
"(",
"Object",
"anAttribute",
",",
"Object",
"aValue",
",",
"UserAlias",
"anAlias",
")",
"{",
"return",
"new",
"FieldCriteria",
"(",
"anAttribute",
",",
"aValue",
",",
"NOT_GREATER",
",",
"anAlias",
")",
";",
... | static FieldCriteria buildNotGreaterCriteria(Object anAttribute, Object aValue, String anAlias) | [
"static",
"FieldCriteria",
"buildNotGreaterCriteria",
"(",
"Object",
"anAttribute",
"Object",
"aValue",
"String",
"anAlias",
")"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/FieldCriteria.java#L49-L52 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfStamperImp.java | PdfStamperImp.setDuration | void setDuration(int seconds, int page) {
"""
Sets the display duration for the page (for presentations)
@param seconds the number of seconds to display the page. A negative value removes the entry
@param page the page where the duration will be applied. The first page is 1
"""
PdfDictionary pg = r... | java | void setDuration(int seconds, int page) {
PdfDictionary pg = reader.getPageN(page);
if (seconds < 0)
pg.remove(PdfName.DUR);
else
pg.put(PdfName.DUR, new PdfNumber(seconds));
markUsed(pg);
} | [
"void",
"setDuration",
"(",
"int",
"seconds",
",",
"int",
"page",
")",
"{",
"PdfDictionary",
"pg",
"=",
"reader",
".",
"getPageN",
"(",
"page",
")",
";",
"if",
"(",
"seconds",
"<",
"0",
")",
"pg",
".",
"remove",
"(",
"PdfName",
".",
"DUR",
")",
";"... | Sets the display duration for the page (for presentations)
@param seconds the number of seconds to display the page. A negative value removes the entry
@param page the page where the duration will be applied. The first page is 1 | [
"Sets",
"the",
"display",
"duration",
"for",
"the",
"page",
"(",
"for",
"presentations",
")"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfStamperImp.java#L1418-L1425 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/DigitalPackageUrl.java | DigitalPackageUrl.getDigitalPackageUrl | public static MozuUrl getDigitalPackageUrl(String digitalPackageId, String orderId, String responseFields) {
"""
Get Resource Url for GetDigitalPackage
@param digitalPackageId This parameter supplies package ID to get fulfillment actions for the digital package.
@param orderId Unique identifier of the order.
@p... | java | public static MozuUrl getDigitalPackageUrl(String digitalPackageId, String orderId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/digitalpackages/{digitalPackageId}?responseFields={responseFields}");
formatter.formatUrl("digitalPackageId", digitalPackageId);
... | [
"public",
"static",
"MozuUrl",
"getDigitalPackageUrl",
"(",
"String",
"digitalPackageId",
",",
"String",
"orderId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/orders/{orderId}/digitalpackages/{di... | Get Resource Url for GetDigitalPackage
@param digitalPackageId This parameter supplies package ID to get fulfillment actions for the digital package.
@param orderId Unique identifier of the order.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a... | [
"Get",
"Resource",
"Url",
"for",
"GetDigitalPackage"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/DigitalPackageUrl.java#L37-L44 |
alkacon/opencms-core | src/org/opencms/configuration/CmsVfsConfiguration.java | CmsVfsConfiguration.getFileTranslator | public CmsResourceTranslator getFileTranslator() {
"""
Returns the file resource translator that has been initialized
with the configured file translation rules.<p>
@return the file resource translator
"""
String[] array = new String[0];
if (m_fileTranslationEnabled) {
array = ... | java | public CmsResourceTranslator getFileTranslator() {
String[] array = new String[0];
if (m_fileTranslationEnabled) {
array = new String[m_fileTranslations.size()];
for (int i = 0; i < m_fileTranslations.size(); i++) {
array[i] = m_fileTranslations.get(i);
... | [
"public",
"CmsResourceTranslator",
"getFileTranslator",
"(",
")",
"{",
"String",
"[",
"]",
"array",
"=",
"new",
"String",
"[",
"0",
"]",
";",
"if",
"(",
"m_fileTranslationEnabled",
")",
"{",
"array",
"=",
"new",
"String",
"[",
"m_fileTranslations",
".",
"siz... | Returns the file resource translator that has been initialized
with the configured file translation rules.<p>
@return the file resource translator | [
"Returns",
"the",
"file",
"resource",
"translator",
"that",
"has",
"been",
"initialized",
"with",
"the",
"configured",
"file",
"translation",
"rules",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/CmsVfsConfiguration.java#L808-L818 |
cloudfoundry/uaa | model/src/main/java/org/cloudfoundry/identity/uaa/provider/ExternalIdentityProviderDefinition.java | ExternalIdentityProviderDefinition.addAttributeMapping | @JsonIgnore
public void addAttributeMapping(String key, Object value) {
"""
adds an attribute mapping, where the key is known to the UAA and the value represents
the attribute name on the IDP
@param key - known to the UAA, such as {@link #EMAIL_ATTRIBUTE_NAME}, {@link #GROUP_ATTRIBUTE_NAME}, {@link #PHONE_NU... | java | @JsonIgnore
public void addAttributeMapping(String key, Object value) {
attributeMappings.put(key, value);
} | [
"@",
"JsonIgnore",
"public",
"void",
"addAttributeMapping",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"attributeMappings",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | adds an attribute mapping, where the key is known to the UAA and the value represents
the attribute name on the IDP
@param key - known to the UAA, such as {@link #EMAIL_ATTRIBUTE_NAME}, {@link #GROUP_ATTRIBUTE_NAME}, {@link #PHONE_NUMBER_ATTRIBUTE_NAME}
@param value - the name of the attribute on the IDP side, for exam... | [
"adds",
"an",
"attribute",
"mapping",
"where",
"the",
"key",
"is",
"known",
"to",
"the",
"UAA",
"and",
"the",
"value",
"represents",
"the",
"attribute",
"name",
"on",
"the",
"IDP"
] | train | https://github.com/cloudfoundry/uaa/blob/e8df3d7060580c92d33461106399f9e4f36e3cd2/model/src/main/java/org/cloudfoundry/identity/uaa/provider/ExternalIdentityProviderDefinition.java#L75-L78 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/CompositeBundlePathMappingBuilder.java | CompositeBundlePathMappingBuilder.addFilePathMapping | private void addFilePathMapping(BundlePathMapping bundlePathMapping, List<BundlePath> itemPathList) {
"""
Adds bundle paths to the file path mapping
@param bundlePathMapping
the bundle path mapping
@param paths
the paths to add
"""
for (BundlePath bundlePath : itemPathList) {
addFilePathMapping(bund... | java | private void addFilePathMapping(BundlePathMapping bundlePathMapping, List<BundlePath> itemPathList) {
for (BundlePath bundlePath : itemPathList) {
addFilePathMapping(bundlePathMapping, bundlePath.getPath());
}
} | [
"private",
"void",
"addFilePathMapping",
"(",
"BundlePathMapping",
"bundlePathMapping",
",",
"List",
"<",
"BundlePath",
">",
"itemPathList",
")",
"{",
"for",
"(",
"BundlePath",
"bundlePath",
":",
"itemPathList",
")",
"{",
"addFilePathMapping",
"(",
"bundlePathMapping"... | Adds bundle paths to the file path mapping
@param bundlePathMapping
the bundle path mapping
@param paths
the paths to add | [
"Adds",
"bundle",
"paths",
"to",
"the",
"file",
"path",
"mapping"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/CompositeBundlePathMappingBuilder.java#L97-L101 |
gliga/ekstazi | org.ekstazi.core/src/main/java/org/ekstazi/data/DependencyAnalyzer.java | DependencyAnalyzer.hasHashChanged | private boolean hasHashChanged(Hasher hasher, RegData regDatum) {
"""
Hashes file and compares with the old hash. If hashes are different,
return true; false otherwise
"""
String urlExternalForm = regDatum.getURLExternalForm();
Boolean modified = mUrlExternalForm2Modified.get(urlExternalForm);... | java | private boolean hasHashChanged(Hasher hasher, RegData regDatum) {
String urlExternalForm = regDatum.getURLExternalForm();
Boolean modified = mUrlExternalForm2Modified.get(urlExternalForm);
if (modified != null) {
return modified;
}
// Check hash
String newHash... | [
"private",
"boolean",
"hasHashChanged",
"(",
"Hasher",
"hasher",
",",
"RegData",
"regDatum",
")",
"{",
"String",
"urlExternalForm",
"=",
"regDatum",
".",
"getURLExternalForm",
"(",
")",
";",
"Boolean",
"modified",
"=",
"mUrlExternalForm2Modified",
".",
"get",
"(",... | Hashes file and compares with the old hash. If hashes are different,
return true; false otherwise | [
"Hashes",
"file",
"and",
"compares",
"with",
"the",
"old",
"hash",
".",
"If",
"hashes",
"are",
"different",
"return",
"true",
";",
"false",
"otherwise"
] | train | https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/data/DependencyAnalyzer.java#L307-L318 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.forEachColumnInContentValue | static void forEachColumnInContentValue(MethodSpec.Builder methodBuilder, final SQLiteModelMethod method, String columnSetString, boolean generateColumnNameCheck, OnColumnListener listener) {
"""
<p>
Generate column check
</p>
.
@param methodBuilder
the method builder
@param method
the method
@param colu... | java | static void forEachColumnInContentValue(MethodSpec.Builder methodBuilder, final SQLiteModelMethod method, String columnSetString, boolean generateColumnNameCheck, OnColumnListener listener) {
methodBuilder.beginControlFlow("for (String columnName:$L)", columnSetString);
if (generateColumnNameCheck) {
methodBuild... | [
"static",
"void",
"forEachColumnInContentValue",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"final",
"SQLiteModelMethod",
"method",
",",
"String",
"columnSetString",
",",
"boolean",
"generateColumnNameCheck",
",",
"OnColumnListener",
"listener",
")",
"{",
... | <p>
Generate column check
</p>
.
@param methodBuilder
the method builder
@param method
the method
@param columnSetString
the column set string
@param generateColumnNameCheck
the generate column name check
@param listener
the listener | [
"<p",
">",
"Generate",
"column",
"check",
"<",
"/",
"p",
">",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L109-L120 |
bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlDataWriterDAO.java | CqlDataWriterDAO.blockDeleteStatement | private Statement blockDeleteStatement(BlockedDeltaTableDDL tableDDL, ByteBuffer rowKey, UUID changeId, int block, ConsistencyLevel consistencyLevel) {
"""
This method returns a delete statement for a single block, rather than the delta as whole. In order to delete an
entire delta using this method, it should be ... | java | private Statement blockDeleteStatement(BlockedDeltaTableDDL tableDDL, ByteBuffer rowKey, UUID changeId, int block, ConsistencyLevel consistencyLevel) {
return QueryBuilder.delete()
.from(tableDDL.getTableMetadata())
.where(eq(tableDDL.getRowKeyColumnName(), rowKey))
... | [
"private",
"Statement",
"blockDeleteStatement",
"(",
"BlockedDeltaTableDDL",
"tableDDL",
",",
"ByteBuffer",
"rowKey",
",",
"UUID",
"changeId",
",",
"int",
"block",
",",
"ConsistencyLevel",
"consistencyLevel",
")",
"{",
"return",
"QueryBuilder",
".",
"delete",
"(",
"... | This method returns a delete statement for a single block, rather than the delta as whole. In order to delete an
entire delta using this method, it should be called once for each block. In cases in which there are relatively
few blocks in a delta, this method can be more efficient than {@link #deleteStatement(TableDDL,... | [
"This",
"method",
"returns",
"a",
"delete",
"statement",
"for",
"a",
"single",
"block",
"rather",
"than",
"the",
"delta",
"as",
"whole",
".",
"In",
"order",
"to",
"delete",
"an",
"entire",
"delta",
"using",
"this",
"method",
"it",
"should",
"be",
"called",... | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlDataWriterDAO.java#L211-L218 |
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.beginCreateOrUpdate | public SnapshotInner beginCreateOrUpdate(String resourceGroupName, String snapshotName, SnapshotInner snapshot) {
"""
Creates or updates 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 s... | java | public SnapshotInner beginCreateOrUpdate(String resourceGroupName, String snapshotName, SnapshotInner snapshot) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot).toBlocking().single().body();
} | [
"public",
"SnapshotInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"snapshotName",
",",
"SnapshotInner",
"snapshot",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"snapshotName",
",",
"sna... | Creates or updates 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 sn... | [
"Creates",
"or",
"updates",
"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#L221-L223 |
google/gson | gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java | ISO8601Utils.padInt | private static void padInt(StringBuilder buffer, int value, int length) {
"""
Zero pad a number to a specified length
@param buffer buffer to use for padding
@param value the integer value to pad if necessary.
@param length the length of the string we should zero pad
"""
String strValue = Integer.... | java | private static void padInt(StringBuilder buffer, int value, int length) {
String strValue = Integer.toString(value);
for (int i = length - strValue.length(); i > 0; i--) {
buffer.append('0');
}
buffer.append(strValue);
} | [
"private",
"static",
"void",
"padInt",
"(",
"StringBuilder",
"buffer",
",",
"int",
"value",
",",
"int",
"length",
")",
"{",
"String",
"strValue",
"=",
"Integer",
".",
"toString",
"(",
"value",
")",
";",
"for",
"(",
"int",
"i",
"=",
"length",
"-",
"strV... | Zero pad a number to a specified length
@param buffer buffer to use for padding
@param value the integer value to pad if necessary.
@param length the length of the string we should zero pad | [
"Zero",
"pad",
"a",
"number",
"to",
"a",
"specified",
"length"
] | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java#L333-L339 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Setter.java | Setter.setTimePicker | public void setTimePicker(final TimePicker timePicker, final int hour, final int minute) {
"""
Sets the time in a given {@link TimePicker}.
@param timePicker the {@code TimePicker} object.
@param hour the hour e.g. 15
@param minute the minute e.g. 30
"""
if(timePicker != null){
Activity activity = ac... | java | public void setTimePicker(final TimePicker timePicker, final int hour, final int minute) {
if(timePicker != null){
Activity activity = activityUtils.getCurrentActivity(false);
if(activity != null){
activity.runOnUiThread(new Runnable()
{
public void run()
{
try{
timePicker.setCurr... | [
"public",
"void",
"setTimePicker",
"(",
"final",
"TimePicker",
"timePicker",
",",
"final",
"int",
"hour",
",",
"final",
"int",
"minute",
")",
"{",
"if",
"(",
"timePicker",
"!=",
"null",
")",
"{",
"Activity",
"activity",
"=",
"activityUtils",
".",
"getCurrent... | Sets the time in a given {@link TimePicker}.
@param timePicker the {@code TimePicker} object.
@param hour the hour e.g. 15
@param minute the minute e.g. 30 | [
"Sets",
"the",
"time",
"in",
"a",
"given",
"{",
"@link",
"TimePicker",
"}",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Setter.java#L80-L96 |
Azure/azure-sdk-for-java | policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java | PolicyDefinitionsInner.createOrUpdateAtManagementGroupAsync | public Observable<PolicyDefinitionInner> createOrUpdateAtManagementGroupAsync(String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters) {
"""
Creates or updates a policy definition at management group level.
@param policyDefinitionName The name of the policy definition to create.
... | java | public Observable<PolicyDefinitionInner> createOrUpdateAtManagementGroupAsync(String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters) {
return createOrUpdateAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId, parameters).map(new Func1<ServiceRespon... | [
"public",
"Observable",
"<",
"PolicyDefinitionInner",
">",
"createOrUpdateAtManagementGroupAsync",
"(",
"String",
"policyDefinitionName",
",",
"String",
"managementGroupId",
",",
"PolicyDefinitionInner",
"parameters",
")",
"{",
"return",
"createOrUpdateAtManagementGroupWithServic... | Creates or updates a policy definition at management group level.
@param policyDefinitionName The name of the policy definition to create.
@param managementGroupId The ID of the management group.
@param parameters The policy definition properties.
@throws IllegalArgumentException thrown if parameters fail the validati... | [
"Creates",
"or",
"updates",
"a",
"policy",
"definition",
"at",
"management",
"group",
"level",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java#L477-L484 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java | ServiceHandler.getClusterInfo | @Override
public ClusterSummary getClusterInfo() throws TException {
"""
get cluster's summary, it will contain SupervisorSummary and TopologySummary
@return ClusterSummary
"""
long start = System.nanoTime();
try {
StormClusterState stormClusterState = data.getStormClusterSta... | java | @Override
public ClusterSummary getClusterInfo() throws TException {
long start = System.nanoTime();
try {
StormClusterState stormClusterState = data.getStormClusterState();
Map<String, Assignment> assignments = new HashMap<>();
// get TopologySummary
... | [
"@",
"Override",
"public",
"ClusterSummary",
"getClusterInfo",
"(",
")",
"throws",
"TException",
"{",
"long",
"start",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"try",
"{",
"StormClusterState",
"stormClusterState",
"=",
"data",
".",
"getStormClusterState",
... | get cluster's summary, it will contain SupervisorSummary and TopologySummary
@return ClusterSummary | [
"get",
"cluster",
"s",
"summary",
"it",
"will",
"contain",
"SupervisorSummary",
"and",
"TopologySummary"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/nimbus/ServiceHandler.java#L951-L981 |
astrapi69/jaulp-wicket | jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/resource/ResourceModelFactory.java | ResourceModelFactory.newResourceModel | public static IModel<String> newResourceModel(final String resourceKey,
final Component component, final IModel<?> model, final String defaultValue,
final Object... parameters) {
"""
Factory method to create a new {@link StringResourceModel} from the given arguments.
@param resourceKey
the resource key
@p... | java | public static IModel<String> newResourceModel(final String resourceKey,
final Component component, final IModel<?> model, final String defaultValue,
final Object... parameters)
{
if ((parameters != null) && (parameters.length > 0))
{
for (int i = 0; i < parameters.length; i++)
{
if ((parameters[i] !=... | [
"public",
"static",
"IModel",
"<",
"String",
">",
"newResourceModel",
"(",
"final",
"String",
"resourceKey",
",",
"final",
"Component",
"component",
",",
"final",
"IModel",
"<",
"?",
">",
"model",
",",
"final",
"String",
"defaultValue",
",",
"final",
"Object",... | Factory method to create a new {@link StringResourceModel} from the given arguments.
@param resourceKey
the resource key
@param component
the component
@param model
the model
@param defaultValue
the default value
@param parameters
the parameters
@return a new {@link StringResourceModel} as an {@link IModel} | [
"Factory",
"method",
"to",
"create",
"a",
"new",
"{",
"@link",
"StringResourceModel",
"}",
"from",
"the",
"given",
"arguments",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/resource/ResourceModelFactory.java#L167-L185 |
haifengl/smile | core/src/main/java/smile/classification/NeuralNetwork.java | NeuralNetwork.backpropagate | private void backpropagate(Layer upper, Layer lower) {
"""
Propagates the errors back from a upper layer to the next lower layer.
@param upper the lower layer where errors are from.
@param lower the upper layer where errors are propagated back to.
"""
for (int i = 0; i <= lower.units; i++) {
... | java | private void backpropagate(Layer upper, Layer lower) {
for (int i = 0; i <= lower.units; i++) {
double out = lower.output[i];
double err = 0;
for (int j = 0; j < upper.units; j++) {
err += upper.weight[j][i] * upper.error[j];
}
lower.er... | [
"private",
"void",
"backpropagate",
"(",
"Layer",
"upper",
",",
"Layer",
"lower",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<=",
"lower",
".",
"units",
";",
"i",
"++",
")",
"{",
"double",
"out",
"=",
"lower",
".",
"output",
"[",
"i",... | Propagates the errors back from a upper layer to the next lower layer.
@param upper the lower layer where errors are from.
@param lower the upper layer where errors are propagated back to. | [
"Propagates",
"the",
"errors",
"back",
"from",
"a",
"upper",
"layer",
"to",
"the",
"next",
"lower",
"layer",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/classification/NeuralNetwork.java#L738-L747 |
jenkinsci/jenkins | core/src/main/java/jenkins/model/Jenkins.java | Jenkins.doSecured | public void doSecured( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
"""
Checks if the user was successfully authenticated.
@see BasicAuthenticationFilter
"""
// TODO fire something in SecurityListener? (seems to be used only for REST calls when LegacySecurityRealm... | java | public void doSecured( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
// TODO fire something in SecurityListener? (seems to be used only for REST calls when LegacySecurityRealm is active)
if(req.getUserPrincipal()==null) {
// authentication must have failed... | [
"public",
"void",
"doSecured",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"// TODO fire something in SecurityListener? (seems to be used only for REST calls when LegacySecurityRealm is active)",
"if",
"("... | Checks if the user was successfully authenticated.
@see BasicAuthenticationFilter | [
"Checks",
"if",
"the",
"user",
"was",
"successfully",
"authenticated",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L3976-L3992 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/ClassUtil.java | ClassUtil.getClassPath | public static String getClassPath(Class clazz) {
"""
Returns the classpath resource(directory or jar) from which
specified class is loaded.
@param clazz class
@return resource from which the class is loaded
"""
CodeSource codeSource = clazz.getProtectionDomain().getCodeSource();
if(codeSou... | java | public static String getClassPath(Class clazz){
CodeSource codeSource = clazz.getProtectionDomain().getCodeSource();
if(codeSource!=null)
return URLUtil.toSystemID(codeSource.getLocation());
else{
URL url = clazz.getResource(clazz.getSimpleName() + ".class");
... | [
"public",
"static",
"String",
"getClassPath",
"(",
"Class",
"clazz",
")",
"{",
"CodeSource",
"codeSource",
"=",
"clazz",
".",
"getProtectionDomain",
"(",
")",
".",
"getCodeSource",
"(",
")",
";",
"if",
"(",
"codeSource",
"!=",
"null",
")",
"return",
"URLUtil... | Returns the classpath resource(directory or jar) from which
specified class is loaded.
@param clazz class
@return resource from which the class is loaded | [
"Returns",
"the",
"classpath",
"resource",
"(",
"directory",
"or",
"jar",
")",
"from",
"which",
"specified",
"class",
"is",
"loaded",
"."
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/ClassUtil.java#L38-L58 |
GeneralElectric/snowizard | snowizard-client/src/main/java/com/ge/snowizard/client/SnowizardClient.java | SnowizardClient.executeRequest | @Nullable
public SnowizardResponse executeRequest(final String host, final int count)
throws IOException {
"""
Execute a request to the Snowizard service URL
@param host
Host:Port pair to connect to
@param count
Number of IDs to generate
@return SnowizardResponse
@throws IOException
Error ... | java | @Nullable
public SnowizardResponse executeRequest(final String host, final int count)
throws IOException {
final String uri = String.format("http://%s/?count=%d", host, count);
final HttpGet request = new HttpGet(uri);
request.addHeader(HttpHeaders.ACCEPT, ProtocolBufferMediaType... | [
"@",
"Nullable",
"public",
"SnowizardResponse",
"executeRequest",
"(",
"final",
"String",
"host",
",",
"final",
"int",
"count",
")",
"throws",
"IOException",
"{",
"final",
"String",
"uri",
"=",
"String",
".",
"format",
"(",
"\"http://%s/?count=%d\"",
",",
"host"... | Execute a request to the Snowizard service URL
@param host
Host:Port pair to connect to
@param count
Number of IDs to generate
@return SnowizardResponse
@throws IOException
Error in communicating with Snowizard | [
"Execute",
"a",
"request",
"to",
"the",
"Snowizard",
"service",
"URL"
] | train | https://github.com/GeneralElectric/snowizard/blob/307fdf17892275a56bb666aa1f577ca7cab327c6/snowizard-client/src/main/java/com/ge/snowizard/client/SnowizardClient.java#L141-L166 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java | ComputeNodeOperations.rebootComputeNode | public void rebootComputeNode(String poolId, String nodeId, ComputeNodeRebootOption nodeRebootOption) throws BatchErrorException, IOException {
"""
Reboots the specified compute node.
<p>You can reboot a compute node only when it is in the {@link com.microsoft.azure.batch.protocol.models.ComputeNodeState#IDLE Idl... | java | public void rebootComputeNode(String poolId, String nodeId, ComputeNodeRebootOption nodeRebootOption) throws BatchErrorException, IOException {
rebootComputeNode(poolId, nodeId, nodeRebootOption, null);
} | [
"public",
"void",
"rebootComputeNode",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"ComputeNodeRebootOption",
"nodeRebootOption",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"rebootComputeNode",
"(",
"poolId",
",",
"nodeId",
",",
"nodeReb... | Reboots the specified compute node.
<p>You can reboot a compute node only when it is in the {@link com.microsoft.azure.batch.protocol.models.ComputeNodeState#IDLE Idle} or {@link com.microsoft.azure.batch.protocol.models.ComputeNodeState#RUNNING Running} state.</p>
@param poolId The ID of the pool that contains the co... | [
"Reboots",
"the",
"specified",
"compute",
"node",
".",
"<p",
">",
"You",
"can",
"reboot",
"a",
"compute",
"node",
"only",
"when",
"it",
"is",
"in",
"the",
"{",
"@link",
"com",
".",
"microsoft",
".",
"azure",
".",
"batch",
".",
"protocol",
".",
"models"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L291-L293 |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/MyNumberUtils.java | MyNumberUtils.randomLongBetween | public static long randomLongBetween(long min, long max) {
"""
Returns a long between interval
@param min Minimum value
@param max Maximum value
@return long number
"""
Random rand = new Random();
return min + (long) (rand.nextDouble() * (max - min));
} | java | public static long randomLongBetween(long min, long max) {
Random rand = new Random();
return min + (long) (rand.nextDouble() * (max - min));
} | [
"public",
"static",
"long",
"randomLongBetween",
"(",
"long",
"min",
",",
"long",
"max",
")",
"{",
"Random",
"rand",
"=",
"new",
"Random",
"(",
")",
";",
"return",
"min",
"+",
"(",
"long",
")",
"(",
"rand",
".",
"nextDouble",
"(",
")",
"*",
"(",
"m... | Returns a long between interval
@param min Minimum value
@param max Maximum value
@return long number | [
"Returns",
"a",
"long",
"between",
"interval"
] | train | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/MyNumberUtils.java#L46-L49 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/OpenShiftManagedClustersInner.java | OpenShiftManagedClustersInner.updateTags | public OpenShiftManagedClusterInner updateTags(String resourceGroupName, String resourceName) {
"""
Updates tags on an OpenShift managed cluster.
Updates an OpenShift managed cluster with the specified tags.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the OpenShift... | java | public OpenShiftManagedClusterInner updateTags(String resourceGroupName, String resourceName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body();
} | [
"public",
"OpenShiftManagedClusterInner",
"updateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",
"toBlocking",
"(",
")",
".",
"la... | Updates tags on an OpenShift managed cluster.
Updates an OpenShift managed cluster with the specified tags.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the OpenShift managed cluster resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ... | [
"Updates",
"tags",
"on",
"an",
"OpenShift",
"managed",
"cluster",
".",
"Updates",
"an",
"OpenShift",
"managed",
"cluster",
"with",
"the",
"specified",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/OpenShiftManagedClustersInner.java#L619-L621 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/util/BitMaskUtil.java | BitMaskUtil.isBitOn | public static boolean isBitOn(int value, int bitNumber) {
"""
Check if the bit is set to '1'
@param value
integer to check bit
@param number
of bit to check (right first bit starting at 1)
"""
if (bitNumber <= 0 || bitNumber > 8) {
throw new IllegalArgumentException("Only bits 1 through 8 are s... | java | public static boolean isBitOn(int value, int bitNumber) {
if (bitNumber <= 0 || bitNumber > 8) {
throw new IllegalArgumentException("Only bits 1 through 8 are supported");
}
return ((value & MASKS[bitNumber - 1]) == MASKS[bitNumber - 1]);
} | [
"public",
"static",
"boolean",
"isBitOn",
"(",
"int",
"value",
",",
"int",
"bitNumber",
")",
"{",
"if",
"(",
"bitNumber",
"<=",
"0",
"||",
"bitNumber",
">",
"8",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Only bits 1 through 8 are supported\""... | Check if the bit is set to '1'
@param value
integer to check bit
@param number
of bit to check (right first bit starting at 1) | [
"Check",
"if",
"the",
"bit",
"is",
"set",
"to",
"1"
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/util/BitMaskUtil.java#L81-L87 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.queryTransactionByID | public TransactionInfo queryTransactionByID(Peer peer, String txID, User userContext) throws ProposalException, InvalidArgumentException {
"""
Query for a Fabric Transaction given its transactionID
@param peer the peer to send the request to
@param txID the ID of the transaction
@param userConte... | java | public TransactionInfo queryTransactionByID(Peer peer, String txID, User userContext) throws ProposalException, InvalidArgumentException {
return queryTransactionByID(Collections.singleton(peer), txID, userContext);
} | [
"public",
"TransactionInfo",
"queryTransactionByID",
"(",
"Peer",
"peer",
",",
"String",
"txID",
",",
"User",
"userContext",
")",
"throws",
"ProposalException",
",",
"InvalidArgumentException",
"{",
"return",
"queryTransactionByID",
"(",
"Collections",
".",
"singleton",... | Query for a Fabric Transaction given its transactionID
@param peer the peer to send the request to
@param txID the ID of the transaction
@param userContext the user context
@return a {@link TransactionInfo}
@throws ProposalException
@throws InvalidArgumentException | [
"Query",
"for",
"a",
"Fabric",
"Transaction",
"given",
"its",
"transactionID"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L3210-L3212 |
jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/Bitstream.java | Bitstream.syncHeader | int syncHeader(byte syncmode) throws BitstreamException {
"""
Get next 32 bits from bitstream.
They are stored in the headerstring.
syncmod allows Synchro flag ID
The returned value is False at the end of stream.
"""
boolean sync;
int headerstring;
// read additional 2 bytes
int bytesRead = readByte... | java | int syncHeader(byte syncmode) throws BitstreamException
{
boolean sync;
int headerstring;
// read additional 2 bytes
int bytesRead = readBytes(syncbuf, 0, 3);
if (bytesRead!=3) throw newBitstreamException(STREAM_EOF, null);
headerstring = ((syncbuf[0] << 16) & 0x00FF0000) | ((syncbuf[1] << 8) & 0x0000FF0... | [
"int",
"syncHeader",
"(",
"byte",
"syncmode",
")",
"throws",
"BitstreamException",
"{",
"boolean",
"sync",
";",
"int",
"headerstring",
";",
"// read additional 2 bytes",
"int",
"bytesRead",
"=",
"readBytes",
"(",
"syncbuf",
",",
"0",
",",
"3",
")",
";",
"if",
... | Get next 32 bits from bitstream.
They are stored in the headerstring.
syncmod allows Synchro flag ID
The returned value is False at the end of stream. | [
"Get",
"next",
"32",
"bits",
"from",
"bitstream",
".",
"They",
"are",
"stored",
"in",
"the",
"headerstring",
".",
"syncmod",
"allows",
"Synchro",
"flag",
"ID",
"The",
"returned",
"value",
"is",
"False",
"at",
"the",
"end",
"of",
"stream",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/Bitstream.java#L430-L458 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/clhm/ConcurrentLinkedHashMap.java | ConcurrentLinkedHashMap.makeDead | @GuardedBy("evictionLock")
void makeDead(Node<K, V> node) {
"""
Atomically transitions the node to the <tt>dead</tt> state and decrements
the <tt>weightedSize</tt>.
@param node the entry in the page replacement policy
"""
for (;;) {
WeightedValue<V> current = node.get();
... | java | @GuardedBy("evictionLock")
void makeDead(Node<K, V> node) {
for (;;) {
WeightedValue<V> current = node.get();
WeightedValue<V> dead = new WeightedValue<V>(current.value, 0);
if (node.compareAndSet(current, dead)) {
weightedSize.lazySet(weightedSize.get() -... | [
"@",
"GuardedBy",
"(",
"\"evictionLock\"",
")",
"void",
"makeDead",
"(",
"Node",
"<",
"K",
",",
"V",
">",
"node",
")",
"{",
"for",
"(",
";",
";",
")",
"{",
"WeightedValue",
"<",
"V",
">",
"current",
"=",
"node",
".",
"get",
"(",
")",
";",
"Weight... | Atomically transitions the node to the <tt>dead</tt> state and decrements
the <tt>weightedSize</tt>.
@param node the entry in the page replacement policy | [
"Atomically",
"transitions",
"the",
"node",
"to",
"the",
"<tt",
">",
"dead<",
"/",
"tt",
">",
"state",
"and",
"decrements",
"the",
"<tt",
">",
"weightedSize<",
"/",
"tt",
">",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/clhm/ConcurrentLinkedHashMap.java#L517-L527 |
Waikato/jclasslocator | src/main/java/nz/ac/waikato/cms/locator/ClassLocator.java | ClassLocator.hasInterface | public static boolean hasInterface(String intf, String cls) {
"""
Checks whether the given class implements the given interface.
@param intf the interface to look for in the given class
@param cls the class to check for the interface
@return TRUE if the class contains the interface
"""... | java | public static boolean hasInterface(String intf, String cls) {
String key;
key = intf + "-" + cls;
if (m_CheckInterface.containsKey(key))
return m_CheckInterface.get(key);
try {
return hasInterface(Class.forName(intf), Class.forName(cls));
}
catch (Throwable t) {
return false;... | [
"public",
"static",
"boolean",
"hasInterface",
"(",
"String",
"intf",
",",
"String",
"cls",
")",
"{",
"String",
"key",
";",
"key",
"=",
"intf",
"+",
"\"-\"",
"+",
"cls",
";",
"if",
"(",
"m_CheckInterface",
".",
"containsKey",
"(",
"key",
")",
")",
"ret... | Checks whether the given class implements the given interface.
@param intf the interface to look for in the given class
@param cls the class to check for the interface
@return TRUE if the class contains the interface | [
"Checks",
"whether",
"the",
"given",
"class",
"implements",
"the",
"given",
"interface",
"."
] | train | https://github.com/Waikato/jclasslocator/blob/c899072fff607a56ee7f8c2d01fbeb15157ad144/src/main/java/nz/ac/waikato/cms/locator/ClassLocator.java#L645-L658 |
Alluxio/alluxio | integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java | SparkIntegrationChecker.runSparkJob | private Status runSparkJob(JavaSparkContext sc, PrintWriter reportWriter) {
"""
Spark job to check whether Spark executors can recognize Alluxio filesystem.
@param sc current JavaSparkContext
@param reportWriter save user-facing messages to a generated file
@return Spark job result
"""
// Generate a l... | java | private Status runSparkJob(JavaSparkContext sc, PrintWriter reportWriter) {
// Generate a list of integer for testing
List<Integer> nums = IntStream.rangeClosed(1, mPartitions).boxed().collect(Collectors.toList());
JavaRDD<Integer> dataSet = sc.parallelize(nums, mPartitions);
// Run a Spark job to che... | [
"private",
"Status",
"runSparkJob",
"(",
"JavaSparkContext",
"sc",
",",
"PrintWriter",
"reportWriter",
")",
"{",
"// Generate a list of integer for testing",
"List",
"<",
"Integer",
">",
"nums",
"=",
"IntStream",
".",
"rangeClosed",
"(",
"1",
",",
"mPartitions",
")"... | Spark job to check whether Spark executors can recognize Alluxio filesystem.
@param sc current JavaSparkContext
@param reportWriter save user-facing messages to a generated file
@return Spark job result | [
"Spark",
"job",
"to",
"check",
"whether",
"Spark",
"executors",
"can",
"recognize",
"Alluxio",
"filesystem",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java#L110-L136 |
Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/KDTree.java | KDTree.refineOwners | protected int[] refineOwners(KDTreeNode node, Instances centers,
int[] candidates) throws Exception {
"""
Refines the ownerlist.
@param node The current tree node.
@param centers all centers
@param candidates the indexes of those centers that are candidates.
@return list of owners
@throws Exception If... | java | protected int[] refineOwners(KDTreeNode node, Instances centers,
int[] candidates) throws Exception {
int[] owners = new int[candidates.length];
double minDistance = Double.POSITIVE_INFINITY;
int ownerIndex = -1;
Instance owner;
int numCand = candidates.length;
double[] distance = new dou... | [
"protected",
"int",
"[",
"]",
"refineOwners",
"(",
"KDTreeNode",
"node",
",",
"Instances",
"centers",
",",
"int",
"[",
"]",
"candidates",
")",
"throws",
"Exception",
"{",
"int",
"[",
"]",
"owners",
"=",
"new",
"int",
"[",
"candidates",
".",
"length",
"]"... | Refines the ownerlist.
@param node The current tree node.
@param centers all centers
@param candidates the indexes of those centers that are candidates.
@return list of owners
@throws Exception If some problem occurs in refining. | [
"Refines",
"the",
"ownerlist",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/KDTree.java#L755-L807 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/TransactionImpl.java | TransactionImpl.setCascadingDelete | public void setCascadingDelete(Class target, String referenceField, boolean doCascade) {
"""
Allows to change the <em>cascading delete</em> behavior of the specified reference
of the target class while this transaction is in use.
@param target The class to change cascading delete behavior of the references.
@... | java | public void setCascadingDelete(Class target, String referenceField, boolean doCascade)
{
ClassDescriptor cld = getBroker().getClassDescriptor(target);
ObjectReferenceDescriptor ord = cld.getObjectReferenceDescriptorByName(referenceField);
if(ord == null)
{
ord = cld... | [
"public",
"void",
"setCascadingDelete",
"(",
"Class",
"target",
",",
"String",
"referenceField",
",",
"boolean",
"doCascade",
")",
"{",
"ClassDescriptor",
"cld",
"=",
"getBroker",
"(",
")",
".",
"getClassDescriptor",
"(",
"target",
")",
";",
"ObjectReferenceDescri... | Allows to change the <em>cascading delete</em> behavior of the specified reference
of the target class while this transaction is in use.
@param target The class to change cascading delete behavior of the references.
@param referenceField The field name of the 1:1, 1:n or 1:n reference.
@param doCascade If <em>true</em... | [
"Allows",
"to",
"change",
"the",
"<em",
">",
"cascading",
"delete<",
"/",
"em",
">",
"behavior",
"of",
"the",
"specified",
"reference",
"of",
"the",
"target",
"class",
"while",
"this",
"transaction",
"is",
"in",
"use",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L1395-L1409 |
upwork/java-upwork | src/com/Upwork/api/Routers/Hr/Freelancers/Offers.java | Offers.actions | public JSONObject actions(String reference, HashMap<String, String> params) throws JSONException {
"""
Run a specific action
@param reference Offer reference
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject}
"""
return oClient.post("/offers/v1/contrac... | java | public JSONObject actions(String reference, HashMap<String, String> params) throws JSONException {
return oClient.post("/offers/v1/contractors/offers/" + reference, params);
} | [
"public",
"JSONObject",
"actions",
"(",
"String",
"reference",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"post",
"(",
"\"/offers/v1/contractors/offers/\"",
"+",
"reference",
",",
"... | Run a specific action
@param reference Offer reference
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Run",
"a",
"specific",
"action"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Hr/Freelancers/Offers.java#L76-L78 |
udoprog/ffwd-client-java | src/main/java/com/google/protobuf250/CodedOutputStream.java | CodedOutputStream.writeSFixed32 | public void writeSFixed32(final int fieldNumber, final int value)
throws IOException {
"""
Write an {@code sfixed32} field, including tag, to the stream.
"""
writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED32);
writeSFixed32NoTag(value);
} | java | public void writeSFixed32(final int fieldNumber, final int value)
throws IOException {
writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED32);
writeSFixed32NoTag(value);
} | [
"public",
"void",
"writeSFixed32",
"(",
"final",
"int",
"fieldNumber",
",",
"final",
"int",
"value",
")",
"throws",
"IOException",
"{",
"writeTag",
"(",
"fieldNumber",
",",
"WireFormat",
".",
"WIRETYPE_FIXED32",
")",
";",
"writeSFixed32NoTag",
"(",
"value",
")",... | Write an {@code sfixed32} field, including tag, to the stream. | [
"Write",
"an",
"{"
] | train | https://github.com/udoprog/ffwd-client-java/blob/b4161d2b138e3edb8fa9420cc3cc653d5764cf5b/src/main/java/com/google/protobuf250/CodedOutputStream.java#L250-L254 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadLocalRandom.java | ThreadLocalRandom.internalNextInt | final int internalNextInt(int origin, int bound) {
"""
The form of nextInt used by IntStream Spliterators.
Exactly the same as long version, except for types.
@param origin the least value, unless greater than bound
@param bound the upper bound (exclusive), must not equal origin
@return a pseudorandom value
... | java | final int internalNextInt(int origin, int bound) {
int r = mix32(nextSeed());
if (origin < bound) {
int n = bound - origin, m = n - 1;
if ((n & m) == 0)
r = (r & m) + origin;
else if (n > 0) {
for (int u = r >>> 1;
... | [
"final",
"int",
"internalNextInt",
"(",
"int",
"origin",
",",
"int",
"bound",
")",
"{",
"int",
"r",
"=",
"mix32",
"(",
"nextSeed",
"(",
")",
")",
";",
"if",
"(",
"origin",
"<",
"bound",
")",
"{",
"int",
"n",
"=",
"bound",
"-",
"origin",
",",
"m",... | The form of nextInt used by IntStream Spliterators.
Exactly the same as long version, except for types.
@param origin the least value, unless greater than bound
@param bound the upper bound (exclusive), must not equal origin
@return a pseudorandom value | [
"The",
"form",
"of",
"nextInt",
"used",
"by",
"IntStream",
"Spliterators",
".",
"Exactly",
"the",
"same",
"as",
"long",
"version",
"except",
"for",
"types",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadLocalRandom.java#L239-L258 |
Dempsy/dempsy | dempsy-framework.api/src/main/java/net/dempsy/lifecycle/annotation/internal/MessageUtils.java | MessageUtils.unwindMessages | public static void unwindMessages(final Object message, final List<Object> messages) {
"""
Return values from invoke's may be Iterables in which case there are many messages to be sent out.
"""
if (message instanceof Iterable) {
@SuppressWarnings("rawtypes")
final Iterator it = ... | java | public static void unwindMessages(final Object message, final List<Object> messages) {
if (message instanceof Iterable) {
@SuppressWarnings("rawtypes")
final Iterator it = ((Iterable) message).iterator();
while (it.hasNext())
unwindMessages(it.next(), messages... | [
"public",
"static",
"void",
"unwindMessages",
"(",
"final",
"Object",
"message",
",",
"final",
"List",
"<",
"Object",
">",
"messages",
")",
"{",
"if",
"(",
"message",
"instanceof",
"Iterable",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"fin... | Return values from invoke's may be Iterables in which case there are many messages to be sent out. | [
"Return",
"values",
"from",
"invoke",
"s",
"may",
"be",
"Iterables",
"in",
"which",
"case",
"there",
"are",
"many",
"messages",
"to",
"be",
"sent",
"out",
"."
] | train | https://github.com/Dempsy/dempsy/blob/cd3415b51b6787a6a9d9589b15f00ce674b6f113/dempsy-framework.api/src/main/java/net/dempsy/lifecycle/annotation/internal/MessageUtils.java#L25-L33 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/primitives/DoubleUtils.java | DoubleUtils.argMin | public static int argMin(final double[] x, final int startInclusive, final int endExclusive) {
"""
Returns the index of the first minimal element of the array within the specified bounds. That
is, if there is a unique minimum, its index is returned. If there are multiple values tied for
smallest, the index of th... | java | public static int argMin(final double[] x, final int startInclusive, final int endExclusive) {
checkArgument(endExclusive > startInclusive);
checkArgument(startInclusive >= 0);
checkArgument(endExclusive <= x.length);
double minValue = Double.MAX_VALUE;
int minIndex = 0;
for (int i = startInclu... | [
"public",
"static",
"int",
"argMin",
"(",
"final",
"double",
"[",
"]",
"x",
",",
"final",
"int",
"startInclusive",
",",
"final",
"int",
"endExclusive",
")",
"{",
"checkArgument",
"(",
"endExclusive",
">",
"startInclusive",
")",
";",
"checkArgument",
"(",
"st... | Returns the index of the first minimal element of the array within the specified bounds. That
is, if there is a unique minimum, its index is returned. If there are multiple values tied for
smallest, the index of the first is returned. If the supplied array is empty, an {@link
IllegalArgumentException} is thrown. | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"minimal",
"element",
"of",
"the",
"array",
"within",
"the",
"specified",
"bounds",
".",
"That",
"is",
"if",
"there",
"is",
"a",
"unique",
"minimum",
"its",
"index",
"is",
"returned",
".",
"If",
"there",
"... | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/primitives/DoubleUtils.java#L93-L108 |
metamx/java-util | src/main/java/com/metamx/common/parsers/JSONPathParser.java | JSONPathParser.parse | @Override
public Map<String, Object> parse(String input) {
"""
@param input JSON string. The root must be a JSON object, not an array.
e.g., {"valid": "true"} and {"valid":[1,2,3]} are supported
but [{"invalid": "true"}] and [1,2,3] are not.
@return A map of field names and values
"""
try {
Ma... | java | @Override
public Map<String, Object> parse(String input)
{
try {
Map<String, Object> map = new LinkedHashMap<>();
Map<String, Object> document = mapper.readValue(
input,
new TypeReference<Map<String, Object>>()
{
}
);
for (Map.Entry<String, Pair<Fi... | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"parse",
"(",
"String",
"input",
")",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"Map",
"<",
"String",
","... | @param input JSON string. The root must be a JSON object, not an array.
e.g., {"valid": "true"} and {"valid":[1,2,3]} are supported
but [{"invalid": "true"}] and [1,2,3] are not.
@return A map of field names and values | [
"@param",
"input",
"JSON",
"string",
".",
"The",
"root",
"must",
"be",
"a",
"JSON",
"object",
"not",
"an",
"array",
".",
"e",
".",
"g",
".",
"{",
"valid",
":",
"true",
"}",
"and",
"{",
"valid",
":",
"[",
"1",
"2",
"3",
"]",
"}",
"are",
"support... | train | https://github.com/metamx/java-util/blob/9d204043da1136e94fb2e2d63e3543a29bf54b4d/src/main/java/com/metamx/common/parsers/JSONPathParser.java#L92-L127 |
Pi4J/pi4j | pi4j-gpio-extension/src/main/java/com/pi4j/gpio/extension/base/DacGpioProviderBase.java | DacGpioProviderBase.setShutdownValue | public void setShutdownValue(Number value, Pin ... pin) {
"""
Set the shutdown/terminate value that the DAC should apply to the given GPIO pin
when the class is destroyed/terminated.
@param value the shutdown value to apply to the given pin(s)
@param pin analog output pin (vararg: one or more pins)
"""
... | java | public void setShutdownValue(Number value, Pin ... pin){
for(Pin p : pin){
shutdownValues[p.getAddress()] = value.doubleValue();
}
} | [
"public",
"void",
"setShutdownValue",
"(",
"Number",
"value",
",",
"Pin",
"...",
"pin",
")",
"{",
"for",
"(",
"Pin",
"p",
":",
"pin",
")",
"{",
"shutdownValues",
"[",
"p",
".",
"getAddress",
"(",
")",
"]",
"=",
"value",
".",
"doubleValue",
"(",
")",
... | Set the shutdown/terminate value that the DAC should apply to the given GPIO pin
when the class is destroyed/terminated.
@param value the shutdown value to apply to the given pin(s)
@param pin analog output pin (vararg: one or more pins) | [
"Set",
"the",
"shutdown",
"/",
"terminate",
"value",
"that",
"the",
"DAC",
"should",
"apply",
"to",
"the",
"given",
"GPIO",
"pin",
"when",
"the",
"class",
"is",
"destroyed",
"/",
"terminated",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-gpio-extension/src/main/java/com/pi4j/gpio/extension/base/DacGpioProviderBase.java#L150-L154 |
nikolavp/approval | approval-core/src/main/java/com/github/approval/reporters/Reporters.java | Reporters.fileLauncherWithoutInteraction | public static Reporter fileLauncherWithoutInteraction() {
"""
Same as {@link #fileLauncher} but doesn't do the swing interaction after it opens the file. This is mostly used to reuse the logic
of file launching without adding the burden for prompting the user after that.
@return a reporter that launches the fi... | java | public static Reporter fileLauncherWithoutInteraction() {
final String cmd = new CrossPlatformCommand<String>() {
@Override
protected String onWindows() {
return "cmd /C start";
}
@Override
protected String onMac() {
r... | [
"public",
"static",
"Reporter",
"fileLauncherWithoutInteraction",
"(",
")",
"{",
"final",
"String",
"cmd",
"=",
"new",
"CrossPlatformCommand",
"<",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"protected",
"String",
"onWindows",
"(",
")",
"{",
"return",
"\"c... | Same as {@link #fileLauncher} but doesn't do the swing interaction after it opens the file. This is mostly used to reuse the logic
of file launching without adding the burden for prompting the user after that.
@return a reporter that launches the file | [
"Same",
"as",
"{",
"@link",
"#fileLauncher",
"}",
"but",
"doesn",
"t",
"do",
"the",
"swing",
"interaction",
"after",
"it",
"opens",
"the",
"file",
".",
"This",
"is",
"mostly",
"used",
"to",
"reuse",
"the",
"logic",
"of",
"file",
"launching",
"without",
"... | train | https://github.com/nikolavp/approval/blob/5e32ecc3bc7f631e94a7049894fdd99a3aa5b1b8/approval-core/src/main/java/com/github/approval/reporters/Reporters.java#L113-L144 |
ralscha/extdirectspring | src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectResponseBuilder.java | ExtDirectResponseBuilder.addResultProperty | public ExtDirectResponseBuilder addResultProperty(String key, Object value) {
"""
Add additional property to the response.
@param key the key of the property
@param value the value of this property
@return this instance
"""
this.result.put(key, value);
return this;
} | java | public ExtDirectResponseBuilder addResultProperty(String key, Object value) {
this.result.put(key, value);
return this;
} | [
"public",
"ExtDirectResponseBuilder",
"addResultProperty",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"this",
".",
"result",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add additional property to the response.
@param key the key of the property
@param value the value of this property
@return this instance | [
"Add",
"additional",
"property",
"to",
"the",
"response",
"."
] | train | https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectResponseBuilder.java#L188-L191 |
cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/Mappings.java | Mappings.toArray | public int[][] toArray() {
"""
Mappings are lazily generated and best used in a loop. However if all
mappings are required this method can provide a fixed size array of
mappings.
<blockquote><pre>
IAtomContainer query = ...;
IAtomContainer target = ...;
Pattern pat = Pattern.findSubstructure(query);
... | java | public int[][] toArray() {
int[][] res = new int[14][];
int size = 0;
for (int[] map : this) {
if (size == res.length)
res = Arrays.copyOf(res, size + (size >> 1));
res[size++] = map.clone();
}
return Arrays.copyOf(res, size);
} | [
"public",
"int",
"[",
"]",
"[",
"]",
"toArray",
"(",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"res",
"=",
"new",
"int",
"[",
"14",
"]",
"[",
"",
"]",
";",
"int",
"size",
"=",
"0",
";",
"for",
"(",
"int",
"[",
"]",
"map",
":",
"this",
")",
"... | Mappings are lazily generated and best used in a loop. However if all
mappings are required this method can provide a fixed size array of
mappings.
<blockquote><pre>
IAtomContainer query = ...;
IAtomContainer target = ...;
Pattern pat = Pattern.findSubstructure(query);
// lazily iterator
for (int[] mapping : pat.m... | [
"Mappings",
"are",
"lazily",
"generated",
"and",
"best",
"used",
"in",
"a",
"loop",
".",
"However",
"if",
"all",
"mappings",
"are",
"required",
"this",
"method",
"can",
"provide",
"a",
"fixed",
"size",
"array",
"of",
"mappings",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/Mappings.java#L355-L364 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.saas_csp2_license_licenseName_GET | public OvhPrice saas_csp2_license_licenseName_GET(net.minidev.ovh.api.price.saas.csp2.OvhLicenseEnum licenseName) throws IOException {
"""
Get the monthly price for an Office 365 license
REST: GET /price/saas/csp2/license/{licenseName}
@param licenseName [required] License
"""
String qPath = "/price/saas... | java | public OvhPrice saas_csp2_license_licenseName_GET(net.minidev.ovh.api.price.saas.csp2.OvhLicenseEnum licenseName) throws IOException {
String qPath = "/price/saas/csp2/license/{licenseName}";
StringBuilder sb = path(qPath, licenseName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(res... | [
"public",
"OvhPrice",
"saas_csp2_license_licenseName_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"saas",
".",
"csp2",
".",
"OvhLicenseEnum",
"licenseName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/price/saas... | Get the monthly price for an Office 365 license
REST: GET /price/saas/csp2/license/{licenseName}
@param licenseName [required] License | [
"Get",
"the",
"monthly",
"price",
"for",
"an",
"Office",
"365",
"license"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L7256-L7261 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.verifyIPFlow | public VerificationIPFlowResultInner verifyIPFlow(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) {
"""
Verify IP flow from the specified VM to a location given the currently configured NSG rules.
@param resourceGroupName The name of the resource group.
@param netw... | java | public VerificationIPFlowResultInner verifyIPFlow(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) {
return verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body();
} | [
"public",
"VerificationIPFlowResultInner",
"verifyIPFlow",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"VerificationIPFlowParameters",
"parameters",
")",
"{",
"return",
"verifyIPFlowWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"net... | Verify IP flow from the specified VM to a location given the currently configured NSG rules.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param parameters Parameters that define the IP flow to be verified.
@throws IllegalArgumentException thrown i... | [
"Verify",
"IP",
"flow",
"from",
"the",
"specified",
"VM",
"to",
"a",
"location",
"given",
"the",
"currently",
"configured",
"NSG",
"rules",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L958-L960 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java | JBBPUtils.packInt | public static int packInt(final byte[] array, final JBBPIntCounter position, final int value) {
"""
Pack an integer value and save that into a byte array since defined
position.
@param array a byte array where to write the packed data, it must not be
null
@param position the position of the first byte of ... | java | public static int packInt(final byte[] array, final JBBPIntCounter position, final int value) {
if ((value & 0xFFFFFF80) == 0) {
array[position.getAndIncrement()] = (byte) value;
return 1;
} else if ((value & 0xFFFF0000) == 0) {
array[position.getAndIncrement()] = (byte) 0x80;
array[posi... | [
"public",
"static",
"int",
"packInt",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"JBBPIntCounter",
"position",
",",
"final",
"int",
"value",
")",
"{",
"if",
"(",
"(",
"value",
"&",
"0xFFFFFF80",
")",
"==",
"0",
")",
"{",
"array",
"[",
"po... | Pack an integer value and save that into a byte array since defined
position.
@param array a byte array where to write the packed data, it must not be
null
@param position the position of the first byte of the packed value, it must
not be null
@param value the value to be packed
@return number of bytes written i... | [
"Pack",
"an",
"integer",
"value",
"and",
"save",
"that",
"into",
"a",
"byte",
"array",
"since",
"defined",
"position",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java#L127-L143 |
codegist/crest | core/src/main/java/org/codegist/crest/CRestBuilder.java | CRestBuilder.deserializeJsonWith | public CRestBuilder deserializeJsonWith(Class<? extends Deserializer> deserializer, Map<String, Object> config) {
"""
<p>Overrides the default {@link org.codegist.crest.serializer.jackson.JacksonDeserializer} JSON deserializer with the given one</p>
<p>By default, <b>CRest</b> will use this deserializer for the f... | java | public CRestBuilder deserializeJsonWith(Class<? extends Deserializer> deserializer, Map<String, Object> config) {
this.jsonDeserializer = deserializer;
this.jsonDeserializerConfig.clear();
this.jsonDeserializerConfig.putAll(config);
return this;
} | [
"public",
"CRestBuilder",
"deserializeJsonWith",
"(",
"Class",
"<",
"?",
"extends",
"Deserializer",
">",
"deserializer",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"config",
")",
"{",
"this",
".",
"jsonDeserializer",
"=",
"deserializer",
";",
"this",
".",
... | <p>Overrides the default {@link org.codegist.crest.serializer.jackson.JacksonDeserializer} JSON deserializer with the given one</p>
<p>By default, <b>CRest</b> will use this deserializer for the following response Content-Type:</p>
<ul>
<li>application/json</li>
<li>application/javascript</li>
<li>text/javascript</li>
... | [
"<p",
">",
"Overrides",
"the",
"default",
"{"
] | train | https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/CRestBuilder.java#L795-L800 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/http/HttpHeaderMap.java | HttpHeaderMap.setIntHeader | public void setIntHeader (@Nonnull @Nonempty final String sName, final int nValue) {
"""
Set the passed header as a number.
@param sName
Header name. May neither be <code>null</code> nor empty.
@param nValue
The value to be set. May not be <code>null</code>.
"""
_setHeader (sName, Integer.toString (n... | java | public void setIntHeader (@Nonnull @Nonempty final String sName, final int nValue)
{
_setHeader (sName, Integer.toString (nValue));
} | [
"public",
"void",
"setIntHeader",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sName",
",",
"final",
"int",
"nValue",
")",
"{",
"_setHeader",
"(",
"sName",
",",
"Integer",
".",
"toString",
"(",
"nValue",
")",
")",
";",
"}"
] | Set the passed header as a number.
@param sName
Header name. May neither be <code>null</code> nor empty.
@param nValue
The value to be set. May not be <code>null</code>. | [
"Set",
"the",
"passed",
"header",
"as",
"a",
"number",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/http/HttpHeaderMap.java#L343-L346 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/datastyle/FloatStyle.java | FloatStyle.appendXMLAttributes | void appendXMLAttributes(final XMLUtil util, final Appendable appendable) throws IOException {
"""
Append number:decimal-places, number:min-integer-digits and number:grouping
@param util an XML util
@param appendable the appendable
@throws IOException if an I/O error occurs
"""
util.appendAttribute(append... | java | void appendXMLAttributes(final XMLUtil util, final Appendable appendable) throws IOException {
util.appendAttribute(appendable, "number:decimal-places",
this.decimalPlaces);
this.numberStyle.appendNumberAttribute(util, appendable);
} | [
"void",
"appendXMLAttributes",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"Appendable",
"appendable",
")",
"throws",
"IOException",
"{",
"util",
".",
"appendAttribute",
"(",
"appendable",
",",
"\"number:decimal-places\"",
",",
"this",
".",
"decimalPlaces",
")",
... | Append number:decimal-places, number:min-integer-digits and number:grouping
@param util an XML util
@param appendable the appendable
@throws IOException if an I/O error occurs | [
"Append",
"number",
":",
"decimal",
"-",
"places",
"number",
":",
"min",
"-",
"integer",
"-",
"digits",
"and",
"number",
":",
"grouping"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/datastyle/FloatStyle.java#L90-L94 |
awin/rabbiteasy | rabbiteasy-cdi/src/main/java/com/zanox/rabbiteasy/cdi/EventPublisher.java | EventPublisher.addEvent | public <T> void addEvent(Class<T> eventType, PublisherConfiguration configuration) {
"""
Adds events of the given type to the CDI events to which the event publisher listens in order to
publish them. The publisher configuration is used to decide where to and how to publish messages.
@param eventType The event ... | java | public <T> void addEvent(Class<T> eventType, PublisherConfiguration configuration) {
publisherConfigurations.put(eventType, configuration);
} | [
"public",
"<",
"T",
">",
"void",
"addEvent",
"(",
"Class",
"<",
"T",
">",
"eventType",
",",
"PublisherConfiguration",
"configuration",
")",
"{",
"publisherConfigurations",
".",
"put",
"(",
"eventType",
",",
"configuration",
")",
";",
"}"
] | Adds events of the given type to the CDI events to which the event publisher listens in order to
publish them. The publisher configuration is used to decide where to and how to publish messages.
@param eventType The event type
@param configuration The configuration used when publishing and event
@param <T> The event t... | [
"Adds",
"events",
"of",
"the",
"given",
"type",
"to",
"the",
"CDI",
"events",
"to",
"which",
"the",
"event",
"publisher",
"listens",
"in",
"order",
"to",
"publish",
"them",
".",
"The",
"publisher",
"configuration",
"is",
"used",
"to",
"decide",
"where",
"t... | train | https://github.com/awin/rabbiteasy/blob/c161efda6c0f7ef319aedf09dfe40a4a90165510/rabbiteasy-cdi/src/main/java/com/zanox/rabbiteasy/cdi/EventPublisher.java#L50-L52 |
apache/incubator-zipkin | zipkin/src/main/java/zipkin2/v1/V1BinaryAnnotation.java | V1BinaryAnnotation.createString | public static V1BinaryAnnotation createString(String key, String value, Endpoint endpoint) {
"""
Creates a tag annotation, which is the same as {@link Span#tags()} except duplicating the
endpoint.
<p>A special case is when the key is "lc" and value is empty: This substitutes for the {@link
Span#localEndpoint(... | java | public static V1BinaryAnnotation createString(String key, String value, Endpoint endpoint) {
if (value == null) throw new NullPointerException("value == null");
return new V1BinaryAnnotation(key, value, endpoint);
} | [
"public",
"static",
"V1BinaryAnnotation",
"createString",
"(",
"String",
"key",
",",
"String",
"value",
",",
"Endpoint",
"endpoint",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"value == null\"",
")",
";",
"r... | Creates a tag annotation, which is the same as {@link Span#tags()} except duplicating the
endpoint.
<p>A special case is when the key is "lc" and value is empty: This substitutes for the {@link
Span#localEndpoint()}. | [
"Creates",
"a",
"tag",
"annotation",
"which",
"is",
"the",
"same",
"as",
"{",
"@link",
"Span#tags",
"()",
"}",
"except",
"duplicating",
"the",
"endpoint",
"."
] | train | https://github.com/apache/incubator-zipkin/blob/89b2fab983fc626b3be32ce9d7cf64b3f01f1a87/zipkin/src/main/java/zipkin2/v1/V1BinaryAnnotation.java#L51-L54 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.backupStorageAccount | public BackupStorageResult backupStorageAccount(String vaultBaseUrl, String storageAccountName) {
"""
Backs up the specified storage account.
Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission.
@param vaultBaseUrl The vault... | java | public BackupStorageResult backupStorageAccount(String vaultBaseUrl, String storageAccountName) {
return backupStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body();
} | [
"public",
"BackupStorageResult",
"backupStorageAccount",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
")",
"{",
"return",
"backupStorageAccountWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"storageAccountName",
")",
".",
"toBlocking",
"(",
")",... | Backs up the specified storage account.
Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.... | [
"Backs",
"up",
"the",
"specified",
"storage",
"account",
".",
"Requests",
"that",
"a",
"backup",
"of",
"the",
"specified",
"storage",
"account",
"be",
"downloaded",
"to",
"the",
"client",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"backup",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L9520-L9522 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.