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 |
|---|---|---|---|---|---|---|---|---|---|---|
uber/rides-java-sdk | uber-core-oauth-client-adapter/src/main/java/com/uber/sdk/core/auth/OAuth2Credentials.java | OAuth2Credentials.clearCredential | public void clearCredential(String userId) throws AuthException {
"""
Clears the credential for the user in the underlying (@link DateStore}.
@throws AuthException If the credential could not be cleared.
"""
try {
authorizationCodeFlow.getCredentialDataStore().delete(userId);
} cat... | java | public void clearCredential(String userId) throws AuthException {
try {
authorizationCodeFlow.getCredentialDataStore().delete(userId);
} catch (IOException e) {
throw new AuthException("Unable to clear credential.", e);
}
} | [
"public",
"void",
"clearCredential",
"(",
"String",
"userId",
")",
"throws",
"AuthException",
"{",
"try",
"{",
"authorizationCodeFlow",
".",
"getCredentialDataStore",
"(",
")",
".",
"delete",
"(",
"userId",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",... | Clears the credential for the user in the underlying (@link DateStore}.
@throws AuthException If the credential could not be cleared. | [
"Clears",
"the",
"credential",
"for",
"the",
"user",
"in",
"the",
"underlying",
"("
] | train | https://github.com/uber/rides-java-sdk/blob/6c75570ab7884f8ecafaad312ef471dd33f64c42/uber-core-oauth-client-adapter/src/main/java/com/uber/sdk/core/auth/OAuth2Credentials.java#L287-L293 |
gallandarakhneorg/afc | core/text/src/main/java/org/arakhne/afc/text/TextUtil.java | TextUtil.mergeBrackets | @Pure
@Inline(value = "TextUtil.join(' {
"""
Merge the given strings with to brackets.
The brackets are used to delimit the groups
of characters.
<p>Examples:
<ul>
<li><code>mergeBrackets("a","b","cd")</code> returns the string
<code>"{a}{b}{cd}"</code></li>
<li><code>mergeBrackets("a{bcd")</code> return... | java | @Pure
@Inline(value = "TextUtil.join('{', '}', $1)", imported = {TextUtil.class})
public static <T> String mergeBrackets(@SuppressWarnings("unchecked") T... strs) {
return join('{', '}', strs);
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"TextUtil.join('{', '}', $1)\"",
",",
"imported",
"=",
"{",
"TextUtil",
".",
"class",
"}",
")",
"public",
"static",
"<",
"T",
">",
"String",
"mergeBrackets",
"(",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
... | Merge the given strings with to brackets.
The brackets are used to delimit the groups
of characters.
<p>Examples:
<ul>
<li><code>mergeBrackets("a","b","cd")</code> returns the string
<code>"{a}{b}{cd}"</code></li>
<li><code>mergeBrackets("a{bcd")</code> returns the string
<code>"{a{bcd}"</code></li>
</ul>
@param <T> ... | [
"Merge",
"the",
"given",
"strings",
"with",
"to",
"brackets",
".",
"The",
"brackets",
"are",
"used",
"to",
"delimit",
"the",
"groups",
"of",
"characters",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/text/src/main/java/org/arakhne/afc/text/TextUtil.java#L842-L846 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java | AbstractParser.getTransactionCounter | protected int getTransactionCounter() throws CommunicationException {
"""
Method used to get Transaction counter
@return the number of card transaction
@throws CommunicationException communication error
"""
int ret = UNKNOW;
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Get Transaction Counter ATC");... | java | protected int getTransactionCounter() throws CommunicationException {
int ret = UNKNOW;
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Get Transaction Counter ATC");
}
byte[] data = template.get().getProvider().transceive(new CommandApdu(CommandEnum.GET_DATA, 0x9F, 0x36, 0).toBytes());
if (ResponseUtils.isSu... | [
"protected",
"int",
"getTransactionCounter",
"(",
")",
"throws",
"CommunicationException",
"{",
"int",
"ret",
"=",
"UNKNOW",
";",
"if",
"(",
"LOGGER",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Get Transaction Counter ATC\"",
")",... | Method used to get Transaction counter
@return the number of card transaction
@throws CommunicationException communication error | [
"Method",
"used",
"to",
"get",
"Transaction",
"counter"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java#L169-L183 |
SonarSource/sonarqube | sonar-core/src/main/java/org/sonar/core/util/UuidFactoryFast.java | UuidFactoryFast.putLong | private static void putLong(byte[] array, long l, int pos, int numberOfLongBytes) {
"""
Puts the lower numberOfLongBytes from l into the array, starting index pos.
"""
for (int i = 0; i < numberOfLongBytes; ++i) {
array[pos + numberOfLongBytes - i - 1] = (byte) (l >>> (i * 8));
}
} | java | private static void putLong(byte[] array, long l, int pos, int numberOfLongBytes) {
for (int i = 0; i < numberOfLongBytes; ++i) {
array[pos + numberOfLongBytes - i - 1] = (byte) (l >>> (i * 8));
}
} | [
"private",
"static",
"void",
"putLong",
"(",
"byte",
"[",
"]",
"array",
",",
"long",
"l",
",",
"int",
"pos",
",",
"int",
"numberOfLongBytes",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numberOfLongBytes",
";",
"++",
"i",
")",
"{",
... | Puts the lower numberOfLongBytes from l into the array, starting index pos. | [
"Puts",
"the",
"lower",
"numberOfLongBytes",
"from",
"l",
"into",
"the",
"array",
"starting",
"index",
"pos",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-core/src/main/java/org/sonar/core/util/UuidFactoryFast.java#L62-L66 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java | ConfigurationsInner.list | public ClusterConfigurationsInner list(String resourceGroupName, String clusterName) {
"""
Gets all configuration information for an HDI cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fail the ... | java | public ClusterConfigurationsInner list(String resourceGroupName, String clusterName) {
return listWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body();
} | [
"public",
"ClusterConfigurationsInner",
"list",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
... | Gets all configuration information for an HDI cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws Runtim... | [
"Gets",
"all",
"configuration",
"information",
"for",
"an",
"HDI",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java#L86-L88 |
lmdbjava/lmdbjava | src/main/java/org/lmdbjava/ByteArrayProxy.java | ByteArrayProxy.compareArrays | @SuppressWarnings("checkstyle:ReturnCount")
public static int compareArrays(final byte[] o1, final byte[] o2) {
"""
Lexicographically compare two byte arrays.
@param o1 left operand (required)
@param o2 right operand (required)
@return as specified by {@link Comparable} interface
"""
requireNonNull(... | java | @SuppressWarnings("checkstyle:ReturnCount")
public static int compareArrays(final byte[] o1, final byte[] o2) {
requireNonNull(o1);
requireNonNull(o2);
if (o1 == o2) {
return 0;
}
final int minLength = Math.min(o1.length, o2.length);
for (int i = 0; i < minLength; i++) {
final int... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:ReturnCount\"",
")",
"public",
"static",
"int",
"compareArrays",
"(",
"final",
"byte",
"[",
"]",
"o1",
",",
"final",
"byte",
"[",
"]",
"o2",
")",
"{",
"requireNonNull",
"(",
"o1",
")",
";",
"requireNonNull",
"(",
... | Lexicographically compare two byte arrays.
@param o1 left operand (required)
@param o2 right operand (required)
@return as specified by {@link Comparable} interface | [
"Lexicographically",
"compare",
"two",
"byte",
"arrays",
"."
] | train | https://github.com/lmdbjava/lmdbjava/blob/5912beb1037722c71f3ddc05e70fcbe739dfa272/src/main/java/org/lmdbjava/ByteArrayProxy.java#L50-L69 |
amaembo/streamex | src/main/java/one/util/streamex/MoreCollectors.java | MoreCollectors.onlyOne | public static <T> Collector<T, ?, Optional<T>> onlyOne(Predicate<? super T> predicate) {
"""
Returns a {@code Collector} which collects the stream element satisfying the predicate
if there is only one such element.
<p>
This method returns a
<a href="package-summary.html#ShortCircuitReduction">short-circuitin... | java | public static <T> Collector<T, ?, Optional<T>> onlyOne(Predicate<? super T> predicate) {
return filtering(predicate, onlyOne());
} | [
"public",
"static",
"<",
"T",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Optional",
"<",
"T",
">",
">",
"onlyOne",
"(",
"Predicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"return",
"filtering",
"(",
"predicate",
",",
"onlyOne",
"(",
... | Returns a {@code Collector} which collects the stream element satisfying the predicate
if there is only one such element.
<p>
This method returns a
<a href="package-summary.html#ShortCircuitReduction">short-circuiting
collector</a>.
@param predicate a predicate to be applied to the stream elements
@param <T> the type... | [
"Returns",
"a",
"{",
"@code",
"Collector",
"}",
"which",
"collects",
"the",
"stream",
"element",
"satisfying",
"the",
"predicate",
"if",
"there",
"is",
"only",
"one",
"such",
"element",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/MoreCollectors.java#L531-L533 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security/src/com/ibm/ws/security/internal/SecurityServiceImpl.java | SecurityServiceImpl.getEffectiveSecurityConfiguration | private SecurityConfiguration getEffectiveSecurityConfiguration() {
"""
Eventually this will be execution context aware and pick the right domain.
Till then, we're only accessing the system domain configuration.
@return SecurityConfiguration representing the "effective" configuration
for the execution context... | java | private SecurityConfiguration getEffectiveSecurityConfiguration() {
SecurityConfiguration effectiveConfig = configs.getService(cfgSystemDomain);
if (effectiveConfig == null) {
Tr.error(tc, "SECURITY_SERVICE_ERROR_BAD_DOMAIN", cfgSystemDomain, CFG_KEY_SYSTEM_DOMAIN);
throw new Ill... | [
"private",
"SecurityConfiguration",
"getEffectiveSecurityConfiguration",
"(",
")",
"{",
"SecurityConfiguration",
"effectiveConfig",
"=",
"configs",
".",
"getService",
"(",
"cfgSystemDomain",
")",
";",
"if",
"(",
"effectiveConfig",
"==",
"null",
")",
"{",
"Tr",
".",
... | Eventually this will be execution context aware and pick the right domain.
Till then, we're only accessing the system domain configuration.
@return SecurityConfiguration representing the "effective" configuration
for the execution context. | [
"Eventually",
"this",
"will",
"be",
"execution",
"context",
"aware",
"and",
"pick",
"the",
"right",
"domain",
".",
"Till",
"then",
"we",
"re",
"only",
"accessing",
"the",
"system",
"domain",
"configuration",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security/src/com/ibm/ws/security/internal/SecurityServiceImpl.java#L374-L381 |
sniggle/simple-pgp | simple-pgp-api/src/main/java/me/sniggle/pgp/crypt/internal/io/IOUtils.java | IOUtils.copy | public static void copy(InputStream inputStream, OutputStream outputStream) throws IOException {
"""
copies the input stream to the output stream
@param inputStream
the source stream
@param outputStream
the target stream
@throws IOException
"""
LOGGER.trace("copy(InputStream, OutputStream)");
co... | java | public static void copy(InputStream inputStream, OutputStream outputStream) throws IOException {
LOGGER.trace("copy(InputStream, OutputStream)");
copy(inputStream, outputStream, new byte[BUFFER_SIZE]);
} | [
"public",
"static",
"void",
"copy",
"(",
"InputStream",
"inputStream",
",",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
"{",
"LOGGER",
".",
"trace",
"(",
"\"copy(InputStream, OutputStream)\"",
")",
";",
"copy",
"(",
"inputStream",
",",
"outputStrea... | copies the input stream to the output stream
@param inputStream
the source stream
@param outputStream
the target stream
@throws IOException | [
"copies",
"the",
"input",
"stream",
"to",
"the",
"output",
"stream"
] | train | https://github.com/sniggle/simple-pgp/blob/2ab83e4d370b8189f767d8e4e4c7e6020e60fbe3/simple-pgp-api/src/main/java/me/sniggle/pgp/crypt/internal/io/IOUtils.java#L54-L57 |
googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/xml/atom/Atom.java | Atom.setSlugHeader | public static void setSlugHeader(HttpHeaders headers, String value) {
"""
Sets the {@code "Slug"} header, properly escaping the header value. See <a
href="http://tools.ietf.org/html/rfc5023#section-9.7">The Slug Header</a>.
@since 1.14
"""
if (value == null) {
headers.remove("Slug");
} else {... | java | public static void setSlugHeader(HttpHeaders headers, String value) {
if (value == null) {
headers.remove("Slug");
} else {
headers.set("Slug", Lists.newArrayList(Arrays.asList(SLUG_ESCAPER.escape(value))));
}
} | [
"public",
"static",
"void",
"setSlugHeader",
"(",
"HttpHeaders",
"headers",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"headers",
".",
"remove",
"(",
"\"Slug\"",
")",
";",
"}",
"else",
"{",
"headers",
".",
"set",
"(",... | Sets the {@code "Slug"} header, properly escaping the header value. See <a
href="http://tools.ietf.org/html/rfc5023#section-9.7">The Slug Header</a>.
@since 1.14 | [
"Sets",
"the",
"{",
"@code",
"Slug",
"}",
"header",
"properly",
"escaping",
"the",
"header",
"value",
".",
"See",
"<a",
"href",
"=",
"http",
":",
"//",
"tools",
".",
"ietf",
".",
"org",
"/",
"html",
"/",
"rfc5023#section",
"-",
"9",
".",
"7",
">",
... | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/xml/atom/Atom.java#L85-L91 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java | base_resource.resource_to_string | protected String resource_to_string(nitro_service service, String id, options option) {
"""
Converts netscaler resource to Json string.
@param service nitro_service object.
@param id sessionId.
@param option Options object.
@return string in Json format.
"""
Boolean warning = service.get_warning();
S... | java | protected String resource_to_string(nitro_service service, String id, options option)
{
Boolean warning = service.get_warning();
String onerror = service.get_onerror();
String result = service.get_payload_formatter().resource_to_string(this, id, option, warning, onerror);
return result;
} | [
"protected",
"String",
"resource_to_string",
"(",
"nitro_service",
"service",
",",
"String",
"id",
",",
"options",
"option",
")",
"{",
"Boolean",
"warning",
"=",
"service",
".",
"get_warning",
"(",
")",
";",
"String",
"onerror",
"=",
"service",
".",
"get_onerr... | Converts netscaler resource to Json string.
@param service nitro_service object.
@param id sessionId.
@param option Options object.
@return string in Json format. | [
"Converts",
"netscaler",
"resource",
"to",
"Json",
"string",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java#L65-L71 |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/Mode.java | Mode.bindAttribute | boolean bindAttribute(String ns, String wildcard, AttributeActionSet actions) {
"""
Adds a set of attribute actions to be performed in this mode
for attributes in a specified namespace.
@param ns The namespace pattern.
@param wildcard The wildcard character.
@param actions The set of attribute actions.
@ret... | java | boolean bindAttribute(String ns, String wildcard, AttributeActionSet actions) {
NamespaceSpecification nss = new NamespaceSpecification(ns, wildcard);
if (nssAttributeMap.get(nss) != null)
return false;
for (Enumeration e = nssAttributeMap.keys(); e.hasMoreElements();) {
NamespaceSpecification n... | [
"boolean",
"bindAttribute",
"(",
"String",
"ns",
",",
"String",
"wildcard",
",",
"AttributeActionSet",
"actions",
")",
"{",
"NamespaceSpecification",
"nss",
"=",
"new",
"NamespaceSpecification",
"(",
"ns",
",",
"wildcard",
")",
";",
"if",
"(",
"nssAttributeMap",
... | Adds a set of attribute actions to be performed in this mode
for attributes in a specified namespace.
@param ns The namespace pattern.
@param wildcard The wildcard character.
@param actions The set of attribute actions.
@return true if successfully added, that is the namespace was
not already present in the attributeM... | [
"Adds",
"a",
"set",
"of",
"attribute",
"actions",
"to",
"be",
"performed",
"in",
"this",
"mode",
"for",
"attributes",
"in",
"a",
"specified",
"namespace",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/Mode.java#L389-L401 |
betfair/cougar | cougar-framework/cougar-zipkin-common/src/main/java/com/betfair/cougar/modules/zipkin/impl/ZipkinAnnotationsStore.java | ZipkinAnnotationsStore.addAnnotation | @Nonnull
public ZipkinAnnotationsStore addAnnotation(@Nonnull String key, @Nonnull String value) {
"""
Adds a (binary) string annotation for an event.
@param key The key of the annotation
@param value The value of the annotation
@return this object
"""
return addBinaryAnnotation(key, value, ... | java | @Nonnull
public ZipkinAnnotationsStore addAnnotation(@Nonnull String key, @Nonnull String value) {
return addBinaryAnnotation(key, value, defaultEndpoint);
} | [
"@",
"Nonnull",
"public",
"ZipkinAnnotationsStore",
"addAnnotation",
"(",
"@",
"Nonnull",
"String",
"key",
",",
"@",
"Nonnull",
"String",
"value",
")",
"{",
"return",
"addBinaryAnnotation",
"(",
"key",
",",
"value",
",",
"defaultEndpoint",
")",
";",
"}"
] | Adds a (binary) string annotation for an event.
@param key The key of the annotation
@param value The value of the annotation
@return this object | [
"Adds",
"a",
"(",
"binary",
")",
"string",
"annotation",
"for",
"an",
"event",
"."
] | train | https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/cougar-framework/cougar-zipkin-common/src/main/java/com/betfair/cougar/modules/zipkin/impl/ZipkinAnnotationsStore.java#L82-L85 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/CharsetUtil.java | CharsetUtil.convert | public static String convert(String source, Charset srcCharset, Charset destCharset) {
"""
转换字符串的字符集编码<br>
当以错误的编码读取为字符串时,打印字符串将出现乱码。<br>
此方法用于纠正因读取使用编码错误导致的乱码问题。<br>
例如,在Servlet请求中客户端用GBK编码了请求参数,我们使用UTF-8读取到的是乱码,此时,使用此方法即可还原原编码的内容
<pre>
客户端 -》 GBK编码 -》 Servlet容器 -》 UTF-8解码 -》 乱码
乱码 -》 UTF-8编码 -》 GBK解码 -》 正确... | java | public static String convert(String source, Charset srcCharset, Charset destCharset) {
if(null == srcCharset) {
srcCharset = StandardCharsets.ISO_8859_1;
}
if(null == destCharset) {
destCharset = StandardCharsets.UTF_8;
}
if (StrUtil.isBlank(source) || srcCharset.equals(destCharset)) {
... | [
"public",
"static",
"String",
"convert",
"(",
"String",
"source",
",",
"Charset",
"srcCharset",
",",
"Charset",
"destCharset",
")",
"{",
"if",
"(",
"null",
"==",
"srcCharset",
")",
"{",
"srcCharset",
"=",
"StandardCharsets",
".",
"ISO_8859_1",
";",
"}",
"if"... | 转换字符串的字符集编码<br>
当以错误的编码读取为字符串时,打印字符串将出现乱码。<br>
此方法用于纠正因读取使用编码错误导致的乱码问题。<br>
例如,在Servlet请求中客户端用GBK编码了请求参数,我们使用UTF-8读取到的是乱码,此时,使用此方法即可还原原编码的内容
<pre>
客户端 -》 GBK编码 -》 Servlet容器 -》 UTF-8解码 -》 乱码
乱码 -》 UTF-8编码 -》 GBK解码 -》 正确内容
</pre>
@param source 字符串
@param srcCharset 源字符集,默认ISO-8859-1
@param destCharset 目标字符集,默认UTF-8
@ret... | [
"转换字符串的字符集编码<br",
">",
"当以错误的编码读取为字符串时,打印字符串将出现乱码。<br",
">",
"此方法用于纠正因读取使用编码错误导致的乱码问题。<br",
">",
"例如,在Servlet请求中客户端用GBK编码了请求参数,我们使用UTF",
"-",
"8读取到的是乱码,此时,使用此方法即可还原原编码的内容",
"<pre",
">",
"客户端",
"-",
"》",
"GBK编码",
"-",
"》",
"Servlet容器",
"-",
"》",
"UTF",
"-",
"8解码",
"-",
... | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/CharsetUtil.java#L67-L80 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/DBSCAN.java | DBSCAN.processNeighbors | private void processNeighbors(DoubleDBIDListIter neighbor, ModifiableDBIDs currentCluster, ArrayModifiableDBIDs seeds) {
"""
Process a single core point.
@param neighbor Iterator over neighbors
@param currentCluster Current cluster
@param seeds Seed set
"""
final boolean ismetric = getDistanceFunction... | java | private void processNeighbors(DoubleDBIDListIter neighbor, ModifiableDBIDs currentCluster, ArrayModifiableDBIDs seeds) {
final boolean ismetric = getDistanceFunction().isMetric();
for(; neighbor.valid(); neighbor.advance()) {
if(processedIDs.add(neighbor)) {
if(!ismetric || neighbor.doubleValue() ... | [
"private",
"void",
"processNeighbors",
"(",
"DoubleDBIDListIter",
"neighbor",
",",
"ModifiableDBIDs",
"currentCluster",
",",
"ArrayModifiableDBIDs",
"seeds",
")",
"{",
"final",
"boolean",
"ismetric",
"=",
"getDistanceFunction",
"(",
")",
".",
"isMetric",
"(",
")",
"... | Process a single core point.
@param neighbor Iterator over neighbors
@param currentCluster Current cluster
@param seeds Seed set | [
"Process",
"a",
"single",
"core",
"point",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/DBSCAN.java#L260-L273 |
google/j2objc | jre_emul/android/platform/external/mockwebserver/src/main/java/com/google/mockwebserver/MockResponse.java | MockResponse.throttleBody | public MockResponse throttleBody(int bytesPerPeriod, long period, TimeUnit unit) {
"""
Throttles the response body writer to sleep for the given period after each
series of {@code bytesPerPeriod} bytes are written. Use this to simulate
network behavior.
"""
this.throttleBytesPerPeriod = bytesPerPerio... | java | public MockResponse throttleBody(int bytesPerPeriod, long period, TimeUnit unit) {
this.throttleBytesPerPeriod = bytesPerPeriod;
this.throttlePeriod = period;
this.throttleUnit = unit;
return this;
} | [
"public",
"MockResponse",
"throttleBody",
"(",
"int",
"bytesPerPeriod",
",",
"long",
"period",
",",
"TimeUnit",
"unit",
")",
"{",
"this",
".",
"throttleBytesPerPeriod",
"=",
"bytesPerPeriod",
";",
"this",
".",
"throttlePeriod",
"=",
"period",
";",
"this",
".",
... | Throttles the response body writer to sleep for the given period after each
series of {@code bytesPerPeriod} bytes are written. Use this to simulate
network behavior. | [
"Throttles",
"the",
"response",
"body",
"writer",
"to",
"sleep",
"for",
"the",
"given",
"period",
"after",
"each",
"series",
"of",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/mockwebserver/src/main/java/com/google/mockwebserver/MockResponse.java#L236-L241 |
ltsopensource/light-task-scheduler | lts-core/src/main/java/com/github/ltsopensource/core/commons/utils/WebUtils.java | WebUtils.decode | public static String decode(String value, String charset) {
"""
使用指定的字符集反编码请求参数值。
@param value 参数值
@param charset 字符集
@return 反编码后的参数值
"""
String result = null;
if (!StringUtils.isEmpty(value)) {
try {
result = URLDecoder.decode(value, charset);
} ... | java | public static String decode(String value, String charset) {
String result = null;
if (!StringUtils.isEmpty(value)) {
try {
result = URLDecoder.decode(value, charset);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
... | [
"public",
"static",
"String",
"decode",
"(",
"String",
"value",
",",
"String",
"charset",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"value",
")",
")",
"{",
"try",
"{",
"result",
"=",
"URLDecoder... | 使用指定的字符集反编码请求参数值。
@param value 参数值
@param charset 字符集
@return 反编码后的参数值 | [
"使用指定的字符集反编码请求参数值。"
] | train | https://github.com/ltsopensource/light-task-scheduler/blob/64d3aa000ff5022be5e94f511b58f405e5f4c8eb/lts-core/src/main/java/com/github/ltsopensource/core/commons/utils/WebUtils.java#L313-L323 |
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.beginCreateOrUpdateAsync | public Observable<OpenShiftManagedClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) {
"""
Creates or updates an OpenShift managed cluster.
Creates or updates a OpenShift managed cluster with the specified configuration for agents and Ope... | java | public Observable<OpenShiftManagedClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1<ServiceResponse<OpenShiftManagedCluster... | [
"public",
"Observable",
"<",
"OpenShiftManagedClusterInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"OpenShiftManagedClusterInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
... | Creates or updates an OpenShift managed cluster.
Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the OpenShift managed cluster resource.
@param parameters Parameter... | [
"Creates",
"or",
"updates",
"an",
"OpenShift",
"managed",
"cluster",
".",
"Creates",
"or",
"updates",
"a",
"OpenShift",
"managed",
"cluster",
"with",
"the",
"specified",
"configuration",
"for",
"agents",
"and",
"OpenShift",
"version",
"."
] | 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#L552-L559 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.serviceName_pca_pcaServiceName_serviceInfos_PUT | public void serviceName_pca_pcaServiceName_serviceInfos_PUT(String serviceName, String pcaServiceName, OvhService body) throws IOException {
"""
Alter this object properties
REST: PUT /cloud/{serviceName}/pca/{pcaServiceName}/serviceInfos
@param body [required] New object properties
@param serviceName [requir... | java | public void serviceName_pca_pcaServiceName_serviceInfos_PUT(String serviceName, String pcaServiceName, OvhService body) throws IOException {
String qPath = "/cloud/{serviceName}/pca/{pcaServiceName}/serviceInfos";
StringBuilder sb = path(qPath, serviceName, pcaServiceName);
exec(qPath, "PUT", sb.toString(), body)... | [
"public",
"void",
"serviceName_pca_pcaServiceName_serviceInfos_PUT",
"(",
"String",
"serviceName",
",",
"String",
"pcaServiceName",
",",
"OvhService",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/{serviceName}/pca/{pcaServiceName}/serviceInfos\""... | Alter this object properties
REST: PUT /cloud/{serviceName}/pca/{pcaServiceName}/serviceInfos
@param body [required] New object properties
@param serviceName [required] The internal name of your public cloud passport
@param pcaServiceName [required] The internal name of your PCA offer
@deprecated | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2435-L2439 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Zip.java | Zip.required | private void required(String attributeName, Resource attributValue, boolean exists) throws ApplicationException {
"""
throw a error if the value is empty (null)
@param attributeName
@param attributValue
@throws ApplicationException
"""
if (attributValue == null)
throw new ApplicationException("inval... | java | private void required(String attributeName, Resource attributValue, boolean exists) throws ApplicationException {
if (attributValue == null)
throw new ApplicationException("invalid attribute constellation for the tag zip", "attribute [" + attributeName + "] is required, if action is [" + action + "]");
if (exis... | [
"private",
"void",
"required",
"(",
"String",
"attributeName",
",",
"Resource",
"attributValue",
",",
"boolean",
"exists",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"attributValue",
"==",
"null",
")",
"throw",
"new",
"ApplicationException",
"(",
"\"in... | throw a error if the value is empty (null)
@param attributeName
@param attributValue
@throws ApplicationException | [
"throw",
"a",
"error",
"if",
"the",
"value",
"is",
"empty",
"(",
"null",
")"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Zip.java#L694-L701 |
kamcpp/avicenna | src/avicenna/src/main/java/org/labcrypto/avicenna/Avicenna.java | Avicenna.defineDependency | public static <T> void defineDependency(Class<T> clazz, T dependency) {
"""
Adds a direct mapping between a type and an object.
@param clazz Class type which should be injected.
@param dependency Dependency reference which should be copied to injection targets.
"""
defineDependency(clazz, null... | java | public static <T> void defineDependency(Class<T> clazz, T dependency) {
defineDependency(clazz, null, dependency);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"defineDependency",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"T",
"dependency",
")",
"{",
"defineDependency",
"(",
"clazz",
",",
"null",
",",
"dependency",
")",
";",
"}"
] | Adds a direct mapping between a type and an object.
@param clazz Class type which should be injected.
@param dependency Dependency reference which should be copied to injection targets. | [
"Adds",
"a",
"direct",
"mapping",
"between",
"a",
"type",
"and",
"an",
"object",
"."
] | train | https://github.com/kamcpp/avicenna/blob/0fc4eff447761140cd3799287427d99c63ea6e6e/src/avicenna/src/main/java/org/labcrypto/avicenna/Avicenna.java#L145-L147 |
Netflix/conductor | core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java | ForkJoinDynamicTaskMapper.createJoinTask | @VisibleForTesting
Task createJoinTask(Workflow workflowInstance, WorkflowTask joinWorkflowTask, HashMap<String, Object> joinInput) {
"""
This method creates a JOIN task that is used in the {@link this#getMappedTasks(TaskMapperContext)}
at the end to add a join task to be scheduled after all the fork tasks
... | java | @VisibleForTesting
Task createJoinTask(Workflow workflowInstance, WorkflowTask joinWorkflowTask, HashMap<String, Object> joinInput) {
Task joinTask = new Task();
joinTask.setTaskType(SystemTaskType.JOIN.name());
joinTask.setTaskDefName(SystemTaskType.JOIN.name());
joinTask.setReferen... | [
"@",
"VisibleForTesting",
"Task",
"createJoinTask",
"(",
"Workflow",
"workflowInstance",
",",
"WorkflowTask",
"joinWorkflowTask",
",",
"HashMap",
"<",
"String",
",",
"Object",
">",
"joinInput",
")",
"{",
"Task",
"joinTask",
"=",
"new",
"Task",
"(",
")",
";",
"... | This method creates a JOIN task that is used in the {@link this#getMappedTasks(TaskMapperContext)}
at the end to add a join task to be scheduled after all the fork tasks
@param workflowInstance: A instance of the {@link Workflow} which represents the workflow being executed.
@param joinWorkflowTask: A instance of {@li... | [
"This",
"method",
"creates",
"a",
"JOIN",
"task",
"that",
"is",
"used",
"in",
"the",
"{",
"@link",
"this#getMappedTasks",
"(",
"TaskMapperContext",
")",
"}",
"at",
"the",
"end",
"to",
"add",
"a",
"join",
"task",
"to",
"be",
"scheduled",
"after",
"all",
"... | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java#L208-L223 |
rnorth/visible-assertions | src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java | VisibleAssertions.assertThrows | public static <T> void assertThrows(String message, Class<? extends Exception> exceptionClass, Callable<T> callable) {
"""
Assert that a given callable throws an exception of a particular class.
<p>
The assertion passes if the callable throws exactly the same class of exception (not a subclass).
<p>
If the cal... | java | public static <T> void assertThrows(String message, Class<? extends Exception> exceptionClass, Callable<T> callable) {
T result;
try {
result = callable.call();
fail(message, "No exception was thrown (expected " + exceptionClass.getSimpleName() + " but '" + result + "' was return... | [
"public",
"static",
"<",
"T",
">",
"void",
"assertThrows",
"(",
"String",
"message",
",",
"Class",
"<",
"?",
"extends",
"Exception",
">",
"exceptionClass",
",",
"Callable",
"<",
"T",
">",
"callable",
")",
"{",
"T",
"result",
";",
"try",
"{",
"result",
... | Assert that a given callable throws an exception of a particular class.
<p>
The assertion passes if the callable throws exactly the same class of exception (not a subclass).
<p>
If the callable doesn't throw an exception at all, or if another class of exception is thrown, the assertion
fails.
<p>
If the assertion passe... | [
"Assert",
"that",
"a",
"given",
"callable",
"throws",
"an",
"exception",
"of",
"a",
"particular",
"class",
".",
"<p",
">",
"The",
"assertion",
"passes",
"if",
"the",
"callable",
"throws",
"exactly",
"the",
"same",
"class",
"of",
"exception",
"(",
"not",
"a... | train | https://github.com/rnorth/visible-assertions/blob/6d7a7724db40ac0e9f87279553f814b790310b3b/src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java#L376-L388 |
xqbase/util | util-jdk17/src/main/java/com/xqbase/util/Time.java | Time.parse | public static long parse(String date, String time) {
"""
Convert a date and a time string to a Unix time (in milliseconds).
Either date or time can be null.
"""
return parseDate(date) + parseTime(time) + timeZoneOffset;
} | java | public static long parse(String date, String time) {
return parseDate(date) + parseTime(time) + timeZoneOffset;
} | [
"public",
"static",
"long",
"parse",
"(",
"String",
"date",
",",
"String",
"time",
")",
"{",
"return",
"parseDate",
"(",
"date",
")",
"+",
"parseTime",
"(",
"time",
")",
"+",
"timeZoneOffset",
";",
"}"
] | Convert a date and a time string to a Unix time (in milliseconds).
Either date or time can be null. | [
"Convert",
"a",
"date",
"and",
"a",
"time",
"string",
"to",
"a",
"Unix",
"time",
"(",
"in",
"milliseconds",
")",
".",
"Either",
"date",
"or",
"time",
"can",
"be",
"null",
"."
] | train | https://github.com/xqbase/util/blob/e7b9167b6c701b9eec988a9d1e68446cef5ef420/util-jdk17/src/main/java/com/xqbase/util/Time.java#L51-L53 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java | EmbedBuilder.addInlineField | public EmbedBuilder addInlineField(String name, String value) {
"""
Adds an inline field to the embed.
@param name The name of the field.
@param value The value of the field.
@return The current instance in order to chain call methods.
"""
delegate.addField(name, value, true);
return this;... | java | public EmbedBuilder addInlineField(String name, String value) {
delegate.addField(name, value, true);
return this;
} | [
"public",
"EmbedBuilder",
"addInlineField",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"delegate",
".",
"addField",
"(",
"name",
",",
"value",
",",
"true",
")",
";",
"return",
"this",
";",
"}"
] | Adds an inline field to the embed.
@param name The name of the field.
@param value The value of the field.
@return The current instance in order to chain call methods. | [
"Adds",
"an",
"inline",
"field",
"to",
"the",
"embed",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L599-L602 |
apache/incubator-gobblin | gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/converter/InstrumentedConverterBase.java | InstrumentedConverterBase.afterConvert | public void afterConvert(Iterable<DO> iterable, long startTimeNanos) {
"""
Called after conversion.
@param iterable conversion result.
@param startTimeNanos start time of conversion.
"""
Instrumented.updateTimer(this.converterTimer, System.nanoTime() - startTimeNanos, TimeUnit.NANOSECONDS);
} | java | public void afterConvert(Iterable<DO> iterable, long startTimeNanos) {
Instrumented.updateTimer(this.converterTimer, System.nanoTime() - startTimeNanos, TimeUnit.NANOSECONDS);
} | [
"public",
"void",
"afterConvert",
"(",
"Iterable",
"<",
"DO",
">",
"iterable",
",",
"long",
"startTimeNanos",
")",
"{",
"Instrumented",
".",
"updateTimer",
"(",
"this",
".",
"converterTimer",
",",
"System",
".",
"nanoTime",
"(",
")",
"-",
"startTimeNanos",
"... | Called after conversion.
@param iterable conversion result.
@param startTimeNanos start time of conversion. | [
"Called",
"after",
"conversion",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/converter/InstrumentedConverterBase.java#L156-L158 |
onepf/OpenIAB | library/src/main/java/org/onepf/oms/OpenIabHelper.java | OpenIabHelper.getStoreSku | @NotNull
public static String getStoreSku(@NotNull final String appStoreName, @NotNull String sku) {
"""
Return the previously mapped store SKU for the internal SKU
@param appStoreName The store name
@param sku The internal SKU
@return SKU used in the store for the specified internal SKU
@see or... | java | @NotNull
public static String getStoreSku(@NotNull final String appStoreName, @NotNull String sku) {
return SkuManager.getInstance().getStoreSku(appStoreName, sku);
} | [
"@",
"NotNull",
"public",
"static",
"String",
"getStoreSku",
"(",
"@",
"NotNull",
"final",
"String",
"appStoreName",
",",
"@",
"NotNull",
"String",
"sku",
")",
"{",
"return",
"SkuManager",
".",
"getInstance",
"(",
")",
".",
"getStoreSku",
"(",
"appStoreName",
... | Return the previously mapped store SKU for the internal SKU
@param appStoreName The store name
@param sku The internal SKU
@return SKU used in the store for the specified internal SKU
@see org.onepf.oms.SkuManager#mapSku(String, String, String)
@deprecated Use {@link org.onepf.oms.SkuManager#getStoreSku(Strin... | [
"Return",
"the",
"previously",
"mapped",
"store",
"SKU",
"for",
"the",
"internal",
"SKU"
] | train | https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/OpenIabHelper.java#L367-L370 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterTokenServices.java | TwitterTokenServices.getRequestToken | public void getRequestToken(HttpServletRequest request, HttpServletResponse response, String callbackUrl, String stateValue, SocialLoginConfig config) {
"""
Attemps to obtain a request token from the oauth/request_token Twitter API. This request token can later be used to
obtain an access token. If a request toke... | java | public void getRequestToken(HttpServletRequest request, HttpServletResponse response, String callbackUrl, String stateValue, SocialLoginConfig config) {
TwitterEndpointServices twitter = getTwitterEndpointServices();
twitter.setConsumerKey(config.getClientId());
twitter.setConsumerSecret(config.... | [
"public",
"void",
"getRequestToken",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"callbackUrl",
",",
"String",
"stateValue",
",",
"SocialLoginConfig",
"config",
")",
"{",
"TwitterEndpointServices",
"twitter",
"=",
"getTwi... | Attemps to obtain a request token from the oauth/request_token Twitter API. This request token can later be used to
obtain an access token. If a request token is successfully obtained, the request is redirected to the oauth/authorize
Twitter API to have Twitter authenticate the user and allow the user to authorize the ... | [
"Attemps",
"to",
"obtain",
"a",
"request",
"token",
"from",
"the",
"oauth",
"/",
"request_token",
"Twitter",
"API",
".",
"This",
"request",
"token",
"can",
"later",
"be",
"used",
"to",
"obtain",
"an",
"access",
"token",
".",
"If",
"a",
"request",
"token",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterTokenServices.java#L56-L101 |
johnkil/Android-ProgressFragment | progressfragment-native/src/com/devspark/progressfragment/ProgressFragment.java | ProgressFragment.setContentShown | private void setContentShown(boolean shown, boolean animate) {
"""
Control whether the content is being displayed. You can make it not
displayed if you are waiting for the initial data to show in it. During
this time an indeterminant progress indicator will be shown instead.
@param shown If true, the cont... | java | private void setContentShown(boolean shown, boolean animate) {
ensureContent();
if (mContentShown == shown) {
return;
}
mContentShown = shown;
if (shown) {
if (animate) {
mProgressContainer.startAnimation(AnimationUtils.loadAnimation(getAct... | [
"private",
"void",
"setContentShown",
"(",
"boolean",
"shown",
",",
"boolean",
"animate",
")",
"{",
"ensureContent",
"(",
")",
";",
"if",
"(",
"mContentShown",
"==",
"shown",
")",
"{",
"return",
";",
"}",
"mContentShown",
"=",
"shown",
";",
"if",
"(",
"s... | Control whether the content is being displayed. You can make it not
displayed if you are waiting for the initial data to show in it. During
this time an indeterminant progress indicator will be shown instead.
@param shown If true, the content view is shown; if false, the progress
indicator. The initial value is t... | [
"Control",
"whether",
"the",
"content",
"is",
"being",
"displayed",
".",
"You",
"can",
"make",
"it",
"not",
"displayed",
"if",
"you",
"are",
"waiting",
"for",
"the",
"initial",
"data",
"to",
"show",
"in",
"it",
".",
"During",
"this",
"time",
"an",
"indet... | train | https://github.com/johnkil/Android-ProgressFragment/blob/f4b3b969f36f3ac9598c662722630f9ffb151bd6/progressfragment-native/src/com/devspark/progressfragment/ProgressFragment.java#L202-L229 |
liferay/com-liferay-commerce | commerce-api/src/main/java/com/liferay/commerce/model/CommerceAvailabilityEstimateWrapper.java | CommerceAvailabilityEstimateWrapper.getTitle | @Override
public String getTitle(String languageId, boolean useDefault) {
"""
Returns the localized title of this commerce availability estimate in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefau... | java | @Override
public String getTitle(String languageId, boolean useDefault) {
return _commerceAvailabilityEstimate.getTitle(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getTitle",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_commerceAvailabilityEstimate",
".",
"getTitle",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized title of this commerce availability estimate in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested lang... | [
"Returns",
"the",
"localized",
"title",
"of",
"this",
"commerce",
"availability",
"estimate",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/model/CommerceAvailabilityEstimateWrapper.java#L313-L316 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ArabicShaping.java | ArabicShaping.flipArray | private static int flipArray(char [] dest, int start, int e, int w) {
"""
/*
Name : flipArray
Function: inverts array, so that start becomes end and vice versa
"""
int r;
if (w > start) {
// shift, assume small buffer size so don't use arraycopy
r = w;
w = start... | java | private static int flipArray(char [] dest, int start, int e, int w){
int r;
if (w > start) {
// shift, assume small buffer size so don't use arraycopy
r = w;
w = start;
while (r < e) {
dest[w++] = dest[r++];
}
} else {
w ... | [
"private",
"static",
"int",
"flipArray",
"(",
"char",
"[",
"]",
"dest",
",",
"int",
"start",
",",
"int",
"e",
",",
"int",
"w",
")",
"{",
"int",
"r",
";",
"if",
"(",
"w",
">",
"start",
")",
"{",
"// shift, assume small buffer size so don't use arraycopy",
... | /*
Name : flipArray
Function: inverts array, so that start becomes end and vice versa | [
"/",
"*",
"Name",
":",
"flipArray",
"Function",
":",
"inverts",
"array",
"so",
"that",
"start",
"becomes",
"end",
"and",
"vice",
"versa"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ArabicShaping.java#L1183-L1196 |
javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/i/IntTuples.java | IntTuples.compareLexicographically | public static int compareLexicographically(IntTuple t0, IntTuple t1) {
"""
Compares two tuples lexicographically, starting with
the elements of the lowest index.
@param t0 The first tuple
@param t1 The second tuple
@return -1 if the first tuple is lexicographically
smaller than the second, +1 if it is large... | java | public static int compareLexicographically(IntTuple t0, IntTuple t1)
{
Utils.checkForEqualSize(t0, t1);
for (int i=0; i<t0.getSize(); i++)
{
if (t0.get(i) < t1.get(i))
{
return -1;
}
else if (t0.get(i) > t1.get(i))
... | [
"public",
"static",
"int",
"compareLexicographically",
"(",
"IntTuple",
"t0",
",",
"IntTuple",
"t1",
")",
"{",
"Utils",
".",
"checkForEqualSize",
"(",
"t0",
",",
"t1",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"t0",
".",
"getSize",
"... | Compares two tuples lexicographically, starting with
the elements of the lowest index.
@param t0 The first tuple
@param t1 The second tuple
@return -1 if the first tuple is lexicographically
smaller than the second, +1 if it is larger, and
0 if they are equal.
@throws IllegalArgumentException If the given tuples do no... | [
"Compares",
"two",
"tuples",
"lexicographically",
"starting",
"with",
"the",
"elements",
"of",
"the",
"lowest",
"index",
"."
] | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/i/IntTuples.java#L902-L917 |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java | ProjectTreeController.addTasks | private void addTasks(MpxjTreeNode parentNode, ChildTaskContainer parent) {
"""
Add tasks to the tree.
@param parentNode parent tree node
@param parent parent task container
"""
for (Task task : parent.getChildTasks())
{
final Task t = task;
MpxjTreeNode childNode = new MpxjTr... | java | private void addTasks(MpxjTreeNode parentNode, ChildTaskContainer parent)
{
for (Task task : parent.getChildTasks())
{
final Task t = task;
MpxjTreeNode childNode = new MpxjTreeNode(task, TASK_EXCLUDED_METHODS)
{
@Override public String toString()
{
... | [
"private",
"void",
"addTasks",
"(",
"MpxjTreeNode",
"parentNode",
",",
"ChildTaskContainer",
"parent",
")",
"{",
"for",
"(",
"Task",
"task",
":",
"parent",
".",
"getChildTasks",
"(",
")",
")",
"{",
"final",
"Task",
"t",
"=",
"task",
";",
"MpxjTreeNode",
"c... | Add tasks to the tree.
@param parentNode parent tree node
@param parent parent task container | [
"Add",
"tasks",
"to",
"the",
"tree",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java#L198-L213 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java | RESTClient.sendRequest | public RESTResponse sendRequest(HttpMethod method, String uri,
Map<String, String> headers, byte[] body)
throws IOException {
"""
Send a REST command with the given method, URI, headers, and body to the
server and return the response in a {@link RESTResponse} obje... | java | public RESTResponse sendRequest(HttpMethod method, String uri,
Map<String, String> headers, byte[] body)
throws IOException {
// Compress body using GZIP and add a content-encoding header if compression is requested.
byte[] entity = body;
if (... | [
"public",
"RESTResponse",
"sendRequest",
"(",
"HttpMethod",
"method",
",",
"String",
"uri",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
",",
"byte",
"[",
"]",
"body",
")",
"throws",
"IOException",
"{",
"// Compress body using GZIP and add a content-e... | Send a REST command with the given method, URI, headers, and body to the
server and return the response in a {@link RESTResponse} object.
@param method HTTP method such as "GET" or "POST".
@param uri URI such as "/foo/bar?baz"
@param headers Headers to be included in the request, including conte... | [
"Send",
"a",
"REST",
"command",
"with",
"the",
"given",
"method",
"URI",
"headers",
"and",
"body",
"to",
"the",
"server",
"and",
"return",
"the",
"response",
"in",
"a",
"{",
"@link",
"RESTResponse",
"}",
"object",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java#L282-L292 |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/DateParser.java | DateParser.parseUsingMask | private static Date parseUsingMask(final String[] masks, String sDate, final Locale locale) {
"""
Parses a Date out of a string using an array of masks.
<p/>
It uses the masks in order until one of them succedes or all fail.
<p/>
@param masks array of masks to use for parsing the string
@param sDate string ... | java | private static Date parseUsingMask(final String[] masks, String sDate, final Locale locale) {
if (sDate != null) {
sDate = sDate.trim();
}
ParsePosition pp = null;
Date d = null;
for (int i = 0; d == null && i < masks.length; i++) {
final DateFormat df = n... | [
"private",
"static",
"Date",
"parseUsingMask",
"(",
"final",
"String",
"[",
"]",
"masks",
",",
"String",
"sDate",
",",
"final",
"Locale",
"locale",
")",
"{",
"if",
"(",
"sDate",
"!=",
"null",
")",
"{",
"sDate",
"=",
"sDate",
".",
"trim",
"(",
")",
";... | Parses a Date out of a string using an array of masks.
<p/>
It uses the masks in order until one of them succedes or all fail.
<p/>
@param masks array of masks to use for parsing the string
@param sDate string to parse for a date.
@return the Date represented by the given string using one of the given masks. It return... | [
"Parses",
"a",
"Date",
"out",
"of",
"a",
"string",
"using",
"an",
"array",
"of",
"masks",
".",
"<p",
"/",
">",
"It",
"uses",
"the",
"masks",
"in",
"order",
"until",
"one",
"of",
"them",
"succedes",
"or",
"all",
"fail",
".",
"<p",
"/",
">"
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/DateParser.java#L100-L120 |
bluelinelabs/Conductor | demo/src/main/java/com/bluelinelabs/conductor/demo/util/AnimUtils.java | AnimUtils.createIntProperty | public static <T> Property<T, Integer> createIntProperty(final IntProp<T> impl) {
"""
The animation framework has an optimization for <code>Properties</code> of type
<code>int</code> but it was only made public in API24, so wrap the impl in our own type
and conditionally create the appropriate type, delegating t... | java | public static <T> Property<T, Integer> createIntProperty(final IntProp<T> impl) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return new IntProperty<T>(impl.name) {
@Override
public Integer get(T object) {
return impl.get(object);
... | [
"public",
"static",
"<",
"T",
">",
"Property",
"<",
"T",
",",
"Integer",
">",
"createIntProperty",
"(",
"final",
"IntProp",
"<",
"T",
">",
"impl",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODES",
".",
... | The animation framework has an optimization for <code>Properties</code> of type
<code>int</code> but it was only made public in API24, so wrap the impl in our own type
and conditionally create the appropriate type, delegating the implementation. | [
"The",
"animation",
"framework",
"has",
"an",
"optimization",
"for",
"<code",
">",
"Properties<",
"/",
"code",
">",
"of",
"type",
"<code",
">",
"int<",
"/",
"code",
">",
"but",
"it",
"was",
"only",
"made",
"public",
"in",
"API24",
"so",
"wrap",
"the",
... | train | https://github.com/bluelinelabs/Conductor/blob/94c9121bb16f93b481954513a8e3905846829fb2/demo/src/main/java/com/bluelinelabs/conductor/demo/util/AnimUtils.java#L109-L135 |
JOML-CI/JOML | src/org/joml/Matrix3x2d.java | Matrix3x2d.scaleAround | public Matrix3x2d scaleAround(double sx, double sy, double ox, double oy) {
"""
Apply scaling to this matrix by scaling the base axes by the given sx and
sy factors while using <code>(ox, oy)</code> as the scaling origin.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
... | java | public Matrix3x2d scaleAround(double sx, double sy, double ox, double oy) {
return scaleAround(sx, sy, ox, oy, this);
} | [
"public",
"Matrix3x2d",
"scaleAround",
"(",
"double",
"sx",
",",
"double",
"sy",
",",
"double",
"ox",
",",
"double",
"oy",
")",
"{",
"return",
"scaleAround",
"(",
"sx",
",",
"sy",
",",
"ox",
",",
"oy",
",",
"this",
")",
";",
"}"
] | Apply scaling to this matrix by scaling the base axes by the given sx and
sy factors while using <code>(ox, oy)</code> as the scaling origin.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be <code>M * S</code>. So when transforming a
vector <code>v</co... | [
"Apply",
"scaling",
"to",
"this",
"matrix",
"by",
"scaling",
"the",
"base",
"axes",
"by",
"the",
"given",
"sx",
"and",
"sy",
"factors",
"while",
"using",
"<code",
">",
"(",
"ox",
"oy",
")",
"<",
"/",
"code",
">",
"as",
"the",
"scaling",
"origin",
"."... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2d.java#L1464-L1466 |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatControllerOutput.java | DssatControllerOutput.recordSWData | private void recordSWData(Map expData, DssatCommonOutput output) {
"""
write soil/weather files
@param expData The holder for experiment data include soil/weather data
@param output The DSSAT Writer object
"""
String id;
HashMap<String, Map> swData;
try {
if (output inst... | java | private void recordSWData(Map expData, DssatCommonOutput output) {
String id;
HashMap<String, Map> swData;
try {
if (output instanceof DssatSoilOutput) {
Map soilTmp = getObjectOr(expData, "soil", new HashMap());
if (soilTmp.isEmpty()) {
... | [
"private",
"void",
"recordSWData",
"(",
"Map",
"expData",
",",
"DssatCommonOutput",
"output",
")",
"{",
"String",
"id",
";",
"HashMap",
"<",
"String",
",",
"Map",
">",
"swData",
";",
"try",
"{",
"if",
"(",
"output",
"instanceof",
"DssatSoilOutput",
")",
"{... | write soil/weather files
@param expData The holder for experiment data include soil/weather data
@param output The DSSAT Writer object | [
"write",
"soil",
"/",
"weather",
"files"
] | train | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatControllerOutput.java#L284-L319 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java | AmazonDynamoDBClient.describeTable | public DescribeTableResult describeTable(DescribeTableRequest describeTableRequest)
throws AmazonServiceException, AmazonClientException {
"""
<p>
Retrieves information about the table, including the current status of
the table, the primary key schema and when the table was created.
</p>
<p>
If th... | java | public DescribeTableResult describeTable(DescribeTableRequest describeTableRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(describeTableRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMet... | [
"public",
"DescribeTableResult",
"describeTable",
"(",
"DescribeTableRequest",
"describeTableRequest",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
"{",
"ExecutionContext",
"executionContext",
"=",
"createExecutionContext",
"(",
"describeTableRequest",
"... | <p>
Retrieves information about the table, including the current status of
the table, the primary key schema and when the table was created.
</p>
<p>
If the table does not exist, Amazon DynamoDB returns a
<code>ResourceNotFoundException</code> .
</p>
@param describeTableRequest Container for the necessary parameters t... | [
"<p",
">",
"Retrieves",
"information",
"about",
"the",
"table",
"including",
"the",
"current",
"status",
"of",
"the",
"table",
"the",
"primary",
"key",
"schema",
"and",
"when",
"the",
"table",
"was",
"created",
".",
"<",
"/",
"p",
">",
"<p",
">",
"If",
... | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java#L589-L601 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/SnsAPI.java | SnsAPI.auth | public static BaseResult auth(String access_token,String openid) {
"""
检验授权凭证(access_token)是否有效
@since 2.8.1
@param access_token access_token
@param openid openid
@return result
"""
HttpUriRequest httpUriRequest = RequestBuilder.get()
.setUri(BASE_URI + "/sns/auth")
.addParameter(PARAM_ACCESS_TOK... | java | public static BaseResult auth(String access_token,String openid){
HttpUriRequest httpUriRequest = RequestBuilder.get()
.setUri(BASE_URI + "/sns/auth")
.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token))
.addParameter("openid", openid)
.build();
return LocalHttpClient.executeJsonResult(h... | [
"public",
"static",
"BaseResult",
"auth",
"(",
"String",
"access_token",
",",
"String",
"openid",
")",
"{",
"HttpUriRequest",
"httpUriRequest",
"=",
"RequestBuilder",
".",
"get",
"(",
")",
".",
"setUri",
"(",
"BASE_URI",
"+",
"\"/sns/auth\"",
")",
".",
"addPar... | 检验授权凭证(access_token)是否有效
@since 2.8.1
@param access_token access_token
@param openid openid
@return result | [
"检验授权凭证(access_token)是否有效"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/SnsAPI.java#L110-L117 |
twitter/hraven | hraven-core/src/main/java/com/twitter/hraven/datasource/AppSummaryService.java | AppSummaryService.getTimestamp | long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) {
"""
find out the top of the day/week timestamp
@param runId
@return top of the day/week timestamp
"""
if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) {
// get top of the hour
long dayTimestamp = ru... | java | long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) {
if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) {
// get top of the hour
long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY);
return dayTimestamp;
} else if (AggregationConstants.AGGREGAT... | [
"long",
"getTimestamp",
"(",
"long",
"runId",
",",
"AggregationConstants",
".",
"AGGREGATION_TYPE",
"aggType",
")",
"{",
"if",
"(",
"AggregationConstants",
".",
"AGGREGATION_TYPE",
".",
"DAILY",
".",
"equals",
"(",
"aggType",
")",
")",
"{",
"// get top of the hour... | find out the top of the day/week timestamp
@param runId
@return top of the day/week timestamp | [
"find",
"out",
"the",
"top",
"of",
"the",
"day",
"/",
"week",
"timestamp"
] | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/AppSummaryService.java#L366-L383 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationsInner.java | OperationsInner.getAsync | public Observable<OperationResultInner> getAsync(String locationName, String operationName) {
"""
Get operation.
@param locationName The name of the location.
@param operationName The name of the operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to th... | java | public Observable<OperationResultInner> getAsync(String locationName, String operationName) {
return getWithServiceResponseAsync(locationName, operationName).map(new Func1<ServiceResponse<OperationResultInner>, OperationResultInner>() {
@Override
public OperationResultInner call(ServiceR... | [
"public",
"Observable",
"<",
"OperationResultInner",
">",
"getAsync",
"(",
"String",
"locationName",
",",
"String",
"operationName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"locationName",
",",
"operationName",
")",
".",
"map",
"(",
"new",
"Func1",
... | Get operation.
@param locationName The name of the location.
@param operationName The name of the operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationResultInner object | [
"Get",
"operation",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationsInner.java#L95-L102 |
google/j2objc | jre_emul/android/platform/libcore/xml/src/main/java/org/kxml2/io/KXmlParser.java | KXmlParser.pushContentSource | private void pushContentSource(char[] newBuffer) {
"""
Prepends the characters of {@code newBuffer} to be read before the
current buffer.
"""
nextContentSource = new ContentSource(nextContentSource, buffer, position, limit);
buffer = newBuffer;
position = 0;
limit = newBuffer.l... | java | private void pushContentSource(char[] newBuffer) {
nextContentSource = new ContentSource(nextContentSource, buffer, position, limit);
buffer = newBuffer;
position = 0;
limit = newBuffer.length;
} | [
"private",
"void",
"pushContentSource",
"(",
"char",
"[",
"]",
"newBuffer",
")",
"{",
"nextContentSource",
"=",
"new",
"ContentSource",
"(",
"nextContentSource",
",",
"buffer",
",",
"position",
",",
"limit",
")",
";",
"buffer",
"=",
"newBuffer",
";",
"position... | Prepends the characters of {@code newBuffer} to be read before the
current buffer. | [
"Prepends",
"the",
"characters",
"of",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/xml/src/main/java/org/kxml2/io/KXmlParser.java#L2162-L2167 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/main/JavaCompiler.java | JavaCompiler.printSource | JavaFileObject printSource(Env<AttrContext> env, JCClassDecl cdef) throws IOException {
"""
Emit plain Java source for a class.
@param env The attribution environment of the outermost class
containing this class.
@param cdef The class definition to be printed.
"""
JavaFileObject outFile
... | java | JavaFileObject printSource(Env<AttrContext> env, JCClassDecl cdef) throws IOException {
JavaFileObject outFile
= fileManager.getJavaFileForOutput(CLASS_OUTPUT,
cdef.sym.flatname.toString(),
JavaFileObject.K... | [
"JavaFileObject",
"printSource",
"(",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"JCClassDecl",
"cdef",
")",
"throws",
"IOException",
"{",
"JavaFileObject",
"outFile",
"=",
"fileManager",
".",
"getJavaFileForOutput",
"(",
"CLASS_OUTPUT",
",",
"cdef",
".",
"sym",
... | Emit plain Java source for a class.
@param env The attribution environment of the outermost class
containing this class.
@param cdef The class definition to be printed. | [
"Emit",
"plain",
"Java",
"source",
"for",
"a",
"class",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java#L716-L736 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.initiateConference | public void initiateConference(String connId, String destination) throws WorkspaceApiException {
"""
Initiate a two-step conference to the specified destination. This places the existing call on
hold and creates a new call in the dialing state (step 1). After initiating the conference you can use
`completeConfer... | java | public void initiateConference(String connId, String destination) throws WorkspaceApiException {
this.initiateConference(connId, destination, null, null, null, null, null);
} | [
"public",
"void",
"initiateConference",
"(",
"String",
"connId",
",",
"String",
"destination",
")",
"throws",
"WorkspaceApiException",
"{",
"this",
".",
"initiateConference",
"(",
"connId",
",",
"destination",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
... | Initiate a two-step conference to the specified destination. This places the existing call on
hold and creates a new call in the dialing state (step 1). After initiating the conference you can use
`completeConference()` to complete the conference and bring all parties into the same call (step 2).
@param connId The conn... | [
"Initiate",
"a",
"two",
"-",
"step",
"conference",
"to",
"the",
"specified",
"destination",
".",
"This",
"places",
"the",
"existing",
"call",
"on",
"hold",
"and",
"creates",
"a",
"new",
"call",
"in",
"the",
"dialing",
"state",
"(",
"step",
"1",
")",
".",... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L663-L665 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_udp_farm_farmId_PUT | public void serviceName_udp_farm_farmId_PUT(String serviceName, Long farmId, OvhBackendUdp body) throws IOException {
"""
Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/udp/farm/{farmId}
@param body [required] New object properties
@param serviceName [required] The internal name of your... | java | public void serviceName_udp_farm_farmId_PUT(String serviceName, Long farmId, OvhBackendUdp body) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/udp/farm/{farmId}";
StringBuilder sb = path(qPath, serviceName, farmId);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_udp_farm_farmId_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"farmId",
",",
"OvhBackendUdp",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/udp/farm/{farmId}\"",
";",
"StringBuilder",
... | Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/udp/farm/{farmId}
@param body [required] New object properties
@param serviceName [required] The internal name of your IP load balancing
@param farmId [required] Id of your farm
API beta | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L912-L916 |
konmik/solid | streams/src/main/java/solid/stream/Stream.java | Stream.distinct | public Stream<T> distinct() {
"""
Returns a new stream that filters out duplicate items off the current stream.
<p/>
This operator keeps a list of all items that has been passed to
compare it against next items.
@return a new stream that filters out duplicate items off the current stream.
"""
fin... | java | public Stream<T> distinct() {
final ArrayList<T> passed = new ArrayList<>();
return filter(new Func1<T, Boolean>() {
@Override
public Boolean call(T value) {
if (passed.contains(value))
return false;
passed.add(value);
... | [
"public",
"Stream",
"<",
"T",
">",
"distinct",
"(",
")",
"{",
"final",
"ArrayList",
"<",
"T",
">",
"passed",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"return",
"filter",
"(",
"new",
"Func1",
"<",
"T",
",",
"Boolean",
">",
"(",
")",
"{",
"@",... | Returns a new stream that filters out duplicate items off the current stream.
<p/>
This operator keeps a list of all items that has been passed to
compare it against next items.
@return a new stream that filters out duplicate items off the current stream. | [
"Returns",
"a",
"new",
"stream",
"that",
"filters",
"out",
"duplicate",
"items",
"off",
"the",
"current",
"stream",
".",
"<p",
"/",
">",
"This",
"operator",
"keeps",
"a",
"list",
"of",
"all",
"items",
"that",
"has",
"been",
"passed",
"to",
"compare",
"it... | train | https://github.com/konmik/solid/blob/3d6c452ef3219fd843547f3590b3d2e1ad3f1d17/streams/src/main/java/solid/stream/Stream.java#L482-L493 |
fuinorg/objects4j | src/main/java/org/fuin/objects4j/vo/LocaleStrValidator.java | LocaleStrValidator.isValid | public static final boolean isValid(final String value) {
"""
Check that a given string is a valid {@link java.util.Locale}.
@param value
Value to check.
@return Returns <code>true</code> if it's a valid Localed else <code>false</code> is returned.
"""
if (value == null) {
return t... | java | public static final boolean isValid(final String value) {
if (value == null) {
return true;
}
final Locale locale;
final int p = value.indexOf("__");
if (p > -1) {
locale = new Locale(value.substring(0, p), null, value.substring(p + 2));
} ... | [
"public",
"static",
"final",
"boolean",
"isValid",
"(",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"final",
"Locale",
"locale",
";",
"final",
"int",
"p",
"=",
"value",
".",
"indexOf",
... | Check that a given string is a valid {@link java.util.Locale}.
@param value
Value to check.
@return Returns <code>true</code> if it's a valid Localed else <code>false</code> is returned. | [
"Check",
"that",
"a",
"given",
"string",
"is",
"a",
"valid",
"{",
"@link",
"java",
".",
"util",
".",
"Locale",
"}",
"."
] | train | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/LocaleStrValidator.java#L51-L72 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyBeanHelper.java | ModifyBeanHelper.generateWhereCondition | public void generateWhereCondition(MethodSpec.Builder methodBuilder, SQLiteModelMethod method, SqlAnalyzer analyzer) {
"""
Generate where condition.
@param methodBuilder
the method builder
@param method
the method
@param analyzer
the analyzer
"""
SQLiteEntity entity = method.getEntity();
String be... | java | public void generateWhereCondition(MethodSpec.Builder methodBuilder, SQLiteModelMethod method, SqlAnalyzer analyzer) {
SQLiteEntity entity = method.getEntity();
String beanParamName = method.getParameters().get(0).value0;
SQLProperty property;
boolean nullable;
TypeName beanClass = typeName(entity.getElement... | [
"public",
"void",
"generateWhereCondition",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"SQLiteModelMethod",
"method",
",",
"SqlAnalyzer",
"analyzer",
")",
"{",
"SQLiteEntity",
"entity",
"=",
"method",
".",
"getEntity",
"(",
")",
";",
"String",
"beanP... | Generate where condition.
@param methodBuilder
the method builder
@param method
the method
@param analyzer
the analyzer | [
"Generate",
"where",
"condition",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyBeanHelper.java#L207-L242 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/AdapterUtil.java | AdapterUtil.mapSQLException | public static SQLException mapSQLException(SQLException se, Object mapper) {
"""
Translates a SQLException from the database. Exception mapping code is
now consolidated into AdapterUtil.mapException.
@param SQLException se - the SQLException from the database
@param mapper the managed connection or managed ... | java | public static SQLException mapSQLException(SQLException se, Object mapper) {
return (SQLException) mapException(se, null, mapper, true);
} | [
"public",
"static",
"SQLException",
"mapSQLException",
"(",
"SQLException",
"se",
",",
"Object",
"mapper",
")",
"{",
"return",
"(",
"SQLException",
")",
"mapException",
"(",
"se",
",",
"null",
",",
"mapper",
",",
"true",
")",
";",
"}"
] | Translates a SQLException from the database. Exception mapping code is
now consolidated into AdapterUtil.mapException.
@param SQLException se - the SQLException from the database
@param mapper the managed connection or managed connection factory capable of
mapping the exception. If this value is NULL, then exception ... | [
"Translates",
"a",
"SQLException",
"from",
"the",
"database",
".",
"Exception",
"mapping",
"code",
"is",
"now",
"consolidated",
"into",
"AdapterUtil",
".",
"mapException",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/AdapterUtil.java#L1257-L1259 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/PixelDepthLinearMetric.java | PixelDepthLinearMetric.depth2View | public double depth2View( Point2D_F64 a , Point2D_F64 b , Se3_F64 fromAtoB ) {
"""
Computes pixel depth in image 'a' from two observations.
@param a Observation in first frame. In calibrated coordinates. Not modified.
@param b Observation in second frame. In calibrated coordinates. Not modified.
@param from... | java | public double depth2View( Point2D_F64 a , Point2D_F64 b , Se3_F64 fromAtoB )
{
DMatrixRMaj R = fromAtoB.getR();
Vector3D_F64 T = fromAtoB.getT();
GeometryMath_F64.multCrossA(b, R, temp0);
GeometryMath_F64.mult(temp0,a,temp1);
GeometryMath_F64.cross(b, T, temp2);
return -(temp2.x+temp2.y+temp2.z)/(temp1.... | [
"public",
"double",
"depth2View",
"(",
"Point2D_F64",
"a",
",",
"Point2D_F64",
"b",
",",
"Se3_F64",
"fromAtoB",
")",
"{",
"DMatrixRMaj",
"R",
"=",
"fromAtoB",
".",
"getR",
"(",
")",
";",
"Vector3D_F64",
"T",
"=",
"fromAtoB",
".",
"getT",
"(",
")",
";",
... | Computes pixel depth in image 'a' from two observations.
@param a Observation in first frame. In calibrated coordinates. Not modified.
@param b Observation in second frame. In calibrated coordinates. Not modified.
@param fromAtoB Transform from frame a to frame b.
@return Pixel depth in first frame. In same units as... | [
"Computes",
"pixel",
"depth",
"in",
"image",
"a",
"from",
"two",
"observations",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/PixelDepthLinearMetric.java#L101-L112 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.addIndex | Index addIndex(int[] col, HsqlName name, boolean unique, boolean migrating) {
"""
Because of the way indexes and column data are held in memory and on
disk, it is necessary to recreate the table when an index is added to a
non-empty cached table.
<p> With empty tables, Index objects are simply added
<p> Wi... | java | Index addIndex(int[] col, HsqlName name, boolean unique, boolean migrating) {
Index newindex;
if (table.isEmpty(session) || table.isIndexingMutable()) {
PersistentStore store = session.sessionData.getRowStore(table);
newindex = table.createIndex(store, name, col, null, null, u... | [
"Index",
"addIndex",
"(",
"int",
"[",
"]",
"col",
",",
"HsqlName",
"name",
",",
"boolean",
"unique",
",",
"boolean",
"migrating",
")",
"{",
"Index",
"newindex",
";",
"if",
"(",
"table",
".",
"isEmpty",
"(",
"session",
")",
"||",
"table",
".",
"isIndexi... | Because of the way indexes and column data are held in memory and on
disk, it is necessary to recreate the table when an index is added to a
non-empty cached table.
<p> With empty tables, Index objects are simply added
<p> With MEOMRY and TEXT tables, a new index is built up and nodes for
earch row are interlinked (f... | [
"Because",
"of",
"the",
"way",
"indexes",
"and",
"column",
"data",
"are",
"held",
"in",
"memory",
"and",
"on",
"disk",
"it",
"is",
"necessary",
"to",
"recreate",
"the",
"table",
"when",
"an",
"index",
"is",
"added",
"to",
"a",
"non",
"-",
"empty",
"cac... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L486-L517 |
Bedework/bw-util | bw-util-xml/src/main/java/org/bedework/util/xml/XmlUtil.java | XmlUtil.getReqOneNodeVal | public static String getReqOneNodeVal(final Node el, final String name)
throws SAXException {
"""
Get the value of an element. We expect 1 child node otherwise we raise an
exception.
@param el Node whose value we want
@param name String name to make exception messages more readable
@ret... | java | public static String getReqOneNodeVal(final Node el, final String name)
throws SAXException {
String str = getOneNodeVal(el, name);
if ((str == null) || (str.length() == 0)) {
throw new SAXException("Missing property value: " + name);
}
return str;
} | [
"public",
"static",
"String",
"getReqOneNodeVal",
"(",
"final",
"Node",
"el",
",",
"final",
"String",
"name",
")",
"throws",
"SAXException",
"{",
"String",
"str",
"=",
"getOneNodeVal",
"(",
"el",
",",
"name",
")",
";",
"if",
"(",
"(",
"str",
"==",
"null"... | Get the value of an element. We expect 1 child node otherwise we raise an
exception.
@param el Node whose value we want
@param name String name to make exception messages more readable
@return String node value
@throws SAXException | [
"Get",
"the",
"value",
"of",
"an",
"element",
".",
"We",
"expect",
"1",
"child",
"node",
"otherwise",
"we",
"raise",
"an",
"exception",
"."
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlUtil.java#L189-L198 |
EsotericSoftware/kryo | benchmarks/src/main/java/com/esotericsoftware/kryo/benchmarks/KryoBenchmarks.java | KryoBenchmarks.main | static public void main (String[] args) throws Exception {
"""
To run from command line: $ mvn clean install exec:java -Dexec.args="-f 4 -wi 5 -i 3 -t 2 -w 2s -r 2s"
<p>
Fork 0 can be used for debugging/development, eg: -f 0 -wi 1 -i 1 -t 1 -w 1s -r 1s [benchmarkClassName]
"""
if (args.length == 0) {
St... | java | static public void main (String[] args) throws Exception {
if (args.length == 0) {
String commandLine = "-f 0 -wi 1 -i 1 -t 1 -w 1s -r 1s " // For developement only (fork 0, short runs).
// + "-bs 2500000 ArrayBenchmark" //
// + "-rf csv FieldSerializerBenchmark.field FieldSerializerBenchmark.tagged" //
/... | [
"static",
"public",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"if",
"(",
"args",
".",
"length",
"==",
"0",
")",
"{",
"String",
"commandLine",
"=",
"\"-f 0 -wi 1 -i 1 -t 1 -w 1s -r 1s \"",
"// For developement only (fork 0, s... | To run from command line: $ mvn clean install exec:java -Dexec.args="-f 4 -wi 5 -i 3 -t 2 -w 2s -r 2s"
<p>
Fork 0 can be used for debugging/development, eg: -f 0 -wi 1 -i 1 -t 1 -w 1s -r 1s [benchmarkClassName] | [
"To",
"run",
"from",
"command",
"line",
":",
"$",
"mvn",
"clean",
"install",
"exec",
":",
"java",
"-",
"Dexec",
".",
"args",
"=",
"-",
"f",
"4",
"-",
"wi",
"5",
"-",
"i",
"3",
"-",
"t",
"2",
"-",
"w",
"2s",
"-",
"r",
"2s",
"<p",
">",
"Fork"... | train | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/benchmarks/src/main/java/com/esotericsoftware/kryo/benchmarks/KryoBenchmarks.java#L28-L39 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.orthoSymmetricLH | public Matrix4d orthoSymmetricLH(double width, double height, double zNear, double zFar, Matrix4d dest) {
"""
Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix and store the result in <code>dest</code>.
... | java | public Matrix4d orthoSymmetricLH(double width, double height, double zNear, double zFar, Matrix4d dest) {
return orthoSymmetricLH(width, height, zNear, zFar, false, dest);
} | [
"public",
"Matrix4d",
"orthoSymmetricLH",
"(",
"double",
"width",
",",
"double",
"height",
",",
"double",
"zNear",
",",
"double",
"zFar",
",",
"Matrix4d",
"dest",
")",
"{",
"return",
"orthoSymmetricLH",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFar",... | Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix and store the result in <code>dest</code>.
<p>
This method is equivalent to calling {@link #orthoLH(double, double, double, double, double, double, Matrix4d) or... | [
"Apply",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..",
"+",
"1",
"]",
"<",
"/",
"code",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L10325-L10327 |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/GeneratedSourceMerger.java | GeneratedSourceMerger.extractGeneratedSection | protected Section extractGeneratedSection (Matcher m, String input) {
"""
Returns a section name and its contents from the given matcher pointing to the start of a
section. <code>m</code> is at the end of the section when this returns.
"""
int startIdx = m.start();
String name = m.group(1);
... | java | protected Section extractGeneratedSection (Matcher m, String input)
{
int startIdx = m.start();
String name = m.group(1);
if (m.group(2).equals("DISABLED")) {
return new Section(name, input.substring(startIdx, m.end()), true);
}
Preconditions.checkArgument(m.group... | [
"protected",
"Section",
"extractGeneratedSection",
"(",
"Matcher",
"m",
",",
"String",
"input",
")",
"{",
"int",
"startIdx",
"=",
"m",
".",
"start",
"(",
")",
";",
"String",
"name",
"=",
"m",
".",
"group",
"(",
"1",
")",
";",
"if",
"(",
"m",
".",
"... | Returns a section name and its contents from the given matcher pointing to the start of a
section. <code>m</code> is at the end of the section when this returns. | [
"Returns",
"a",
"section",
"name",
"and",
"its",
"contents",
"from",
"the",
"given",
"matcher",
"pointing",
"to",
"the",
"start",
"of",
"a",
"section",
".",
"<code",
">",
"m<",
"/",
"code",
">",
"is",
"at",
"the",
"end",
"of",
"the",
"section",
"when",... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/GeneratedSourceMerger.java#L98-L114 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/msg/ReadFileRecordRequest.java | ReadFileRecordRequest.readData | public void readData(DataInput din) throws IOException {
"""
readData -- read all the data for this request.
@throws java.io.IOException If the data cannot be read
"""
int byteCount = din.readUnsignedByte();
int recordCount = byteCount / 7;
records = new RecordRequest[recordCount];
... | java | public void readData(DataInput din) throws IOException {
int byteCount = din.readUnsignedByte();
int recordCount = byteCount / 7;
records = new RecordRequest[recordCount];
for (int i = 0; i < recordCount; i++) {
if (din.readByte() != 6) {
throw new IOExcepti... | [
"public",
"void",
"readData",
"(",
"DataInput",
"din",
")",
"throws",
"IOException",
"{",
"int",
"byteCount",
"=",
"din",
".",
"readUnsignedByte",
"(",
")",
";",
"int",
"recordCount",
"=",
"byteCount",
"/",
"7",
";",
"records",
"=",
"new",
"RecordRequest",
... | readData -- read all the data for this request.
@throws java.io.IOException If the data cannot be read | [
"readData",
"--",
"read",
"all",
"the",
"data",
"for",
"this",
"request",
"."
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/msg/ReadFileRecordRequest.java#L175-L196 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java | SARLOperationHelper._hasSideEffects | protected Boolean _hasSideEffects(XThrowExpression expression, ISideEffectContext context) {
"""
Test if the given expression has side effects.
@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects.
"""
return hasSideEff... | java | protected Boolean _hasSideEffects(XThrowExpression expression, ISideEffectContext context) {
return hasSideEffects(expression.getExpression(), context);
} | [
"protected",
"Boolean",
"_hasSideEffects",
"(",
"XThrowExpression",
"expression",
",",
"ISideEffectContext",
"context",
")",
"{",
"return",
"hasSideEffects",
"(",
"expression",
".",
"getExpression",
"(",
")",
",",
"context",
")",
";",
"}"
] | Test if the given expression has side effects.
@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects. | [
"Test",
"if",
"the",
"given",
"expression",
"has",
"side",
"effects",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java#L349-L351 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/JBossRuleCreator.java | JBossRuleCreator.visit | @Override
public void visit(HighLevelAbstractionDefinition def) throws ProtempaException {
"""
Translates a high-level abstraction definition into rules.
@param def a {@link HighLevelAbstractionDefinition}. Cannot be
<code>null</code>.
@throws KnowledgeSourceReadException if an error occurs accessing the
... | java | @Override
public void visit(HighLevelAbstractionDefinition def) throws ProtempaException {
LOGGER.log(Level.FINER, "Creating rule for {0}", def);
try {
Set<ExtendedPropositionDefinition> epdsC = def
.getExtendedPropositionDefinitions();
/*
* ... | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"HighLevelAbstractionDefinition",
"def",
")",
"throws",
"ProtempaException",
"{",
"LOGGER",
".",
"log",
"(",
"Level",
".",
"FINER",
",",
"\"Creating rule for {0}\"",
",",
"def",
")",
";",
"try",
"{",
"Set",
"<",... | Translates a high-level abstraction definition into rules.
@param def a {@link HighLevelAbstractionDefinition}. Cannot be
<code>null</code>.
@throws KnowledgeSourceReadException if an error occurs accessing the
knowledge source during rule creation. | [
"Translates",
"a",
"high",
"-",
"level",
"abstraction",
"definition",
"into",
"rules",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/JBossRuleCreator.java#L253-L290 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/Polygon.java | Polygon.fromLngLats | static Polygon fromLngLats(@NonNull double[][][] coordinates) {
"""
Create a new instance of this class by passing in three dimensional double array which defines
the geometry of this polygon.
@param coordinates a three dimensional double array defining this polygons geometry
@return a new instance of this cl... | java | static Polygon fromLngLats(@NonNull double[][][] coordinates) {
List<List<Point>> converted = new ArrayList<>(coordinates.length);
for (double[][] coordinate : coordinates) {
List<Point> innerList = new ArrayList<>(coordinate.length);
for (double[] pointCoordinate : coordinate) {
innerList.a... | [
"static",
"Polygon",
"fromLngLats",
"(",
"@",
"NonNull",
"double",
"[",
"]",
"[",
"]",
"[",
"]",
"coordinates",
")",
"{",
"List",
"<",
"List",
"<",
"Point",
">>",
"converted",
"=",
"new",
"ArrayList",
"<>",
"(",
"coordinates",
".",
"length",
")",
";",
... | Create a new instance of this class by passing in three dimensional double array which defines
the geometry of this polygon.
@param coordinates a three dimensional double array defining this polygons geometry
@return a new instance of this class defined by the values passed inside this static factory
method
@since 3.0... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"passing",
"in",
"three",
"dimensional",
"double",
"array",
"which",
"defines",
"the",
"geometry",
"of",
"this",
"polygon",
"."
] | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/Polygon.java#L127-L137 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/JPAEntity.java | JPAEntity.findByPrimaryKey | public static <E extends Identifiable> E findByPrimaryKey(EntityManager em, BigInteger id, Class<E> type) {
"""
Finds a JPA entity by its primary key.
@param <E> The JPA entity type.
@param em The entity manager to use. Cannot be null.
@param id The ID of the entity to find. Must be a positive... | java | public static <E extends Identifiable> E findByPrimaryKey(EntityManager em, BigInteger id, Class<E> type) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(id != null && id.compareTo(ZERO) > 0, "ID cannot be null and must be positive and non-zero");
requireArgu... | [
"public",
"static",
"<",
"E",
"extends",
"Identifiable",
">",
"E",
"findByPrimaryKey",
"(",
"EntityManager",
"em",
",",
"BigInteger",
"id",
",",
"Class",
"<",
"E",
">",
"type",
")",
"{",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"The entity manager ... | Finds a JPA entity by its primary key.
@param <E> The JPA entity type.
@param em The entity manager to use. Cannot be null.
@param id The ID of the entity to find. Must be a positive, non-zero integer.
@param type The runtime type to cast the result value to.
@return The corresponding entity or nu... | [
"Finds",
"a",
"JPA",
"entity",
"by",
"its",
"primary",
"key",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/JPAEntity.java#L181-L196 |
shinesolutions/swagger-aem | java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/ConsoleApi.java | ConsoleApi.postSamlConfigurationAsync | public com.squareup.okhttp.Call postSamlConfigurationAsync(Boolean post, Boolean apply, Boolean delete, String action, String location, List<String> path, String serviceRanking, String idpUrl, String idpCertAlias, Boolean idpHttpRedirect, String serviceProviderEntityId, String assertionConsumerServiceURL, String spPriv... | java | public com.squareup.okhttp.Call postSamlConfigurationAsync(Boolean post, Boolean apply, Boolean delete, String action, String location, List<String> path, String serviceRanking, String idpUrl, String idpCertAlias, Boolean idpHttpRedirect, String serviceProviderEntityId, String assertionConsumerServiceURL, String spPriv... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"postSamlConfigurationAsync",
"(",
"Boolean",
"post",
",",
"Boolean",
"apply",
",",
"Boolean",
"delete",
",",
"String",
"action",
",",
"String",
"location",
",",
"List",
"<",
"String",
">",
"path"... | (asynchronously)
@param post (optional)
@param apply (optional)
@param delete (optional)
@param action (optional)
@param location (optional)
@param path (optional)
@param serviceRanking (optional)
@param idpUrl (optional)
@param idpCertAlias (optional)
@param idpHttpRedirect (optional)
@param serviceProvider... | [
"(",
"asynchronously",
")"
] | train | https://github.com/shinesolutions/swagger-aem/blob/ae7da4df93e817dc2bad843779b2069d9c4e7c6b/java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/ConsoleApi.java#L585-L610 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/GroupService.java | GroupService.findLockableGroup | public static ILockableEntityGroup findLockableGroup(String key, String lockOwner)
throws GroupsException {
"""
Returns a pre-existing <code>ILockableEntityGroup</code> or null if the group is not found.
@param key String - the group key.
@param lockOwner String - the owner of the lock, typically t... | java | public static ILockableEntityGroup findLockableGroup(String key, String lockOwner)
throws GroupsException {
LOGGER.trace("Invoking findLockableGroup for key='{}', lockOwner='{}'", key, lockOwner);
return instance().ifindLockableGroup(key, lockOwner);
} | [
"public",
"static",
"ILockableEntityGroup",
"findLockableGroup",
"(",
"String",
"key",
",",
"String",
"lockOwner",
")",
"throws",
"GroupsException",
"{",
"LOGGER",
".",
"trace",
"(",
"\"Invoking findLockableGroup for key='{}', lockOwner='{}'\"",
",",
"key",
",",
"lockOwne... | Returns a pre-existing <code>ILockableEntityGroup</code> or null if the group is not found.
@param key String - the group key.
@param lockOwner String - the owner of the lock, typically the user.
@return org.apereo.portal.groups.ILockableEntityGroup | [
"Returns",
"a",
"pre",
"-",
"existing",
"<code",
">",
"ILockableEntityGroup<",
"/",
"code",
">",
"or",
"null",
"if",
"the",
"group",
"is",
"not",
"found",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/GroupService.java#L91-L95 |
vladmihalcea/flexy-pool | flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/LazyJndiResolver.java | LazyJndiResolver.newInstance | @SuppressWarnings("unchecked")
public static <T> T newInstance(String name, Class<?> objectType) {
"""
Creates a new Proxy instance
@param name JNDI name of the object to be lazily looked up
@param objectType object type
@param <T> typed parameter
@return Proxy object
"""
return ... | java | @SuppressWarnings("unchecked")
public static <T> T newInstance(String name, Class<?> objectType) {
return (T) Proxy.newProxyInstance(
ClassLoaderUtils.getClassLoader(),
new Class[]{objectType},
new LazyJndiResolver(name));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"objectType",
")",
"{",
"return",
"(",
"T",
")",
"Proxy",
".",
"newProxyInstance",
"(",
"ClassL... | Creates a new Proxy instance
@param name JNDI name of the object to be lazily looked up
@param objectType object type
@param <T> typed parameter
@return Proxy object | [
"Creates",
"a",
"new",
"Proxy",
"instance"
] | train | https://github.com/vladmihalcea/flexy-pool/blob/d763d359e68299c2b4e28e4b67770581ae083431/flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/LazyJndiResolver.java#L60-L66 |
opentelecoms-org/jsmpp | jsmpp/src/main/java/org/jsmpp/util/RelativeTimeFormatter.java | RelativeTimeFormatter.format | public String format(Calendar calendar, Calendar smscCalendar) {
"""
Return the relative time from the calendar datetime against the SMSC datetime.
@param calendar the date.
@param smscCalendar the SMSC date.
@return The relative time between the calendar date and the SMSC calendar date.
"""
if (c... | java | public String format(Calendar calendar, Calendar smscCalendar) {
if (calendar == null || smscCalendar == null) {
return null;
}
long diffTimeInMillis = calendar.getTimeInMillis() - smscCalendar.getTimeInMillis();
if (diffTimeInMillis < 0) {
throw new IllegalArgumentException("The requested ... | [
"public",
"String",
"format",
"(",
"Calendar",
"calendar",
",",
"Calendar",
"smscCalendar",
")",
"{",
"if",
"(",
"calendar",
"==",
"null",
"||",
"smscCalendar",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"long",
"diffTimeInMillis",
"=",
"calendar",
... | Return the relative time from the calendar datetime against the SMSC datetime.
@param calendar the date.
@param smscCalendar the SMSC date.
@return The relative time between the calendar date and the SMSC calendar date. | [
"Return",
"the",
"relative",
"time",
"from",
"the",
"calendar",
"datetime",
"against",
"the",
"SMSC",
"datetime",
"."
] | train | https://github.com/opentelecoms-org/jsmpp/blob/acc15e73e7431deabc803731971b15323315baaf/jsmpp/src/main/java/org/jsmpp/util/RelativeTimeFormatter.java#L64-L89 |
scireum/parsii | src/main/java/parsii/eval/Parser.java | Parser.reOrder | protected Expression reOrder(Expression left, Expression right, BinaryOperation.Op op) {
"""
/*
Reorders the operands of the given operation in order to generate a "left handed" AST which performs evaluations
in natural order (from left to right).
"""
if (right instanceof BinaryOperation) {
... | java | protected Expression reOrder(Expression left, Expression right, BinaryOperation.Op op) {
if (right instanceof BinaryOperation) {
BinaryOperation rightOp = (BinaryOperation) right;
if (!rightOp.isSealed() && rightOp.getOp().getPriority() == op.getPriority()) {
replaceLeft(... | [
"protected",
"Expression",
"reOrder",
"(",
"Expression",
"left",
",",
"Expression",
"right",
",",
"BinaryOperation",
".",
"Op",
"op",
")",
"{",
"if",
"(",
"right",
"instanceof",
"BinaryOperation",
")",
"{",
"BinaryOperation",
"rightOp",
"=",
"(",
"BinaryOperatio... | /*
Reorders the operands of the given operation in order to generate a "left handed" AST which performs evaluations
in natural order (from left to right). | [
"/",
"*",
"Reorders",
"the",
"operands",
"of",
"the",
"given",
"operation",
"in",
"order",
"to",
"generate",
"a",
"left",
"handed",
"AST",
"which",
"performs",
"evaluations",
"in",
"natural",
"order",
"(",
"from",
"left",
"to",
"right",
")",
"."
] | train | https://github.com/scireum/parsii/blob/fbf686155b1147b9e07ae21dcd02820b15c79a8c/src/main/java/parsii/eval/Parser.java#L299-L308 |
Javen205/IJPay | src/main/java/com/jpay/util/IOUtils.java | IOUtils.toFile | public static void toFile(InputStream input, File file) throws IOException {
"""
InputStream to File
@param input the <code>InputStream</code> to read from
@param file the File to write
@throws IOException id异常
"""
OutputStream os = new FileOutputStream(file);
int bytesRead = 0;
byte[] buffer = new b... | java | public static void toFile(InputStream input, File file) throws IOException {
OutputStream os = new FileOutputStream(file);
int bytesRead = 0;
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
while ((bytesRead = input.read(buffer, 0, DEFAULT_BUFFER_SIZE)) != -1) {
os.write(buffer, 0, bytesRead);
}
IOUtils.c... | [
"public",
"static",
"void",
"toFile",
"(",
"InputStream",
"input",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"OutputStream",
"os",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
";",
"int",
"bytesRead",
"=",
"0",
";",
"byte",
"[",
"]",
"... | InputStream to File
@param input the <code>InputStream</code> to read from
@param file the File to write
@throws IOException id异常 | [
"InputStream",
"to",
"File"
] | train | https://github.com/Javen205/IJPay/blob/78da6be4b70675abc6a41df74817532fa257ef29/src/main/java/com/jpay/util/IOUtils.java#L66-L75 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/msvc/MsvcProjectWriter.java | MsvcProjectWriter.getSources | private File[] getSources(final List<File> sourceList) {
"""
Get alphabetized array of source files.
@param sourceList
list of source files
@return File[] source files
"""
final File[] sortedSources = new File[sourceList.size()];
sourceList.toArray(sortedSources);
Arrays.sort(sortedSources, ne... | java | private File[] getSources(final List<File> sourceList) {
final File[] sortedSources = new File[sourceList.size()];
sourceList.toArray(sortedSources);
Arrays.sort(sortedSources, new Comparator<File>() {
@Override
public int compare(final File o1, final File o2) {
return o1.getName().compa... | [
"private",
"File",
"[",
"]",
"getSources",
"(",
"final",
"List",
"<",
"File",
">",
"sourceList",
")",
"{",
"final",
"File",
"[",
"]",
"sortedSources",
"=",
"new",
"File",
"[",
"sourceList",
".",
"size",
"(",
")",
"]",
";",
"sourceList",
".",
"toArray",... | Get alphabetized array of source files.
@param sourceList
list of source files
@return File[] source files | [
"Get",
"alphabetized",
"array",
"of",
"source",
"files",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/MsvcProjectWriter.java#L163-L173 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/crypto/HDUtils.java | HDUtils.parsePath | public static List<ChildNumber> parsePath(@Nonnull String path) {
"""
The path is a human-friendly representation of the deterministic path. For example:
"44H / 0H / 0H / 1 / 1"
Where a letter "H" means hardened key. Spaces are ignored.
"""
String[] parsedNodes = path.replace("M", "").split("/");... | java | public static List<ChildNumber> parsePath(@Nonnull String path) {
String[] parsedNodes = path.replace("M", "").split("/");
List<ChildNumber> nodes = new ArrayList<>();
for (String n : parsedNodes) {
n = n.replaceAll(" ", "");
if (n.length() == 0) continue;
bo... | [
"public",
"static",
"List",
"<",
"ChildNumber",
">",
"parsePath",
"(",
"@",
"Nonnull",
"String",
"path",
")",
"{",
"String",
"[",
"]",
"parsedNodes",
"=",
"path",
".",
"replace",
"(",
"\"M\"",
",",
"\"\"",
")",
".",
"split",
"(",
"\"/\"",
")",
";",
"... | The path is a human-friendly representation of the deterministic path. For example:
"44H / 0H / 0H / 1 / 1"
Where a letter "H" means hardened key. Spaces are ignored. | [
"The",
"path",
"is",
"a",
"human",
"-",
"friendly",
"representation",
"of",
"the",
"deterministic",
"path",
".",
"For",
"example",
":"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/crypto/HDUtils.java#L92-L106 |
google/j2objc | jre_emul/android/frameworks/base/core/java/com/android/internal/util/ArrayUtils.java | ArrayUtils.containsAll | public static <T> boolean containsAll(T[] array, T[] check) {
"""
Test if all {@code check} items are contained in {@code array}.
"""
for (T checkItem : check) {
if (!contains(array, checkItem)) {
return false;
}
}
return true;
} | java | public static <T> boolean containsAll(T[] array, T[] check) {
for (T checkItem : check) {
if (!contains(array, checkItem)) {
return false;
}
}
return true;
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"containsAll",
"(",
"T",
"[",
"]",
"array",
",",
"T",
"[",
"]",
"check",
")",
"{",
"for",
"(",
"T",
"checkItem",
":",
"check",
")",
"{",
"if",
"(",
"!",
"contains",
"(",
"array",
",",
"checkItem",
")"... | Test if all {@code check} items are contained in {@code array}. | [
"Test",
"if",
"all",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/com/android/internal/util/ArrayUtils.java#L151-L158 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java | TmdbMovies.getSimilarMovies | public ResultList<MovieInfo> getSimilarMovies(int movieId, Integer page, String language) throws MovieDbException {
"""
The similar movies method will let you retrieve the similar movies for a particular movie.
This data is created dynamically but with the help of users votes on TMDb.
The data is much better... | java | public ResultList<MovieInfo> getSimilarMovies(int movieId, Integer page, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, movieId);
parameters.add(Param.LANGUAGE, language);
parameters.add(Param.PAGE, page);
UR... | [
"public",
"ResultList",
"<",
"MovieInfo",
">",
"getSimilarMovies",
"(",
"int",
"movieId",
",",
"Integer",
"page",
",",
"String",
"language",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"par... | The similar movies method will let you retrieve the similar movies for a particular movie.
This data is created dynamically but with the help of users votes on TMDb.
The data is much better with movies that have more keywords
@param movieId
@param language
@param page
@return
@throws MovieDbException | [
"The",
"similar",
"movies",
"method",
"will",
"let",
"you",
"retrieve",
"the",
"similar",
"movies",
"for",
"a",
"particular",
"movie",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java#L392-L401 |
threerings/narya | core/src/main/java/com/threerings/presents/client/ClientDObjectMgr.java | ClientDObjectMgr.notifyFailure | protected void notifyFailure (int oid, String message) {
"""
Notifies the subscribers that had requested this object (for subscription) that it is not
available.
"""
// let the penders know that the object is not available
PendingRequest<?> req = _penders.remove(oid);
if (req == null) ... | java | protected void notifyFailure (int oid, String message)
{
// let the penders know that the object is not available
PendingRequest<?> req = _penders.remove(oid);
if (req == null) {
log.warning("Failed to get object, but no one cares?!", "oid", oid);
return;
}
... | [
"protected",
"void",
"notifyFailure",
"(",
"int",
"oid",
",",
"String",
"message",
")",
"{",
"// let the penders know that the object is not available",
"PendingRequest",
"<",
"?",
">",
"req",
"=",
"_penders",
".",
"remove",
"(",
"oid",
")",
";",
"if",
"(",
"req... | Notifies the subscribers that had requested this object (for subscription) that it is not
available. | [
"Notifies",
"the",
"subscribers",
"that",
"had",
"requested",
"this",
"object",
"(",
"for",
"subscription",
")",
"that",
"it",
"is",
"not",
"available",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/ClientDObjectMgr.java#L379-L391 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/UTF8ByteArrayUtils.java | UTF8ByteArrayUtils.findNthByte | public static int findNthByte(byte [] utf, int start, int length, byte b, int n) {
"""
Find the nth occurrence of the given byte b in a UTF-8 encoded string
@param utf a byte array containing a UTF-8 encoded string
@param start starting offset
@param length the length of byte array
@param b the byte to find
@... | java | public static int findNthByte(byte [] utf, int start, int length, byte b, int n) {
int pos = -1;
int nextStart = start;
for (int i = 0; i < n; i++) {
pos = findByte(utf, nextStart, length, b);
if (pos < 0) {
return pos;
}
nextStart = pos + 1;
}
return pos;
} | [
"public",
"static",
"int",
"findNthByte",
"(",
"byte",
"[",
"]",
"utf",
",",
"int",
"start",
",",
"int",
"length",
",",
"byte",
"b",
",",
"int",
"n",
")",
"{",
"int",
"pos",
"=",
"-",
"1",
";",
"int",
"nextStart",
"=",
"start",
";",
"for",
"(",
... | Find the nth occurrence of the given byte b in a UTF-8 encoded string
@param utf a byte array containing a UTF-8 encoded string
@param start starting offset
@param length the length of byte array
@param b the byte to find
@param n the desired occurrence of the given byte
@return position that nth occurrence of the give... | [
"Find",
"the",
"nth",
"occurrence",
"of",
"the",
"given",
"byte",
"b",
"in",
"a",
"UTF",
"-",
"8",
"encoded",
"string"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/UTF8ByteArrayUtils.java#L73-L84 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesInner.java | CertificatesInner.getAsync | public Observable<CertificateDescriptionInner> getAsync(String resourceGroupName, String resourceName, String certificateName) {
"""
Get the certificate.
Returns the certificate.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@param resourceName The name of the IoT hub.
@p... | java | public Observable<CertificateDescriptionInner> getAsync(String resourceGroupName, String resourceName, String certificateName) {
return getWithServiceResponseAsync(resourceGroupName, resourceName, certificateName).map(new Func1<ServiceResponse<CertificateDescriptionInner>, CertificateDescriptionInner>() {
... | [
"public",
"Observable",
"<",
"CertificateDescriptionInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"String",
"certificateName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceNam... | Get the certificate.
Returns the certificate.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@param resourceName The name of the IoT hub.
@param certificateName The name of the certificate
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observab... | [
"Get",
"the",
"certificate",
".",
"Returns",
"the",
"certificate",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesInner.java#L217-L224 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-util/src/main/java/org/deeplearning4j/util/Dl4jReflection.java | Dl4jReflection.getFieldsAsProperties | public static Properties getFieldsAsProperties(Object obj, Class<?>[] clazzes) throws Exception {
"""
Get fields as properties
@param obj the object to get fields for
@param clazzes the classes to use for reflection and properties.
T
@return the fields as properties
"""
Properties props = new Prope... | java | public static Properties getFieldsAsProperties(Object obj, Class<?>[] clazzes) throws Exception {
Properties props = new Properties();
for (Field field : obj.getClass().getDeclaredFields()) {
if (Modifier.isStatic(field.getModifiers()))
continue;
field.setAccessib... | [
"public",
"static",
"Properties",
"getFieldsAsProperties",
"(",
"Object",
"obj",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"clazzes",
")",
"throws",
"Exception",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"for",
"(",
"Field",
"field"... | Get fields as properties
@param obj the object to get fields for
@param clazzes the classes to use for reflection and properties.
T
@return the fields as properties | [
"Get",
"fields",
"as",
"properties"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-util/src/main/java/org/deeplearning4j/util/Dl4jReflection.java#L106-L122 |
UrielCh/ovh-java-sdk | ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java | ApiOvhSms.serviceName_virtualNumbers_number_chatAccess_GET | public OvhChatAccess serviceName_virtualNumbers_number_chatAccess_GET(String serviceName, String number) throws IOException {
"""
Get this object properties
REST: GET /sms/{serviceName}/virtualNumbers/{number}/chatAccess
@param serviceName [required] The internal name of your SMS offer
@param number [required... | java | public OvhChatAccess serviceName_virtualNumbers_number_chatAccess_GET(String serviceName, String number) throws IOException {
String qPath = "/sms/{serviceName}/virtualNumbers/{number}/chatAccess";
StringBuilder sb = path(qPath, serviceName, number);
String resp = exec(qPath, "GET", sb.toString(), null);
return... | [
"public",
"OvhChatAccess",
"serviceName_virtualNumbers_number_chatAccess_GET",
"(",
"String",
"serviceName",
",",
"String",
"number",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/sms/{serviceName}/virtualNumbers/{number}/chatAccess\"",
";",
"StringBuilder",
"s... | Get this object properties
REST: GET /sms/{serviceName}/virtualNumbers/{number}/chatAccess
@param serviceName [required] The internal name of your SMS offer
@param number [required] The virtual number | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L471-L476 |
stapler/stapler | groovy/src/main/java/org/kohsuke/stapler/jelly/groovy/SimpleTemplateParser.java | SimpleTemplateParser.groovySection | private void groovySection(Reader reader, StringWriter sw) throws IOException {
"""
Closes the currently open write and writes the following text as normal Groovy script code until it reaches an end %>.
@param reader a reader for the template text
@param sw a StringWriter to write expression content
@thro... | java | private void groovySection(Reader reader, StringWriter sw) throws IOException {
sw.write("\"\"\");");
int c;
while ((c = reader.read()) != -1) {
if (c == '%') {
c = reader.read();
if (c != '>') {
sw.write('%');
} els... | [
"private",
"void",
"groovySection",
"(",
"Reader",
"reader",
",",
"StringWriter",
"sw",
")",
"throws",
"IOException",
"{",
"sw",
".",
"write",
"(",
"\"\\\"\\\"\\\");\"",
")",
";",
"int",
"c",
";",
"while",
"(",
"(",
"c",
"=",
"reader",
".",
"read",
"(",
... | Closes the currently open write and writes the following text as normal Groovy script code until it reaches an end %>.
@param reader a reader for the template text
@param sw a StringWriter to write expression content
@throws IOException if something goes wrong | [
"Closes",
"the",
"currently",
"open",
"write",
"and",
"writes",
"the",
"following",
"text",
"as",
"normal",
"Groovy",
"script",
"code",
"until",
"it",
"reaches",
"an",
"end",
"%",
">",
"."
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/groovy/src/main/java/org/kohsuke/stapler/jelly/groovy/SimpleTemplateParser.java#L161-L181 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/neuralnetwork/BackPropagationNet.java | BackPropagationNet.feedForward | private void feedForward(Vec input, List<Vec> activations, List<Vec> derivatives) {
"""
Feeds a vector through the network to get an output
@param input the input to feed forward though the network
@param activations the list of allocated vectors to store the activation
outputs for each layer
@param derivative... | java | private void feedForward(Vec input, List<Vec> activations, List<Vec> derivatives)
{
Vec x = input;
for(int i = 0; i < Ws.size(); i++)
{
Matrix W_i = Ws.get(i);
Vec b_i = bs.get(i);
Vec a_i = activations.get(i);
a_i.zeroOut();
W_i.m... | [
"private",
"void",
"feedForward",
"(",
"Vec",
"input",
",",
"List",
"<",
"Vec",
">",
"activations",
",",
"List",
"<",
"Vec",
">",
"derivatives",
")",
"{",
"Vec",
"x",
"=",
"input",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"Ws",
".",
... | Feeds a vector through the network to get an output
@param input the input to feed forward though the network
@param activations the list of allocated vectors to store the activation
outputs for each layer
@param derivatives the list of allocated vectors to store the derivatives
of the activations | [
"Feeds",
"a",
"vector",
"through",
"the",
"network",
"to",
"get",
"an",
"output"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/neuralnetwork/BackPropagationNet.java#L826-L847 |
MythTV-Clients/MythTV-Service-API | src/main/java/org/mythtv/services/api/ServerVersionQuery.java | ServerVersionQuery.isServerReachable | public static boolean isServerReachable(String baseUrl, long connectTimeout, TimeUnit timeUnit) throws IOException {
"""
Check if the server is reachable
@param baseUrl The url of the server to test
@param connectTimeout connection timeout
@param timeUnit connection timeout unit
@return true if reachable oth... | java | public static boolean isServerReachable(String baseUrl, long connectTimeout, TimeUnit timeUnit) throws IOException {
OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(connectTimeout, timeUnit);
return isServerReachable(baseUrl, client);
} | [
"public",
"static",
"boolean",
"isServerReachable",
"(",
"String",
"baseUrl",
",",
"long",
"connectTimeout",
",",
"TimeUnit",
"timeUnit",
")",
"throws",
"IOException",
"{",
"OkHttpClient",
"client",
"=",
"new",
"OkHttpClient",
"(",
")",
";",
"client",
".",
"setC... | Check if the server is reachable
@param baseUrl The url of the server to test
@param connectTimeout connection timeout
@param timeUnit connection timeout unit
@return true if reachable otherwise false.
@throws IOException if an error occurs | [
"Check",
"if",
"the",
"server",
"is",
"reachable"
] | train | https://github.com/MythTV-Clients/MythTV-Service-API/blob/7951954f767515550738f1b064d6c97099e6df15/src/main/java/org/mythtv/services/api/ServerVersionQuery.java#L110-L114 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java | AbstractHibernateCriteriaBuilder.addProjectionToList | protected void addProjectionToList(Projection propertyProjection, String alias) {
"""
Adds a projection to the projectList for the given alias
@param propertyProjection The projection
@param alias The alias
"""
if (alias != null) {
projectionList.add(propertyProjection,alias);
}... | java | protected void addProjectionToList(Projection propertyProjection, String alias) {
if (alias != null) {
projectionList.add(propertyProjection,alias);
}
else {
projectionList.add(propertyProjection);
}
} | [
"protected",
"void",
"addProjectionToList",
"(",
"Projection",
"propertyProjection",
",",
"String",
"alias",
")",
"{",
"if",
"(",
"alias",
"!=",
"null",
")",
"{",
"projectionList",
".",
"add",
"(",
"propertyProjection",
",",
"alias",
")",
";",
"}",
"else",
"... | Adds a projection to the projectList for the given alias
@param propertyProjection The projection
@param alias The alias | [
"Adds",
"a",
"projection",
"to",
"the",
"projectList",
"for",
"the",
"given",
"alias"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L147-L154 |
hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/http2/encode/UrlEncoded.java | UrlEncoded.decodeTo | public static void decodeTo(String content, MultiMap<String> map, String charset) {
"""
Decoded parameters to Map.
@param content the string containing the encoded parameters
@param map the MultiMap to put parsed query parameters into
@param charset the charset to use for decoding
"""
decodeTo... | java | public static void decodeTo(String content, MultiMap<String> map, String charset) {
decodeTo(content, map, charset == null ? null : Charset.forName(charset));
} | [
"public",
"static",
"void",
"decodeTo",
"(",
"String",
"content",
",",
"MultiMap",
"<",
"String",
">",
"map",
",",
"String",
"charset",
")",
"{",
"decodeTo",
"(",
"content",
",",
"map",
",",
"charset",
"==",
"null",
"?",
"null",
":",
"Charset",
".",
"f... | Decoded parameters to Map.
@param content the string containing the encoded parameters
@param map the MultiMap to put parsed query parameters into
@param charset the charset to use for decoding | [
"Decoded",
"parameters",
"to",
"Map",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/encode/UrlEncoded.java#L175-L177 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/SquareImage_to_FiducialDetector.java | SquareImage_to_FiducialDetector.addPatternImage | public void addPatternImage(T pattern, double threshold, double lengthSide) {
"""
Add a new pattern to be detected. This function takes in a raw gray scale image and thresholds it.
@param pattern Gray scale image of the pattern
@param threshold Threshold used to convert it into a binary image
@param lengthSi... | java | public void addPatternImage(T pattern, double threshold, double lengthSide) {
GrayU8 binary = new GrayU8(pattern.width,pattern.height);
GThresholdImageOps.threshold(pattern,binary,threshold,false);
alg.addPattern(binary, lengthSide);
} | [
"public",
"void",
"addPatternImage",
"(",
"T",
"pattern",
",",
"double",
"threshold",
",",
"double",
"lengthSide",
")",
"{",
"GrayU8",
"binary",
"=",
"new",
"GrayU8",
"(",
"pattern",
".",
"width",
",",
"pattern",
".",
"height",
")",
";",
"GThresholdImageOps"... | Add a new pattern to be detected. This function takes in a raw gray scale image and thresholds it.
@param pattern Gray scale image of the pattern
@param threshold Threshold used to convert it into a binary image
@param lengthSide Length of a side on the square in world units. | [
"Add",
"a",
"new",
"pattern",
"to",
"be",
"detected",
".",
"This",
"function",
"takes",
"in",
"a",
"raw",
"gray",
"scale",
"image",
"and",
"thresholds",
"it",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/SquareImage_to_FiducialDetector.java#L48-L52 |
datasift/datasift-java | src/main/java/com/datasift/client/managedsource/sources/Yammer.java | Yammer.addOAutToken | public Yammer addOAutToken(String oAuthAccessToken, long expires, String name) {
"""
/*
Adds an OAuth token to the managed source
@param oAuthAccessToken an oauth2 token
@param name a human friendly name for this auth token
@param expires identity resource expiry date/time as a UTC times... | java | public Yammer addOAutToken(String oAuthAccessToken, long expires, String name) {
if (oAuthAccessToken == null || oAuthAccessToken.isEmpty()) {
throw new IllegalArgumentException("A valid OAuth and refresh token is required");
}
AuthParams parameterSet = newAuthParams(name, expires);
... | [
"public",
"Yammer",
"addOAutToken",
"(",
"String",
"oAuthAccessToken",
",",
"long",
"expires",
",",
"String",
"name",
")",
"{",
"if",
"(",
"oAuthAccessToken",
"==",
"null",
"||",
"oAuthAccessToken",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"Illega... | /*
Adds an OAuth token to the managed source
@param oAuthAccessToken an oauth2 token
@param name a human friendly name for this auth token
@param expires identity resource expiry date/time as a UTC timestamp, i.e. when the token expires
@return this | [
"/",
"*",
"Adds",
"an",
"OAuth",
"token",
"to",
"the",
"managed",
"source"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/managedsource/sources/Yammer.java#L31-L38 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_domain_domainName_disclaimer_POST | public OvhTask organizationName_service_exchangeService_domain_domainName_disclaimer_POST(String organizationName, String exchangeService, String domainName, String content, Boolean outsideOnly) throws IOException {
"""
Create organization disclaimer of each email
REST: POST /email/exchange/{organizationName}/s... | java | public OvhTask organizationName_service_exchangeService_domain_domainName_disclaimer_POST(String organizationName, String exchangeService, String domainName, String content, Boolean outsideOnly) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/domain/{domainName}/discl... | [
"public",
"OvhTask",
"organizationName_service_exchangeService_domain_domainName_disclaimer_POST",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"domainName",
",",
"String",
"content",
",",
"Boolean",
"outsideOnly",
")",
"throws",
"IOExce... | Create organization disclaimer of each email
REST: POST /email/exchange/{organizationName}/service/{exchangeService}/domain/{domainName}/disclaimer
@param outsideOnly [required] Activate the disclaimer only for external emails
@param content [required] Signature, added at the bottom of your organization emails
@param ... | [
"Create",
"organization",
"disclaimer",
"of",
"each",
"email"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L561-L569 |
joniles/mpxj | src/main/java/net/sf/mpxj/fasttrack/FastTrackData.java | FastTrackData.matchChildBlock | private final boolean matchChildBlock(int bufferIndex) {
"""
Locate a child block by byte pattern and validate by
checking the length of the string we are expecting
to follow the pattern.
@param bufferIndex start index
@return true if a child block starts at this point
"""
//
// Match the pat... | java | private final boolean matchChildBlock(int bufferIndex)
{
//
// Match the pattern we see at the start of the child block
//
int index = 0;
for (byte b : CHILD_BLOCK_PATTERN)
{
if (b != m_buffer[bufferIndex + index])
{
return false;
}
... | [
"private",
"final",
"boolean",
"matchChildBlock",
"(",
"int",
"bufferIndex",
")",
"{",
"//",
"// Match the pattern we see at the start of the child block",
"//",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"byte",
"b",
":",
"CHILD_BLOCK_PATTERN",
")",
"{",
"if",
"(... | Locate a child block by byte pattern and validate by
checking the length of the string we are expecting
to follow the pattern.
@param bufferIndex start index
@return true if a child block starts at this point | [
"Locate",
"a",
"child",
"block",
"by",
"byte",
"pattern",
"and",
"validate",
"by",
"checking",
"the",
"length",
"of",
"the",
"string",
"we",
"are",
"expecting",
"to",
"follow",
"the",
"pattern",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/fasttrack/FastTrackData.java#L307-L338 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/MergeTableHandler.java | MergeTableHandler.fieldChanged | public int fieldChanged(boolean bDisplayOption, int iMoveMode) {
"""
The Field has Changed.
If this field is true, add the table back to the grid query and requery the grid table.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The err... | java | public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
boolean flag = this.getOwner().getState();
if (flag)
m_mergeRecord.getTable().addTable(m_subRecord.getTable());
else
m_mergeRecord.getTable().removeTable(m_subRecord.getTable());
m_mergeRecord.cl... | [
"public",
"int",
"fieldChanged",
"(",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"boolean",
"flag",
"=",
"this",
".",
"getOwner",
"(",
")",
".",
"getState",
"(",
")",
";",
"if",
"(",
"flag",
")",
"m_mergeRecord",
".",
"getTable",
"("... | The Field has Changed.
If this field is true, add the table back to the grid query and requery the grid table.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay). | [
"The",
"Field",
"has",
"Changed",
".",
"If",
"this",
"field",
"is",
"true",
"add",
"the",
"table",
"back",
"to",
"the",
"grid",
"query",
"and",
"requery",
"the",
"grid",
"table",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/MergeTableHandler.java#L111-L123 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlGroupContainer.java | CmsXmlGroupContainer.fillResource | protected void fillResource(CmsObject cms, Element element, CmsResource res) {
"""
Fills a {@link CmsXmlVfsFileValue} with the resource identified by the given id.<p>
@param cms the current CMS context
@param element the XML element to fill
@param res the resource to use
"""
String xpath = elemen... | java | protected void fillResource(CmsObject cms, Element element, CmsResource res) {
String xpath = element.getPath();
int pos = xpath.lastIndexOf("/" + XmlNode.GroupContainers.name() + "/");
if (pos > 0) {
xpath = xpath.substring(pos + 1);
}
CmsRelationType type = getHand... | [
"protected",
"void",
"fillResource",
"(",
"CmsObject",
"cms",
",",
"Element",
"element",
",",
"CmsResource",
"res",
")",
"{",
"String",
"xpath",
"=",
"element",
".",
"getPath",
"(",
")",
";",
"int",
"pos",
"=",
"xpath",
".",
"lastIndexOf",
"(",
"\"/\"",
... | Fills a {@link CmsXmlVfsFileValue} with the resource identified by the given id.<p>
@param cms the current CMS context
@param element the XML element to fill
@param res the resource to use | [
"Fills",
"a",
"{",
"@link",
"CmsXmlVfsFileValue",
"}",
"with",
"the",
"resource",
"identified",
"by",
"the",
"given",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlGroupContainer.java#L281-L290 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java | ValidationDataRepository.findByParamTypeAndMethodAndUrlAndNameAndParentId | public ValidationData findByParamTypeAndMethodAndUrlAndNameAndParentId(ParamType paramType, String method, String url, String name, Long parentId) {
"""
Find by param type and method and url and name and parent id validation data.
@param paramType the param type
@param method the method
@param url th... | java | public ValidationData findByParamTypeAndMethodAndUrlAndNameAndParentId(ParamType paramType, String method, String url, String name, Long parentId) {
if (parentId == null) {
return this.findByParamTypeAndMethodAndUrlAndName(paramType, method, url, name).stream().filter(d -> d.getParentId() == null).f... | [
"public",
"ValidationData",
"findByParamTypeAndMethodAndUrlAndNameAndParentId",
"(",
"ParamType",
"paramType",
",",
"String",
"method",
",",
"String",
"url",
",",
"String",
"name",
",",
"Long",
"parentId",
")",
"{",
"if",
"(",
"parentId",
"==",
"null",
")",
"{",
... | Find by param type and method and url and name and parent id validation data.
@param paramType the param type
@param method the method
@param url the url
@param name the name
@param parentId the parent id
@return the validation data | [
"Find",
"by",
"param",
"type",
"and",
"method",
"and",
"url",
"and",
"name",
"and",
"parent",
"id",
"validation",
"data",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java#L197-L204 |
cloudfoundry-community/cf-java-component | cf-spring/src/main/java/cf/spring/servicebroker/AbstractAnnotationCatalogAccessorProvider.java | AbstractAnnotationCatalogAccessorProvider.getMethodAccessor | protected BrokerServiceAccessor getMethodAccessor(String serviceBrokerName, CatalogService description) {
"""
Returns the accessor used to access the specified service of the
specified broker.
@param serviceBrokerName the name of the broker offering the specified service
@param description the service descrip... | java | protected BrokerServiceAccessor getMethodAccessor(String serviceBrokerName, CatalogService description) {
return new AnnotationBrokerServiceAccessor(description, serviceBrokerName, getBeanClass(serviceBrokerName),
context.getBean(serviceBrokerName));
} | [
"protected",
"BrokerServiceAccessor",
"getMethodAccessor",
"(",
"String",
"serviceBrokerName",
",",
"CatalogService",
"description",
")",
"{",
"return",
"new",
"AnnotationBrokerServiceAccessor",
"(",
"description",
",",
"serviceBrokerName",
",",
"getBeanClass",
"(",
"servic... | Returns the accessor used to access the specified service of the
specified broker.
@param serviceBrokerName the name of the broker offering the specified service
@param description the service description | [
"Returns",
"the",
"accessor",
"used",
"to",
"access",
"the",
"specified",
"service",
"of",
"the",
"specified",
"broker",
"."
] | train | https://github.com/cloudfoundry-community/cf-java-component/blob/9d7d54f2b599f3e4f4706bc0c471e144065671fa/cf-spring/src/main/java/cf/spring/servicebroker/AbstractAnnotationCatalogAccessorProvider.java#L48-L51 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/DocumentFactory.java | DocumentFactory.createRaw | public Document createRaw(@NonNull String content) {
"""
Creates a document with the given content written in the default language. This method does not apply any {@link
TextNormalizer}
@param content the content
@return the document
"""
return createRaw(StringUtils.EMPTY, content, defaultLanguage,... | java | public Document createRaw(@NonNull String content) {
return createRaw(StringUtils.EMPTY, content, defaultLanguage, Collections.emptyMap());
} | [
"public",
"Document",
"createRaw",
"(",
"@",
"NonNull",
"String",
"content",
")",
"{",
"return",
"createRaw",
"(",
"StringUtils",
".",
"EMPTY",
",",
"content",
",",
"defaultLanguage",
",",
"Collections",
".",
"emptyMap",
"(",
")",
")",
";",
"}"
] | Creates a document with the given content written in the default language. This method does not apply any {@link
TextNormalizer}
@param content the content
@return the document | [
"Creates",
"a",
"document",
"with",
"the",
"given",
"content",
"written",
"in",
"the",
"default",
"language",
".",
"This",
"method",
"does",
"not",
"apply",
"any",
"{",
"@link",
"TextNormalizer",
"}"
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/DocumentFactory.java#L181-L183 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/content/CmsMergePages.java | CmsMergePages.reportList | private void reportList(List collected, boolean doReport) {
"""
Creates a report list of all resources in one of the collected lists.<p>
@param collected the list to create the output from
@param doReport flag to enable detailed report
"""
int size = collected.size();
// now loop through a... | java | private void reportList(List collected, boolean doReport) {
int size = collected.size();
// now loop through all collected resources
m_report.println(
Messages.get().container(Messages.RPT_NUM_PAGES_1, new Integer(size)),
I_CmsReport.FORMAT_HEADLINE);
if (doRepor... | [
"private",
"void",
"reportList",
"(",
"List",
"collected",
",",
"boolean",
"doReport",
")",
"{",
"int",
"size",
"=",
"collected",
".",
"size",
"(",
")",
";",
"// now loop through all collected resources",
"m_report",
".",
"println",
"(",
"Messages",
".",
"get",
... | Creates a report list of all resources in one of the collected lists.<p>
@param collected the list to create the output from
@param doReport flag to enable detailed report | [
"Creates",
"a",
"report",
"list",
"of",
"all",
"resources",
"in",
"one",
"of",
"the",
"collected",
"lists",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/content/CmsMergePages.java#L751-L774 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/roles/ActiveRole.java | ActiveRole.isLogUpToDate | boolean isLogUpToDate(long lastIndex, long lastTerm, RaftRequest request) {
"""
Returns a boolean value indicating whether the given candidate's log is up-to-date.
"""
// Read the last entry from the log.
final Indexed<RaftLogEntry> lastEntry = raft.getLogWriter().getLastEntry();
// If the log is ... | java | boolean isLogUpToDate(long lastIndex, long lastTerm, RaftRequest request) {
// Read the last entry from the log.
final Indexed<RaftLogEntry> lastEntry = raft.getLogWriter().getLastEntry();
// If the log is empty then vote for the candidate.
if (lastEntry == null) {
log.debug("Accepted {}: candida... | [
"boolean",
"isLogUpToDate",
"(",
"long",
"lastIndex",
",",
"long",
"lastTerm",
",",
"RaftRequest",
"request",
")",
"{",
"// Read the last entry from the log.",
"final",
"Indexed",
"<",
"RaftLogEntry",
">",
"lastEntry",
"=",
"raft",
".",
"getLogWriter",
"(",
")",
"... | Returns a boolean value indicating whether the given candidate's log is up-to-date. | [
"Returns",
"a",
"boolean",
"value",
"indicating",
"whether",
"the",
"given",
"candidate",
"s",
"log",
"is",
"up",
"-",
"to",
"-",
"date",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/ActiveRole.java#L190-L220 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.forAllClassDefinitions | public void forAllClassDefinitions(String template, Properties attributes) throws XDocletException {
"""
Processes the template for all class definitions.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an error occurs
@doc.tag ... | java | public void forAllClassDefinitions(String template, Properties attributes) throws XDocletException
{
for (Iterator it = _model.getClasses(); it.hasNext(); )
{
_curClassDef = (ClassDescriptorDef)it.next();
generate(template);
}
_curClassDef = null;
... | [
"public",
"void",
"forAllClassDefinitions",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"for",
"(",
"Iterator",
"it",
"=",
"_model",
".",
"getClasses",
"(",
")",
";",
"it",
".",
"hasNext",
"(",
")",
";"... | Processes the template for all class definitions.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an error occurs
@doc.tag type="block" | [
"Processes",
"the",
"template",
"for",
"all",
"class",
"definitions",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L172-L182 |
alkacon/opencms-core | src/org/opencms/main/OpenCmsCore.java | OpenCmsCore.initContext | protected synchronized void initContext(ServletContext context) throws CmsInitException {
"""
Initialization of the OpenCms runtime environment.<p>
The connection information for the database is read
from the <code>opencms.properties</code> configuration file and all
driver manager are initialized via the ini... | java | protected synchronized void initContext(ServletContext context) throws CmsInitException {
m_gwtServiceContexts = new HashMap<String, CmsGwtServiceContext>();
// automatic servlet container recognition and specific behavior:
CmsServletContainerSettings servletContainerSettings = new CmsServletC... | [
"protected",
"synchronized",
"void",
"initContext",
"(",
"ServletContext",
"context",
")",
"throws",
"CmsInitException",
"{",
"m_gwtServiceContexts",
"=",
"new",
"HashMap",
"<",
"String",
",",
"CmsGwtServiceContext",
">",
"(",
")",
";",
"// automatic servlet container r... | Initialization of the OpenCms runtime environment.<p>
The connection information for the database is read
from the <code>opencms.properties</code> configuration file and all
driver manager are initialized via the initializer,
which usually will be an instance of a <code>OpenCms</code> class.
@param context configurat... | [
"Initialization",
"of",
"the",
"OpenCms",
"runtime",
"environment",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/OpenCmsCore.java#L1706-L1755 |
VoltDB/voltdb | src/frontend/org/voltdb/SnapshotDaemon.java | SnapshotDaemon.createAndWatchRequestNode | public void createAndWatchRequestNode(final long clientHandle,
final Connection c,
SnapshotInitiationInfo snapInfo,
boolean notifyChanges) throws ForwardClientException {
"""
Try to create ... | java | public void createAndWatchRequestNode(final long clientHandle,
final Connection c,
SnapshotInitiationInfo snapInfo,
boolean notifyChanges) throws ForwardClientException {
boolean request... | [
"public",
"void",
"createAndWatchRequestNode",
"(",
"final",
"long",
"clientHandle",
",",
"final",
"Connection",
"c",
",",
"SnapshotInitiationInfo",
"snapInfo",
",",
"boolean",
"notifyChanges",
")",
"throws",
"ForwardClientException",
"{",
"boolean",
"requestExists",
"=... | Try to create the ZK request node and watch it if created successfully. | [
"Try",
"to",
"create",
"the",
"ZK",
"request",
"node",
"and",
"watch",
"it",
"if",
"created",
"successfully",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/SnapshotDaemon.java#L1704-L1750 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/BasePretrainNetwork.java | BasePretrainNetwork.getCorruptedInput | public INDArray getCorruptedInput(INDArray x, double corruptionLevel) {
"""
Corrupts the given input by doing a binomial sampling
given the corruption level
@param x the input to corrupt
@param corruptionLevel the corruption value
@return the binomial sampled corrupted input
"""
INDArray corrupted ... | java | public INDArray getCorruptedInput(INDArray x, double corruptionLevel) {
INDArray corrupted = Nd4j.getDistributions().createBinomial(1, 1 - corruptionLevel).sample(x.ulike());
corrupted.muli(x.castTo(corrupted.dataType()));
return corrupted;
} | [
"public",
"INDArray",
"getCorruptedInput",
"(",
"INDArray",
"x",
",",
"double",
"corruptionLevel",
")",
"{",
"INDArray",
"corrupted",
"=",
"Nd4j",
".",
"getDistributions",
"(",
")",
".",
"createBinomial",
"(",
"1",
",",
"1",
"-",
"corruptionLevel",
")",
".",
... | Corrupts the given input by doing a binomial sampling
given the corruption level
@param x the input to corrupt
@param corruptionLevel the corruption value
@return the binomial sampled corrupted input | [
"Corrupts",
"the",
"given",
"input",
"by",
"doing",
"a",
"binomial",
"sampling",
"given",
"the",
"corruption",
"level"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/BasePretrainNetwork.java#L61-L65 |
pmayweg/sonar-groovy | sonar-groovy-plugin/src/main/java/org/sonar/plugins/groovy/jacoco/JaCoCoReportMerger.java | JaCoCoReportMerger.mergeReports | public static void mergeReports(File reportOverall, File... reports) {
"""
Merge all reports in reportOverall.
@param reportOverall destination file of merge.
@param reports files to be merged.
"""
SessionInfoStore infoStore = new SessionInfoStore();
ExecutionDataStore dataStore = new ExecutionDataSt... | java | public static void mergeReports(File reportOverall, File... reports) {
SessionInfoStore infoStore = new SessionInfoStore();
ExecutionDataStore dataStore = new ExecutionDataStore();
boolean isCurrentVersionFormat = loadSourceFiles(infoStore, dataStore, reports);
try (BufferedOutputStream outputStream = ... | [
"public",
"static",
"void",
"mergeReports",
"(",
"File",
"reportOverall",
",",
"File",
"...",
"reports",
")",
"{",
"SessionInfoStore",
"infoStore",
"=",
"new",
"SessionInfoStore",
"(",
")",
";",
"ExecutionDataStore",
"dataStore",
"=",
"new",
"ExecutionDataStore",
... | Merge all reports in reportOverall.
@param reportOverall destination file of merge.
@param reports files to be merged. | [
"Merge",
"all",
"reports",
"in",
"reportOverall",
"."
] | train | https://github.com/pmayweg/sonar-groovy/blob/2d78d6578304601613db928795d81de340e6fa34/sonar-groovy-plugin/src/main/java/org/sonar/plugins/groovy/jacoco/JaCoCoReportMerger.java#L49-L66 |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/SourceFile.java | SourceFile.writeln | protected void writeln (BufferedWriter bout, String line)
throws IOException {
"""
Helper function for writing a string and a newline to a writer.
"""
bout.write(line);
bout.newLine();
} | java | protected void writeln (BufferedWriter bout, String line)
throws IOException
{
bout.write(line);
bout.newLine();
} | [
"protected",
"void",
"writeln",
"(",
"BufferedWriter",
"bout",
",",
"String",
"line",
")",
"throws",
"IOException",
"{",
"bout",
".",
"write",
"(",
"line",
")",
";",
"bout",
".",
"newLine",
"(",
")",
";",
"}"
] | Helper function for writing a string and a newline to a writer. | [
"Helper",
"function",
"for",
"writing",
"a",
"string",
"and",
"a",
"newline",
"to",
"a",
"writer",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/SourceFile.java#L205-L210 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.isMetadataSame | private boolean isMetadataSame(ColumnDef columnDef, ColumnInfo columnInfo, boolean isCql3Enabled,
boolean isCounterColumnType) throws Exception {
"""
is metadata same method returns true if ColumnDef and columnInfo have
same metadata.
@param columnDef
the column def
@param columnInfo
the column ... | java | private boolean isMetadataSame(ColumnDef columnDef, ColumnInfo columnInfo, boolean isCql3Enabled,
boolean isCounterColumnType) throws Exception
{
return isIndexPresent(columnInfo, columnDef, isCql3Enabled, isCounterColumnType);
} | [
"private",
"boolean",
"isMetadataSame",
"(",
"ColumnDef",
"columnDef",
",",
"ColumnInfo",
"columnInfo",
",",
"boolean",
"isCql3Enabled",
",",
"boolean",
"isCounterColumnType",
")",
"throws",
"Exception",
"{",
"return",
"isIndexPresent",
"(",
"columnInfo",
",",
"column... | is metadata same method returns true if ColumnDef and columnInfo have
same metadata.
@param columnDef
the column def
@param columnInfo
the column info
@param isCql3Enabled
the is cql3 enabled
@param isCounterColumnType
the is counter column type
@return true, if is metadata same
@throws Exception
the exception | [
"is",
"metadata",
"same",
"method",
"returns",
"true",
"if",
"ColumnDef",
"and",
"columnInfo",
"have",
"same",
"metadata",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L1953-L1957 |
ludovicianul/selenium-on-steroids | src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java | WebDriverHelper.verifyText | public boolean verifyText(final By by, final String text) {
"""
Verifies that the given element contains the given text.
@param by
the method of identifying the element
@param text
the text to be matched
@return true if the given element contains the given text or false
otherwise
"""
WebElement eleme... | java | public boolean verifyText(final By by, final String text) {
WebElement element = driver.findElement(by);
if (element.getText().equals(text)) {
LOG.info("Element: " + element + " contains the given text: "
+ text);
return true;
}
LOG.info("Element: " + element + " does NOT contain the given text: "
... | [
"public",
"boolean",
"verifyText",
"(",
"final",
"By",
"by",
",",
"final",
"String",
"text",
")",
"{",
"WebElement",
"element",
"=",
"driver",
".",
"findElement",
"(",
"by",
")",
";",
"if",
"(",
"element",
".",
"getText",
"(",
")",
".",
"equals",
"(",
... | Verifies that the given element contains the given text.
@param by
the method of identifying the element
@param text
the text to be matched
@return true if the given element contains the given text or false
otherwise | [
"Verifies",
"that",
"the",
"given",
"element",
"contains",
"the",
"given",
"text",
"."
] | train | https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java#L308-L321 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.