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 |
|---|---|---|---|---|---|---|---|---|---|---|
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/util/retry/RetryBuilder.java | RetryBuilder.doOnRetry | public RetryBuilder doOnRetry(Action4<Integer, Throwable, Long, TimeUnit> doOnRetryAction) {
"""
Execute some code each time a retry is scheduled (at the moment the retriable exception
is caught, but before the retry delay is applied). Only quick executing code should be
performed, do not block in this action.
... | java | public RetryBuilder doOnRetry(Action4<Integer, Throwable, Long, TimeUnit> doOnRetryAction) {
this.doOnRetryAction = doOnRetryAction;
return this;
} | [
"public",
"RetryBuilder",
"doOnRetry",
"(",
"Action4",
"<",
"Integer",
",",
"Throwable",
",",
"Long",
",",
"TimeUnit",
">",
"doOnRetryAction",
")",
"{",
"this",
".",
"doOnRetryAction",
"=",
"doOnRetryAction",
";",
"return",
"this",
";",
"}"
] | Execute some code each time a retry is scheduled (at the moment the retriable exception
is caught, but before the retry delay is applied). Only quick executing code should be
performed, do not block in this action.
<p>
The action receives the retry attempt number (1-n), the exception that caused the retry,
the delay du... | [
"Execute",
"some",
"code",
"each",
"time",
"a",
"retry",
"is",
"scheduled",
"(",
"at",
"the",
"moment",
"the",
"retriable",
"exception",
"is",
"caught",
"but",
"before",
"the",
"retry",
"delay",
"is",
"applied",
")",
".",
"Only",
"quick",
"executing",
"cod... | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/util/retry/RetryBuilder.java#L179-L182 |
real-logic/agrona | agrona/src/main/java/org/agrona/collections/ArrayListUtil.java | ArrayListUtil.fastUnorderedRemove | public static <T> boolean fastUnorderedRemove(final ArrayList<T> list, final T e) {
"""
Removes element but instead of copying all elements to the left, moves into the same slot the last element.
This avoids the copy costs, but spoils the list order. If element is the last element then it is just removed.
@par... | java | public static <T> boolean fastUnorderedRemove(final ArrayList<T> list, final T e)
{
for (int i = 0, size = list.size(); i < size; i++)
{
if (e == list.get(i))
{
fastUnorderedRemove(list, i, size - 1);
return true;
}
}
... | [
"public",
"static",
"<",
"T",
">",
"boolean",
"fastUnorderedRemove",
"(",
"final",
"ArrayList",
"<",
"T",
">",
"list",
",",
"final",
"T",
"e",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"size",
"=",
"list",
".",
"size",
"(",
")",
";",
"i",
... | Removes element but instead of copying all elements to the left, moves into the same slot the last element.
This avoids the copy costs, but spoils the list order. If element is the last element then it is just removed.
@param list to be modified.
@param e to be removed.
@param <T> element type.
@return true if fou... | [
"Removes",
"element",
"but",
"instead",
"of",
"copying",
"all",
"elements",
"to",
"the",
"left",
"moves",
"into",
"the",
"same",
"slot",
"the",
"last",
"element",
".",
"This",
"avoids",
"the",
"copy",
"costs",
"but",
"spoils",
"the",
"list",
"order",
".",
... | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/collections/ArrayListUtil.java#L78-L90 |
js-lib-com/commons | src/main/java/js/util/Params.java | Params.isNumeric | public static void isNumeric(String parameter, String name) {
"""
Check if string parameter is numeric. This validator throws illegal argument if parameter value is not numeric. See
{@link Strings#isNumeric(String)} for <code>numeric</code> definition.
@param parameter invocation parameter value,
@param name ... | java | public static void isNumeric(String parameter, String name) {
if (!Strings.isNumeric(parameter)) {
throw new IllegalArgumentException(String.format("%s |%s| is not numeric.", name, parameter));
}
} | [
"public",
"static",
"void",
"isNumeric",
"(",
"String",
"parameter",
",",
"String",
"name",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isNumeric",
"(",
"parameter",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(... | Check if string parameter is numeric. This validator throws illegal argument if parameter value is not numeric. See
{@link Strings#isNumeric(String)} for <code>numeric</code> definition.
@param parameter invocation parameter value,
@param name parameter name.
@throws IllegalArgumentException if <code>parameter</code> ... | [
"Check",
"if",
"string",
"parameter",
"is",
"numeric",
".",
"This",
"validator",
"throws",
"illegal",
"argument",
"if",
"parameter",
"value",
"is",
"not",
"numeric",
".",
"See",
"{",
"@link",
"Strings#isNumeric",
"(",
"String",
")",
"}",
"for",
"<code",
">",... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L162-L166 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java | DateFormatUtils.formatUTC | public static String formatUTC(final long millis, final String pattern) {
"""
<p>Formats a date/time into a specific pattern using the UTC time zone.</p>
@param millis the date to format expressed in milliseconds
@param pattern the pattern to use to format the date, not null
@return the formatted date
"... | java | public static String formatUTC(final long millis, final String pattern) {
return format(new Date(millis), pattern, UTC_TIME_ZONE, null);
} | [
"public",
"static",
"String",
"formatUTC",
"(",
"final",
"long",
"millis",
",",
"final",
"String",
"pattern",
")",
"{",
"return",
"format",
"(",
"new",
"Date",
"(",
"millis",
")",
",",
"pattern",
",",
"UTC_TIME_ZONE",
",",
"null",
")",
";",
"}"
] | <p>Formats a date/time into a specific pattern using the UTC time zone.</p>
@param millis the date to format expressed in milliseconds
@param pattern the pattern to use to format the date, not null
@return the formatted date | [
"<p",
">",
"Formats",
"a",
"date",
"/",
"time",
"into",
"a",
"specific",
"pattern",
"using",
"the",
"UTC",
"time",
"zone",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java#L217-L219 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/throttling/ThrottlingRpcService.java | ThrottlingRpcService.onFailure | @Override
protected RpcResponse onFailure(ServiceRequestContext ctx, RpcRequest req, @Nullable Throwable cause)
throws Exception {
"""
Invoked when {@code req} is throttled. By default, this method responds with a
{@link HttpStatusException} with {@code 503 Service Unavailable}.
"""
re... | java | @Override
protected RpcResponse onFailure(ServiceRequestContext ctx, RpcRequest req, @Nullable Throwable cause)
throws Exception {
return RpcResponse.ofFailure(HttpStatusException.of(HttpStatus.SERVICE_UNAVAILABLE));
} | [
"@",
"Override",
"protected",
"RpcResponse",
"onFailure",
"(",
"ServiceRequestContext",
"ctx",
",",
"RpcRequest",
"req",
",",
"@",
"Nullable",
"Throwable",
"cause",
")",
"throws",
"Exception",
"{",
"return",
"RpcResponse",
".",
"ofFailure",
"(",
"HttpStatusException... | Invoked when {@code req} is throttled. By default, this method responds with a
{@link HttpStatusException} with {@code 503 Service Unavailable}. | [
"Invoked",
"when",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/throttling/ThrottlingRpcService.java#L58-L62 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/util/SimpleDataModel.java | SimpleDataModel.addItem | public void addItem (int index, T item) {
"""
Adds an item to this model. Does not force the refresh of any display.
"""
if (_items == null) {
return;
}
_items.add(index, item);
} | java | public void addItem (int index, T item)
{
if (_items == null) {
return;
}
_items.add(index, item);
} | [
"public",
"void",
"addItem",
"(",
"int",
"index",
",",
"T",
"item",
")",
"{",
"if",
"(",
"_items",
"==",
"null",
")",
"{",
"return",
";",
"}",
"_items",
".",
"add",
"(",
"index",
",",
"item",
")",
";",
"}"
] | Adds an item to this model. Does not force the refresh of any display. | [
"Adds",
"an",
"item",
"to",
"this",
"model",
".",
"Does",
"not",
"force",
"the",
"refresh",
"of",
"any",
"display",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/SimpleDataModel.java#L73-L79 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/ChatApi.java | ChatApi.asyncResume | public ApiSuccessResponse asyncResume(String id, AsyncResumeData asyncResumeData) throws ApiException {
"""
Resume async interaction chat
Resume for the specified chat.
@param id The ID of the chat interaction. (required)
@param asyncResumeData Request parameters. (required)
@return ApiSuccessResponse
@throws... | java | public ApiSuccessResponse asyncResume(String id, AsyncResumeData asyncResumeData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = asyncResumeWithHttpInfo(id, asyncResumeData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"asyncResume",
"(",
"String",
"id",
",",
"AsyncResumeData",
"asyncResumeData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"asyncResumeWithHttpInfo",
"(",
"id",
",",
"asyncResumeData",
... | Resume async interaction chat
Resume for the specified chat.
@param id The ID of the chat interaction. (required)
@param asyncResumeData Request parameters. (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Resume",
"async",
"interaction",
"chat",
"Resume",
"for",
"the",
"specified",
"chat",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/ChatApi.java#L281-L284 |
akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/common/CeylonUtil.java | CeylonUtil.calculateChecksum | public static String calculateChecksum(final File installedFile) throws MojoExecutionException {
"""
Calculates the SHA1 checksum for a file using a crude method.
@param installedFile The installed artifact for which the checksum is being computed
@return String The SHA1 checksum
@throws MojoExecutionExcepti... | java | public static String calculateChecksum(final File installedFile) throws MojoExecutionException {
int bufsize = CHECKSUM_BUFFER_SIZE;
byte[] buffer = new byte[bufsize];
FileInputStream fis = null;
BufferedInputStream bis = null;
String checksum = null;
try {
... | [
"public",
"static",
"String",
"calculateChecksum",
"(",
"final",
"File",
"installedFile",
")",
"throws",
"MojoExecutionException",
"{",
"int",
"bufsize",
"=",
"CHECKSUM_BUFFER_SIZE",
";",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"bufsize",
"]",
";",
... | Calculates the SHA1 checksum for a file using a crude method.
@param installedFile The installed artifact for which the checksum is being computed
@return String The SHA1 checksum
@throws MojoExecutionException In case of IO error or checksum calculation error | [
"Calculates",
"the",
"SHA1",
"checksum",
"for",
"a",
"file",
"using",
"a",
"crude",
"method",
"."
] | train | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/common/CeylonUtil.java#L184-L214 |
centic9/commons-dost | src/main/java/org/dstadler/commons/net/UrlUtils.java | UrlUtils.isAvailable | public static boolean isAvailable(String destinationUrl, boolean fireRequest, boolean ignoreHTTPSHostCheck,
int timeout) throws IllegalArgumentException {
"""
Check if the HTTP resource specified by the destination URL is available.
@param destinationUrl the destination URL... | java | public static boolean isAvailable(String destinationUrl, boolean fireRequest, boolean ignoreHTTPSHostCheck,
int timeout) throws IllegalArgumentException {
return getAccessError(destinationUrl, fireRequest, ignoreHTTPSHostCheck, timeout, null) == null;
} | [
"public",
"static",
"boolean",
"isAvailable",
"(",
"String",
"destinationUrl",
",",
"boolean",
"fireRequest",
",",
"boolean",
"ignoreHTTPSHostCheck",
",",
"int",
"timeout",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"getAccessError",
"(",
"destinationUrl"... | Check if the HTTP resource specified by the destination URL is available.
@param destinationUrl the destination URL to check for availability
@param fireRequest if true a request will be sent to the given URL in addition to opening the
connection
@param ignoreHTTPSHostCheck if specified true, a HostnameVerifier is reg... | [
"Check",
"if",
"the",
"HTTP",
"resource",
"specified",
"by",
"the",
"destination",
"URL",
"is",
"available",
"."
] | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/net/UrlUtils.java#L340-L343 |
aws/aws-sdk-java | aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/StepFunctionBuilder.java | StepFunctionBuilder.lt | public static NumericLessThanCondition.Builder lt(String variable, long expectedValue) {
"""
Binary condition for Numeric less than comparison. Supports both integral and floating point numeric types.
@param variable The JSONPath expression that determines which piece of the input document is used for the ... | java | public static NumericLessThanCondition.Builder lt(String variable, long expectedValue) {
return NumericLessThanCondition.builder().variable(variable).expectedValue(expectedValue);
} | [
"public",
"static",
"NumericLessThanCondition",
".",
"Builder",
"lt",
"(",
"String",
"variable",
",",
"long",
"expectedValue",
")",
"{",
"return",
"NumericLessThanCondition",
".",
"builder",
"(",
")",
".",
"variable",
"(",
"variable",
")",
".",
"expectedValue",
... | Binary condition for Numeric less than comparison. Supports both integral and floating point numeric types.
@param variable The JSONPath expression that determines which piece of the input document is used for the comparison.
@param expectedValue The expected value for this condition.
@see <a href="https://states... | [
"Binary",
"condition",
"for",
"Numeric",
"less",
"than",
"comparison",
".",
"Supports",
"both",
"integral",
"and",
"floating",
"point",
"numeric",
"types",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/StepFunctionBuilder.java#L380-L382 |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getEntryNameForList | public static String getEntryNameForList(String property, Integer index) {
"""
Returns the entry name for a list element in the EDB format. E.g. the list element for the property "list" with
the index 0 would be "list.0".
"""
return String.format("%s.%d", property, index);
} | java | public static String getEntryNameForList(String property, Integer index) {
return String.format("%s.%d", property, index);
} | [
"public",
"static",
"String",
"getEntryNameForList",
"(",
"String",
"property",
",",
"Integer",
"index",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"%s.%d\"",
",",
"property",
",",
"index",
")",
";",
"}"
] | Returns the entry name for a list element in the EDB format. E.g. the list element for the property "list" with
the index 0 would be "list.0". | [
"Returns",
"the",
"entry",
"name",
"for",
"a",
"list",
"element",
"in",
"the",
"EDB",
"format",
".",
"E",
".",
"g",
".",
"the",
"list",
"element",
"for",
"the",
"property",
"list",
"with",
"the",
"index",
"0",
"would",
"be",
"list",
".",
"0",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L529-L531 |
OpenLiberty/open-liberty | dev/com.ibm.ws.classloader.context/src/com/ibm/ws/classloader/context/internal/ClassloaderContextImpl.java | ClassloaderContextImpl.setCL | private void setCL(final ClassLoader cl) {
"""
Sets the provided classloader on the current thread.
@param cl The clasloader to be set.
"""
PrivilegedAction<Object> action = new PrivilegedAction<Object>() {
@Override
@FFDCIgnore(SecurityException.class)
public Obj... | java | private void setCL(final ClassLoader cl) {
PrivilegedAction<Object> action = new PrivilegedAction<Object>() {
@Override
@FFDCIgnore(SecurityException.class)
public Object run() {
final Thread t = Thread.currentThread();
try {
... | [
"private",
"void",
"setCL",
"(",
"final",
"ClassLoader",
"cl",
")",
"{",
"PrivilegedAction",
"<",
"Object",
">",
"action",
"=",
"new",
"PrivilegedAction",
"<",
"Object",
">",
"(",
")",
"{",
"@",
"Override",
"@",
"FFDCIgnore",
"(",
"SecurityException",
".",
... | Sets the provided classloader on the current thread.
@param cl The clasloader to be set. | [
"Sets",
"the",
"provided",
"classloader",
"on",
"the",
"current",
"thread",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloader.context/src/com/ibm/ws/classloader/context/internal/ClassloaderContextImpl.java#L151-L172 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/PoissonDistribution.java | PoissonDistribution.logpoissonPDFm1 | public static double logpoissonPDFm1(double x_plus_1, double lambda) {
"""
Compute the poisson distribution PDF with an offset of + 1
<p>
log pdf(x_plus_1 - 1, lambda)
@param x_plus_1 x+1
@param lambda Lambda
@return pdf
"""
if(Double.isInfinite(lambda)) {
return Double.NEGATIVE_INFINITY;
... | java | public static double logpoissonPDFm1(double x_plus_1, double lambda) {
if(Double.isInfinite(lambda)) {
return Double.NEGATIVE_INFINITY;
}
if(x_plus_1 > 1) {
return rawLogProbability(x_plus_1 - 1, lambda);
}
if(lambda > Math.abs(x_plus_1 - 1) * MathUtil.LOG2 * Double.MAX_EXPONENT / 1e-14)... | [
"public",
"static",
"double",
"logpoissonPDFm1",
"(",
"double",
"x_plus_1",
",",
"double",
"lambda",
")",
"{",
"if",
"(",
"Double",
".",
"isInfinite",
"(",
"lambda",
")",
")",
"{",
"return",
"Double",
".",
"NEGATIVE_INFINITY",
";",
"}",
"if",
"(",
"x_plus_... | Compute the poisson distribution PDF with an offset of + 1
<p>
log pdf(x_plus_1 - 1, lambda)
@param x_plus_1 x+1
@param lambda Lambda
@return pdf | [
"Compute",
"the",
"poisson",
"distribution",
"PDF",
"with",
"an",
"offset",
"of",
"+",
"1",
"<p",
">",
"log",
"pdf",
"(",
"x_plus_1",
"-",
"1",
"lambda",
")"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/PoissonDistribution.java#L312-L325 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/configuration/Configuration.java | Configuration.getInteger | public int getInteger(String key, int defaultValue) {
"""
Returns the value associated with the given key as an integer.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) v... | java | public int getInteger(String key, int defaultValue) {
String val = getStringInternal(key);
if (val == null) {
return defaultValue;
} else {
return Integer.parseInt(val);
}
} | [
"public",
"int",
"getInteger",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"String",
"val",
"=",
"getStringInternal",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"else",
"{",
"retu... | Returns the value associated with the given key as an integer.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) value associated with the given key | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"as",
"an",
"integer",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/configuration/Configuration.java#L182-L189 |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.setReference | public void setReference(final String propertyName, final BeanId value) {
"""
Overwrite/replace the current references with a provided reference.
@param propertyName name of the property as defined by the bean's schema.
@param value override
"""
Preconditions.checkNotNull(propertyName);
if ... | java | public void setReference(final String propertyName, final BeanId value) {
Preconditions.checkNotNull(propertyName);
if (value == null) {
references.put(propertyName, null);
return;
}
checkCircularReference(value);
List<BeanId> values = new ArrayList<>();
... | [
"public",
"void",
"setReference",
"(",
"final",
"String",
"propertyName",
",",
"final",
"BeanId",
"value",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"propertyName",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"references",
".",
"put",
... | Overwrite/replace the current references with a provided reference.
@param propertyName name of the property as defined by the bean's schema.
@param value override | [
"Overwrite",
"/",
"replace",
"the",
"current",
"references",
"with",
"a",
"provided",
"reference",
"."
] | train | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L390-L400 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/velocity/VelocityLogger.java | VelocityLogger.logVelocityMessage | @Override
public void logVelocityMessage(final int level, final String message) {
"""
Log velocity engine messages.
@param level severity level
@param message complete error message
"""
switch (level) {
case LogSystem.WARN_ID:
LOG.warn(message);
break;
case LogSystem.INFO_ID:
LOG.info(... | java | @Override
public void logVelocityMessage(final int level, final String message) {
switch (level) {
case LogSystem.WARN_ID:
LOG.warn(message);
break;
case LogSystem.INFO_ID:
LOG.info(message);
break;
case LogSystem.DEBUG_ID:
LOG.debug(message);
break;
case LogSystem.ERROR_ID:
L... | [
"@",
"Override",
"public",
"void",
"logVelocityMessage",
"(",
"final",
"int",
"level",
",",
"final",
"String",
"message",
")",
"{",
"switch",
"(",
"level",
")",
"{",
"case",
"LogSystem",
".",
"WARN_ID",
":",
"LOG",
".",
"warn",
"(",
"message",
")",
";",
... | Log velocity engine messages.
@param level severity level
@param message complete error message | [
"Log",
"velocity",
"engine",
"messages",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/velocity/VelocityLogger.java#L36-L55 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/attribute/map/MapfishMapContext.java | MapfishMapContext.getRotatedBoundsAdjustedForPreciseRotatedMapSize | public MapBounds getRotatedBoundsAdjustedForPreciseRotatedMapSize() {
"""
Return the map bounds rotated with the set rotation. The bounds are adapted to rounding changes of the
size of the set paint area.
@return Rotated bounds.
"""
Rectangle2D.Double paintAreaPrecise = getRotatedMapSizePrecise();
... | java | public MapBounds getRotatedBoundsAdjustedForPreciseRotatedMapSize() {
Rectangle2D.Double paintAreaPrecise = getRotatedMapSizePrecise();
Rectangle paintArea = new Rectangle(MapfishMapContext.rectangleDoubleToDimension(paintAreaPrecise));
return getRotatedBounds(paintAreaPrecise, paintArea);
} | [
"public",
"MapBounds",
"getRotatedBoundsAdjustedForPreciseRotatedMapSize",
"(",
")",
"{",
"Rectangle2D",
".",
"Double",
"paintAreaPrecise",
"=",
"getRotatedMapSizePrecise",
"(",
")",
";",
"Rectangle",
"paintArea",
"=",
"new",
"Rectangle",
"(",
"MapfishMapContext",
".",
... | Return the map bounds rotated with the set rotation. The bounds are adapted to rounding changes of the
size of the set paint area.
@return Rotated bounds. | [
"Return",
"the",
"map",
"bounds",
"rotated",
"with",
"the",
"set",
"rotation",
".",
"The",
"bounds",
"are",
"adapted",
"to",
"rounding",
"changes",
"of",
"the",
"size",
"of",
"the",
"set",
"paint",
"area",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/attribute/map/MapfishMapContext.java#L180-L184 |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/AbstractAuthorizedOnly.java | AbstractAuthorizedOnly.compilePattern | private static Pattern compilePattern( String regex, Logger logger ) {
"""
Compiles the given regex. Returns null if the pattern could not be compiled and logs an error message to the
specified logger.
@param regex the regular expression to compile.
@param logger the logger to notify of errors.
@return The ... | java | private static Pattern compilePattern( String regex, Logger logger ) {
try {
return Pattern.compile(regex);
}
catch( PatternSyntaxException pse ) {
logger.error("Could not compile regex "+regex, pse);
}
return null;
} | [
"private",
"static",
"Pattern",
"compilePattern",
"(",
"String",
"regex",
",",
"Logger",
"logger",
")",
"{",
"try",
"{",
"return",
"Pattern",
".",
"compile",
"(",
"regex",
")",
";",
"}",
"catch",
"(",
"PatternSyntaxException",
"pse",
")",
"{",
"logger",
".... | Compiles the given regex. Returns null if the pattern could not be compiled and logs an error message to the
specified logger.
@param regex the regular expression to compile.
@param logger the logger to notify of errors.
@return The compiled regular expression, or null if it could not be compiled. | [
"Compiles",
"the",
"given",
"regex",
".",
"Returns",
"null",
"if",
"the",
"pattern",
"could",
"not",
"be",
"compiled",
"and",
"logs",
"an",
"error",
"message",
"to",
"the",
"specified",
"logger",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/AbstractAuthorizedOnly.java#L55-L63 |
wcm-io/wcm-io-handler | commons/src/main/java/io/wcm/handler/commons/dom/AbstractElement.java | AbstractElement.setAttributeValueAsLong | public final T setAttributeValueAsLong(String name, long value) {
"""
Sets attribute value as long.
@param name Attribute name
@param value Attribute value as long
@return Self reference
"""
setAttribute(name, Long.toString(value));
return (T)this;
} | java | public final T setAttributeValueAsLong(String name, long value) {
setAttribute(name, Long.toString(value));
return (T)this;
} | [
"public",
"final",
"T",
"setAttributeValueAsLong",
"(",
"String",
"name",
",",
"long",
"value",
")",
"{",
"setAttribute",
"(",
"name",
",",
"Long",
".",
"toString",
"(",
"value",
")",
")",
";",
"return",
"(",
"T",
")",
"this",
";",
"}"
] | Sets attribute value as long.
@param name Attribute name
@param value Attribute value as long
@return Self reference | [
"Sets",
"attribute",
"value",
"as",
"long",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/commons/src/main/java/io/wcm/handler/commons/dom/AbstractElement.java#L92-L95 |
ironjacamar/ironjacamar | tracer/src/main/java/org/ironjacamar/tracer/TraceEventHelper.java | TraceEventHelper.getType | public static TraceEvent getType(List<TraceEvent> events, int... types) {
"""
Get a specific event type
@param events The events
@param types The types
@return The first event type found; otherwise <code>null</code> if none
"""
return getType(events, null, types);
} | java | public static TraceEvent getType(List<TraceEvent> events, int... types)
{
return getType(events, null, types);
} | [
"public",
"static",
"TraceEvent",
"getType",
"(",
"List",
"<",
"TraceEvent",
">",
"events",
",",
"int",
"...",
"types",
")",
"{",
"return",
"getType",
"(",
"events",
",",
"null",
",",
"types",
")",
";",
"}"
] | Get a specific event type
@param events The events
@param types The types
@return The first event type found; otherwise <code>null</code> if none | [
"Get",
"a",
"specific",
"event",
"type"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/tracer/src/main/java/org/ironjacamar/tracer/TraceEventHelper.java#L1024-L1027 |
m-m-m/util | version/src/main/java/net/sf/mmm/util/version/base/AbstractVersionIdentifier.java | AbstractVersionIdentifier.compareToRevision | private int compareToRevision(int currentResult, VersionIdentifier otherVersion) {
"""
This method performs the part of {@link #compareTo(VersionIdentifier)} for the {@link #getRevision()
revision}.
@param currentResult is the current result so far.
@param otherVersion is the {@link VersionIdentifier} to comp... | java | private int compareToRevision(int currentResult, VersionIdentifier otherVersion) {
return compareToLinear(currentResult, getRevision(), otherVersion.getRevision(), otherVersion);
} | [
"private",
"int",
"compareToRevision",
"(",
"int",
"currentResult",
",",
"VersionIdentifier",
"otherVersion",
")",
"{",
"return",
"compareToLinear",
"(",
"currentResult",
",",
"getRevision",
"(",
")",
",",
"otherVersion",
".",
"getRevision",
"(",
")",
",",
"otherV... | This method performs the part of {@link #compareTo(VersionIdentifier)} for the {@link #getRevision()
revision}.
@param currentResult is the current result so far.
@param otherVersion is the {@link VersionIdentifier} to compare to.
@return the result of comparison. | [
"This",
"method",
"performs",
"the",
"part",
"of",
"{",
"@link",
"#compareTo",
"(",
"VersionIdentifier",
")",
"}",
"for",
"the",
"{",
"@link",
"#getRevision",
"()",
"revision",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/version/src/main/java/net/sf/mmm/util/version/base/AbstractVersionIdentifier.java#L265-L268 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java | MutableBigInteger.divide3n2n | private MutableBigInteger divide3n2n(MutableBigInteger b, MutableBigInteger quotient) {
"""
This method implements algorithm 2 from pg. 5 of the Burnikel-Ziegler paper.
It divides a 3n-digit number by a 2n-digit number.<br/>
The parameter beta is 2<sup>32</sup> so all shifts are multiples of 32 bits.<br/>
<br/>... | java | private MutableBigInteger divide3n2n(MutableBigInteger b, MutableBigInteger quotient) {
int n = b.intLen / 2; // half the length of b in ints
// step 1: view this as [a1,a2,a3] where each ai is n ints or less; let a12=[a1,a2]
MutableBigInteger a12 = new MutableBigInteger(this);
a12.sa... | [
"private",
"MutableBigInteger",
"divide3n2n",
"(",
"MutableBigInteger",
"b",
",",
"MutableBigInteger",
"quotient",
")",
"{",
"int",
"n",
"=",
"b",
".",
"intLen",
"/",
"2",
";",
"// half the length of b in ints",
"// step 1: view this as [a1,a2,a3] where each ai is n ints or... | This method implements algorithm 2 from pg. 5 of the Burnikel-Ziegler paper.
It divides a 3n-digit number by a 2n-digit number.<br/>
The parameter beta is 2<sup>32</sup> so all shifts are multiples of 32 bits.<br/>
<br/>
{@code this} must be a nonnegative number such that {@code 2*this.bitLength() <= 3*b.bitLength()}
@... | [
"This",
"method",
"implements",
"algorithm",
"2",
"from",
"pg",
".",
"5",
"of",
"the",
"Burnikel",
"-",
"Ziegler",
"paper",
".",
"It",
"divides",
"a",
"3n",
"-",
"digit",
"number",
"by",
"a",
"2n",
"-",
"digit",
"number",
".",
"<br",
"/",
">",
"The",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java#L1345-L1392 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/adapters/ModelAdapter.java | ModelAdapter.getModels | public List<Model> getModels() {
"""
the ModelAdapter does not keep a list of input model's to get retrieve them a `reverseInterceptor` is required
usually it is used to get the `Model` from a `IModelItem`
@return a List of initial Model's
"""
ArrayList<Model> list = new ArrayList<>(mItems.size());... | java | public List<Model> getModels() {
ArrayList<Model> list = new ArrayList<>(mItems.size());
for (Item item : mItems.getItems()) {
if (mReverseInterceptor != null) {
list.add(mReverseInterceptor.intercept(item));
} else if (item instanceof IModelItem) {
... | [
"public",
"List",
"<",
"Model",
">",
"getModels",
"(",
")",
"{",
"ArrayList",
"<",
"Model",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
"mItems",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Item",
"item",
":",
"mItems",
".",
"getItems",
"(",... | the ModelAdapter does not keep a list of input model's to get retrieve them a `reverseInterceptor` is required
usually it is used to get the `Model` from a `IModelItem`
@return a List of initial Model's | [
"the",
"ModelAdapter",
"does",
"not",
"keep",
"a",
"list",
"of",
"input",
"model",
"s",
"to",
"get",
"retrieve",
"them",
"a",
"reverseInterceptor",
"is",
"required",
"usually",
"it",
"is",
"used",
"to",
"get",
"the",
"Model",
"from",
"a",
"IModelItem"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ModelAdapter.java#L198-L210 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java | AkkaInvocationHandler.extractRpcTimeout | private static Time extractRpcTimeout(Annotation[][] parameterAnnotations, Object[] args, Time defaultTimeout) {
"""
Extracts the {@link RpcTimeout} annotated rpc timeout value from the list of given method
arguments. If no {@link RpcTimeout} annotated parameter could be found, then the default
timeout is return... | java | private static Time extractRpcTimeout(Annotation[][] parameterAnnotations, Object[] args, Time defaultTimeout) {
if (args != null) {
Preconditions.checkArgument(parameterAnnotations.length == args.length);
for (int i = 0; i < parameterAnnotations.length; i++) {
if (isRpcTimeout(parameterAnnotations[i])) {
... | [
"private",
"static",
"Time",
"extractRpcTimeout",
"(",
"Annotation",
"[",
"]",
"[",
"]",
"parameterAnnotations",
",",
"Object",
"[",
"]",
"args",
",",
"Time",
"defaultTimeout",
")",
"{",
"if",
"(",
"args",
"!=",
"null",
")",
"{",
"Preconditions",
".",
"che... | Extracts the {@link RpcTimeout} annotated rpc timeout value from the list of given method
arguments. If no {@link RpcTimeout} annotated parameter could be found, then the default
timeout is returned.
@param parameterAnnotations Parameter annotations
@param args Array of arguments
@param defaultTimeout Default timeout ... | [
"Extracts",
"the",
"{",
"@link",
"RpcTimeout",
"}",
"annotated",
"rpc",
"timeout",
"value",
"from",
"the",
"list",
"of",
"given",
"method",
"arguments",
".",
"If",
"no",
"{",
"@link",
"RpcTimeout",
"}",
"annotated",
"parameter",
"could",
"be",
"found",
"then... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java#L298-L316 |
jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpRequest.java | HttpRequest.withHeader | public HttpRequest withHeader(NottableString name, NottableString... values) {
"""
Adds one header to match on or to not match on using the NottableString, each NottableString can either be a positive matching value,
such as string("match"), or a value to not match on, such as not("do not match"), the string valu... | java | public HttpRequest withHeader(NottableString name, NottableString... values) {
this.headers.withEntry(header(name, values));
return this;
} | [
"public",
"HttpRequest",
"withHeader",
"(",
"NottableString",
"name",
",",
"NottableString",
"...",
"values",
")",
"{",
"this",
".",
"headers",
".",
"withEntry",
"(",
"header",
"(",
"name",
",",
"values",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds one header to match on or to not match on using the NottableString, each NottableString can either be a positive matching value,
such as string("match"), or a value to not match on, such as not("do not match"), the string values passed to the NottableString
can also be a plain string or a regex (for more details o... | [
"Adds",
"one",
"header",
"to",
"match",
"on",
"or",
"to",
"not",
"match",
"on",
"using",
"the",
"NottableString",
"each",
"NottableString",
"can",
"either",
"be",
"a",
"positive",
"matching",
"value",
"such",
"as",
"string",
"(",
"match",
")",
"or",
"a",
... | train | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpRequest.java#L425-L428 |
aws/aws-sdk-java | aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/UserPoolType.java | UserPoolType.withUserPoolTags | public UserPoolType withUserPoolTags(java.util.Map<String, String> userPoolTags) {
"""
<p>
The tags that are assigned to the user pool. A tag is a label that you can apply to user pools to categorize and
manage them in different ways, such as by purpose, owner, environment, or other criteria.
</p>
@param use... | java | public UserPoolType withUserPoolTags(java.util.Map<String, String> userPoolTags) {
setUserPoolTags(userPoolTags);
return this;
} | [
"public",
"UserPoolType",
"withUserPoolTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"userPoolTags",
")",
"{",
"setUserPoolTags",
"(",
"userPoolTags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tags that are assigned to the user pool. A tag is a label that you can apply to user pools to categorize and
manage them in different ways, such as by purpose, owner, environment, or other criteria.
</p>
@param userPoolTags
The tags that are assigned to the user pool. A tag is a label that you can apply to use... | [
"<p",
">",
"The",
"tags",
"that",
"are",
"assigned",
"to",
"the",
"user",
"pool",
".",
"A",
"tag",
"is",
"a",
"label",
"that",
"you",
"can",
"apply",
"to",
"user",
"pools",
"to",
"categorize",
"and",
"manage",
"them",
"in",
"different",
"ways",
"such",... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/UserPoolType.java#L1557-L1560 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.isInBounds | public boolean isInBounds(int row, int col) {
"""
Returns true of the specified matrix element is valid element inside this matrix.
@param row Row index.
@param col Column index.
@return true if it is a valid element in the matrix.
"""
return row >= 0 && col >= 0 && row < mat.getNumRows() && col <... | java | public boolean isInBounds(int row, int col) {
return row >= 0 && col >= 0 && row < mat.getNumRows() && col < mat.getNumCols();
} | [
"public",
"boolean",
"isInBounds",
"(",
"int",
"row",
",",
"int",
"col",
")",
"{",
"return",
"row",
">=",
"0",
"&&",
"col",
">=",
"0",
"&&",
"row",
"<",
"mat",
".",
"getNumRows",
"(",
")",
"&&",
"col",
"<",
"mat",
".",
"getNumCols",
"(",
")",
";"... | Returns true of the specified matrix element is valid element inside this matrix.
@param row Row index.
@param col Column index.
@return true if it is a valid element in the matrix. | [
"Returns",
"true",
"of",
"the",
"specified",
"matrix",
"element",
"is",
"valid",
"element",
"inside",
"this",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L1331-L1333 |
osglworks/java-tool | src/main/java/org/osgl/Lang.java | F1.applyOrElse | public R applyOrElse(P1 p1, F1<? super P1, ? extends R> fallback) {
"""
Applies this partial function to the given argument when it is contained in the function domain.
Applies fallback function where this partial function is not defined.
@param p1
the argument this function to be applied
@param fallback
th... | java | public R applyOrElse(P1 p1, F1<? super P1, ? extends R> fallback) {
try {
return apply(p1);
} catch (RuntimeException e) {
return fallback.apply(p1);
}
} | [
"public",
"R",
"applyOrElse",
"(",
"P1",
"p1",
",",
"F1",
"<",
"?",
"super",
"P1",
",",
"?",
"extends",
"R",
">",
"fallback",
")",
"{",
"try",
"{",
"return",
"apply",
"(",
"p1",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
"e",
")",
"{",
"ret... | Applies this partial function to the given argument when it is contained in the function domain.
Applies fallback function where this partial function is not defined.
@param p1
the argument this function to be applied
@param fallback
the function to be applied to the argument p1 when this function failed with any runt... | [
"Applies",
"this",
"partial",
"function",
"to",
"the",
"given",
"argument",
"when",
"it",
"is",
"contained",
"in",
"the",
"function",
"domain",
".",
"Applies",
"fallback",
"function",
"where",
"this",
"partial",
"function",
"is",
"not",
"defined",
"."
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L529-L535 |
xwiki/xwiki-rendering | xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XMLWikiPrinter.java | XMLWikiPrinter.printXMLStartElement | public void printXMLStartElement(String name, Map<String, String> attributes) {
"""
Print the start tag of xml element. In the form {@code <name att1="value1" att2="value2">}.
@param name the xml element to print
@param attributes the xml attributes of the element to print
"""
printXMLStartElement(... | java | public void printXMLStartElement(String name, Map<String, String> attributes)
{
printXMLStartElement(name, createAttributes(attributes));
} | [
"public",
"void",
"printXMLStartElement",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"printXMLStartElement",
"(",
"name",
",",
"createAttributes",
"(",
"attributes",
")",
")",
";",
"}"
] | Print the start tag of xml element. In the form {@code <name att1="value1" att2="value2">}.
@param name the xml element to print
@param attributes the xml attributes of the element to print | [
"Print",
"the",
"start",
"tag",
"of",
"xml",
"element",
".",
"In",
"the",
"form",
"{",
"@code",
"<name",
"att1",
"=",
"value1",
"att2",
"=",
"value2",
">",
"}",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XMLWikiPrinter.java#L166-L169 |
alipay/sofa-hessian | src/main/java/com/caucho/hessian/io/Hessian2Output.java | Hessian2Output.writeBytes | public void writeBytes(byte[] buffer)
throws IOException {
"""
Writes a byte array to the stream.
The array will be written with the following syntax:
<code><pre>
B b16 b18 bytes
</pre></code>
If the value is null, it will be written as
<code><pre>
N
</pre></code>
@param value the string v... | java | public void writeBytes(byte[] buffer)
throws IOException
{
if (buffer == null) {
if (SIZE < _offset + 16)
flushBuffer();
_buffer[_offset++] = 'N';
}
else
writeBytes(buffer, 0, buffer.length);
} | [
"public",
"void",
"writeBytes",
"(",
"byte",
"[",
"]",
"buffer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"buffer",
"==",
"null",
")",
"{",
"if",
"(",
"SIZE",
"<",
"_offset",
"+",
"16",
")",
"flushBuffer",
"(",
")",
";",
"_buffer",
"[",
"_offset... | Writes a byte array to the stream.
The array will be written with the following syntax:
<code><pre>
B b16 b18 bytes
</pre></code>
If the value is null, it will be written as
<code><pre>
N
</pre></code>
@param value the string value to write. | [
"Writes",
"a",
"byte",
"array",
"to",
"the",
"stream",
".",
"The",
"array",
"will",
"be",
"written",
"with",
"the",
"following",
"syntax",
":"
] | train | https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/io/Hessian2Output.java#L1120-L1131 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/LongStream.java | LongStream.mapToDouble | @NotNull
public DoubleStream mapToDouble(@NotNull final LongToDoubleFunction mapper) {
"""
Returns an {@code DoubleStream} consisting of the results of applying the given
function to the elements of this stream.
<p> This is an intermediate operation.
@param mapper the mapper function used to apply to e... | java | @NotNull
public DoubleStream mapToDouble(@NotNull final LongToDoubleFunction mapper) {
return new DoubleStream(params, new LongMapToDouble(iterator, mapper));
} | [
"@",
"NotNull",
"public",
"DoubleStream",
"mapToDouble",
"(",
"@",
"NotNull",
"final",
"LongToDoubleFunction",
"mapper",
")",
"{",
"return",
"new",
"DoubleStream",
"(",
"params",
",",
"new",
"LongMapToDouble",
"(",
"iterator",
",",
"mapper",
")",
")",
";",
"}"... | Returns an {@code DoubleStream} consisting of the results of applying the given
function to the elements of this stream.
<p> This is an intermediate operation.
@param mapper the mapper function used to apply to each element
@return the new {@code DoubleStream} | [
"Returns",
"an",
"{",
"@code",
"DoubleStream",
"}",
"consisting",
"of",
"the",
"results",
"of",
"applying",
"the",
"given",
"function",
"to",
"the",
"elements",
"of",
"this",
"stream",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/LongStream.java#L540-L543 |
elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/AutotuningPCA.java | AutotuningPCA.computeExplainedVariance | private double computeExplainedVariance(double[] eigenValues, int filteredEigenPairs) {
"""
Compute the explained variance for a filtered EigenPairs.
@param eigenValues Eigen values
@param filteredEigenPairs Filtered eigenpairs
@return explained variance by the strong eigenvectors.
"""
double strongsu... | java | private double computeExplainedVariance(double[] eigenValues, int filteredEigenPairs) {
double strongsum = 0., weaksum = 0.;
for(int i = 0; i < filteredEigenPairs; i++) {
strongsum += eigenValues[i];
}
for(int i = filteredEigenPairs; i < eigenValues.length; i++) {
weaksum += eigenValues[i];
... | [
"private",
"double",
"computeExplainedVariance",
"(",
"double",
"[",
"]",
"eigenValues",
",",
"int",
"filteredEigenPairs",
")",
"{",
"double",
"strongsum",
"=",
"0.",
",",
"weaksum",
"=",
"0.",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"filte... | Compute the explained variance for a filtered EigenPairs.
@param eigenValues Eigen values
@param filteredEigenPairs Filtered eigenpairs
@return explained variance by the strong eigenvectors. | [
"Compute",
"the",
"explained",
"variance",
"for",
"a",
"filtered",
"EigenPairs",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/AutotuningPCA.java#L219-L228 |
google/error-prone-javac | src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java | AbstractTypeVisitor6.visitUnknown | @Override
public R visitUnknown(TypeMirror t, P p) {
"""
{@inheritDoc}
@implSpec The default implementation of this method in {@code
AbstractTypeVisitor6} will always throw {@code
new UnknownTypeException(t, p)}. This behavior is not required of a
subclass.
@param t {@inheritDoc}
@param p {@inheri... | java | @Override
public R visitUnknown(TypeMirror t, P p) {
throw new UnknownTypeException(t, p);
} | [
"@",
"Override",
"public",
"R",
"visitUnknown",
"(",
"TypeMirror",
"t",
",",
"P",
"p",
")",
"{",
"throw",
"new",
"UnknownTypeException",
"(",
"t",
",",
"p",
")",
";",
"}"
] | {@inheritDoc}
@implSpec The default implementation of this method in {@code
AbstractTypeVisitor6} will always throw {@code
new UnknownTypeException(t, p)}. This behavior is not required of a
subclass.
@param t {@inheritDoc}
@param p {@inheritDoc}
@return a visitor-specified result
@throws UnknownTypeException
a vi... | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java#L154-L157 |
jMotif/SAX | src/main/java/net/seninp/util/UCRUtils.java | UCRUtils.saveData | public static void saveData(Map<String, List<double[]>> data, File file) throws IOException {
"""
Saves the dataset.
@param data the dataset.
@param file the file handler.
@throws IOException if error occurs.
"""
BufferedWriter bw = new BufferedWriter(new FileWriter(file));
for (Entry<String, Li... | java | public static void saveData(Map<String, List<double[]>> data, File file) throws IOException {
BufferedWriter bw = new BufferedWriter(new FileWriter(file));
for (Entry<String, List<double[]>> classEntry : data.entrySet()) {
String classLabel = classEntry.getKey();
for (double[] arr : classEntry.get... | [
"public",
"static",
"void",
"saveData",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"double",
"[",
"]",
">",
">",
"data",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"BufferedWriter",
"bw",
"=",
"new",
"BufferedWriter",
"(",
"new",
"FileWrit... | Saves the dataset.
@param data the dataset.
@param file the file handler.
@throws IOException if error occurs. | [
"Saves",
"the",
"dataset",
"."
] | train | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/util/UCRUtils.java#L133-L146 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/ui/CmsVfsTab.java | CmsVfsTab.fillInitially | public void fillInitially(List<CmsVfsEntryBean> entries, String selectedSiteRoot) {
"""
Sets the initial folders in the VFS tab.<p>
@param entries the root folders to display
@param selectedSiteRoot site root that should be selected in the select box
"""
clear();
for (CmsVfsEntryBean entry... | java | public void fillInitially(List<CmsVfsEntryBean> entries, String selectedSiteRoot) {
clear();
for (CmsVfsEntryBean entry : entries) {
if (entry != null) {
CmsLazyTreeItem item = createItem(entry);
addWidgetToList(item);
}
}
if (null... | [
"public",
"void",
"fillInitially",
"(",
"List",
"<",
"CmsVfsEntryBean",
">",
"entries",
",",
"String",
"selectedSiteRoot",
")",
"{",
"clear",
"(",
")",
";",
"for",
"(",
"CmsVfsEntryBean",
"entry",
":",
"entries",
")",
"{",
"if",
"(",
"entry",
"!=",
"null",... | Sets the initial folders in the VFS tab.<p>
@param entries the root folders to display
@param selectedSiteRoot site root that should be selected in the select box | [
"Sets",
"the",
"initial",
"folders",
"in",
"the",
"VFS",
"tab",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/CmsVfsTab.java#L207-L220 |
apache/fluo-recipes | modules/core/src/main/java/org/apache/fluo/recipes/core/map/CollisionFreeMap.java | CollisionFreeMap.get | public V get(SnapshotBase tx, K key) {
"""
This method will retrieve the current value for key and any outstanding updates and combine
them using the configured {@link Combiner}. The result from the combiner is returned.
"""
byte[] k = serializer.serialize(key);
int hash = Hashing.murmur3_32().hashB... | java | public V get(SnapshotBase tx, K key) {
byte[] k = serializer.serialize(key);
int hash = Hashing.murmur3_32().hashBytes(k).asInt();
String bucketId = genBucketId(Math.abs(hash % numBuckets), numBuckets);
BytesBuilder rowBuilder = Bytes.builder();
rowBuilder.append(updatePrefix).append(bucketId).ap... | [
"public",
"V",
"get",
"(",
"SnapshotBase",
"tx",
",",
"K",
"key",
")",
"{",
"byte",
"[",
"]",
"k",
"=",
"serializer",
".",
"serialize",
"(",
"key",
")",
";",
"int",
"hash",
"=",
"Hashing",
".",
"murmur3_32",
"(",
")",
".",
"hashBytes",
"(",
"k",
... | This method will retrieve the current value for key and any outstanding updates and combine
them using the configured {@link Combiner}. The result from the combiner is returned. | [
"This",
"method",
"will",
"retrieve",
"the",
"current",
"value",
"for",
"key",
"and",
"any",
"outstanding",
"updates",
"and",
"combine",
"them",
"using",
"the",
"configured",
"{"
] | train | https://github.com/apache/fluo-recipes/blob/24c11234c9654b16d999437ff49ddc3db86665f8/modules/core/src/main/java/org/apache/fluo/recipes/core/map/CollisionFreeMap.java#L151-L188 |
haifengl/smile | math/src/main/java/smile/math/Math.java | Math.minus | public static void minus(double[] y, double[] x) {
"""
Element-wise subtraction of two arrays y = y - x.
@param y minuend matrix
@param x subtrahend matrix
"""
if (x.length != y.length) {
throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.leng... | java | public static void minus(double[] y, double[] x) {
if (x.length != y.length) {
throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
}
for (int i = 0; i < x.length; i++) {
y[i] -= x[i];
}
} | [
"public",
"static",
"void",
"minus",
"(",
"double",
"[",
"]",
"y",
",",
"double",
"[",
"]",
"x",
")",
"{",
"if",
"(",
"x",
".",
"length",
"!=",
"y",
".",
"length",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
... | Element-wise subtraction of two arrays y = y - x.
@param y minuend matrix
@param x subtrahend matrix | [
"Element",
"-",
"wise",
"subtraction",
"of",
"two",
"arrays",
"y",
"=",
"y",
"-",
"x",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/Math.java#L3775-L3783 |
VoltDB/voltdb | src/frontend/org/voltdb/parser/SQLParser.java | SQLParser.parseExecuteCall | public static ExecuteCallResults parseExecuteCall(
String statement,
Map<String,Map<Integer, List<String>>> procedures) throws SQLParser.Exception {
"""
Parse EXECUTE procedure call.
@param statement statement to parse
@param procedures maps procedures to parameter signature maps
@ret... | java | public static ExecuteCallResults parseExecuteCall(
String statement,
Map<String,Map<Integer, List<String>>> procedures) throws SQLParser.Exception
{
assert(procedures != null);
return parseExecuteCallInternal(statement, procedures);
} | [
"public",
"static",
"ExecuteCallResults",
"parseExecuteCall",
"(",
"String",
"statement",
",",
"Map",
"<",
"String",
",",
"Map",
"<",
"Integer",
",",
"List",
"<",
"String",
">",
">",
">",
"procedures",
")",
"throws",
"SQLParser",
".",
"Exception",
"{",
"asse... | Parse EXECUTE procedure call.
@param statement statement to parse
@param procedures maps procedures to parameter signature maps
@return results object or NULL if statement wasn't recognized
@throws SQLParser.Exception | [
"Parse",
"EXECUTE",
"procedure",
"call",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L1792-L1798 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/StandardResponsesApi.java | StandardResponsesApi.getStandardResponseAttachment | public String getStandardResponseAttachment(String id, String documentId) throws ApiException {
"""
Get the attachment of the Standard Response
Get the attachment of the Standard Response specified in the documentId path parameter
@param id id of the Standard Response (required)
@param documentId id of document... | java | public String getStandardResponseAttachment(String id, String documentId) throws ApiException {
ApiResponse<String> resp = getStandardResponseAttachmentWithHttpInfo(id, documentId);
return resp.getData();
} | [
"public",
"String",
"getStandardResponseAttachment",
"(",
"String",
"id",
",",
"String",
"documentId",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"String",
">",
"resp",
"=",
"getStandardResponseAttachmentWithHttpInfo",
"(",
"id",
",",
"documentId",
")",
... | Get the attachment of the Standard Response
Get the attachment of the Standard Response specified in the documentId path parameter
@param id id of the Standard Response (required)
@param documentId id of document to get (required)
@return String
@throws ApiException If fail to call the API, e.g. server error or cannot ... | [
"Get",
"the",
"attachment",
"of",
"the",
"Standard",
"Response",
"Get",
"the",
"attachment",
"of",
"the",
"Standard",
"Response",
"specified",
"in",
"the",
"documentId",
"path",
"parameter"
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/StandardResponsesApi.java#L899-L902 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/io/ImageSaver.java | ImageSaver.saveImage | public static void saveImage(Image image, OutputStream os, String imgFileFormat) {
"""
Saves specified Image to file of specified img file format.
<p>
Some image file formats may require image type conversion before
saving. This method converts to type INT_RGB for jpg, jpeg and bmp,
and to type BYTE_BINARY for... | java | public static void saveImage(Image image, OutputStream os, String imgFileFormat){
BufferedImage bImg = null;
if(image instanceof BufferedImage){
bImg = (BufferedImage) image;
} else {
bImg = BufferedImageFactory.getINT_ARGB(image);
}
if(isFormatRGBOnly(imgFileFormat) && bImg.getType() != BufferedImag... | [
"public",
"static",
"void",
"saveImage",
"(",
"Image",
"image",
",",
"OutputStream",
"os",
",",
"String",
"imgFileFormat",
")",
"{",
"BufferedImage",
"bImg",
"=",
"null",
";",
"if",
"(",
"image",
"instanceof",
"BufferedImage",
")",
"{",
"bImg",
"=",
"(",
"... | Saves specified Image to file of specified img file format.
<p>
Some image file formats may require image type conversion before
saving. This method converts to type INT_RGB for jpg, jpeg and bmp,
and to type BYTE_BINARY for wbmp.
<p>
The provided {@link OutputStream} will not be closed, this is the
responsibility of t... | [
"Saves",
"specified",
"Image",
"to",
"file",
"of",
"specified",
"img",
"file",
"format",
".",
"<p",
">",
"Some",
"image",
"file",
"formats",
"may",
"require",
"image",
"type",
"conversion",
"before",
"saving",
".",
"This",
"method",
"converts",
"to",
"type",... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/io/ImageSaver.java#L91-L112 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.convertTo | public <S, T> T convertTo(ConverterKey<S,T> key, Object object) {
"""
Convert an object which is an instance of source class to the given target class
@param key The converter key to use
@param object The object to be converted
"""
if (object == null) {
return null;
}
Converter<S, T> conv ... | java | public <S, T> T convertTo(ConverterKey<S,T> key, Object object) {
if (object == null) {
return null;
}
Converter<S, T> conv = findConverter(key.getInputClass(), key.getOutputClass(), key.getQualifierAnnotation() == null ? DefaultBinding.class : key.getQualifierAnnotation());
if (conv == null) ... | [
"public",
"<",
"S",
",",
"T",
">",
"T",
"convertTo",
"(",
"ConverterKey",
"<",
"S",
",",
"T",
">",
"key",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Converter",
"<",
"S",
",",
"T... | Convert an object which is an instance of source class to the given target class
@param key The converter key to use
@param object The object to be converted | [
"Convert",
"an",
"object",
"which",
"is",
"an",
"instance",
"of",
"source",
"class",
"to",
"the",
"given",
"target",
"class"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L815-L830 |
QNJR-GROUP/EasyTransaction | easytrans-core/src/main/java/com/yiqiniu/easytrans/idempotent/IdempotentHelper.java | IdempotentHelper.getIdempotentPo | public IdempotentPo getIdempotentPo(EasyTransFilterChain filterChain, Map<String,Object> header, EasyTransRequest<?, ?> reqest) {
"""
get execute result from database
@param filterChain
@param reqest
@return
"""
BusinessIdentifer businessType = ReflectUtil.getBusinessIdentifer(reqest.getClass());
Obje... | java | public IdempotentPo getIdempotentPo(EasyTransFilterChain filterChain, Map<String,Object> header, EasyTransRequest<?, ?> reqest){
BusinessIdentifer businessType = ReflectUtil.getBusinessIdentifer(reqest.getClass());
Object trxIdObj = header.get(EasytransConstant.CallHeadKeys.PARENT_TRX_ID_KEY);
TransactionId tr... | [
"public",
"IdempotentPo",
"getIdempotentPo",
"(",
"EasyTransFilterChain",
"filterChain",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"header",
",",
"EasyTransRequest",
"<",
"?",
",",
"?",
">",
"reqest",
")",
"{",
"BusinessIdentifer",
"businessType",
"=",
"Ref... | get execute result from database
@param filterChain
@param reqest
@return | [
"get",
"execute",
"result",
"from",
"database"
] | train | https://github.com/QNJR-GROUP/EasyTransaction/blob/53b031724a3fd1145f32b9a7b5c6fb8138d6a426/easytrans-core/src/main/java/com/yiqiniu/easytrans/idempotent/IdempotentHelper.java#L142-L168 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.cosInterpolate | private double cosInterpolate(final double Y1, final double Y2, final double MU) {
"""
Returns the value smoothed by a cosinus interpolation function
@param Y1
@param Y2
@param MU
@return the value smoothed by a cosinus interpolation function
"""
final double MU2;
MU2 = (1 - Math.cos(MU * ... | java | private double cosInterpolate(final double Y1, final double Y2, final double MU) {
final double MU2;
MU2 = (1 - Math.cos(MU * Math.PI)) / 2;
return (Y1 * (1 - MU2) + Y2 * MU2);
} | [
"private",
"double",
"cosInterpolate",
"(",
"final",
"double",
"Y1",
",",
"final",
"double",
"Y2",
",",
"final",
"double",
"MU",
")",
"{",
"final",
"double",
"MU2",
";",
"MU2",
"=",
"(",
"1",
"-",
"Math",
".",
"cos",
"(",
"MU",
"*",
"Math",
".",
"P... | Returns the value smoothed by a cosinus interpolation function
@param Y1
@param Y2
@param MU
@return the value smoothed by a cosinus interpolation function | [
"Returns",
"the",
"value",
"smoothed",
"by",
"a",
"cosinus",
"interpolation",
"function"
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L1108-L1113 |
Impetus/Kundera | src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/GraphEntityMapper.java | GraphEntityMapper.getOrCreateRelationshipWithUniqueFactory | private Relationship getOrCreateRelationshipWithUniqueFactory(Object entity, EntityMetadata m,
GraphDatabaseService graphDb) {
"""
Gets (if available) or creates a relationship for the given entity
"""
Object id = PropertyAccessorHelper.getObject(entity, (Field) m.getIdAttribute().getJavaMe... | java | private Relationship getOrCreateRelationshipWithUniqueFactory(Object entity, EntityMetadata m,
GraphDatabaseService graphDb)
{
Object id = PropertyAccessorHelper.getObject(entity, (Field) m.getIdAttribute().getJavaMember());
final String idFieldName = m.getIdAttribute().getName();
... | [
"private",
"Relationship",
"getOrCreateRelationshipWithUniqueFactory",
"(",
"Object",
"entity",
",",
"EntityMetadata",
"m",
",",
"GraphDatabaseService",
"graphDb",
")",
"{",
"Object",
"id",
"=",
"PropertyAccessorHelper",
".",
"getObject",
"(",
"entity",
",",
"(",
"Fie... | Gets (if available) or creates a relationship for the given entity | [
"Gets",
"(",
"if",
"available",
")",
"or",
"creates",
"a",
"relationship",
"for",
"the",
"given",
"entity"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/GraphEntityMapper.java#L575-L598 |
Erudika/para | para-client/src/main/java/com/erudika/para/client/ParaClient.java | ParaClient.findTagged | public <P extends ParaObject> List<P> findTagged(String type, String[] tags, Pager... pager) {
"""
Searches for objects tagged with one or more tags.
@param <P> type of the object
@param type the type of object to search for. See {@link com.erudika.para.core.ParaObject#getType()}
@param tags the list of tags
@... | java | public <P extends ParaObject> List<P> findTagged(String type, String[] tags, Pager... pager) {
MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
params.put("tags", tags == null ? null : Arrays.asList(tags));
params.putSingle(Config._TYPE, type);
params.putAll(pagerToParams(pager));
return ge... | [
"public",
"<",
"P",
"extends",
"ParaObject",
">",
"List",
"<",
"P",
">",
"findTagged",
"(",
"String",
"type",
",",
"String",
"[",
"]",
"tags",
",",
"Pager",
"...",
"pager",
")",
"{",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"params",
"=",
... | Searches for objects tagged with one or more tags.
@param <P> type of the object
@param type the type of object to search for. See {@link com.erudika.para.core.ParaObject#getType()}
@param tags the list of tags
@param pager a {@link com.erudika.para.utils.Pager}
@return a list of objects found | [
"Searches",
"for",
"objects",
"tagged",
"with",
"one",
"or",
"more",
"tags",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L780-L786 |
elki-project/elki | elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/kd/MinimalisticMemoryKDTree.java | MinimalisticMemoryKDTree.buildTree | private void buildTree(int left, int right, int axis, SortDBIDsBySingleDimension comp) {
"""
Recursively build the tree by partial sorting. O(n log n) complexity.
Apparently there exists a variant in only O(n log log n)? Please
contribute!
@param left Interval minimum
@param right Interval maximum
@param ax... | java | private void buildTree(int left, int right, int axis, SortDBIDsBySingleDimension comp) {
int middle = (left + right) >>> 1;
comp.setDimension(axis);
QuickSelectDBIDs.quickSelect(sorted, comp, left, right, middle);
final int next = (axis + 1) % dims;
if(left + leafsize < middle) {
buildTree(le... | [
"private",
"void",
"buildTree",
"(",
"int",
"left",
",",
"int",
"right",
",",
"int",
"axis",
",",
"SortDBIDsBySingleDimension",
"comp",
")",
"{",
"int",
"middle",
"=",
"(",
"left",
"+",
"right",
")",
">>>",
"1",
";",
"comp",
".",
"setDimension",
"(",
"... | Recursively build the tree by partial sorting. O(n log n) complexity.
Apparently there exists a variant in only O(n log log n)? Please
contribute!
@param left Interval minimum
@param right Interval maximum
@param axis Current splitting axis
@param comp Comparator | [
"Recursively",
"build",
"the",
"tree",
"by",
"partial",
"sorting",
".",
"O",
"(",
"n",
"log",
"n",
")",
"complexity",
".",
"Apparently",
"there",
"exists",
"a",
"variant",
"in",
"only",
"O",
"(",
"n",
"log",
"log",
"n",
")",
"?",
"Please",
"contribute!... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/kd/MinimalisticMemoryKDTree.java#L192-L205 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointsInner.java | RecoveryPointsInner.getAsync | public Observable<RecoveryPointResourceInner> getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) {
"""
Provides the backup data for the RecoveryPointID. This is an asynchronous operation. To learn the status of the operati... | java | public Observable<RecoveryPointResourceInner> getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) {
return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryP... | [
"public",
"Observable",
"<",
"RecoveryPointResourceInner",
">",
"getAsync",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
",",
"String",
"fabricName",
",",
"String",
"containerName",
",",
"String",
"protectedItemName",
",",
"String",
"recoveryPointId",... | Provides the backup data for the RecoveryPointID. This is an asynchronous operation. To learn the status of the operation, call the GetProtectedItemOperationResult API.
@param vaultName The name of the Recovery Services vault.
@param resourceGroupName The name of the resource group associated with the Recovery Service... | [
"Provides",
"the",
"backup",
"data",
"for",
"the",
"RecoveryPointID",
".",
"This",
"is",
"an",
"asynchronous",
"operation",
".",
"To",
"learn",
"the",
"status",
"of",
"the",
"operation",
"call",
"the",
"GetProtectedItemOperationResult",
"API",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointsInner.java#L112-L119 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/bind/BindUploader.java | BindUploader.getPutStmt | private String getPutStmt(String bindDir, String stagePath) {
"""
Build PUT statement string. Handle filesystem differences and escaping backslashes.
@param bindDir the local directory which contains files with binds
@param stagePath the stage path to upload to
@return put statement for files in bindDir to ... | java | private String getPutStmt(String bindDir, String stagePath)
{
return String.format(PUT_STMT, bindDir, File.separator, stagePath)
.replaceAll("\\\\", "\\\\\\\\");
} | [
"private",
"String",
"getPutStmt",
"(",
"String",
"bindDir",
",",
"String",
"stagePath",
")",
"{",
"return",
"String",
".",
"format",
"(",
"PUT_STMT",
",",
"bindDir",
",",
"File",
".",
"separator",
",",
"stagePath",
")",
".",
"replaceAll",
"(",
"\"\\\\\\\\\"... | Build PUT statement string. Handle filesystem differences and escaping backslashes.
@param bindDir the local directory which contains files with binds
@param stagePath the stage path to upload to
@return put statement for files in bindDir to stagePath | [
"Build",
"PUT",
"statement",
"string",
".",
"Handle",
"filesystem",
"differences",
"and",
"escaping",
"backslashes",
"."
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/bind/BindUploader.java#L413-L417 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.showTextAligned | public void showTextAligned(int alignment, String text, float x, float y, float rotation) {
"""
Shows text right, left or center aligned with rotation.
@param alignment the alignment can be ALIGN_CENTER, ALIGN_RIGHT or ALIGN_LEFT
@param text the text to show
@param x the x pivot position
@param y the y pivot p... | java | public void showTextAligned(int alignment, String text, float x, float y, float rotation) {
showTextAligned(alignment, text, x, y, rotation, false);
} | [
"public",
"void",
"showTextAligned",
"(",
"int",
"alignment",
",",
"String",
"text",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"rotation",
")",
"{",
"showTextAligned",
"(",
"alignment",
",",
"text",
",",
"x",
",",
"y",
",",
"rotation",
",",
"... | Shows text right, left or center aligned with rotation.
@param alignment the alignment can be ALIGN_CENTER, ALIGN_RIGHT or ALIGN_LEFT
@param text the text to show
@param x the x pivot position
@param y the y pivot position
@param rotation the rotation to be applied in degrees counterclockwise | [
"Shows",
"text",
"right",
"left",
"or",
"center",
"aligned",
"with",
"rotation",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L1712-L1714 |
WASdev/tool.accelerate.core | liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java | DomUtil.findOrAddChildNode | public static Node findOrAddChildNode(Document doc, Node parentNode, String childName, String childValue) {
"""
Get the matching child node. Create a node if it doens't already exist
@param parentNode - the parent node
@param childName - name of child node to match
@param childValue - value of child node to mat... | java | public static Node findOrAddChildNode(Document doc, Node parentNode, String childName, String childValue){
Node matchingChild = getChildNode(parentNode, childName, childValue);
return matchingChild != null ? matchingChild : addChildNode(doc, parentNode, childName, childValue);
} | [
"public",
"static",
"Node",
"findOrAddChildNode",
"(",
"Document",
"doc",
",",
"Node",
"parentNode",
",",
"String",
"childName",
",",
"String",
"childValue",
")",
"{",
"Node",
"matchingChild",
"=",
"getChildNode",
"(",
"parentNode",
",",
"childName",
",",
"child... | Get the matching child node. Create a node if it doens't already exist
@param parentNode - the parent node
@param childName - name of child node to match
@param childValue - value of child node to match, specify null to not match value
@return the child node | [
"Get",
"the",
"matching",
"child",
"node",
".",
"Create",
"a",
"node",
"if",
"it",
"doens",
"t",
"already",
"exist"
] | train | https://github.com/WASdev/tool.accelerate.core/blob/6511da654a69a25a76573eb76eefff349d9c4d80/liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java#L126-L129 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/CopySource.java | CopySource.setWorkUnitGuid | public static void setWorkUnitGuid(State state, Guid guid) {
"""
Set a unique, replicable guid for this work unit. Used for recovering partially successful work units.
@param state {@link State} where guid should be written.
@param guid A byte array guid.
"""
state.setProp(WORK_UNIT_GUID, guid.toString()... | java | public static void setWorkUnitGuid(State state, Guid guid) {
state.setProp(WORK_UNIT_GUID, guid.toString());
} | [
"public",
"static",
"void",
"setWorkUnitGuid",
"(",
"State",
"state",
",",
"Guid",
"guid",
")",
"{",
"state",
".",
"setProp",
"(",
"WORK_UNIT_GUID",
",",
"guid",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Set a unique, replicable guid for this work unit. Used for recovering partially successful work units.
@param state {@link State} where guid should be written.
@param guid A byte array guid. | [
"Set",
"a",
"unique",
"replicable",
"guid",
"for",
"this",
"work",
"unit",
".",
"Used",
"for",
"recovering",
"partially",
"successful",
"work",
"units",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/CopySource.java#L490-L492 |
apache/incubator-atlas | common/src/main/java/org/apache/atlas/utils/ParamChecker.java | ParamChecker.lessThan | public static void lessThan(long value, long maxValue, String name) {
"""
Checks that the given value is <= max value.
@param value
@param maxValue
@param name
"""
if (value <= 0) {
throw new IllegalArgumentException(name + " should be > 0, current value " + value);
}
if ... | java | public static void lessThan(long value, long maxValue, String name) {
if (value <= 0) {
throw new IllegalArgumentException(name + " should be > 0, current value " + value);
}
if (value > maxValue) {
throw new IllegalArgumentException(name + " should be <= " + maxValue + "... | [
"public",
"static",
"void",
"lessThan",
"(",
"long",
"value",
",",
"long",
"maxValue",
",",
"String",
"name",
")",
"{",
"if",
"(",
"value",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"name",
"+",
"\" should be > 0, current value \"",... | Checks that the given value is <= max value.
@param value
@param maxValue
@param name | [
"Checks",
"that",
"the",
"given",
"value",
"is",
"<",
"=",
"max",
"value",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/common/src/main/java/org/apache/atlas/utils/ParamChecker.java#L147-L154 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/SemanticAPI.java | SemanticAPI.addvoicetorecofortext | public static BaseResult addvoicetorecofortext(String accessToken, String voiceId, File voice) {
"""
提交语音
@param accessToken 接口调用凭证
@param voiceId 语音唯一标识
@param voice 文件格式 只支持mp3,16k,单声道,最大1M
@return BaseResult
@since 2.8.22
"""
return addvoicetorecofortext(accessToken, voiceId, null,... | java | public static BaseResult addvoicetorecofortext(String accessToken, String voiceId, File voice) {
return addvoicetorecofortext(accessToken, voiceId, null, voice);
} | [
"public",
"static",
"BaseResult",
"addvoicetorecofortext",
"(",
"String",
"accessToken",
",",
"String",
"voiceId",
",",
"File",
"voice",
")",
"{",
"return",
"addvoicetorecofortext",
"(",
"accessToken",
",",
"voiceId",
",",
"null",
",",
"voice",
")",
";",
"}"
] | 提交语音
@param accessToken 接口调用凭证
@param voiceId 语音唯一标识
@param voice 文件格式 只支持mp3,16k,单声道,最大1M
@return BaseResult
@since 2.8.22 | [
"提交语音"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/SemanticAPI.java#L84-L86 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.fromCallable | public static <R> Observable<R> fromCallable(Callable<? extends R> callable, Scheduler scheduler) {
"""
Return an Observable that calls the given Callable and emits its result or Exception when an Observer
subscribes.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fro... | java | public static <R> Observable<R> fromCallable(Callable<? extends R> callable, Scheduler scheduler) {
return Observable.create(OperatorFromFunctionals.fromCallable(callable)).subscribeOn(scheduler);
} | [
"public",
"static",
"<",
"R",
">",
"Observable",
"<",
"R",
">",
"fromCallable",
"(",
"Callable",
"<",
"?",
"extends",
"R",
">",
"callable",
",",
"Scheduler",
"scheduler",
")",
"{",
"return",
"Observable",
".",
"create",
"(",
"OperatorFromFunctionals",
".",
... | Return an Observable that calls the given Callable and emits its result or Exception when an Observer
subscribes.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fromCallable.s.png" alt="">
@param <R> the return type
@param callable the callable to call on each subscription
@... | [
"Return",
"an",
"Observable",
"that",
"calls",
"the",
"given",
"Callable",
"and",
"emits",
"its",
"result",
"or",
"Exception",
"when",
"an",
"Observer",
"subscribes",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
"."... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L2059-L2061 |
facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/HadoopArchives.java | HadoopArchives.createNewPartStream | private FSDataOutputStream createNewPartStream(Path dst, int partId) throws IOException {
"""
Creates new stream to write actual file data
@param dst parent of the part-id file
@param partId id of the part
@return the open stream
@throws IOException
"""
String partName = PART_PREFIX + partId;
Path ... | java | private FSDataOutputStream createNewPartStream(Path dst, int partId) throws IOException {
String partName = PART_PREFIX + partId;
Path output = new Path(dst, partName);
FileSystem destFs = output.getFileSystem(conf);
FSDataOutputStream partStream = destFs.create(output, false,
conf.getInt("io.fi... | [
"private",
"FSDataOutputStream",
"createNewPartStream",
"(",
"Path",
"dst",
",",
"int",
"partId",
")",
"throws",
"IOException",
"{",
"String",
"partName",
"=",
"PART_PREFIX",
"+",
"partId",
";",
"Path",
"output",
"=",
"new",
"Path",
"(",
"dst",
",",
"partName"... | Creates new stream to write actual file data
@param dst parent of the part-id file
@param partId id of the part
@return the open stream
@throws IOException | [
"Creates",
"new",
"stream",
"to",
"write",
"actual",
"file",
"data"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/HadoopArchives.java#L1110-L1118 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/ComboBoxArrowButtonPainter.java | ComboBoxArrowButtonPainter.createButtonPath | private Shape createButtonPath(CornerSize size, int x, int y, int w, int h) {
"""
DOCUMENT ME!
@param size DOCUMENT ME!
@param x DOCUMENT ME!
@param y DOCUMENT ME!
@param w DOCUMENT ME!
@param h DOCUMENT ME!
@return DOCUMENT ME!
"""
return shapeGenerator.createRoundRectangle(... | java | private Shape createButtonPath(CornerSize size, int x, int y, int w, int h) {
return shapeGenerator.createRoundRectangle(x, y, w, h, size, CornerStyle.SQUARE, CornerStyle.SQUARE, CornerStyle.ROUNDED,
CornerStyle.ROUNDED);
} | [
"private",
"Shape",
"createButtonPath",
"(",
"CornerSize",
"size",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
")",
"{",
"return",
"shapeGenerator",
".",
"createRoundRectangle",
"(",
"x",
",",
"y",
",",
"w",
",",
"h",
",",
"si... | DOCUMENT ME!
@param size DOCUMENT ME!
@param x DOCUMENT ME!
@param y DOCUMENT ME!
@param w DOCUMENT ME!
@param h DOCUMENT ME!
@return DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/ComboBoxArrowButtonPainter.java#L217-L220 |
killbill/killbill | util/src/main/java/org/killbill/billing/util/callcontext/InternalCallContextFactory.java | InternalCallContextFactory.createInternalCallContextWithoutAccountRecordId | public InternalCallContext createInternalCallContextWithoutAccountRecordId(final CallContext context) {
"""
Create an internal call callcontext without populating the account record id
<p/>
This is used for update/delete operations - we don't need the account id in that case - and
also when we don't have an acc... | java | public InternalCallContext createInternalCallContextWithoutAccountRecordId(final CallContext context) {
// If tenant id is null, this will default to the default tenant record id (multi-tenancy disabled)
final Long tenantRecordId = getTenantRecordIdSafe(context);
populateMDCContext(context.getUs... | [
"public",
"InternalCallContext",
"createInternalCallContextWithoutAccountRecordId",
"(",
"final",
"CallContext",
"context",
")",
"{",
"// If tenant id is null, this will default to the default tenant record id (multi-tenancy disabled)",
"final",
"Long",
"tenantRecordId",
"=",
"getTenantR... | Create an internal call callcontext without populating the account record id
<p/>
This is used for update/delete operations - we don't need the account id in that case - and
also when we don't have an account_record_id column (e.g. tenants, tag_definitions)
@param context original call callcontext
@return internal cal... | [
"Create",
"an",
"internal",
"call",
"callcontext",
"without",
"populating",
"the",
"account",
"record",
"id",
"<p",
"/",
">",
"This",
"is",
"used",
"for",
"update",
"/",
"delete",
"operations",
"-",
"we",
"don",
"t",
"need",
"the",
"account",
"id",
"in",
... | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/util/src/main/java/org/killbill/billing/util/callcontext/InternalCallContextFactory.java#L249-L254 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java | OrientedBox3f.setSecondAxis | @Override
public void setSecondAxis(double x, double y, double z, double extent) {
"""
Set the second axis of the box.
The third axis is updated to be perpendicular to the two other axis.
@param x
@param y
@param z
@param extent
"""
setSecondAxis(x, y, z, extent, CoordinateSystem3D.getDefaultCoordina... | java | @Override
public void setSecondAxis(double x, double y, double z, double extent) {
setSecondAxis(x, y, z, extent, CoordinateSystem3D.getDefaultCoordinateSystem());
} | [
"@",
"Override",
"public",
"void",
"setSecondAxis",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
",",
"double",
"extent",
")",
"{",
"setSecondAxis",
"(",
"x",
",",
"y",
",",
"z",
",",
"extent",
",",
"CoordinateSystem3D",
".",
"getDefaultCo... | Set the second axis of the box.
The third axis is updated to be perpendicular to the two other axis.
@param x
@param y
@param z
@param extent | [
"Set",
"the",
"second",
"axis",
"of",
"the",
"box",
".",
"The",
"third",
"axis",
"is",
"updated",
"to",
"be",
"perpendicular",
"to",
"the",
"two",
"other",
"axis",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java#L506-L509 |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/DateUtils.java | DateUtils.toZonedDateTimeUtc | public static ZonedDateTime toZonedDateTimeUtc(final long epoch) {
"""
Returns a <code>ZonedDateTime</code> from the given epoch value.
Note that this implementation attempts to protect against caller providing timestamps in
different units. For example, Unix timestamps are the number of SECONDS since January ... | java | public static ZonedDateTime toZonedDateTimeUtc(final long epoch) {
final EpochUnits units = EpochUnits.valueOf(epoch);
return toZonedDateTimeUtc(epoch, units);
} | [
"public",
"static",
"ZonedDateTime",
"toZonedDateTimeUtc",
"(",
"final",
"long",
"epoch",
")",
"{",
"final",
"EpochUnits",
"units",
"=",
"EpochUnits",
".",
"valueOf",
"(",
"epoch",
")",
";",
"return",
"toZonedDateTimeUtc",
"(",
"epoch",
",",
"units",
")",
";",... | Returns a <code>ZonedDateTime</code> from the given epoch value.
Note that this implementation attempts to protect against caller providing timestamps in
different units. For example, Unix timestamps are the number of SECONDS since January 1,
1970, while Java Dates are number of MILLISECONDS since January 1, 1970.
@p... | [
"Returns",
"a",
"<code",
">",
"ZonedDateTime<",
"/",
"code",
">",
"from",
"the",
"given",
"epoch",
"value",
"."
] | train | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/DateUtils.java#L553-L556 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/APIClient.java | APIClient.generateSecuredApiKey | public String generateSecuredApiKey(String privateApiKey, Query query) throws NoSuchAlgorithmException, InvalidKeyException {
"""
Generate a secured and public API Key from a query and an
optional user token identifying the current user
@param privateApiKey your private API Key
@param query contains t... | java | public String generateSecuredApiKey(String privateApiKey, Query query) throws NoSuchAlgorithmException, InvalidKeyException {
return generateSecuredApiKey(privateApiKey, query, null);
} | [
"public",
"String",
"generateSecuredApiKey",
"(",
"String",
"privateApiKey",
",",
"Query",
"query",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"return",
"generateSecuredApiKey",
"(",
"privateApiKey",
",",
"query",
",",
"null",
")",
";"... | Generate a secured and public API Key from a query and an
optional user token identifying the current user
@param privateApiKey your private API Key
@param query contains the parameter applied to the query (used as security) | [
"Generate",
"a",
"secured",
"and",
"public",
"API",
"Key",
"from",
"a",
"query",
"and",
"an",
"optional",
"user",
"token",
"identifying",
"the",
"current",
"user"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L993-L995 |
JakeWharton/NineOldAndroids | library/src/com/nineoldandroids/view/ViewPropertyAnimatorPreHC.java | ViewPropertyAnimatorPreHC.setValue | private void setValue(int propertyConstant, float value) {
"""
This method handles setting the property values directly in the View object's fields.
propertyConstant tells it which property should be set, value is the value to set
the property to.
@param propertyConstant The property to be set
@param value T... | java | private void setValue(int propertyConstant, float value) {
//final View.TransformationInfo info = mView.mTransformationInfo;
switch (propertyConstant) {
case TRANSLATION_X:
//info.mTranslationX = value;
mProxy.setTranslationX(value);
break;
... | [
"private",
"void",
"setValue",
"(",
"int",
"propertyConstant",
",",
"float",
"value",
")",
"{",
"//final View.TransformationInfo info = mView.mTransformationInfo;",
"switch",
"(",
"propertyConstant",
")",
"{",
"case",
"TRANSLATION_X",
":",
"//info.mTranslationX = value;",
"... | This method handles setting the property values directly in the View object's fields.
propertyConstant tells it which property should be set, value is the value to set
the property to.
@param propertyConstant The property to be set
@param value The value to set the property to | [
"This",
"method",
"handles",
"setting",
"the",
"property",
"values",
"directly",
"in",
"the",
"View",
"object",
"s",
"fields",
".",
"propertyConstant",
"tells",
"it",
"which",
"property",
"should",
"be",
"set",
"value",
"is",
"the",
"value",
"to",
"set",
"th... | train | https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/view/ViewPropertyAnimatorPreHC.java#L541-L585 |
apache/incubator-druid | sql/src/main/java/org/apache/druid/sql/calcite/schema/InformationSchema.java | InformationSchema.getView | @Nullable
private static TableMacro getView(final SchemaPlus schemaPlus, final String functionName) {
"""
Return a view macro that may or may not be defined in a certain schema. If it's not defined, returns null.
@param schemaPlus schema
@param functionName function name
@return view, or null
"""
... | java | @Nullable
private static TableMacro getView(final SchemaPlus schemaPlus, final String functionName)
{
// Look for a zero-arg function that is also a TableMacro. The returned value
// is never null so we don't need to check for that.
final Collection<org.apache.calcite.schema.Function> functions =
... | [
"@",
"Nullable",
"private",
"static",
"TableMacro",
"getView",
"(",
"final",
"SchemaPlus",
"schemaPlus",
",",
"final",
"String",
"functionName",
")",
"{",
"// Look for a zero-arg function that is also a TableMacro. The returned value",
"// is never null so we don't need to check fo... | Return a view macro that may or may not be defined in a certain schema. If it's not defined, returns null.
@param schemaPlus schema
@param functionName function name
@return view, or null | [
"Return",
"a",
"view",
"macro",
"that",
"may",
"or",
"may",
"not",
"be",
"defined",
"in",
"a",
"certain",
"schema",
".",
"If",
"it",
"s",
"not",
"defined",
"returns",
"null",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/sql/src/main/java/org/apache/druid/sql/calcite/schema/InformationSchema.java#L432-L447 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java | SARLJvmModelInferrer.copyTypeParametersFromJvmOperation | protected void copyTypeParametersFromJvmOperation(JvmOperation fromOperation, JvmOperation toOperation) {
"""
Copy the type parameters from a JvmOperation.
<p>This function differs from {@link #copyAndFixTypeParameters(List, org.eclipse.xtext.common.types.JvmTypeParameterDeclarator)}
and {@link #copyTypeParame... | java | protected void copyTypeParametersFromJvmOperation(JvmOperation fromOperation, JvmOperation toOperation) {
Utils.copyTypeParametersFromJvmOperation(fromOperation, toOperation,
this._typeReferenceBuilder, this.typeBuilder, this.typeReferences, this.typesFactory);
} | [
"protected",
"void",
"copyTypeParametersFromJvmOperation",
"(",
"JvmOperation",
"fromOperation",
",",
"JvmOperation",
"toOperation",
")",
"{",
"Utils",
".",
"copyTypeParametersFromJvmOperation",
"(",
"fromOperation",
",",
"toOperation",
",",
"this",
".",
"_typeReferenceBuil... | Copy the type parameters from a JvmOperation.
<p>This function differs from {@link #copyAndFixTypeParameters(List, org.eclipse.xtext.common.types.JvmTypeParameterDeclarator)}
and {@link #copyTypeParameters(List, org.eclipse.xtext.common.types.JvmTypeParameterDeclarator)}
in the fact that the type parameters were alrea... | [
"Copy",
"the",
"type",
"parameters",
"from",
"a",
"JvmOperation",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java#L3435-L3438 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.classOrInterfaceBody | List<JCTree> classOrInterfaceBody(Name className, boolean isInterface) {
"""
ClassBody = "{" {ClassBodyDeclaration} "}"
InterfaceBody = "{" {InterfaceBodyDeclaration} "}"
"""
accept(LBRACE);
if (token.pos <= endPosTable.errorEndPos) {
// error recovery
skip(false, t... | java | List<JCTree> classOrInterfaceBody(Name className, boolean isInterface) {
accept(LBRACE);
if (token.pos <= endPosTable.errorEndPos) {
// error recovery
skip(false, true, false, false);
if (token.kind == LBRACE)
nextToken();
}
ListBuffer<... | [
"List",
"<",
"JCTree",
">",
"classOrInterfaceBody",
"(",
"Name",
"className",
",",
"boolean",
"isInterface",
")",
"{",
"accept",
"(",
"LBRACE",
")",
";",
"if",
"(",
"token",
".",
"pos",
"<=",
"endPosTable",
".",
"errorEndPos",
")",
"{",
"// error recovery",
... | ClassBody = "{" {ClassBodyDeclaration} "}"
InterfaceBody = "{" {InterfaceBodyDeclaration} "}" | [
"ClassBody",
"=",
"{",
"{",
"ClassBodyDeclaration",
"}",
"}",
"InterfaceBody",
"=",
"{",
"{",
"InterfaceBodyDeclaration",
"}",
"}"
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/parser/JavacParser.java#L3484-L3502 |
hgoebl/DavidWebb | src/main/java/com/goebl/david/Webb.java | Webb.setGlobalHeader | public static void setGlobalHeader(String name, Object value) {
"""
Set the value for a named header which is valid for all requests in the running JVM.
<br>
The value can be overwritten by calling {@link Webb#setDefaultHeader(String, Object)} and/or
{@link com.goebl.david.Request#header(String, Object)}.
<br>... | java | public static void setGlobalHeader(String name, Object value) {
if (value != null) {
globalHeaders.put(name, value);
} else {
globalHeaders.remove(name);
}
} | [
"public",
"static",
"void",
"setGlobalHeader",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"globalHeaders",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}",
"else",
"{",
"globalHeaders",
"."... | Set the value for a named header which is valid for all requests in the running JVM.
<br>
The value can be overwritten by calling {@link Webb#setDefaultHeader(String, Object)} and/or
{@link com.goebl.david.Request#header(String, Object)}.
<br>
For the supported types for values see {@link Request#header(String, Object)... | [
"Set",
"the",
"value",
"for",
"a",
"named",
"header",
"which",
"is",
"valid",
"for",
"all",
"requests",
"in",
"the",
"running",
"JVM",
".",
"<br",
">",
"The",
"value",
"can",
"be",
"overwritten",
"by",
"calling",
"{",
"@link",
"Webb#setDefaultHeader",
"(",... | train | https://github.com/hgoebl/DavidWebb/blob/4f1532fbc3d817886d38de24eacc02b44b910b42/src/main/java/com/goebl/david/Webb.java#L80-L86 |
Karumien/jasper-utils | src/main/java/cz/i24/util/jasper/QRCodeColored.java | QRCodeColored.withHint | public QRCodeColored withHint(EncodeHintType hintType, Object value) {
"""
Sets hint to {@link com.google.zxing.qrcode.QRCodeWriter#encode}
@return the current QRCode object
"""
this.hints.put(hintType, value);
return this;
} | java | public QRCodeColored withHint(EncodeHintType hintType, Object value) {
this.hints.put(hintType, value);
return this;
} | [
"public",
"QRCodeColored",
"withHint",
"(",
"EncodeHintType",
"hintType",
",",
"Object",
"value",
")",
"{",
"this",
".",
"hints",
".",
"put",
"(",
"hintType",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets hint to {@link com.google.zxing.qrcode.QRCodeWriter#encode}
@return the current QRCode object | [
"Sets",
"hint",
"to",
"{",
"@link",
"com",
".",
"google",
".",
"zxing",
".",
"qrcode",
".",
"QRCodeWriter#encode",
"}"
] | train | https://github.com/Karumien/jasper-utils/blob/7abc795511aca090089e404c14763b13cbeade72/src/main/java/cz/i24/util/jasper/QRCodeColored.java#L87-L90 |
brianwhu/xillium | base/src/main/java/org/xillium/base/util/Mathematical.java | Mathematical.ceiling | public static int ceiling(int n, int m) {
"""
Rounds n up to the nearest multiple of m
@param n an integer
@param m an integer
@return the value after rounding {@code n} up to the nearest multiple of {@code m}
"""
return n >= 0 ? ((n + m - 1) / m) * m : (n / m) * m;
} | java | public static int ceiling(int n, int m) {
return n >= 0 ? ((n + m - 1) / m) * m : (n / m) * m;
} | [
"public",
"static",
"int",
"ceiling",
"(",
"int",
"n",
",",
"int",
"m",
")",
"{",
"return",
"n",
">=",
"0",
"?",
"(",
"(",
"n",
"+",
"m",
"-",
"1",
")",
"/",
"m",
")",
"*",
"m",
":",
"(",
"n",
"/",
"m",
")",
"*",
"m",
";",
"}"
] | Rounds n up to the nearest multiple of m
@param n an integer
@param m an integer
@return the value after rounding {@code n} up to the nearest multiple of {@code m} | [
"Rounds",
"n",
"up",
"to",
"the",
"nearest",
"multiple",
"of",
"m"
] | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/util/Mathematical.java#L37-L39 |
finmath/finmath-lib | src/main/java6/net/finmath/montecarlo/interestrate/products/SwaprateCovarianceAnalyticApproximation.java | SwaprateCovarianceAnalyticApproximation.getValue | public RandomVariableInterface getValue(double evaluationTime, LIBORMarketModel model) throws CalculationException {
"""
Calculates the approximated integrated instantaneous covariance of two swap rates,
using the approximation d log(S(t))/d log(L(t)) = d log(S(0))/d log(L(0)).
@param evaluationTime The evalua... | java | public RandomVariableInterface getValue(double evaluationTime, LIBORMarketModel model) throws CalculationException {
int swapStartIndex1 = model.getLiborPeriodIndex(swapTenor1[0]);
int swapEndIndex1 = model.getLiborPeriodIndex(swapTenor1[swapTenor1.length-1]);
int swapStartIndex2 = model.getLiborPeriodInde... | [
"public",
"RandomVariableInterface",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORMarketModel",
"model",
")",
"throws",
"CalculationException",
"{",
"int",
"swapStartIndex1",
"=",
"model",
".",
"getLiborPeriodIndex",
"(",
"swapTenor1",
"[",
"0",
"]",
")",
... | Calculates the approximated integrated instantaneous covariance of two swap rates,
using the approximation d log(S(t))/d log(L(t)) = d log(S(0))/d log(L(0)).
@param evaluationTime The evaluation time.
@param model A model implementing the LIBORMarketModel
@return Returns the approximated integrated instantaneous covar... | [
"Calculates",
"the",
"approximated",
"integrated",
"instantaneous",
"covariance",
"of",
"two",
"swap",
"rates",
"using",
"the",
"approximation",
"d",
"log",
"(",
"S",
"(",
"t",
"))",
"/",
"d",
"log",
"(",
"L",
"(",
"t",
"))",
"=",
"d",
"log",
"(",
"S",... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/montecarlo/interestrate/products/SwaprateCovarianceAnalyticApproximation.java#L60-L87 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WPartialDateField.java | WPartialDateField.parseDateComponent | private Integer parseDateComponent(final String component, final char padding) {
"""
Parses a component of a partial date.
@param component the date component.
@param padding the padding character.
@return the parsed value, may be null.
"""
if (component != null && component.indexOf(padding) == -1) {
... | java | private Integer parseDateComponent(final String component, final char padding) {
if (component != null && component.indexOf(padding) == -1) {
try {
return Integer.valueOf(component);
} catch (NumberFormatException e) {
return null;
}
}
return null;
} | [
"private",
"Integer",
"parseDateComponent",
"(",
"final",
"String",
"component",
",",
"final",
"char",
"padding",
")",
"{",
"if",
"(",
"component",
"!=",
"null",
"&&",
"component",
".",
"indexOf",
"(",
"padding",
")",
"==",
"-",
"1",
")",
"{",
"try",
"{"... | Parses a component of a partial date.
@param component the date component.
@param padding the padding character.
@return the parsed value, may be null. | [
"Parses",
"a",
"component",
"of",
"a",
"partial",
"date",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WPartialDateField.java#L727-L736 |
quattor/pan | panc/src/main/java/org/quattor/pan/ttemplate/BuildContext.java | BuildContext.setLocalVariable | public void setLocalVariable(String name, Element value)
throws EvaluationException {
"""
Set the local variable to the given value. If the value is null, then the
corresponding variable will be removed. If there is a global variable of
the same name, then an EvaluationException will be thrown. This method
d... | java | public void setLocalVariable(String name, Element value)
throws EvaluationException {
assert (name != null);
// Only truly local variables can be set via this method. Throw an
// exception if a global variable is found which matches the name.
if (globalVariables.containsKey(name)) {
throw new Evaluation... | [
"public",
"void",
"setLocalVariable",
"(",
"String",
"name",
",",
"Element",
"value",
")",
"throws",
"EvaluationException",
"{",
"assert",
"(",
"name",
"!=",
"null",
")",
";",
"// Only truly local variables can be set via this method. Throw an",
"// exception if a global va... | Set the local variable to the given value. If the value is null, then the
corresponding variable will be removed. If there is a global variable of
the same name, then an EvaluationException will be thrown. This method
does not allow children of the referenced value to be set.
@param name
name of the local variable
@pa... | [
"Set",
"the",
"local",
"variable",
"to",
"the",
"given",
"value",
".",
"If",
"the",
"value",
"is",
"null",
"then",
"the",
"corresponding",
"variable",
"will",
"be",
"removed",
".",
"If",
"there",
"is",
"a",
"global",
"variable",
"of",
"the",
"same",
"nam... | train | https://github.com/quattor/pan/blob/009934a603dd0c08d3fa4bb7d9389c380a916f54/panc/src/main/java/org/quattor/pan/ttemplate/BuildContext.java#L1216-L1230 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Namespace.java | Namespace.findByQualifier | public static Namespace findByQualifier(EntityManager em, String qualifier) {
"""
Returns a namespace entity using the provided namespace qualifier.
@param em The entity manager. Cannot be null.
@param qualifier The qualifier. Cannot be null or empty.
@return The namespace or null if no corr... | java | public static Namespace findByQualifier(EntityManager em, String qualifier) {
SystemAssert.requireArgument(em != null, "EntityManager cannot be null.");
SystemAssert.requireArgument(qualifier != null && !qualifier.isEmpty(), "Namespace qualifier cannot be null or empty.");
TypedQuery<Namespace>... | [
"public",
"static",
"Namespace",
"findByQualifier",
"(",
"EntityManager",
"em",
",",
"String",
"qualifier",
")",
"{",
"SystemAssert",
".",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"EntityManager cannot be null.\"",
")",
";",
"SystemAssert",
".",
"requireAr... | Returns a namespace entity using the provided namespace qualifier.
@param em The entity manager. Cannot be null.
@param qualifier The qualifier. Cannot be null or empty.
@return The namespace or null if no corresponding namespace is found. | [
"Returns",
"a",
"namespace",
"entity",
"using",
"the",
"provided",
"namespace",
"qualifier",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Namespace.java#L137-L148 |
mapbox/mapbox-plugins-android | plugin-offline/src/main/java/com/mapbox/mapboxsdk/plugins/offline/offline/OfflineDownloadService.java | OfflineDownloadService.onResolveCommand | private void onResolveCommand(String intentAction, OfflineDownloadOptions offlineDownload) {
"""
Several actions can take place inside this service including starting and canceling a specific
region download. First, it is determined what action to take by using the {@code intentAction}
parameter. This action is ... | java | private void onResolveCommand(String intentAction, OfflineDownloadOptions offlineDownload) {
if (OfflineConstants.ACTION_START_DOWNLOAD.equals(intentAction)) {
createDownload(offlineDownload);
} else if (OfflineConstants.ACTION_CANCEL_DOWNLOAD.equals(intentAction)) {
cancelDownload(offlineDownload);... | [
"private",
"void",
"onResolveCommand",
"(",
"String",
"intentAction",
",",
"OfflineDownloadOptions",
"offlineDownload",
")",
"{",
"if",
"(",
"OfflineConstants",
".",
"ACTION_START_DOWNLOAD",
".",
"equals",
"(",
"intentAction",
")",
")",
"{",
"createDownload",
"(",
"... | Several actions can take place inside this service including starting and canceling a specific
region download. First, it is determined what action to take by using the {@code intentAction}
parameter. This action is finally passed in to the correct map offline methods.
@param intentAction string holding the task th... | [
"Several",
"actions",
"can",
"take",
"place",
"inside",
"this",
"service",
"including",
"starting",
"and",
"canceling",
"a",
"specific",
"region",
"download",
".",
"First",
"it",
"is",
"determined",
"what",
"action",
"to",
"take",
"by",
"using",
"the",
"{",
... | train | https://github.com/mapbox/mapbox-plugins-android/blob/c683cad4d8306945d71838d96fae73b8cbe2e6c9/plugin-offline/src/main/java/com/mapbox/mapboxsdk/plugins/offline/offline/OfflineDownloadService.java#L110-L116 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextItems.java | ContextItems.setItem | public void setItem(String itemName, Object value) {
"""
Sets a context item value.
@param itemName Item name.
@param value The value to set. The value's class must have an associated context serializer
registered for it.
"""
if (value == null) {
setItem(itemName, (String) null);
... | java | public void setItem(String itemName, Object value) {
if (value == null) {
setItem(itemName, (String) null);
} else {
@SuppressWarnings("unchecked")
ISerializer<Object> contextSerializer = (ISerializer<Object>) ContextSerializerRegistry.getInstance()
... | [
"public",
"void",
"setItem",
"(",
"String",
"itemName",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"setItem",
"(",
"itemName",
",",
"(",
"String",
")",
"null",
")",
";",
"}",
"else",
"{",
"@",
"SuppressWarnings",
"(... | Sets a context item value.
@param itemName Item name.
@param value The value to set. The value's class must have an associated context serializer
registered for it. | [
"Sets",
"a",
"context",
"item",
"value",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextItems.java#L250-L264 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsInner.java | VirtualWANsInner.getByResourceGroup | public VirtualWANInner getByResourceGroup(String resourceGroupName, String virtualWANName) {
"""
Retrieves the details of a VirtualWAN.
@param resourceGroupName The resource group name of the VirtualWan.
@param virtualWANName The name of the VirtualWAN being retrieved.
@throws IllegalArgumentException thrown ... | java | public VirtualWANInner getByResourceGroup(String resourceGroupName, String virtualWANName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body();
} | [
"public",
"VirtualWANInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualWANName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualWANName",
")",
".",
"toBlocking",
"(",
")",
"."... | Retrieves the details of a VirtualWAN.
@param resourceGroupName The resource group name of the VirtualWan.
@param virtualWANName The name of the VirtualWAN being retrieved.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorException thrown if the request is rejected by server
@thro... | [
"Retrieves",
"the",
"details",
"of",
"a",
"VirtualWAN",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsInner.java#L126-L128 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/IntStream.java | IntStream.mapToLong | @NotNull
public LongStream mapToLong(@NotNull final IntToLongFunction mapper) {
"""
Returns a {@code LongStream} consisting of the results of applying the given
function to the elements of this stream.
<p> This is an intermediate operation.
@param mapper the mapper function used to apply to each elemen... | java | @NotNull
public LongStream mapToLong(@NotNull final IntToLongFunction mapper) {
return new LongStream(params, new IntMapToLong(iterator, mapper));
} | [
"@",
"NotNull",
"public",
"LongStream",
"mapToLong",
"(",
"@",
"NotNull",
"final",
"IntToLongFunction",
"mapper",
")",
"{",
"return",
"new",
"LongStream",
"(",
"params",
",",
"new",
"IntMapToLong",
"(",
"iterator",
",",
"mapper",
")",
")",
";",
"}"
] | Returns a {@code LongStream} consisting of the results of applying the given
function to the elements of this stream.
<p> This is an intermediate operation.
@param mapper the mapper function used to apply to each element
@return the new {@code LongStream}
@since 1.1.4
@see #flatMap(com.annimon.stream.function.IntFun... | [
"Returns",
"a",
"{",
"@code",
"LongStream",
"}",
"consisting",
"of",
"the",
"results",
"of",
"applying",
"the",
"given",
"function",
"to",
"the",
"elements",
"of",
"this",
"stream",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L542-L545 |
OwlPlatform/java-owl-sensor | src/main/java/com/owlplatform/sensor/SensorIoHandler.java | SensorIoHandler.messageReceived | @Override
public void messageReceived(IoSession session, Object message)
throws Exception {
"""
Demultiplexes the message type and passes it to the appropriate method of
the IOAdapter.
@see SensorIoAdapter#sensorSampleReceived(IoSession, SampleMessage)
@see SensorIoAdapter#handshakeMessageReceived(IoSessi... | java | @Override
public void messageReceived(IoSession session, Object message)
throws Exception {
log.debug("{} <-- {}", session, message);
if (this.sensorIoAdapter == null) {
log.warn(
"No SensorIoAdapter defined. Ignoring message from {}: {}",
session, message);
return;
}
if (message instanceof... | [
"@",
"Override",
"public",
"void",
"messageReceived",
"(",
"IoSession",
"session",
",",
"Object",
"message",
")",
"throws",
"Exception",
"{",
"log",
".",
"debug",
"(",
"\"{} <-- {}\"",
",",
"session",
",",
"message",
")",
";",
"if",
"(",
"this",
".",
"sens... | Demultiplexes the message type and passes it to the appropriate method of
the IOAdapter.
@see SensorIoAdapter#sensorSampleReceived(IoSession, SampleMessage)
@see SensorIoAdapter#handshakeMessageReceived(IoSession, HandshakeMessage) | [
"Demultiplexes",
"the",
"message",
"type",
"and",
"passes",
"it",
"to",
"the",
"appropriate",
"method",
"of",
"the",
"IOAdapter",
"."
] | train | https://github.com/OwlPlatform/java-owl-sensor/blob/7d98e985f2fc150dd696ca5683ad9ef6514be92b/src/main/java/com/owlplatform/sensor/SensorIoHandler.java#L78-L107 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/GregorianCalendar.java | GregorianCalendar.getFixedDateJan1 | private long getFixedDateJan1(BaseCalendar.Date date, long fixedDate) {
"""
Returns the fixed date of the first day of the year (usually
January 1) before the specified date.
@param date the date for which the first day of the year is
calculated. The date has to be in the cut-over year (Gregorian
or Julian).... | java | private long getFixedDateJan1(BaseCalendar.Date date, long fixedDate) {
assert date.getNormalizedYear() == gregorianCutoverYear ||
date.getNormalizedYear() == gregorianCutoverYearJulian;
if (gregorianCutoverYear != gregorianCutoverYearJulian) {
if (fixedDate >= gregorianCutoverDa... | [
"private",
"long",
"getFixedDateJan1",
"(",
"BaseCalendar",
".",
"Date",
"date",
",",
"long",
"fixedDate",
")",
"{",
"assert",
"date",
".",
"getNormalizedYear",
"(",
")",
"==",
"gregorianCutoverYear",
"||",
"date",
".",
"getNormalizedYear",
"(",
")",
"==",
"gr... | Returns the fixed date of the first day of the year (usually
January 1) before the specified date.
@param date the date for which the first day of the year is
calculated. The date has to be in the cut-over year (Gregorian
or Julian).
@param fixedDate the fixed date representation of the date | [
"Returns",
"the",
"fixed",
"date",
"of",
"the",
"first",
"day",
"of",
"the",
"year",
"(",
"usually",
"January",
"1",
")",
"before",
"the",
"specified",
"date",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/GregorianCalendar.java#L3166-L3181 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.serviceName_owo_POST | public ArrayList<OvhWhoisObfuscatorFieldsEnum> serviceName_owo_POST(String serviceName, OvhWhoisObfuscatorFieldsEnum[] fields) throws IOException {
"""
Add whois obfuscators
REST: POST /domain/{serviceName}/owo
@param fields [required] Fields to obfuscate
@param serviceName [required] The internal name of you... | java | public ArrayList<OvhWhoisObfuscatorFieldsEnum> serviceName_owo_POST(String serviceName, OvhWhoisObfuscatorFieldsEnum[] fields) throws IOException {
String qPath = "/domain/{serviceName}/owo";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "field... | [
"public",
"ArrayList",
"<",
"OvhWhoisObfuscatorFieldsEnum",
">",
"serviceName_owo_POST",
"(",
"String",
"serviceName",
",",
"OvhWhoisObfuscatorFieldsEnum",
"[",
"]",
"fields",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/{serviceName}/owo\"",
";",... | Add whois obfuscators
REST: POST /domain/{serviceName}/owo
@param fields [required] Fields to obfuscate
@param serviceName [required] The internal name of your domain | [
"Add",
"whois",
"obfuscators"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L1515-L1522 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/FilterCellFastStr.java | FilterCellFastStr.addNewCell | public FilterCellFastStr addNewCell(int hashcode, int length) {
"""
Add a new succeeding cell to this cell, based on a new valid address value
that
can follow this cell's value, into the address tree. This is done
by adding the new cell to the hashtable of next cells.
@param hashcode
a valid value, that can... | java | public FilterCellFastStr addNewCell(int hashcode, int length) {
// check for wildcard
if ((hashcode != 0) || (length != 0)) {
// not a wildcard
if (nextCell == null) {
// no next node on this tree, so add one
nextCell = new FastSynchHashTable();
... | [
"public",
"FilterCellFastStr",
"addNewCell",
"(",
"int",
"hashcode",
",",
"int",
"length",
")",
"{",
"// check for wildcard",
"if",
"(",
"(",
"hashcode",
"!=",
"0",
")",
"||",
"(",
"length",
"!=",
"0",
")",
")",
"{",
"// not a wildcard",
"if",
"(",
"nextCe... | Add a new succeeding cell to this cell, based on a new valid address value
that
can follow this cell's value, into the address tree. This is done
by adding the new cell to the hashtable of next cells.
@param hashcode
a valid value, that can follow this cell's value, in the address
tree
@param length
of the string whic... | [
"Add",
"a",
"new",
"succeeding",
"cell",
"to",
"this",
"cell",
"based",
"on",
"a",
"new",
"valid",
"address",
"value",
"that",
"can",
"follow",
"this",
"cell",
"s",
"value",
"into",
"the",
"address",
"tree",
".",
"This",
"is",
"done",
"by",
"adding",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/FilterCellFastStr.java#L133-L153 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ExceptionDestinationHandlerImpl.java | ExceptionDestinationHandlerImpl.handleUndeliverableMessage | @Override
public UndeliverableReturnCode handleUndeliverableMessage(
SIBusMessage msg,
String alternateUser,
TransactionCommon tra... | java | @Override
public UndeliverableReturnCode handleUndeliverableMessage(
SIBusMessage msg,
String alternateUser,
TransactionCommon tra... | [
"@",
"Override",
"public",
"UndeliverableReturnCode",
"handleUndeliverableMessage",
"(",
"SIBusMessage",
"msg",
",",
"String",
"alternateUser",
",",
"TransactionCommon",
"tran",
",",
"int",
"exceptionReason",
",",
"String",
"[",
"]",
"exceptionStrings",
")",
"{",
"// ... | Wrapper method for handleUndeliverableMessage. This version will be called
from an external component via the
com.ibm.ws.sib.processor.ExceptionDestinationHandler interface. E.g. we
need to access this routine from the MQLink in the comms component.
@param msg - The undeliverable message
@param tran - The transaction ... | [
"Wrapper",
"method",
"for",
"handleUndeliverableMessage",
".",
"This",
"version",
"will",
"be",
"called",
"from",
"an",
"external",
"component",
"via",
"the",
"com",
".",
"ibm",
".",
"ws",
".",
"sib",
".",
"processor",
".",
"ExceptionDestinationHandler",
"interf... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ExceptionDestinationHandlerImpl.java#L428-L440 |
Erudika/para | para-client/src/main/java/com/erudika/para/client/ParaClient.java | ParaClient.validationConstraints | public Map<String, Map<String, Map<String, Map<String, ?>>>> validationConstraints(String type) {
"""
Returns the validation constraints map.
@param type a type
@return a map containing all validation constraints for this type.
"""
return getEntity(invokeGet(Utils.formatMessage("_constraints/{0}", type), n... | java | public Map<String, Map<String, Map<String, Map<String, ?>>>> validationConstraints(String type) {
return getEntity(invokeGet(Utils.formatMessage("_constraints/{0}", type), null), Map.class);
} | [
"public",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"?",
">",
">",
">",
">",
"validationConstraints",
"(",
"String",
"type",
")",
"{",
"return",
"getEntity",
"(",
"invokeGet",
"(",
"Ut... | Returns the validation constraints map.
@param type a type
@return a map containing all validation constraints for this type. | [
"Returns",
"the",
"validation",
"constraints",
"map",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L1367-L1369 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/Expression.java | Expression.asIteratorRaw | public DTMIterator asIteratorRaw(XPathContext xctxt, int contextNode)
throws javax.xml.transform.TransformerException {
"""
Given an select expression and a context, evaluate the XPath
and return the resulting iterator, but do not clone.
@param xctxt The execution context.
@param contextNode The nod... | java | public DTMIterator asIteratorRaw(XPathContext xctxt, int contextNode)
throws javax.xml.transform.TransformerException
{
try
{
xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
XNodeSet nodeset = (XNodeSet)execute(xctxt);
return nodeset.iterRaw();
}
finally
... | [
"public",
"DTMIterator",
"asIteratorRaw",
"(",
"XPathContext",
"xctxt",
",",
"int",
"contextNode",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"try",
"{",
"xctxt",
".",
"pushCurrentNodeAndExpression",
"(",
"contextNode",
... | Given an select expression and a context, evaluate the XPath
and return the resulting iterator, but do not clone.
@param xctxt The execution context.
@param contextNode The node that "." expresses.
@return A valid DTMIterator.
@throws TransformerException thrown if the active ProblemListener decides
the error condit... | [
"Given",
"an",
"select",
"expression",
"and",
"a",
"context",
"evaluate",
"the",
"XPath",
"and",
"return",
"the",
"resulting",
"iterator",
"but",
"do",
"not",
"clone",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/Expression.java#L275-L290 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/BitmapUtil.java | BitmapUtil.clipSquare | @SuppressWarnings("SuspiciousNameCombination")
public static Bitmap clipSquare(@NonNull final Bitmap bitmap, final int size) {
"""
Clips the long edge of a bitmap, if its width and height are not equal, in order to form it
into a square. Additionally, the bitmap is resized to a specific size.
@param bitmap... | java | @SuppressWarnings("SuspiciousNameCombination")
public static Bitmap clipSquare(@NonNull final Bitmap bitmap, final int size) {
Condition.INSTANCE.ensureNotNull(bitmap, "The bitmap may not be null");
Condition.INSTANCE.ensureAtLeast(size, 1, "The size must be at least 1");
Bitmap clippedBitma... | [
"@",
"SuppressWarnings",
"(",
"\"SuspiciousNameCombination\"",
")",
"public",
"static",
"Bitmap",
"clipSquare",
"(",
"@",
"NonNull",
"final",
"Bitmap",
"bitmap",
",",
"final",
"int",
"size",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"bit... | Clips the long edge of a bitmap, if its width and height are not equal, in order to form it
into a square. Additionally, the bitmap is resized to a specific size.
@param bitmap
The bitmap, which should be clipped, as an instance of the class {@link Bitmap}. The
bitmap may not be null
@param size
The size, the bitmap s... | [
"Clips",
"the",
"long",
"edge",
"of",
"a",
"bitmap",
"if",
"its",
"width",
"and",
"height",
"are",
"not",
"equal",
"in",
"order",
"to",
"form",
"it",
"into",
"a",
"square",
".",
"Additionally",
"the",
"bitmap",
"is",
"resized",
"to",
"a",
"specific",
"... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/BitmapUtil.java#L248-L269 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/proxy/GeneratedKeysUtils.java | GeneratedKeysUtils.isAutoGenerateEnabledParameters | public static boolean isAutoGenerateEnabledParameters(Object[] args) {
"""
Whether given method arguments intend to enable auto-generated keys.
@param args method parameters for methods that can enable auto-generated keys.
@return true if method params indicate to enable auto-generated keys
@see #isMethodToRe... | java | public static boolean isAutoGenerateEnabledParameters(Object[] args) {
if (args == null || args.length != 2 || args[1] == null) {
return false;
}
Object arg = args[1];
if (arg instanceof Integer) {
// for method(String sql, int autoGeneratedKeys)
ret... | [
"public",
"static",
"boolean",
"isAutoGenerateEnabledParameters",
"(",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
"==",
"null",
"||",
"args",
".",
"length",
"!=",
"2",
"||",
"args",
"[",
"1",
"]",
"==",
"null",
")",
"{",
"return",
"false"... | Whether given method arguments intend to enable auto-generated keys.
@param args method parameters for methods that can enable auto-generated keys.
@return true if method params indicate to enable auto-generated keys
@see #isMethodToRetrieveGeneratedKeys(Method) | [
"Whether",
"given",
"method",
"arguments",
"intend",
"to",
"enable",
"auto",
"-",
"generated",
"keys",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/proxy/GeneratedKeysUtils.java#L64-L84 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/AbstractQueryRunner.java | AbstractQueryRunner.createStatement | protected Statement createStatement(Connection conn, OutputHandler outputHandler, String sql)
throws SQLException {
"""
Creates new {@link Statement} instance
@param conn SQL Connection
@param sql SQL Query string
@return new {@link Statement} instance
@throws SQLException if exception would be ... | java | protected Statement createStatement(Connection conn, OutputHandler outputHandler, String sql)
throws SQLException {
Statement result = null;
Integer resultSetType = null;
Integer resultSetConcurrency = null;
if (outputHandler instanceof LazyScrollOutputHandler) {
... | [
"protected",
"Statement",
"createStatement",
"(",
"Connection",
"conn",
",",
"OutputHandler",
"outputHandler",
",",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"Statement",
"result",
"=",
"null",
";",
"Integer",
"resultSetType",
"=",
"null",
";",
"Integer... | Creates new {@link Statement} instance
@param conn SQL Connection
@param sql SQL Query string
@return new {@link Statement} instance
@throws SQLException if exception would be thrown by Driver/Database | [
"Creates",
"new",
"{",
"@link",
"Statement",
"}",
"instance"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/AbstractQueryRunner.java#L364-L398 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java | ComputeNodeOperations.updateComputeNodeUser | public void updateComputeNodeUser(String poolId, String nodeId, String userName, String sshPublicKey, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Updates the specified user account on the specified compute node.
@param poolId The ID of the pool that contains ... | java | public void updateComputeNodeUser(String poolId, String nodeId, String userName, String sshPublicKey, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
NodeUpdateUserParameter param = new NodeUpdateUserParameter();
param.withSshPublicKey(sshPublicKey);
... | [
"public",
"void",
"updateComputeNodeUser",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"String",
"userName",
",",
"String",
"sshPublicKey",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
... | Updates the specified user account on the specified compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node where the user account will be updated.
@param userName The name of the user account to update.
@param sshPublicKey The SSH public key that can be ... | [
"Updates",
"the",
"specified",
"user",
"account",
"on",
"the",
"specified",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L195-L200 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/parametrics/independentsamples/StudentsIndependentSamples.java | StudentsIndependentSamples.checkCriticalValue | private static boolean checkCriticalValue(double score, int df, boolean is_twoTailed, double aLevel) {
"""
Checks the Critical Value to determine if the Hypothesis should be rejected
@param score
@param df
@param is_twoTailed
@param aLevel
@return
"""
double probability=ContinuousDistributions.s... | java | private static boolean checkCriticalValue(double score, int df, boolean is_twoTailed, double aLevel) {
double probability=ContinuousDistributions.studentsCdf(score,df);
boolean rejectH0=false;
double a=aLevel;
if(is_twoTailed) { //if to tailed test then split the statistical significan... | [
"private",
"static",
"boolean",
"checkCriticalValue",
"(",
"double",
"score",
",",
"int",
"df",
",",
"boolean",
"is_twoTailed",
",",
"double",
"aLevel",
")",
"{",
"double",
"probability",
"=",
"ContinuousDistributions",
".",
"studentsCdf",
"(",
"score",
",",
"df... | Checks the Critical Value to determine if the Hypothesis should be rejected
@param score
@param df
@param is_twoTailed
@param aLevel
@return | [
"Checks",
"the",
"Critical",
"Value",
"to",
"determine",
"if",
"the",
"Hypothesis",
"should",
"be",
"rejected"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/parametrics/independentsamples/StudentsIndependentSamples.java#L100-L114 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java | JenkinsServer.getJob | public JobWithDetails getJob(FolderJob folder, String jobName) throws IOException {
"""
Get a single Job from the given folder.
@param folder {@link FolderJob}
@param jobName name of the job to get details of.
@return A single Job, null if not present
@throws IOException in case of an error.
"""
... | java | public JobWithDetails getJob(FolderJob folder, String jobName) throws IOException {
try {
JobWithDetails job = client.get(UrlUtils.toJobBaseUrl(folder, jobName), JobWithDetails.class);
job.setClient(client);
return job;
} catch (HttpResponseException e) {
... | [
"public",
"JobWithDetails",
"getJob",
"(",
"FolderJob",
"folder",
",",
"String",
"jobName",
")",
"throws",
"IOException",
"{",
"try",
"{",
"JobWithDetails",
"job",
"=",
"client",
".",
"get",
"(",
"UrlUtils",
".",
"toJobBaseUrl",
"(",
"folder",
",",
"jobName",
... | Get a single Job from the given folder.
@param folder {@link FolderJob}
@param jobName name of the job to get details of.
@return A single Job, null if not present
@throws IOException in case of an error. | [
"Get",
"a",
"single",
"Job",
"from",
"the",
"given",
"folder",
"."
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L282-L296 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java | DrawerUtils.setStickyFooterSelection | public static void setStickyFooterSelection(DrawerBuilder drawer, int position, Boolean fireOnClick) {
"""
helper method to set the selection of the footer
@param drawer
@param position
@param fireOnClick
"""
if (position > -1) {
if (drawer.mStickyFooterView != null && drawer.mStickyFo... | java | public static void setStickyFooterSelection(DrawerBuilder drawer, int position, Boolean fireOnClick) {
if (position > -1) {
if (drawer.mStickyFooterView != null && drawer.mStickyFooterView instanceof LinearLayout) {
LinearLayout footer = (LinearLayout) drawer.mStickyFooterView;
... | [
"public",
"static",
"void",
"setStickyFooterSelection",
"(",
"DrawerBuilder",
"drawer",
",",
"int",
"position",
",",
"Boolean",
"fireOnClick",
")",
"{",
"if",
"(",
"position",
">",
"-",
"1",
")",
"{",
"if",
"(",
"drawer",
".",
"mStickyFooterView",
"!=",
"nul... | helper method to set the selection of the footer
@param drawer
@param position
@param fireOnClick | [
"helper",
"method",
"to",
"set",
"the",
"selection",
"of",
"the",
"footer"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L85-L98 |
VoltDB/voltdb | src/frontend/org/voltdb/export/ExportSequenceNumberTracker.java | ExportSequenceNumberTracker.addRange | public long addRange(long start, long end) {
"""
Add a range to the tracker.
@param start
@param end
@return number of non-overlapped sequence being added
"""
Range<Long> newRange = range(start, end);
long nonOverlapSize = end - start + 1;
if (m_map.intersects(newRange)) {
... | java | public long addRange(long start, long end) {
Range<Long> newRange = range(start, end);
long nonOverlapSize = end - start + 1;
if (m_map.intersects(newRange)) {
for (Range<Long> next : m_map.asRanges()) {
if (next.isConnected(newRange)) {
Range<L... | [
"public",
"long",
"addRange",
"(",
"long",
"start",
",",
"long",
"end",
")",
"{",
"Range",
"<",
"Long",
">",
"newRange",
"=",
"range",
"(",
"start",
",",
"end",
")",
";",
"long",
"nonOverlapSize",
"=",
"end",
"-",
"start",
"+",
"1",
";",
"if",
"(",... | Add a range to the tracker.
@param start
@param end
@return number of non-overlapped sequence being added | [
"Add",
"a",
"range",
"to",
"the",
"tracker",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/export/ExportSequenceNumberTracker.java#L95-L108 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.data_proContact_proContactId_GET | public OvhProContact data_proContact_proContactId_GET(Long proContactId) throws IOException {
"""
Retrieve information about a Pro Contact
REST: GET /domain/data/proContact/{proContactId}
@param proContactId [required] ProContact ID
"""
String qPath = "/domain/data/proContact/{proContactId}";
StringBui... | java | public OvhProContact data_proContact_proContactId_GET(Long proContactId) throws IOException {
String qPath = "/domain/data/proContact/{proContactId}";
StringBuilder sb = path(qPath, proContactId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhProContact.class);
} | [
"public",
"OvhProContact",
"data_proContact_proContactId_GET",
"(",
"Long",
"proContactId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/data/proContact/{proContactId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"proContactId",... | Retrieve information about a Pro Contact
REST: GET /domain/data/proContact/{proContactId}
@param proContactId [required] ProContact ID | [
"Retrieve",
"information",
"about",
"a",
"Pro",
"Contact"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L259-L264 |
osglworks/java-tool | src/main/java/org/osgl/util/E.java | E.NPE | public static void NPE(Object o1, Object o2, Object o3) {
"""
Throws out {@link NullPointerException} if `o1` or `o2` or `o3` is `null`.
@param o1
the first object to be evaluated
@param o2
the second object to be evaluated
@param o3
the third object to be evaluated
"""
if (null == o1 || null == ... | java | public static void NPE(Object o1, Object o2, Object o3) {
if (null == o1 || null == o2 || null == o3) {
throw new NullPointerException();
}
} | [
"public",
"static",
"void",
"NPE",
"(",
"Object",
"o1",
",",
"Object",
"o2",
",",
"Object",
"o3",
")",
"{",
"if",
"(",
"null",
"==",
"o1",
"||",
"null",
"==",
"o2",
"||",
"null",
"==",
"o3",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")... | Throws out {@link NullPointerException} if `o1` or `o2` or `o3` is `null`.
@param o1
the first object to be evaluated
@param o2
the second object to be evaluated
@param o3
the third object to be evaluated | [
"Throws",
"out",
"{"
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/E.java#L132-L136 |
TGIO/RNCryptorNative | jncryptor/src/main/java/org/cryptonode/jncryptor/AES256JNCryptorOutputStream.java | AES256JNCryptorOutputStream.createStreams | private void createStreams(SecretKey encryptionKey, SecretKey hmacKey,
byte[] iv, OutputStream out) throws CryptorException {
"""
Creates the cipher and MAC streams required,
@param encryptionKey
the encryption key
@param hmacKey
the HMAC key
@param iv
the IV
@param out
the output stream we are wra... | java | private void createStreams(SecretKey encryptionKey, SecretKey hmacKey,
byte[] iv, OutputStream out) throws CryptorException {
this.iv = iv;
try {
Cipher cipher = Cipher.getInstance(AES256JNCryptor.AES_CIPHER_ALGORITHM);
cipher.init(Cipher.ENCRYPT_MODE, encryptionKey, new IvParameterSpec(iv))... | [
"private",
"void",
"createStreams",
"(",
"SecretKey",
"encryptionKey",
",",
"SecretKey",
"hmacKey",
",",
"byte",
"[",
"]",
"iv",
",",
"OutputStream",
"out",
")",
"throws",
"CryptorException",
"{",
"this",
".",
"iv",
"=",
"iv",
";",
"try",
"{",
"Cipher",
"c... | Creates the cipher and MAC streams required,
@param encryptionKey
the encryption key
@param hmacKey
the HMAC key
@param iv
the IV
@param out
the output stream we are wrapping
@throws CryptorException | [
"Creates",
"the",
"cipher",
"and",
"MAC",
"streams",
"required"
] | train | https://github.com/TGIO/RNCryptorNative/blob/5209f10b988e4033c0b769a40b0d6cc99ea16af7/jncryptor/src/main/java/org/cryptonode/jncryptor/AES256JNCryptorOutputStream.java#L128-L151 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java | FDBigInteger.multDiffMe | private /*@ helper @*/ long multDiffMe(long q, FDBigInteger S) {
"""
/*@
@ requires 0 < q && q <= (1L << 31);
@ requires data != null;
@ requires 0 <= nWords && nWords <= data.length && offset >= 0;
@ requires !this.isImmutable;
@ requires this.size() == S.size();
@ requires this != S;
@ assignable this.nWo... | java | private /*@ helper @*/ long multDiffMe(long q, FDBigInteger S) {
long diff = 0L;
if (q != 0) {
int deltaSize = S.offset - this.offset;
if (deltaSize >= 0) {
int[] sd = S.data;
int[] td = this.data;
for (int sIndex = 0, tIndex = delt... | [
"private",
"/*@ helper @*/",
"long",
"multDiffMe",
"(",
"long",
"q",
",",
"FDBigInteger",
"S",
")",
"{",
"long",
"diff",
"=",
"0L",
";",
"if",
"(",
"q",
"!=",
"0",
")",
"{",
"int",
"deltaSize",
"=",
"S",
".",
"offset",
"-",
"this",
".",
"offset",
"... | /*@
@ requires 0 < q && q <= (1L << 31);
@ requires data != null;
@ requires 0 <= nWords && nWords <= data.length && offset >= 0;
@ requires !this.isImmutable;
@ requires this.size() == S.size();
@ requires this != S;
@ assignable this.nWords, this.offset, this.data, this.data[*];
@ ensures -q <= \result && \result <= ... | [
"/",
"*"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java#L1289-L1325 |
wildfly/wildfly-core | deployment-repository/src/main/java/org/jboss/as/repository/PathUtil.java | PathUtil.resolveSecurely | public static final Path resolveSecurely(Path rootPath, String path) {
"""
Resolve a path from the rootPath checking that it doesn't go out of the rootPath.
@param rootPath the starting point for resolution.
@param path the path we want to resolve.
@return the resolved path.
@throws IllegalArgumentException if... | java | public static final Path resolveSecurely(Path rootPath, String path) {
Path resolvedPath;
if(path == null || path.isEmpty()) {
resolvedPath = rootPath.normalize();
} else {
String relativePath = removeSuperflousSlashes(path);
resolvedPath = rootPath.resolve(re... | [
"public",
"static",
"final",
"Path",
"resolveSecurely",
"(",
"Path",
"rootPath",
",",
"String",
"path",
")",
"{",
"Path",
"resolvedPath",
";",
"if",
"(",
"path",
"==",
"null",
"||",
"path",
".",
"isEmpty",
"(",
")",
")",
"{",
"resolvedPath",
"=",
"rootPa... | Resolve a path from the rootPath checking that it doesn't go out of the rootPath.
@param rootPath the starting point for resolution.
@param path the path we want to resolve.
@return the resolved path.
@throws IllegalArgumentException if the resolved path is out of the rootPath or if the resolution failed. | [
"Resolve",
"a",
"path",
"from",
"the",
"rootPath",
"checking",
"that",
"it",
"doesn",
"t",
"go",
"out",
"of",
"the",
"rootPath",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/deployment-repository/src/main/java/org/jboss/as/repository/PathUtil.java#L142-L154 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Downloader.java | Downloader.fetchContent | public String fetchContent(URL url, boolean useProxy) throws DownloadFailedException {
"""
Retrieves a file from a given URL and returns the contents.
@param url the URL of the file to download
@param useProxy whether to use the configured proxy when downloading
files
@return the content of the file
@throws... | java | public String fetchContent(URL url, boolean useProxy) throws DownloadFailedException {
try (HttpResourceConnection conn = new HttpResourceConnection(settings, useProxy);
ByteArrayOutputStream out = new ByteArrayOutputStream()) {
final InputStream in = conn.fetch(url);
IOU... | [
"public",
"String",
"fetchContent",
"(",
"URL",
"url",
",",
"boolean",
"useProxy",
")",
"throws",
"DownloadFailedException",
"{",
"try",
"(",
"HttpResourceConnection",
"conn",
"=",
"new",
"HttpResourceConnection",
"(",
"settings",
",",
"useProxy",
")",
";",
"ByteA... | Retrieves a file from a given URL and returns the contents.
@param url the URL of the file to download
@param useProxy whether to use the configured proxy when downloading
files
@return the content of the file
@throws DownloadFailedException is thrown if there is an error
downloading the file | [
"Retrieves",
"a",
"file",
"from",
"a",
"given",
"URL",
"and",
"returns",
"the",
"contents",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Downloader.java#L100-L110 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/equation/Equation.java | Equation.compileAssignment | private void compileAssignment(Sequence sequence, TokenList tokens, TokenList.Token t0) {
"""
An assignment is being made to some output. looks something like: A = B
"""
// see if it is assign or a range
List<Variable> range = parseAssignRange(sequence, tokens, t0);
TokenList.Token t1 ... | java | private void compileAssignment(Sequence sequence, TokenList tokens, TokenList.Token t0) {
// see if it is assign or a range
List<Variable> range = parseAssignRange(sequence, tokens, t0);
TokenList.Token t1 = t0.next;
if (t1.getType() != Type.SYMBOL || t1.getSymbol() != Symbol.ASSIGN)
... | [
"private",
"void",
"compileAssignment",
"(",
"Sequence",
"sequence",
",",
"TokenList",
"tokens",
",",
"TokenList",
".",
"Token",
"t0",
")",
"{",
"// see if it is assign or a range",
"List",
"<",
"Variable",
">",
"range",
"=",
"parseAssignRange",
"(",
"sequence",
"... | An assignment is being made to some output. looks something like: A = B | [
"An",
"assignment",
"is",
"being",
"made",
"to",
"some",
"output",
".",
"looks",
"something",
"like",
":",
"A",
"=",
"B"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/Equation.java#L471-L498 |
tcurdt/jdeb | src/main/java/org/vafer/jdeb/signing/PGPSigner.java | PGPSigner.clearSign | public void clearSign(String input, OutputStream output) throws IOException, PGPException, GeneralSecurityException {
"""
Creates a clear sign signature over the input data. (Not detached)
@param input the content to be signed
@param output the output destination of the signature
"""
clear... | java | public void clearSign(String input, OutputStream output) throws IOException, PGPException, GeneralSecurityException {
clearSign(new ByteArrayInputStream(input.getBytes("UTF-8")), output);
} | [
"public",
"void",
"clearSign",
"(",
"String",
"input",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
",",
"PGPException",
",",
"GeneralSecurityException",
"{",
"clearSign",
"(",
"new",
"ByteArrayInputStream",
"(",
"input",
".",
"getBytes",
"(",
"\"U... | Creates a clear sign signature over the input data. (Not detached)
@param input the content to be signed
@param output the output destination of the signature | [
"Creates",
"a",
"clear",
"sign",
"signature",
"over",
"the",
"input",
"data",
".",
"(",
"Not",
"detached",
")"
] | train | https://github.com/tcurdt/jdeb/blob/b899a7b1b3391356aafc491ab601f258961f67f0/src/main/java/org/vafer/jdeb/signing/PGPSigner.java#L71-L73 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java | DataStream.assignTimestampsAndWatermarks | public SingleOutputStreamOperator<T> assignTimestampsAndWatermarks(
AssignerWithPunctuatedWatermarks<T> timestampAndWatermarkAssigner) {
"""
Assigns timestamps to the elements in the data stream and creates watermarks to
signal event time progress based on the elements themselves.
<p>This method creates wat... | java | public SingleOutputStreamOperator<T> assignTimestampsAndWatermarks(
AssignerWithPunctuatedWatermarks<T> timestampAndWatermarkAssigner) {
// match parallelism to input, otherwise dop=1 sources could lead to some strange
// behaviour: the watermark will creep along very slowly because the elements
// from the s... | [
"public",
"SingleOutputStreamOperator",
"<",
"T",
">",
"assignTimestampsAndWatermarks",
"(",
"AssignerWithPunctuatedWatermarks",
"<",
"T",
">",
"timestampAndWatermarkAssigner",
")",
"{",
"// match parallelism to input, otherwise dop=1 sources could lead to some strange",
"// behaviour:... | Assigns timestamps to the elements in the data stream and creates watermarks to
signal event time progress based on the elements themselves.
<p>This method creates watermarks based purely on stream elements. For each element
that is handled via {@link AssignerWithPunctuatedWatermarks#extractTimestamp(Object, long)},
t... | [
"Assigns",
"timestamps",
"to",
"the",
"elements",
"in",
"the",
"data",
"stream",
"and",
"creates",
"watermarks",
"to",
"signal",
"event",
"time",
"progress",
"based",
"on",
"the",
"elements",
"themselves",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L926-L940 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/animation/transformation/Rotation.java | Rotation.offset | public Rotation offset(float x, float y, float z) {
"""
Sets the axis position for this {@link Rotation}.
@param x the x
@param y the y
@param z the z
@return the rotation
"""
offsetX = x;
offsetY = y;
offsetZ = z;
return this;
} | java | public Rotation offset(float x, float y, float z)
{
offsetX = x;
offsetY = y;
offsetZ = z;
return this;
} | [
"public",
"Rotation",
"offset",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"offsetX",
"=",
"x",
";",
"offsetY",
"=",
"y",
";",
"offsetZ",
"=",
"z",
";",
"return",
"this",
";",
"}"
] | Sets the axis position for this {@link Rotation}.
@param x the x
@param y the y
@param z the z
@return the rotation | [
"Sets",
"the",
"axis",
"position",
"for",
"this",
"{",
"@link",
"Rotation",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/animation/transformation/Rotation.java#L152-L158 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.