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 |
|---|---|---|---|---|---|---|---|---|---|---|
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java | BackendServiceClient.deleteSignedUrlKeyBackendService | @BetaApi
public final Operation deleteSignedUrlKeyBackendService(String backendService, String keyName) {
"""
Deletes a key for validating requests with signed URLs for this backend service.
<p>Sample code:
<pre><code>
try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
Proj... | java | @BetaApi
public final Operation deleteSignedUrlKeyBackendService(String backendService, String keyName) {
DeleteSignedUrlKeyBackendServiceHttpRequest request =
DeleteSignedUrlKeyBackendServiceHttpRequest.newBuilder()
.setBackendService(backendService)
.setKeyName(keyName)
... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"deleteSignedUrlKeyBackendService",
"(",
"String",
"backendService",
",",
"String",
"keyName",
")",
"{",
"DeleteSignedUrlKeyBackendServiceHttpRequest",
"request",
"=",
"DeleteSignedUrlKeyBackendServiceHttpRequest",
".",
"newBuilde... | Deletes a key for validating requests with signed URLs for this backend service.
<p>Sample code:
<pre><code>
try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
String k... | [
"Deletes",
"a",
"key",
"for",
"validating",
"requests",
"with",
"signed",
"URLs",
"for",
"this",
"backend",
"service",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java#L568-L577 |
amzn/ion-java | src/com/amazon/ion/Timestamp.java | Timestamp.addDay | public final Timestamp addDay(int amount) {
"""
Returns a timestamp relative to this one by the given number of days.
@param amount a number of days.
"""
long delta = (long) amount * 24 * 60 * 60 * 1000;
return addMillisForPrecision(delta, Precision.DAY, false);
} | java | public final Timestamp addDay(int amount)
{
long delta = (long) amount * 24 * 60 * 60 * 1000;
return addMillisForPrecision(delta, Precision.DAY, false);
} | [
"public",
"final",
"Timestamp",
"addDay",
"(",
"int",
"amount",
")",
"{",
"long",
"delta",
"=",
"(",
"long",
")",
"amount",
"*",
"24",
"*",
"60",
"*",
"60",
"*",
"1000",
";",
"return",
"addMillisForPrecision",
"(",
"delta",
",",
"Precision",
".",
"DAY"... | Returns a timestamp relative to this one by the given number of days.
@param amount a number of days. | [
"Returns",
"a",
"timestamp",
"relative",
"to",
"this",
"one",
"by",
"the",
"given",
"number",
"of",
"days",
"."
] | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/Timestamp.java#L2443-L2447 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/search/Search.java | Search.setStopCriterionCheckPeriod | public void setStopCriterionCheckPeriod(long period, TimeUnit timeUnit) {
"""
Instructs the search to check its stop criteria at regular intervals separated by the given period.
For the default period, see {@link StopCriterionChecker}, which is used internally for this purpose.
The period should be at least 1 mi... | java | public void setStopCriterionCheckPeriod(long period, TimeUnit timeUnit){
// acquire status lock
synchronized(statusLock){
// assert idle
assertIdle("Cannot modify stop criterion check period.");
// pass new settings to checker
stopCriterionChecker.setPerio... | [
"public",
"void",
"setStopCriterionCheckPeriod",
"(",
"long",
"period",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"// acquire status lock",
"synchronized",
"(",
"statusLock",
")",
"{",
"// assert idle",
"assertIdle",
"(",
"\"Cannot modify stop criterion check period.\"",
")",
... | Instructs the search to check its stop criteria at regular intervals separated by the given period.
For the default period, see {@link StopCriterionChecker}, which is used internally for this purpose.
The period should be at least 1 millisecond, else the stop criterion checker may thrown an exception
when the search is... | [
"Instructs",
"the",
"search",
"to",
"check",
"its",
"stop",
"criteria",
"at",
"regular",
"intervals",
"separated",
"by",
"the",
"given",
"period",
".",
"For",
"the",
"default",
"period",
"see",
"{",
"@link",
"StopCriterionChecker",
"}",
"which",
"is",
"used",
... | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/Search.java#L596-L606 |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/InventoryItem.java | InventoryItem.setContent | public void setContent(java.util.Collection<java.util.Map<String, String>> content) {
"""
<p>
The inventory data of the inventory type.
</p>
@param content
The inventory data of the inventory type.
"""
if (content == null) {
this.content = null;
return;
}
... | java | public void setContent(java.util.Collection<java.util.Map<String, String>> content) {
if (content == null) {
this.content = null;
return;
}
this.content = new com.amazonaws.internal.SdkInternalList<java.util.Map<String, String>>(content);
} | [
"public",
"void",
"setContent",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
">",
"content",
")",
"{",
"if",
"(",
"content",
"==",
"null",
")",
"{",
"this",
".",
"content",
"=... | <p>
The inventory data of the inventory type.
</p>
@param content
The inventory data of the inventory type. | [
"<p",
">",
"The",
"inventory",
"data",
"of",
"the",
"inventory",
"type",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/InventoryItem.java#L282-L289 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getTag | public Tag getTag(UUID projectId, UUID tagId, GetTagOptionalParameter getTagOptionalParameter) {
"""
Get information about a specific tag.
@param projectId The project this tag belongs to
@param tagId The tag id
@param getTagOptionalParameter the object representing the optional parameters to be set before ca... | java | public Tag getTag(UUID projectId, UUID tagId, GetTagOptionalParameter getTagOptionalParameter) {
return getTagWithServiceResponseAsync(projectId, tagId, getTagOptionalParameter).toBlocking().single().body();
} | [
"public",
"Tag",
"getTag",
"(",
"UUID",
"projectId",
",",
"UUID",
"tagId",
",",
"GetTagOptionalParameter",
"getTagOptionalParameter",
")",
"{",
"return",
"getTagWithServiceResponseAsync",
"(",
"projectId",
",",
"tagId",
",",
"getTagOptionalParameter",
")",
".",
"toBlo... | Get information about a specific tag.
@param projectId The project this tag belongs to
@param tagId The tag id
@param getTagOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExceptio... | [
"Get",
"information",
"about",
"a",
"specific",
"tag",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L777-L779 |
pmwmedia/tinylog | tinylog-impl/src/main/java/org/tinylog/writers/RollingFileWriter.java | RollingFileWriter.canBeContinued | private static boolean canBeContinued(final String fileName, final List<Policy> policies) {
"""
Checks if an already existing log file can be continued.
@param fileName
Log file
@param policies
Policies that should be applied
@return {@code true} if the passed log file can be continued, {@code false} if a n... | java | private static boolean canBeContinued(final String fileName, final List<Policy> policies) {
boolean result = true;
for (Policy policy : policies) {
result &= policy.continueExistingFile(fileName);
}
return result;
} | [
"private",
"static",
"boolean",
"canBeContinued",
"(",
"final",
"String",
"fileName",
",",
"final",
"List",
"<",
"Policy",
">",
"policies",
")",
"{",
"boolean",
"result",
"=",
"true",
";",
"for",
"(",
"Policy",
"policy",
":",
"policies",
")",
"{",
"result"... | Checks if an already existing log file can be continued.
@param fileName
Log file
@param policies
Policies that should be applied
@return {@code true} if the passed log file can be continued, {@code false} if a new log file should be started | [
"Checks",
"if",
"an",
"already",
"existing",
"log",
"file",
"can",
"be",
"continued",
"."
] | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-impl/src/main/java/org/tinylog/writers/RollingFileWriter.java#L206-L212 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java | SyntheticStorableReferenceBuilder.copyFromMaster | @Deprecated
public void copyFromMaster(Storable indexEntry, S master) throws FetchException {
"""
Sets all the properties of the given index entry, using the applicable
properties of the given master.
@param indexEntry index entry whose properties will be set
@param master source of property values
@dep... | java | @Deprecated
public void copyFromMaster(Storable indexEntry, S master) throws FetchException {
getReferenceAccess().copyFromMaster(indexEntry, master);
} | [
"@",
"Deprecated",
"public",
"void",
"copyFromMaster",
"(",
"Storable",
"indexEntry",
",",
"S",
"master",
")",
"throws",
"FetchException",
"{",
"getReferenceAccess",
"(",
")",
".",
"copyFromMaster",
"(",
"indexEntry",
",",
"master",
")",
";",
"}"
] | Sets all the properties of the given index entry, using the applicable
properties of the given master.
@param indexEntry index entry whose properties will be set
@param master source of property values
@deprecated call getReferenceAccess | [
"Sets",
"all",
"the",
"properties",
"of",
"the",
"given",
"index",
"entry",
"using",
"the",
"applicable",
"properties",
"of",
"the",
"given",
"master",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java#L366-L369 |
elki-project/elki | elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/invertedlist/InMemoryInvertedIndex.java | InMemoryInvertedIndex.indexDense | private void indexDense(DBIDRef ref, V obj) {
"""
Index a single (dense) instance.
@param ref Object reference
@param obj Object to index.
"""
double len = 0.;
for(int dim = 0, max = obj.getDimensionality(); dim < max; dim++) {
final double val = obj.doubleValue(dim);
if(val == 0. || va... | java | private void indexDense(DBIDRef ref, V obj) {
double len = 0.;
for(int dim = 0, max = obj.getDimensionality(); dim < max; dim++) {
final double val = obj.doubleValue(dim);
if(val == 0. || val != val) {
continue;
}
len += val * val;
getOrCreateColumn(dim).add(val, ref);
... | [
"private",
"void",
"indexDense",
"(",
"DBIDRef",
"ref",
",",
"V",
"obj",
")",
"{",
"double",
"len",
"=",
"0.",
";",
"for",
"(",
"int",
"dim",
"=",
"0",
",",
"max",
"=",
"obj",
".",
"getDimensionality",
"(",
")",
";",
"dim",
"<",
"max",
";",
"dim"... | Index a single (dense) instance.
@param ref Object reference
@param obj Object to index. | [
"Index",
"a",
"single",
"(",
"dense",
")",
"instance",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/invertedlist/InMemoryInvertedIndex.java#L146-L157 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/util/ArrayUtil.java | ArrayUtil.readShort | public static short readShort(byte b[], int offset) {
"""
Unserializes a short from a byte array at a specific offset in big-endian order
@param b byte array from which to read a short value.
@param offset offset within byte array to start reading.
@return short read from byte array.
"""
int retValue;... | java | public static short readShort(byte b[], int offset) {
int retValue;
retValue = b[offset++] << 8;
retValue |= b[offset] & 0xff;
return (short)retValue;
} | [
"public",
"static",
"short",
"readShort",
"(",
"byte",
"b",
"[",
"]",
",",
"int",
"offset",
")",
"{",
"int",
"retValue",
";",
"retValue",
"=",
"b",
"[",
"offset",
"++",
"]",
"<<",
"8",
";",
"retValue",
"|=",
"b",
"[",
"offset",
"]",
"&",
"0xff",
... | Unserializes a short from a byte array at a specific offset in big-endian order
@param b byte array from which to read a short value.
@param offset offset within byte array to start reading.
@return short read from byte array. | [
"Unserializes",
"a",
"short",
"from",
"a",
"byte",
"array",
"at",
"a",
"specific",
"offset",
"in",
"big",
"-",
"endian",
"order"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/util/ArrayUtil.java#L118-L125 |
vipshop/vjtools | vjkit/src/main/java/com/vip/vjtools/vjkit/concurrent/limiter/RateLimiterUtil.java | RateLimiterUtil.create | public static RateLimiter create(double permitsPerSecond, double maxBurstSeconds, boolean filledWithToken)
throws ReflectiveOperationException {
"""
一个用来定制RateLimiter的方法。
@param permitsPerSecond 每秒允许的请求书,可看成QPS
@param maxBurstSeconds 最大的突发缓冲时间。用来应对突发流量。Guava的实现默认是1s。permitsPerSecond * maxBurstSeconds的数量,就是闲... | java | public static RateLimiter create(double permitsPerSecond, double maxBurstSeconds, boolean filledWithToken)
throws ReflectiveOperationException {
Class<?> sleepingStopwatchClass = Class
.forName("com.google.common.util.concurrent.RateLimiter$SleepingStopwatch");
Method createStopwatchMethod = sleepingStopwatc... | [
"public",
"static",
"RateLimiter",
"create",
"(",
"double",
"permitsPerSecond",
",",
"double",
"maxBurstSeconds",
",",
"boolean",
"filledWithToken",
")",
"throws",
"ReflectiveOperationException",
"{",
"Class",
"<",
"?",
">",
"sleepingStopwatchClass",
"=",
"Class",
"."... | 一个用来定制RateLimiter的方法。
@param permitsPerSecond 每秒允许的请求书,可看成QPS
@param maxBurstSeconds 最大的突发缓冲时间。用来应对突发流量。Guava的实现默认是1s。permitsPerSecond * maxBurstSeconds的数量,就是闲置时预留的缓冲token数量
@param filledWithToken 是否需要创建时就保留有permitsPerSecond * maxBurstSeconds的token | [
"一个用来定制RateLimiter的方法。"
] | train | https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjkit/src/main/java/com/vip/vjtools/vjkit/concurrent/limiter/RateLimiterUtil.java#L29-L52 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBObjectMapper.java | CouchDBObjectMapper.getJsonPrimitive | private static JsonElement getJsonPrimitive(Object value, Class clazz) {
"""
Gets the json primitive.
@param value
the value
@param clazz
the clazz
@return the json primitive
"""
if (value != null)
{
if (clazz.isAssignableFrom(Number.class) || value instanceof Number)
... | java | private static JsonElement getJsonPrimitive(Object value, Class clazz)
{
if (value != null)
{
if (clazz.isAssignableFrom(Number.class) || value instanceof Number)
{
return new JsonPrimitive((Number) value);
}
else if (clazz.isAssignable... | [
"private",
"static",
"JsonElement",
"getJsonPrimitive",
"(",
"Object",
"value",
",",
"Class",
"clazz",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"clazz",
".",
"isAssignableFrom",
"(",
"Number",
".",
"class",
")",
"||",
"value",
"in... | Gets the json primitive.
@param value
the value
@param clazz
the clazz
@return the json primitive | [
"Gets",
"the",
"json",
"primitive",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBObjectMapper.java#L440-L464 |
twitter/hraven | hraven-core/src/main/java/com/twitter/hraven/datasource/AppSummaryService.java | AppSummaryService.getNumberRunsScratch | long getNumberRunsScratch(Map<byte[], byte[]> rawFamily) {
"""
interprets the number of runs based on number of columns in raw col family
@param {@link Result}
@return number of runs
"""
long numberRuns = 0L;
if (rawFamily != null) {
numberRuns = rawFamily.size();
}
if (numberRuns == 0L... | java | long getNumberRunsScratch(Map<byte[], byte[]> rawFamily) {
long numberRuns = 0L;
if (rawFamily != null) {
numberRuns = rawFamily.size();
}
if (numberRuns == 0L) {
LOG.error("Number of runs in scratch column family can't be 0,"
+ " if processing within TTL");
throw new Process... | [
"long",
"getNumberRunsScratch",
"(",
"Map",
"<",
"byte",
"[",
"]",
",",
"byte",
"[",
"]",
">",
"rawFamily",
")",
"{",
"long",
"numberRuns",
"=",
"0L",
";",
"if",
"(",
"rawFamily",
"!=",
"null",
")",
"{",
"numberRuns",
"=",
"rawFamily",
".",
"size",
"... | interprets the number of runs based on number of columns in raw col family
@param {@link Result}
@return number of runs | [
"interprets",
"the",
"number",
"of",
"runs",
"based",
"on",
"number",
"of",
"columns",
"in",
"raw",
"col",
"family"
] | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/AppSummaryService.java#L288-L299 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java | Shape.isWholeArray | public static boolean isWholeArray(int rank, int... dimension) {
"""
Returns true if the dimension is null
or the dimension length is 1 and the first entry
is {@link Integer#MAX_VALUE}
@param rank the rank of the input array
@param dimension the dimensions specified
@return true if the dimension length is e... | java | public static boolean isWholeArray(int rank, int... dimension){
return rank == 0 || dimension == null || dimension.length == 0 ||
(dimension.length == 1 && dimension[0] == Integer.MAX_VALUE) || dimension.length == rank;
} | [
"public",
"static",
"boolean",
"isWholeArray",
"(",
"int",
"rank",
",",
"int",
"...",
"dimension",
")",
"{",
"return",
"rank",
"==",
"0",
"||",
"dimension",
"==",
"null",
"||",
"dimension",
".",
"length",
"==",
"0",
"||",
"(",
"dimension",
".",
"length",... | Returns true if the dimension is null
or the dimension length is 1 and the first entry
is {@link Integer#MAX_VALUE}
@param rank the rank of the input array
@param dimension the dimensions specified
@return true if the dimension length is equal to the rank,
the dimension is null or the dimension length is 1 and the fir... | [
"Returns",
"true",
"if",
"the",
"dimension",
"is",
"null",
"or",
"the",
"dimension",
"length",
"is",
"1",
"and",
"the",
"first",
"entry",
"is",
"{",
"@link",
"Integer#MAX_VALUE",
"}",
"@param",
"rank",
"the",
"rank",
"of",
"the",
"input",
"array",
"@param"... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java#L348-L351 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putShortBigEndian | public final void putShortBigEndian(int index, short value) {
"""
Writes the given short integer value (16 bit, 2 bytes) to the given position in big-endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putShort(int, short)}. For most cases (suc... | java | public final void putShortBigEndian(int index, short value) {
if (LITTLE_ENDIAN) {
putShort(index, Short.reverseBytes(value));
} else {
putShort(index, value);
}
} | [
"public",
"final",
"void",
"putShortBigEndian",
"(",
"int",
"index",
",",
"short",
"value",
")",
"{",
"if",
"(",
"LITTLE_ENDIAN",
")",
"{",
"putShort",
"(",
"index",
",",
"Short",
".",
"reverseBytes",
"(",
"value",
")",
")",
";",
"}",
"else",
"{",
"put... | Writes the given short integer value (16 bit, 2 bytes) to the given position in big-endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putShort(int, short)}. For most cases (such as
transient storage in memory or serialization for I/O and network),
i... | [
"Writes",
"the",
"given",
"short",
"integer",
"value",
"(",
"16",
"bit",
"2",
"bytes",
")",
"to",
"the",
"given",
"position",
"in",
"big",
"-",
"endian",
"byte",
"order",
".",
"This",
"method",
"s",
"speed",
"depends",
"on",
"the",
"system",
"s",
"nati... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L668-L674 |
janus-project/guava.janusproject.io | guava/src/com/google/common/util/concurrent/Uninterruptibles.java | Uninterruptibles.putUninterruptibly | public static <E> void putUninterruptibly(BlockingQueue<E> queue, E element) {
"""
Invokes {@code queue.}{@link BlockingQueue#put(Object) put(element)}
uninterruptibly.
@throws ClassCastException if the class of the specified element prevents
it from being added to the given queue
@throws IllegalArgumentExce... | java | public static <E> void putUninterruptibly(BlockingQueue<E> queue, E element) {
boolean interrupted = false;
try {
while (true) {
try {
queue.put(element);
return;
} catch (InterruptedException e) {
interrupted = true;
}
}
} finally {
if... | [
"public",
"static",
"<",
"E",
">",
"void",
"putUninterruptibly",
"(",
"BlockingQueue",
"<",
"E",
">",
"queue",
",",
"E",
"element",
")",
"{",
"boolean",
"interrupted",
"=",
"false",
";",
"try",
"{",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"queue",
... | Invokes {@code queue.}{@link BlockingQueue#put(Object) put(element)}
uninterruptibly.
@throws ClassCastException if the class of the specified element prevents
it from being added to the given queue
@throws IllegalArgumentException if some property of the specified element
prevents it from being added to the given que... | [
"Invokes",
"{",
"@code",
"queue",
".",
"}",
"{",
"@link",
"BlockingQueue#put",
"(",
"Object",
")",
"put",
"(",
"element",
")",
"}",
"uninterruptibly",
"."
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/util/concurrent/Uninterruptibles.java#L244-L260 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deletePatternAnyEntityModel | public OperationStatus deletePatternAnyEntityModel(UUID appId, String versionId, UUID entityId) {
"""
Deletes a Pattern.Any entity extractor from the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The Pattern.Any entity extractor ID.
@throws IllegalArgumentExce... | java | public OperationStatus deletePatternAnyEntityModel(UUID appId, String versionId, UUID entityId) {
return deletePatternAnyEntityModelWithServiceResponseAsync(appId, versionId, entityId).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"deletePatternAnyEntityModel",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
")",
"{",
"return",
"deletePatternAnyEntityModelWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"entityId",
")",
".",
... | Deletes a Pattern.Any entity extractor from the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The Pattern.Any entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected ... | [
"Deletes",
"a",
"Pattern",
".",
"Any",
"entity",
"extractor",
"from",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L10650-L10652 |
michel-kraemer/gradle-download-task | src/main/java/de/undercouch/gradle/tasks/download/DownloadAction.java | DownloadAction.performDownload | private void performDownload(HttpResponse response, File destFile)
throws IOException {
"""
Save an HTTP response to a file
@param response the response to save
@param destFile the destination file
@throws IOException if the response could not be downloaded
"""
HttpEntity entity = respon... | java | private void performDownload(HttpResponse response, File destFile)
throws IOException {
HttpEntity entity = response.getEntity();
if (entity == null) {
return;
}
//get content length
long contentLength = entity.getContentLength();
if (cont... | [
"private",
"void",
"performDownload",
"(",
"HttpResponse",
"response",
",",
"File",
"destFile",
")",
"throws",
"IOException",
"{",
"HttpEntity",
"entity",
"=",
"response",
".",
"getEntity",
"(",
")",
";",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"return"... | Save an HTTP response to a file
@param response the response to save
@param destFile the destination file
@throws IOException if the response could not be downloaded | [
"Save",
"an",
"HTTP",
"response",
"to",
"a",
"file"
] | train | https://github.com/michel-kraemer/gradle-download-task/blob/a20c7f29c15ccb699700518f860373692148e3fc/src/main/java/de/undercouch/gradle/tasks/download/DownloadAction.java#L297-L316 |
michael-rapp/AndroidBottomSheet | library/src/main/java/de/mrapp/android/bottomsheet/view/DraggableView.java | DraggableView.isScrollUpEvent | private boolean isScrollUpEvent(final float x, final float y,
@NonNull final ViewGroup viewGroup) {
"""
Returns, whether a touch event at a specific position targets a view, which can be scrolled
up.
@param x
The horizontal position of the touch event in pixels as a {@link ... | java | private boolean isScrollUpEvent(final float x, final float y,
@NonNull final ViewGroup viewGroup) {
int location[] = new int[2];
viewGroup.getLocationOnScreen(location);
if (x >= location[0] && x <= location[0] + viewGroup.getWidth() && y >= location[1] &&
... | [
"private",
"boolean",
"isScrollUpEvent",
"(",
"final",
"float",
"x",
",",
"final",
"float",
"y",
",",
"@",
"NonNull",
"final",
"ViewGroup",
"viewGroup",
")",
"{",
"int",
"location",
"[",
"]",
"=",
"new",
"int",
"[",
"2",
"]",
";",
"viewGroup",
".",
"ge... | Returns, whether a touch event at a specific position targets a view, which can be scrolled
up.
@param x
The horizontal position of the touch event in pixels as a {@link Float} value
@param y
The vertical position of the touch event in pixels as a {@link Float} value
@param viewGroup
The view group, which should be us... | [
"Returns",
"whether",
"a",
"touch",
"event",
"at",
"a",
"specific",
"position",
"targets",
"a",
"view",
"which",
"can",
"be",
"scrolled",
"up",
"."
] | train | https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/library/src/main/java/de/mrapp/android/bottomsheet/view/DraggableView.java#L166-L185 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/Sources.java | Sources.asURL | public static URL asURL(Class<?> contextClass, String resourceName) {
"""
Returns the given source as an {@link URL}
@param contextClass
@param resourceName
@return
"""
return Resources.getResource(contextClass, resourceName);
} | java | public static URL asURL(Class<?> contextClass, String resourceName) {
return Resources.getResource(contextClass, resourceName);
} | [
"public",
"static",
"URL",
"asURL",
"(",
"Class",
"<",
"?",
">",
"contextClass",
",",
"String",
"resourceName",
")",
"{",
"return",
"Resources",
".",
"getResource",
"(",
"contextClass",
",",
"resourceName",
")",
";",
"}"
] | Returns the given source as an {@link URL}
@param contextClass
@param resourceName
@return | [
"Returns",
"the",
"given",
"source",
"as",
"an",
"{",
"@link",
"URL",
"}"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/Sources.java#L170-L172 |
leadware/jpersistence-tools | jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/utils/DAOValidatorMethodExpressionExecutor.java | DAOValidatorMethodExpressionExecutor.invoke | public Object invoke(String methodName, Object...parameters) {
"""
Methode d'execution de la methode
@param methodName Nom de la methode a executer
@param parameters Parametres de la methode
@return Valeur de retour
"""
// Si le nom de la methode est vide
if(methodName == null || methodName.trim()... | java | public Object invoke(String methodName, Object...parameters) {
// Si le nom de la methode est vide
if(methodName == null || methodName.trim().length() == 0) return null;
// Obtention de la methode
Method method = methods.get(methodName.trim());
// Si la methode n'existe pas
if(method == nu... | [
"public",
"Object",
"invoke",
"(",
"String",
"methodName",
",",
"Object",
"...",
"parameters",
")",
"{",
"// Si le nom de la methode est vide\r",
"if",
"(",
"methodName",
"==",
"null",
"||",
"methodName",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",
... | Methode d'execution de la methode
@param methodName Nom de la methode a executer
@param parameters Parametres de la methode
@return Valeur de retour | [
"Methode",
"d",
"execution",
"de",
"la",
"methode"
] | train | https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/utils/DAOValidatorMethodExpressionExecutor.java#L117-L141 |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java | AbsSetting.getBool | public Boolean getBool(String key, String group, Boolean defaultValue) {
"""
获取波尔型型属性值
@param key 属性名
@param group 分组名
@param defaultValue 默认值
@return 属性值
"""
return Convert.toBool(getByGroup(key, group), defaultValue);
} | java | public Boolean getBool(String key, String group, Boolean defaultValue) {
return Convert.toBool(getByGroup(key, group), defaultValue);
} | [
"public",
"Boolean",
"getBool",
"(",
"String",
"key",
",",
"String",
"group",
",",
"Boolean",
"defaultValue",
")",
"{",
"return",
"Convert",
".",
"toBool",
"(",
"getByGroup",
"(",
"key",
",",
"group",
")",
",",
"defaultValue",
")",
";",
"}"
] | 获取波尔型型属性值
@param key 属性名
@param group 分组名
@param defaultValue 默认值
@return 属性值 | [
"获取波尔型型属性值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java#L188-L190 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.convertNormToPixel | public static Point2D_F64 convertNormToPixel(CameraModel param , Point2D_F64 norm , Point2D_F64 pixel ) {
"""
<p>
Convenient function for converting from normalized image coordinates to the original image pixel coordinate.
If speed is a concern then {@link PinholeNtoP_F64} should be used instead.
</p>
NOTE: ... | java | public static Point2D_F64 convertNormToPixel(CameraModel param , Point2D_F64 norm , Point2D_F64 pixel ) {
return convertNormToPixel(param,norm.x,norm.y,pixel);
} | [
"public",
"static",
"Point2D_F64",
"convertNormToPixel",
"(",
"CameraModel",
"param",
",",
"Point2D_F64",
"norm",
",",
"Point2D_F64",
"pixel",
")",
"{",
"return",
"convertNormToPixel",
"(",
"param",
",",
"norm",
".",
"x",
",",
"norm",
".",
"y",
",",
"pixel",
... | <p>
Convenient function for converting from normalized image coordinates to the original image pixel coordinate.
If speed is a concern then {@link PinholeNtoP_F64} should be used instead.
</p>
NOTE: norm and pixel can be the same instance.
@param param Intrinsic camera parameters
@param norm Normalized image coordina... | [
"<p",
">",
"Convenient",
"function",
"for",
"converting",
"from",
"normalized",
"image",
"coordinates",
"to",
"the",
"original",
"image",
"pixel",
"coordinate",
".",
"If",
"speed",
"is",
"a",
"concern",
"then",
"{",
"@link",
"PinholeNtoP_F64",
"}",
"should",
"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L410-L412 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/servlet/ServletOperationSet.java | ServletOperationSet.getOperation | public ServletOperation getOperation(SlingHttpServletRequest request, Method method) {
"""
Retrieves the servlet operation requested for the used HTTP method.
Looks in the selectors for a operation and gives their implementation in the extensions context.
@param request the servlet request
@param method the ... | java | public ServletOperation getOperation(SlingHttpServletRequest request, Method method) {
ServletOperation operation = null;
E extension = RequestUtil.getExtension(request, defaultExtension);
Map<E, O> extensionDefaults = operationDefaults.get(method);
if (extensionDefaults != null) {
... | [
"public",
"ServletOperation",
"getOperation",
"(",
"SlingHttpServletRequest",
"request",
",",
"Method",
"method",
")",
"{",
"ServletOperation",
"operation",
"=",
"null",
";",
"E",
"extension",
"=",
"RequestUtil",
".",
"getExtension",
"(",
"request",
",",
"defaultExt... | Retrieves the servlet operation requested for the used HTTP method.
Looks in the selectors for a operation and gives their implementation in the extensions context.
@param request the servlet request
@param method the requested HTTP method
@return the operation or 'null', if the requested combination of selector
and ... | [
"Retrieves",
"the",
"servlet",
"operation",
"requested",
"for",
"the",
"used",
"HTTP",
"method",
".",
"Looks",
"in",
"the",
"selectors",
"for",
"a",
"operation",
"and",
"gives",
"their",
"implementation",
"in",
"the",
"extensions",
"context",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/servlet/ServletOperationSet.java#L51-L68 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateExplicitListItem | public OperationStatus updateExplicitListItem(UUID appId, String versionId, UUID entityId, long itemId, UpdateExplicitListItemOptionalParameter updateExplicitListItemOptionalParameter) {
"""
Updates an explicit list item for a Pattern.Any entity.
@param appId The application ID.
@param versionId The version ID... | java | public OperationStatus updateExplicitListItem(UUID appId, String versionId, UUID entityId, long itemId, UpdateExplicitListItemOptionalParameter updateExplicitListItemOptionalParameter) {
return updateExplicitListItemWithServiceResponseAsync(appId, versionId, entityId, itemId, updateExplicitListItemOptionalParam... | [
"public",
"OperationStatus",
"updateExplicitListItem",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"long",
"itemId",
",",
"UpdateExplicitListItemOptionalParameter",
"updateExplicitListItemOptionalParameter",
")",
"{",
"return",
"updateExp... | Updates an explicit list item for a Pattern.Any entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The Pattern.Any entity extractor ID.
@param itemId The explicit list item ID.
@param updateExplicitListItemOptionalParameter the object representing the optional parameters to be se... | [
"Updates",
"an",
"explicit",
"list",
"item",
"for",
"a",
"Pattern",
".",
"Any",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L14063-L14065 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/Comapi.java | Comapi.initialise | public static void initialise(@NonNull Application app, @NonNull ComapiConfig config, Callback<ComapiClient> callback) {
"""
Build SDK client. Can be called only once in onCreate callback on Application class.
"""
String error = checkIfCanInitialise(app, config, false);
if (!TextUtils.isEmpty(... | java | public static void initialise(@NonNull Application app, @NonNull ComapiConfig config, Callback<ComapiClient> callback) {
String error = checkIfCanInitialise(app, config, false);
if (!TextUtils.isEmpty(error) && callback != null) {
callback.error(new Exception(error));
}
Com... | [
"public",
"static",
"void",
"initialise",
"(",
"@",
"NonNull",
"Application",
"app",
",",
"@",
"NonNull",
"ComapiConfig",
"config",
",",
"Callback",
"<",
"ComapiClient",
">",
"callback",
")",
"{",
"String",
"error",
"=",
"checkIfCanInitialise",
"(",
"app",
","... | Build SDK client. Can be called only once in onCreate callback on Application class. | [
"Build",
"SDK",
"client",
".",
"Can",
"be",
"called",
"only",
"once",
"in",
"onCreate",
"callback",
"on",
"Application",
"class",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/Comapi.java#L45-L55 |
apiman/apiman | manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/AbstractJpaStorage.java | AbstractJpaStorage.executeCountQuery | protected <T> int executeCountQuery(SearchCriteriaBean criteria, EntityManager entityManager, Class<T> type) {
"""
Gets a count of the number of rows that would be returned by the search.
@param criteria
@param entityManager
@param type
"""
CriteriaBuilder builder = entityManager.getCriteriaBuilder(... | java | protected <T> int executeCountQuery(SearchCriteriaBean criteria, EntityManager entityManager, Class<T> type) {
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<Long> countQuery = builder.createQuery(Long.class);
Root<T> from = countQuery.from(type);
countQuery.... | [
"protected",
"<",
"T",
">",
"int",
"executeCountQuery",
"(",
"SearchCriteriaBean",
"criteria",
",",
"EntityManager",
"entityManager",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"CriteriaBuilder",
"builder",
"=",
"entityManager",
".",
"getCriteriaBuilder",
"(",... | Gets a count of the number of rows that would be returned by the search.
@param criteria
@param entityManager
@param type | [
"Gets",
"a",
"count",
"of",
"the",
"number",
"of",
"rows",
"that",
"would",
"be",
"returned",
"by",
"the",
"search",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/AbstractJpaStorage.java#L313-L321 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.serviceName_activateZone_POST | public void serviceName_activateZone_POST(String serviceName, Boolean minimized) throws IOException {
"""
Activate the DNS zone for this domain
REST: POST /domain/{serviceName}/activateZone
@param minimized [required] Create only mandatory records
@param serviceName [required] The internal name of your domain... | java | public void serviceName_activateZone_POST(String serviceName, Boolean minimized) throws IOException {
String qPath = "/domain/{serviceName}/activateZone";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "minimized", minimized);
exec(qPath, "POS... | [
"public",
"void",
"serviceName_activateZone_POST",
"(",
"String",
"serviceName",
",",
"Boolean",
"minimized",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/{serviceName}/activateZone\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",... | Activate the DNS zone for this domain
REST: POST /domain/{serviceName}/activateZone
@param minimized [required] Create only mandatory records
@param serviceName [required] The internal name of your domain | [
"Activate",
"the",
"DNS",
"zone",
"for",
"this",
"domain"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L1346-L1352 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java | IterUtil.join | public static <T> String join(Iterable<T> iterable, CharSequence conjunction) {
"""
以 conjunction 为分隔符将集合转换为字符串
@param <T> 集合元素类型
@param iterable {@link Iterable}
@param conjunction 分隔符
@return 连接后的字符串
"""
if (null == iterable) {
return null;
}
return join(iterable.iterator(), conjunction);
... | java | public static <T> String join(Iterable<T> iterable, CharSequence conjunction) {
if (null == iterable) {
return null;
}
return join(iterable.iterator(), conjunction);
} | [
"public",
"static",
"<",
"T",
">",
"String",
"join",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"CharSequence",
"conjunction",
")",
"{",
"if",
"(",
"null",
"==",
"iterable",
")",
"{",
"return",
"null",
";",
"}",
"return",
"join",
"(",
"iterable",... | 以 conjunction 为分隔符将集合转换为字符串
@param <T> 集合元素类型
@param iterable {@link Iterable}
@param conjunction 分隔符
@return 连接后的字符串 | [
"以",
"conjunction",
"为分隔符将集合转换为字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java#L262-L267 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/BaseTable.java | BaseTable.doLocalCriteria | public boolean doLocalCriteria(StringBuffer strFilter, boolean bIncludeFileName, Vector<BaseField> vParamList) {
"""
Set up/do the local criteria.
This is only here to accommodate local file systems that can't handle
REMOTE criteria. All you have to do here to handle the remote criteria
locally is to call: retu... | java | public boolean doLocalCriteria(StringBuffer strFilter, boolean bIncludeFileName, Vector<BaseField> vParamList)
{ // Default BaseListener
if (this.isTable()) // For tables, do the remote criteria now
return this.getRecord().handleRemoteCriteria(strFilter, bIncludeFileName, vParamList); // If... | [
"public",
"boolean",
"doLocalCriteria",
"(",
"StringBuffer",
"strFilter",
",",
"boolean",
"bIncludeFileName",
",",
"Vector",
"<",
"BaseField",
">",
"vParamList",
")",
"{",
"// Default BaseListener",
"if",
"(",
"this",
".",
"isTable",
"(",
")",
")",
"// For tables,... | Set up/do the local criteria.
This is only here to accommodate local file systems that can't handle
REMOTE criteria. All you have to do here to handle the remote criteria
locally is to call: return record.handleRemoteCriteria(xx, yy). | [
"Set",
"up",
"/",
"do",
"the",
"local",
"criteria",
".",
"This",
"is",
"only",
"here",
"to",
"accommodate",
"local",
"file",
"systems",
"that",
"can",
"t",
"handle",
"REMOTE",
"criteria",
".",
"All",
"you",
"have",
"to",
"do",
"here",
"to",
"handle",
"... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/BaseTable.java#L219-L225 |
qiujuer/Genius-Android | caprice/graphics/src/main/java/net/qiujuer/genius/graphics/Blur.java | Blur.onStackBlur | public static Bitmap onStackBlur(Bitmap original, int radius) {
"""
StackBlur By Jni Bitmap
@param original Original Image
@param radius Blur radius
@return Image Bitmap
"""
Bitmap bitmap = checkSource(original, radius);
// Return this none blur
if (radius == 1) {
re... | java | public static Bitmap onStackBlur(Bitmap original, int radius) {
Bitmap bitmap = checkSource(original, radius);
// Return this none blur
if (radius == 1) {
return bitmap;
}
//Jni BitMap Blur
nativeStackBlurBitmap(bitmap, radius);
return (bitmap);
... | [
"public",
"static",
"Bitmap",
"onStackBlur",
"(",
"Bitmap",
"original",
",",
"int",
"radius",
")",
"{",
"Bitmap",
"bitmap",
"=",
"checkSource",
"(",
"original",
",",
"radius",
")",
";",
"// Return this none blur",
"if",
"(",
"radius",
"==",
"1",
")",
"{",
... | StackBlur By Jni Bitmap
@param original Original Image
@param radius Blur radius
@return Image Bitmap | [
"StackBlur",
"By",
"Jni",
"Bitmap"
] | train | https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/graphics/src/main/java/net/qiujuer/genius/graphics/Blur.java#L48-L60 |
alibaba/jstorm | jstorm-core/src/main/java/storm/trident/Stream.java | Stream.slidingWindow | public Stream slidingWindow(BaseWindowedBolt.Duration windowDuration, BaseWindowedBolt.Duration slidingInterval,
WindowsStoreFactory windowStoreFactory, Fields inputFields, Aggregator aggregator, Fields functionFields) {
"""
Returns a stream of tuples which are aggregated result... | java | public Stream slidingWindow(BaseWindowedBolt.Duration windowDuration, BaseWindowedBolt.Duration slidingInterval,
WindowsStoreFactory windowStoreFactory, Fields inputFields, Aggregator aggregator, Fields functionFields) {
return window(SlidingDurationWindow.of(windowDuration, ... | [
"public",
"Stream",
"slidingWindow",
"(",
"BaseWindowedBolt",
".",
"Duration",
"windowDuration",
",",
"BaseWindowedBolt",
".",
"Duration",
"slidingInterval",
",",
"WindowsStoreFactory",
"windowStoreFactory",
",",
"Fields",
"inputFields",
",",
"Aggregator",
"aggregator",
"... | Returns a stream of tuples which are aggregated results of a window which slides at duration of {@code slidingInterval}
and completes a window at {@code windowDuration}
@param windowDuration represents window duration configuration
@param inputFields projected fields for aggregator
@param aggregator aggregator to run ... | [
"Returns",
"a",
"stream",
"of",
"tuples",
"which",
"are",
"aggregated",
"results",
"of",
"a",
"window",
"which",
"slides",
"at",
"duration",
"of",
"{",
"@code",
"slidingInterval",
"}",
"and",
"completes",
"a",
"window",
"at",
"{",
"@code",
"windowDuration",
... | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L653-L656 |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/Assembler.java | Assembler.if_tcmpne | public void if_tcmpne(TypeMirror type, String target) throws IOException {
"""
ne succeeds if and only if value1 != value2
<p>Stack: ..., value1, value2 => ...
@param type
@param target
@throws IOException
"""
pushType(type);
if_tcmpne(target);
popType();
} | java | public void if_tcmpne(TypeMirror type, String target) throws IOException
{
pushType(type);
if_tcmpne(target);
popType();
} | [
"public",
"void",
"if_tcmpne",
"(",
"TypeMirror",
"type",
",",
"String",
"target",
")",
"throws",
"IOException",
"{",
"pushType",
"(",
"type",
")",
";",
"if_tcmpne",
"(",
"target",
")",
";",
"popType",
"(",
")",
";",
"}"
] | ne succeeds if and only if value1 != value2
<p>Stack: ..., value1, value2 => ...
@param type
@param target
@throws IOException | [
"ne",
"succeeds",
"if",
"and",
"only",
"if",
"value1",
"!",
"=",
"value2",
"<p",
">",
"Stack",
":",
"...",
"value1",
"value2",
"=",
">",
";",
"..."
] | train | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/Assembler.java#L572-L577 |
landawn/AbacusUtil | src/com/landawn/abacus/util/SQLExecutor.java | SQLExecutor.createTableIfNotExists | public boolean createTableIfNotExists(final String tableName, final String schema) {
"""
Returns {@code true} if succeed to create table, otherwise {@code false} is returned.
@param tableName
@param schema
@return
"""
Connection conn = getConnection();
try {
return JdbcUti... | java | public boolean createTableIfNotExists(final String tableName, final String schema) {
Connection conn = getConnection();
try {
return JdbcUtil.createTableIfNotExists(conn, tableName, schema);
} finally {
closeQuietly(conn);
}
} | [
"public",
"boolean",
"createTableIfNotExists",
"(",
"final",
"String",
"tableName",
",",
"final",
"String",
"schema",
")",
"{",
"Connection",
"conn",
"=",
"getConnection",
"(",
")",
";",
"try",
"{",
"return",
"JdbcUtil",
".",
"createTableIfNotExists",
"(",
"conn... | Returns {@code true} if succeed to create table, otherwise {@code false} is returned.
@param tableName
@param schema
@return | [
"Returns",
"{",
"@code",
"true",
"}",
"if",
"succeed",
"to",
"create",
"table",
"otherwise",
"{",
"@code",
"false",
"}",
"is",
"returned",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/SQLExecutor.java#L3264-L3272 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java | SqlExecutor.callQuery | public static ResultSet callQuery(Connection conn, String sql, Object... params) throws SQLException {
"""
执行调用存储过程<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param params 参数
@return ResultSet
@throws SQLException SQL执行异常
@since 4.1.4
"""
CallableStatement proc = null;
try {
proc... | java | public static ResultSet callQuery(Connection conn, String sql, Object... params) throws SQLException {
CallableStatement proc = null;
try {
proc = StatementUtil.prepareCall(conn, sql, params);
return proc.executeQuery();
} finally {
DbUtil.close(proc);
}
} | [
"public",
"static",
"ResultSet",
"callQuery",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"CallableStatement",
"proc",
"=",
"null",
";",
"try",
"{",
"proc",
"=",
"StatementUtil",
".",
"... | 执行调用存储过程<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param params 参数
@return ResultSet
@throws SQLException SQL执行异常
@since 4.1.4 | [
"执行调用存储过程<br",
">",
"此方法不会关闭Connection"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L94-L102 |
zerodhatech/javakiteconnect | kiteconnect/src/com/zerodhatech/models/User.java | User.parseArray | public User parseArray(User user, JSONObject response) throws JSONException {
"""
Parses array details of product, exchange and order_type from json response.
@param response is the json response from server.
@param user is the object to which data is copied to from json response.
@return User is the pojo of pa... | java | public User parseArray(User user, JSONObject response) throws JSONException {
JSONArray productArray = response.getJSONArray("products");
user.products = new String[productArray.length()];
for(int i = 0; i < productArray.length(); i++) {
user.products[i] = productArray.getString(i);... | [
"public",
"User",
"parseArray",
"(",
"User",
"user",
",",
"JSONObject",
"response",
")",
"throws",
"JSONException",
"{",
"JSONArray",
"productArray",
"=",
"response",
".",
"getJSONArray",
"(",
"\"products\"",
")",
";",
"user",
".",
"products",
"=",
"new",
"Str... | Parses array details of product, exchange and order_type from json response.
@param response is the json response from server.
@param user is the object to which data is copied to from json response.
@return User is the pojo of parsed data. | [
"Parses",
"array",
"details",
"of",
"product",
"exchange",
"and",
"order_type",
"from",
"json",
"response",
"."
] | train | https://github.com/zerodhatech/javakiteconnect/blob/4a3f15ff2c8a1b3b6ec61799f8bb047e4dfeb92d/kiteconnect/src/com/zerodhatech/models/User.java#L77-L97 |
VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/SystemInformation.java | SystemInformation.run | public VoltTable[] run(SystemProcedureExecutionContext ctx,
String selector) throws VoltAbortException {
"""
Returns the cluster info requested by the provided selector
@param ctx Internal. Not exposed to the end-user.
@param selector Selector requested
@return ... | java | public VoltTable[] run(SystemProcedureExecutionContext ctx,
String selector) throws VoltAbortException
{
VoltTable[] results;
// This selector provides the old @SystemInformation behavior
if (selector.toUpperCase().equals("OVERVIEW"))
{
results... | [
"public",
"VoltTable",
"[",
"]",
"run",
"(",
"SystemProcedureExecutionContext",
"ctx",
",",
"String",
"selector",
")",
"throws",
"VoltAbortException",
"{",
"VoltTable",
"[",
"]",
"results",
";",
"// This selector provides the old @SystemInformation behavior",
"if",
"(",
... | Returns the cluster info requested by the provided selector
@param ctx Internal. Not exposed to the end-user.
@param selector Selector requested
@return The property/value table for the provided selector
@throws VoltAbortException | [
"Returns",
"the",
"cluster",
"info",
"requested",
"by",
"the",
"provided",
"selector"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/SystemInformation.java#L241-L261 |
alexcojocaru/elasticsearch-maven-plugin | src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/util/ProcessUtil.java | ProcessUtil.getElasticsearchPid | public static String getElasticsearchPid(String baseDir) {
"""
Read the ES PID from the pid file and return it.
@param baseDir the base directory where the pid file is
@return
"""
try
{
String pid = new String(Files.readAllBytes(Paths.get(baseDir, "pid")));
return pid;... | java | public static String getElasticsearchPid(String baseDir)
{
try
{
String pid = new String(Files.readAllBytes(Paths.get(baseDir, "pid")));
return pid;
}
catch (IOException e)
{
throw new IllegalStateException(
String.forma... | [
"public",
"static",
"String",
"getElasticsearchPid",
"(",
"String",
"baseDir",
")",
"{",
"try",
"{",
"String",
"pid",
"=",
"new",
"String",
"(",
"Files",
".",
"readAllBytes",
"(",
"Paths",
".",
"get",
"(",
"baseDir",
",",
"\"pid\"",
")",
")",
")",
";",
... | Read the ES PID from the pid file and return it.
@param baseDir the base directory where the pid file is
@return | [
"Read",
"the",
"ES",
"PID",
"from",
"the",
"pid",
"file",
"and",
"return",
"it",
"."
] | train | https://github.com/alexcojocaru/elasticsearch-maven-plugin/blob/c283053cf99dc6b6d411b58629364b6aae62b7f8/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/util/ProcessUtil.java#L97-L112 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/validate/MapSchema.java | MapSchema.performValidation | @SuppressWarnings("unchecked")
@Override
protected void performValidation(String path, Object value, List<ValidationResult> results) {
"""
Validates a given value against the schema and configured validation rules.
@param path a dot notation path to the value.
@param value a value to be validated.
@par... | java | @SuppressWarnings("unchecked")
@Override
protected void performValidation(String path, Object value, List<ValidationResult> results) {
String name = path != null ? path : "value";
value = ObjectReader.getValue(value);
super.performValidation(path, value, results);
if (value == null)
return;
if (value ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"protected",
"void",
"performValidation",
"(",
"String",
"path",
",",
"Object",
"value",
",",
"List",
"<",
"ValidationResult",
">",
"results",
")",
"{",
"String",
"name",
"=",
"path",
"!=",
... | Validates a given value against the schema and configured validation rules.
@param path a dot notation path to the value.
@param value a value to be validated.
@param results a list with validation results to add new results. | [
"Validates",
"a",
"given",
"value",
"against",
"the",
"schema",
"and",
"configured",
"validation",
"rules",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/validate/MapSchema.java#L90-L113 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/endian/EndianNumbers.java | EndianNumbers.toBEDouble | @Pure
@Inline(value = "Double.longBitsToDouble(EndianNumbers.toBELong($1, $2, $3, $4, $5, $6, $7, $8))",
imported = {
"""
Converting eight bytes to a Big Endian double.
@param b1 the first byte.
@param b2 the second byte.
@param b3 the third byte.
@param b4 the fourth byte.
@param b5 the fifth byte.
@p... | java | @Pure
@Inline(value = "Double.longBitsToDouble(EndianNumbers.toBELong($1, $2, $3, $4, $5, $6, $7, $8))",
imported = {EndianNumbers.class})
public static double toBEDouble(int b1, int b2, int b3, int b4, int b5, int b6, int b7, int b8) {
return Double.longBitsToDouble(toBELong(b1, b2, b3, b4, b5, b6, b7, b8));
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"Double.longBitsToDouble(EndianNumbers.toBELong($1, $2, $3, $4, $5, $6, $7, $8))\"",
",",
"imported",
"=",
"{",
"EndianNumbers",
".",
"class",
"}",
")",
"public",
"static",
"double",
"toBEDouble",
"(",
"int",
"b1",
",",... | Converting eight bytes to a Big Endian double.
@param b1 the first byte.
@param b2 the second byte.
@param b3 the third byte.
@param b4 the fourth byte.
@param b5 the fifth byte.
@param b6 the sixth byte.
@param b7 the seventh byte.
@param b8 the eighth byte.
@return the conversion result | [
"Converting",
"eight",
"bytes",
"to",
"a",
"Big",
"Endian",
"double",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/endian/EndianNumbers.java#L165-L170 |
arxanchain/java-common | src/main/java/com/arxanfintech/common/util/HashUtil.java | HashUtil.calcNewAddr | public static byte[] calcNewAddr(byte[] addr, byte[] nonce) {
"""
The way to calculate new address
@param addr - creating addres
@param nonce - nonce of creating address
@return new address
"""
byte[] encSender = RLP.encodeElement(addr);
byte[] encNonce = RLP.encodeBigInteger(new BigInteg... | java | public static byte[] calcNewAddr(byte[] addr, byte[] nonce) {
byte[] encSender = RLP.encodeElement(addr);
byte[] encNonce = RLP.encodeBigInteger(new BigInteger(1, nonce));
return sha3omit12(RLP.encodeList(encSender, encNonce));
} | [
"public",
"static",
"byte",
"[",
"]",
"calcNewAddr",
"(",
"byte",
"[",
"]",
"addr",
",",
"byte",
"[",
"]",
"nonce",
")",
"{",
"byte",
"[",
"]",
"encSender",
"=",
"RLP",
".",
"encodeElement",
"(",
"addr",
")",
";",
"byte",
"[",
"]",
"encNonce",
"=",... | The way to calculate new address
@param addr - creating addres
@param nonce - nonce of creating address
@return new address | [
"The",
"way",
"to",
"calculate",
"new",
"address"
] | train | https://github.com/arxanchain/java-common/blob/3ddfedfd948f5bab3fee0b74b85cdce4702ed84e/src/main/java/com/arxanfintech/common/util/HashUtil.java#L123-L129 |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/internal/adapter/PropertyAdapter.java | PropertyAdapter.convertExample | public static Object convertExample(String value, String type) {
"""
Convert a string {@code value} to specified {@code type}.
@param value value to convert
@param type target conversion type
@return converted value as object
"""
if (value == null) {
return null;
}
tr... | java | public static Object convertExample(String value, String type) {
if (value == null) {
return null;
}
try {
switch (type) {
case "integer":
return Integer.valueOf(value);
case "number":
return Float.v... | [
"public",
"static",
"Object",
"convertExample",
"(",
"String",
"value",
",",
"String",
"type",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"\"integer\"",
":",
... | Convert a string {@code value} to specified {@code type}.
@param value value to convert
@param type target conversion type
@return converted value as object | [
"Convert",
"a",
"string",
"{",
"@code",
"value",
"}",
"to",
"specified",
"{",
"@code",
"type",
"}",
"."
] | train | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/adapter/PropertyAdapter.java#L129-L150 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java | StreamSegmentReadIndex.beginMerge | void beginMerge(long offset, StreamSegmentReadIndex sourceStreamSegmentIndex) {
"""
Executes Step 1 of the 2-Step Merge Process.
The StreamSegments are merged (Source->Target@Offset) in Metadata and a ReadIndex Redirection is put in place.
At this stage, the Source still exists as a physical object in Storage, a... | java | void beginMerge(long offset, StreamSegmentReadIndex sourceStreamSegmentIndex) {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "beginMerge", offset, sourceStreamSegmentIndex.traceObjectId);
Exceptions.checkNotClosed(this.closed, this);
Exceptions.checkArgument(!sourc... | [
"void",
"beginMerge",
"(",
"long",
"offset",
",",
"StreamSegmentReadIndex",
"sourceStreamSegmentIndex",
")",
"{",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterWithContext",
"(",
"log",
",",
"this",
".",
"traceObjectId",
",",
"\"beginMerge\"",
",",
"offse... | Executes Step 1 of the 2-Step Merge Process.
The StreamSegments are merged (Source->Target@Offset) in Metadata and a ReadIndex Redirection is put in place.
At this stage, the Source still exists as a physical object in Storage, and we need to keep its ReadIndex around, pointing
to the old object.
@param offset ... | [
"Executes",
"Step",
"1",
"of",
"the",
"2",
"-",
"Step",
"Merge",
"Process",
".",
"The",
"StreamSegments",
"are",
"merged",
"(",
"Source",
"-",
">",
"Target@Offset",
")",
"in",
"Metadata",
"and",
"a",
"ReadIndex",
"Redirection",
"is",
"put",
"in",
"place",
... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L374-L414 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java | DetectDescribeAssociate.pruneTracks | private void pruneTracks(SetTrackInfo<Desc> info, GrowQueue_I32 unassociated) {
"""
If there are too many unassociated tracks, randomly select some of those tracks and drop them
"""
if( unassociated.size > maxInactiveTracks ) {
// make the first N elements the ones which will be dropped
int numDrop = u... | java | private void pruneTracks(SetTrackInfo<Desc> info, GrowQueue_I32 unassociated) {
if( unassociated.size > maxInactiveTracks ) {
// make the first N elements the ones which will be dropped
int numDrop = unassociated.size-maxInactiveTracks;
for (int i = 0; i < numDrop; i++) {
int selected = rand.nextInt(unas... | [
"private",
"void",
"pruneTracks",
"(",
"SetTrackInfo",
"<",
"Desc",
">",
"info",
",",
"GrowQueue_I32",
"unassociated",
")",
"{",
"if",
"(",
"unassociated",
".",
"size",
">",
"maxInactiveTracks",
")",
"{",
"// make the first N elements the ones which will be dropped",
... | If there are too many unassociated tracks, randomly select some of those tracks and drop them | [
"If",
"there",
"are",
"too",
"many",
"unassociated",
"tracks",
"randomly",
"select",
"some",
"of",
"those",
"tracks",
"and",
"drop",
"them"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java#L174-L192 |
diirt/util | src/main/java/org/epics/util/array/ListNumbers.java | ListNumbers.linearListFromRange | public static ListNumber linearListFromRange(final double minValue, final double maxValue, final int size) {
"""
Creates a list of equally spaced values given the range and the number of
elements.
<p>
Note that, due to rounding errors in double precision, the difference
between the elements may not be exactly ... | java | public static ListNumber linearListFromRange(final double minValue, final double maxValue, final int size) {
if (size <= 0) {
throw new IllegalArgumentException("Size must be positive (was " + size + " )");
}
return new LinearListDoubleFromRange(size, minValue, maxValue);
} | [
"public",
"static",
"ListNumber",
"linearListFromRange",
"(",
"final",
"double",
"minValue",
",",
"final",
"double",
"maxValue",
",",
"final",
"int",
"size",
")",
"{",
"if",
"(",
"size",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"... | Creates a list of equally spaced values given the range and the number of
elements.
<p>
Note that, due to rounding errors in double precision, the difference
between the elements may not be exactly the same.
@param minValue the first value in the list
@param maxValue the last value in the list
@param size the size of ... | [
"Creates",
"a",
"list",
"of",
"equally",
"spaced",
"values",
"given",
"the",
"range",
"and",
"the",
"number",
"of",
"elements",
".",
"<p",
">",
"Note",
"that",
"due",
"to",
"rounding",
"errors",
"in",
"double",
"precision",
"the",
"difference",
"between",
... | train | https://github.com/diirt/util/blob/24aca0a173a635aaf0b78d213a3fee8d4f91c077/src/main/java/org/epics/util/array/ListNumbers.java#L151-L156 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/project/DirectoryYamlFlowLoader.java | DirectoryYamlFlowLoader.loadProjectFlow | @Override
public ValidationReport loadProjectFlow(final Project project, final File projectDir) {
"""
Loads all project flows from the directory.
@param project The project.
@param projectDir The directory to load flows from.
@return the validation report.
"""
convertYamlFiles(projectDir);
FlowL... | java | @Override
public ValidationReport loadProjectFlow(final Project project, final File projectDir) {
convertYamlFiles(projectDir);
FlowLoaderUtils.checkJobProperties(project.getId(), this.props, this.jobPropsMap, this.errors);
return FlowLoaderUtils.generateFlowLoaderReport(this.errors);
} | [
"@",
"Override",
"public",
"ValidationReport",
"loadProjectFlow",
"(",
"final",
"Project",
"project",
",",
"final",
"File",
"projectDir",
")",
"{",
"convertYamlFiles",
"(",
"projectDir",
")",
";",
"FlowLoaderUtils",
".",
"checkJobProperties",
"(",
"project",
".",
... | Loads all project flows from the directory.
@param project The project.
@param projectDir The directory to load flows from.
@return the validation report. | [
"Loads",
"all",
"project",
"flows",
"from",
"the",
"directory",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/DirectoryYamlFlowLoader.java#L111-L116 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepository.java | GraphBackedMetadataRepository.addTrait | @Override
@GraphTransaction
public void addTrait(List<String> entityGuids, ITypedStruct traitInstance) throws RepositoryException {
"""
Adds a new trait to the list of entities represented by their respective guids
@param entityGuids list of globally unique identifier for the entities
@param traitInsta... | java | @Override
@GraphTransaction
public void addTrait(List<String> entityGuids, ITypedStruct traitInstance) throws RepositoryException {
Preconditions.checkNotNull(entityGuids, "entityGuids list cannot be null");
Preconditions.checkNotNull(traitInstance, "Trait instance cannot be null");
if ... | [
"@",
"Override",
"@",
"GraphTransaction",
"public",
"void",
"addTrait",
"(",
"List",
"<",
"String",
">",
"entityGuids",
",",
"ITypedStruct",
"traitInstance",
")",
"throws",
"RepositoryException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"entityGuids",
",",
... | Adds a new trait to the list of entities represented by their respective guids
@param entityGuids list of globally unique identifier for the entities
@param traitInstance trait instance that needs to be added to entities
@throws RepositoryException | [
"Adds",
"a",
"new",
"trait",
"to",
"the",
"list",
"of",
"entities",
"represented",
"by",
"their",
"respective",
"guids"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepository.java#L306-L320 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/MetaFieldUtil.java | MetaFieldUtil.toMetaFieldInfoArray | public static MetaFieldInfo[] toMetaFieldInfoArray(Class type, Object obj, String stringForNullValues, boolean ignoreAnnotatedName, boolean recursive) {
"""
Returns a new MetaFieldInfo array of all Fields annotated with MetaField
in the object type. The object must be an instance of the type, otherwise
this meth... | java | public static MetaFieldInfo[] toMetaFieldInfoArray(Class type, Object obj, String stringForNullValues, boolean ignoreAnnotatedName, boolean recursive) {
return internalToMetaFieldInfoArray(type, obj, null, null, stringForNullValues, ignoreAnnotatedName, recursive);
} | [
"public",
"static",
"MetaFieldInfo",
"[",
"]",
"toMetaFieldInfoArray",
"(",
"Class",
"type",
",",
"Object",
"obj",
",",
"String",
"stringForNullValues",
",",
"boolean",
"ignoreAnnotatedName",
",",
"boolean",
"recursive",
")",
"{",
"return",
"internalToMetaFieldInfoArr... | Returns a new MetaFieldInfo array of all Fields annotated with MetaField
in the object type. The object must be an instance of the type, otherwise
this method may throw a runtime exception. Optionally, this method can
recursively search the object to provide a deep view of the entire class.
@param type The class type o... | [
"Returns",
"a",
"new",
"MetaFieldInfo",
"array",
"of",
"all",
"Fields",
"annotated",
"with",
"MetaField",
"in",
"the",
"object",
"type",
".",
"The",
"object",
"must",
"be",
"an",
"instance",
"of",
"the",
"type",
"otherwise",
"this",
"method",
"may",
"throw",... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/MetaFieldUtil.java#L138-L140 |
jamesagnew/hapi-fhir | hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProvider.java | AbstractJaxRsResourceProvider.findCompartment | @GET
@Path("/ {
"""
Compartment Based Access
@param id the resource to which the compartment belongs
@param compartment the compartment
@return the repsonse
@see <a href="https://www.hl7.org/fhir/http.html#search">https://www.hl7.org/fhir/http.html#search</a>
@see <a href="https://www.hl7.org/fhir/compa... | java | @GET
@Path("/{id}/{compartment}")
public Response findCompartment(@PathParam("id") final String id, @PathParam("compartment") final String compartment)
throws IOException {
final Builder theRequest = getResourceRequest(RequestTypeEnum.GET, RestOperationTypeEnum.SEARCH_TYPE).id(id).compartmen... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/{id}/{compartment}\"",
")",
"public",
"Response",
"findCompartment",
"(",
"@",
"PathParam",
"(",
"\"id\"",
")",
"final",
"String",
"id",
",",
"@",
"PathParam",
"(",
"\"compartment\"",
")",
"final",
"String",
"compartment",
")"... | Compartment Based Access
@param id the resource to which the compartment belongs
@param compartment the compartment
@return the repsonse
@see <a href="https://www.hl7.org/fhir/http.html#search">https://www.hl7.org/fhir/http.html#search</a>
@see <a href="https://www.hl7.org/fhir/compartments.html#compartment">https://w... | [
"Compartment",
"Based",
"Access"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProvider.java#L272-L279 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java | AbstractIndexWriter.addDescription | protected void addDescription(PackageDoc pkg, Content dlTree, SearchIndexItem si) {
"""
Add one line summary comment for the package.
@param pkg the package to be documented
@param dlTree the content tree to which the description will be added
"""
Content link = getPackageLink(pkg, new StringConten... | java | protected void addDescription(PackageDoc pkg, Content dlTree, SearchIndexItem si) {
Content link = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)));
si.setLabel(utils.getPackageName(pkg));
si.setCategory(getResource("doclet.Packages").toString());
Content dt = HtmlTree.D... | [
"protected",
"void",
"addDescription",
"(",
"PackageDoc",
"pkg",
",",
"Content",
"dlTree",
",",
"SearchIndexItem",
"si",
")",
"{",
"Content",
"link",
"=",
"getPackageLink",
"(",
"pkg",
",",
"new",
"StringContent",
"(",
"utils",
".",
"getPackageName",
"(",
"pkg... | Add one line summary comment for the package.
@param pkg the package to be documented
@param dlTree the content tree to which the description will be added | [
"Add",
"one",
"line",
"summary",
"comment",
"for",
"the",
"package",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java#L187-L199 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java | WebhooksInner.beginUpdate | public WebhookInner beginUpdate(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) {
"""
Updates a webhook with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param regi... | java | public WebhookInner beginUpdate(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).toBlocking().single().body();
} | [
"public",
"WebhookInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"webhookName",
",",
"WebhookUpdateParameters",
"webhookUpdateParameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupN... | Updates a webhook with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param webhookName The name of the webhook.
@param webhookUpdateParameters The parameters for updating a webhook.
@th... | [
"Updates",
"a",
"webhook",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java#L654-L656 |
buschmais/jqa-rdbms-plugin | src/main/java/com/buschmais/jqassistant/plugin/rdbms/impl/scanner/AbstractSchemaScannerPlugin.java | AbstractSchemaScannerPlugin.createForeignKeys | private void createForeignKeys(Set<ForeignKey> allForeignKeys, Map<Column, ColumnDescriptor> allColumns, Store store) {
"""
Create the foreign key descriptors.
@param allForeignKeys All collected foreign keys.
@param allColumns All collected columns.
@param store The store.
"""
// For... | java | private void createForeignKeys(Set<ForeignKey> allForeignKeys, Map<Column, ColumnDescriptor> allColumns, Store store) {
// Foreign keys
for (ForeignKey foreignKey : allForeignKeys) {
ForeignKeyDescriptor foreignKeyDescriptor = store.create(ForeignKeyDescriptor.class);
foreignKeyD... | [
"private",
"void",
"createForeignKeys",
"(",
"Set",
"<",
"ForeignKey",
">",
"allForeignKeys",
",",
"Map",
"<",
"Column",
",",
"ColumnDescriptor",
">",
"allColumns",
",",
"Store",
"store",
")",
"{",
"// Foreign keys",
"for",
"(",
"ForeignKey",
"foreignKey",
":",
... | Create the foreign key descriptors.
@param allForeignKeys All collected foreign keys.
@param allColumns All collected columns.
@param store The store. | [
"Create",
"the",
"foreign",
"key",
"descriptors",
"."
] | train | https://github.com/buschmais/jqa-rdbms-plugin/blob/96c3919907deee00175cf5ab005867d76e01ba62/src/main/java/com/buschmais/jqassistant/plugin/rdbms/impl/scanner/AbstractSchemaScannerPlugin.java#L233-L254 |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/CurvedArrow.java | CurvedArrow.setStart | public void setStart(int x1, int y1) {
"""
Sets the start point.
@param x1
the x coordinate of the start point
@param y1
the y coordinate of the start point
"""
start.x = x1;
start.y = y1;
needsRefresh = true;
} | java | public void setStart(int x1, int y1) {
start.x = x1;
start.y = y1;
needsRefresh = true;
} | [
"public",
"void",
"setStart",
"(",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"start",
".",
"x",
"=",
"x1",
";",
"start",
".",
"y",
"=",
"y1",
";",
"needsRefresh",
"=",
"true",
";",
"}"
] | Sets the start point.
@param x1
the x coordinate of the start point
@param y1
the y coordinate of the start point | [
"Sets",
"the",
"start",
"point",
"."
] | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/CurvedArrow.java#L90-L94 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspNavBuilder.java | CmsJspNavBuilder.getNavigationForResource | public CmsJspNavElement getNavigationForResource(String sitePath, CmsResourceFilter reourceFilter) {
"""
Returns a navigation element for the named resource.<p>
@param sitePath the resource name to get the navigation information for,
must be a full path name, e.g. "/docs/index.html"
@param reourceFilter the r... | java | public CmsJspNavElement getNavigationForResource(String sitePath, CmsResourceFilter reourceFilter) {
return getNavigationForResource(sitePath, reourceFilter, false);
} | [
"public",
"CmsJspNavElement",
"getNavigationForResource",
"(",
"String",
"sitePath",
",",
"CmsResourceFilter",
"reourceFilter",
")",
"{",
"return",
"getNavigationForResource",
"(",
"sitePath",
",",
"reourceFilter",
",",
"false",
")",
";",
"}"
] | Returns a navigation element for the named resource.<p>
@param sitePath the resource name to get the navigation information for,
must be a full path name, e.g. "/docs/index.html"
@param reourceFilter the resource filter
@return a navigation element for the given resource | [
"Returns",
"a",
"navigation",
"element",
"for",
"the",
"named",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspNavBuilder.java#L607-L610 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.rotateXYZ | public Matrix4x3f rotateXYZ(Vector3f angles) {
"""
Apply rotation of <code>angles.x</code> radians about the X axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate... | java | public Matrix4x3f rotateXYZ(Vector3f angles) {
return rotateXYZ(angles.x, angles.y, angles.z);
} | [
"public",
"Matrix4x3f",
"rotateXYZ",
"(",
"Vector3f",
"angles",
")",
"{",
"return",
"rotateXYZ",
"(",
"angles",
".",
"x",
",",
"angles",
".",
"y",
",",
"angles",
".",
"z",
")",
";",
"}"
] | Apply rotation of <code>angles.x</code> radians about the X axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter... | [
"Apply",
"rotation",
"of",
"<code",
">",
"angles",
".",
"x<",
"/",
"code",
">",
"radians",
"about",
"the",
"X",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"angles",
".",
"y<",
"/",
"code",
">",
"radians",
"about",
"the",
"Y",
"axi... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L3521-L3523 |
JavaMoney/jsr354-api | src/main/java/javax/money/AbstractContextBuilder.java | AbstractContextBuilder.importContext | public B importContext(AbstractContext context, boolean overwriteDuplicates) {
"""
Apply all attributes on the given context.
@param context the context to be applied, not null.
@param overwriteDuplicates flag, if existing entries should be overwritten.
@return this Builder, for chaining
"""
... | java | public B importContext(AbstractContext context, boolean overwriteDuplicates){
for (Map.Entry<String, Object> en : context.data.entrySet()) {
if (overwriteDuplicates) {
this.data.put(en.getKey(), en.getValue());
}else{
this.data.putIfAbsent(en.getKey(), en.... | [
"public",
"B",
"importContext",
"(",
"AbstractContext",
"context",
",",
"boolean",
"overwriteDuplicates",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
"en",
":",
"context",
".",
"data",
".",
"entrySet",
"(",
")",
")",
"{"... | Apply all attributes on the given context.
@param context the context to be applied, not null.
@param overwriteDuplicates flag, if existing entries should be overwritten.
@return this Builder, for chaining | [
"Apply",
"all",
"attributes",
"on",
"the",
"given",
"context",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/AbstractContextBuilder.java#L48-L57 |
overturetool/overture | core/interpreter/src/main/java/org/overture/interpreter/runtime/Context.java | Context.deepCopy | public Context deepCopy() {
"""
Make a deep copy of the context, using Value.deepCopy. Every concrete subclass must implements its own version of
this method.
@return
"""
Context below = null;
if (outer != null)
{
below = outer.deepCopy();
}
Context result = new Context(assistantFactory, loc... | java | public Context deepCopy()
{
Context below = null;
if (outer != null)
{
below = outer.deepCopy();
}
Context result = new Context(assistantFactory, location, title, below);
result.threadState = threadState;
for (ILexNameToken var : keySet())
{
Value v = get(var);
result.put(var, v.deepCopy())... | [
"public",
"Context",
"deepCopy",
"(",
")",
"{",
"Context",
"below",
"=",
"null",
";",
"if",
"(",
"outer",
"!=",
"null",
")",
"{",
"below",
"=",
"outer",
".",
"deepCopy",
"(",
")",
";",
"}",
"Context",
"result",
"=",
"new",
"Context",
"(",
"assistantF... | Make a deep copy of the context, using Value.deepCopy. Every concrete subclass must implements its own version of
this method.
@return | [
"Make",
"a",
"deep",
"copy",
"of",
"the",
"context",
"using",
"Value",
".",
"deepCopy",
".",
"Every",
"concrete",
"subclass",
"must",
"implements",
"its",
"own",
"version",
"of",
"this",
"method",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/interpreter/src/main/java/org/overture/interpreter/runtime/Context.java#L151-L170 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.warnv | public void warnv(Throwable t, String format, Object... params) {
"""
Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting.
@param t the throwable
@param format the message format string
@param params the parameters
"""
doLog(Level.WARN, FQCN, format, par... | java | public void warnv(Throwable t, String format, Object... params) {
doLog(Level.WARN, FQCN, format, params, t);
} | [
"public",
"void",
"warnv",
"(",
"Throwable",
"t",
",",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLog",
"(",
"Level",
".",
"WARN",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"t",
")",
";",
"}"
] | Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting.
@param t the throwable
@param format the message format string
@param params the parameters | [
"Issue",
"a",
"log",
"message",
"with",
"a",
"level",
"of",
"WARN",
"using",
"{",
"@link",
"java",
".",
"text",
".",
"MessageFormat",
"}",
"-",
"style",
"formatting",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L1343-L1345 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/TransactionContext.java | TransactionContext.commitAsync | public CompletableFuture<Void> commitAsync() {
"""
Asynchronously commits the transaction
@return a CompletableFuture for the commit operation
"""
if (this.messagingFactory == null) {
CompletableFuture<Void> exceptionCompletion = new CompletableFuture<>();
exceptionCompletion.c... | java | public CompletableFuture<Void> commitAsync() {
if (this.messagingFactory == null) {
CompletableFuture<Void> exceptionCompletion = new CompletableFuture<>();
exceptionCompletion.completeExceptionally(new ServiceBusException(false, "MessagingFactory should not be null"));
retur... | [
"public",
"CompletableFuture",
"<",
"Void",
">",
"commitAsync",
"(",
")",
"{",
"if",
"(",
"this",
".",
"messagingFactory",
"==",
"null",
")",
"{",
"CompletableFuture",
"<",
"Void",
">",
"exceptionCompletion",
"=",
"new",
"CompletableFuture",
"<>",
"(",
")",
... | Asynchronously commits the transaction
@return a CompletableFuture for the commit operation | [
"Asynchronously",
"commits",
"the",
"transaction"
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/TransactionContext.java#L56-L64 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java | MessageFormat.applyPattern | public void applyPattern(String pattern, MessagePattern.ApostropheMode aposMode) {
"""
<strong>[icu]</strong> Sets the ApostropheMode and the pattern used by this message format.
Parses the pattern and caches Format objects for simple argument types.
Patterns and their interpretation are specified in the
<a hre... | java | public void applyPattern(String pattern, MessagePattern.ApostropheMode aposMode) {
if (msgPattern == null) {
msgPattern = new MessagePattern(aposMode);
} else if (aposMode != msgPattern.getApostropheMode()) {
msgPattern.clearPatternAndSetApostropheMode(aposMode);
}
... | [
"public",
"void",
"applyPattern",
"(",
"String",
"pattern",
",",
"MessagePattern",
".",
"ApostropheMode",
"aposMode",
")",
"{",
"if",
"(",
"msgPattern",
"==",
"null",
")",
"{",
"msgPattern",
"=",
"new",
"MessagePattern",
"(",
"aposMode",
")",
";",
"}",
"else... | <strong>[icu]</strong> Sets the ApostropheMode and the pattern used by this message format.
Parses the pattern and caches Format objects for simple argument types.
Patterns and their interpretation are specified in the
<a href="#patterns">class description</a>.
<p>
This method is best used only once on a given object t... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Sets",
"the",
"ApostropheMode",
"and",
"the",
"pattern",
"used",
"by",
"this",
"message",
"format",
".",
"Parses",
"the",
"pattern",
"and",
"caches",
"Format",
"objects",
"for",
"simple",
"argument... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java#L474-L481 |
berkesa/datatree-promise | src/main/java/io/datatree/Promise.java | Promise.waitFor | public Tree waitFor(long timeout, TimeUnit unit) throws Exception {
"""
Waits if necessary for this future to complete, and then returns its
result. It's a blocking operation, do not use this method unless it is
absolutely necessary for something. Rather use the "then" and
"catchError" methods.
@param timeou... | java | public Tree waitFor(long timeout, TimeUnit unit) throws Exception {
try {
return future.get(timeout, unit);
} catch (ExecutionException outerError) {
Throwable cause = outerError.getCause();
if (cause != null && cause instanceof Exception) {
throw (Exception) cause;
}
throw outerError;... | [
"public",
"Tree",
"waitFor",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"Exception",
"{",
"try",
"{",
"return",
"future",
".",
"get",
"(",
"timeout",
",",
"unit",
")",
";",
"}",
"catch",
"(",
"ExecutionException",
"outerError",
")",
... | Waits if necessary for this future to complete, and then returns its
result. It's a blocking operation, do not use this method unless it is
absolutely necessary for something. Rather use the "then" and
"catchError" methods.
@param timeout
the maximum time to wait
@param unit
the time unit of the timeout argument
@ret... | [
"Waits",
"if",
"necessary",
"for",
"this",
"future",
"to",
"complete",
"and",
"then",
"returns",
"its",
"result",
".",
"It",
"s",
"a",
"blocking",
"operation",
"do",
"not",
"use",
"this",
"method",
"unless",
"it",
"is",
"absolutely",
"necessary",
"for",
"s... | train | https://github.com/berkesa/datatree-promise/blob/d9093bdb549f69b83b3eff5e29cd511f2014f177/src/main/java/io/datatree/Promise.java#L784-L794 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java | SSLUtils.createRestClientSSLContext | @Nullable
public static SSLContext createRestClientSSLContext(Configuration config) throws Exception {
"""
Creates an SSL context for clients against the external REST endpoint.
"""
final RestSSLContextConfigMode configMode;
if (isRestSSLAuthenticationEnabled(config)) {
configMode = RestSSLContextConfi... | java | @Nullable
public static SSLContext createRestClientSSLContext(Configuration config) throws Exception {
final RestSSLContextConfigMode configMode;
if (isRestSSLAuthenticationEnabled(config)) {
configMode = RestSSLContextConfigMode.MUTUAL;
} else {
configMode = RestSSLContextConfigMode.CLIENT;
}
return ... | [
"@",
"Nullable",
"public",
"static",
"SSLContext",
"createRestClientSSLContext",
"(",
"Configuration",
"config",
")",
"throws",
"Exception",
"{",
"final",
"RestSSLContextConfigMode",
"configMode",
";",
"if",
"(",
"isRestSSLAuthenticationEnabled",
"(",
"config",
")",
")"... | Creates an SSL context for clients against the external REST endpoint. | [
"Creates",
"an",
"SSL",
"context",
"for",
"clients",
"against",
"the",
"external",
"REST",
"endpoint",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java#L343-L353 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/PipelineApi.java | PipelineApi.createPipelineSchedule | public PipelineSchedule createPipelineSchedule(Object projectIdOrPath, PipelineSchedule pipelineSchedule)
throws GitLabApiException {
"""
create a pipeline schedule for a project.
<pre><code>POST /projects/:id/pipeline_schedules</code></pre>
@param projectIdOrPath projectIdOrPath the project in t... | java | public PipelineSchedule createPipelineSchedule(Object projectIdOrPath, PipelineSchedule pipelineSchedule)
throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("description", pipelineSchedule.getDescription(), true)
.withParam("ref", pip... | [
"public",
"PipelineSchedule",
"createPipelineSchedule",
"(",
"Object",
"projectIdOrPath",
",",
"PipelineSchedule",
"pipelineSchedule",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\... | create a pipeline schedule for a project.
<pre><code>POST /projects/:id/pipeline_schedules</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param pipelineSchedule a PipelineSchedule instance to create
@return the added Pipeline... | [
"create",
"a",
"pipeline",
"schedule",
"for",
"a",
"project",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/PipelineApi.java#L395-L406 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDate.java | LocalDate.atTime | public LocalDateTime atTime(int hour, int minute, int second) {
"""
Combines this date with a time to create a {@code LocalDateTime}.
<p>
This returns a {@code LocalDateTime} formed from this date at the
specified hour, minute and second.
The nanosecond field will be set to zero.
The individual time fields mu... | java | public LocalDateTime atTime(int hour, int minute, int second) {
return atTime(LocalTime.of(hour, minute, second));
} | [
"public",
"LocalDateTime",
"atTime",
"(",
"int",
"hour",
",",
"int",
"minute",
",",
"int",
"second",
")",
"{",
"return",
"atTime",
"(",
"LocalTime",
".",
"of",
"(",
"hour",
",",
"minute",
",",
"second",
")",
")",
";",
"}"
] | Combines this date with a time to create a {@code LocalDateTime}.
<p>
This returns a {@code LocalDateTime} formed from this date at the
specified hour, minute and second.
The nanosecond field will be set to zero.
The individual time fields must be within their valid range.
All possible combinations of date and time are... | [
"Combines",
"this",
"date",
"with",
"a",
"time",
"to",
"create",
"a",
"{",
"@code",
"LocalDateTime",
"}",
".",
"<p",
">",
"This",
"returns",
"a",
"{",
"@code",
"LocalDateTime",
"}",
"formed",
"from",
"this",
"date",
"at",
"the",
"specified",
"hour",
"min... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDate.java#L1736-L1738 |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.getGeometryType | public String getGeometryType(Geometry geometry, GeometryIndex index) throws GeometryIndexNotFoundException {
"""
What is the geometry type of the sub-geometry pointed to by the given index? If the index points to a vertex or
edge, the geometry type at the parent level is returned.
@param geometry
The geometr... | java | public String getGeometryType(Geometry geometry, GeometryIndex index) throws GeometryIndexNotFoundException {
if (index != null && index.getType() == GeometryIndexType.TYPE_GEOMETRY) {
if (geometry.getGeometries() != null && geometry.getGeometries().length > index.getValue()) {
return getGeometryType(geometry.... | [
"public",
"String",
"getGeometryType",
"(",
"Geometry",
"geometry",
",",
"GeometryIndex",
"index",
")",
"throws",
"GeometryIndexNotFoundException",
"{",
"if",
"(",
"index",
"!=",
"null",
"&&",
"index",
".",
"getType",
"(",
")",
"==",
"GeometryIndexType",
".",
"T... | What is the geometry type of the sub-geometry pointed to by the given index? If the index points to a vertex or
edge, the geometry type at the parent level is returned.
@param geometry
The geometry wherein to search.
@param index
The index pointing to a vertex/edge/sub-geometry. In the case of a vertex/edge, the paren... | [
"What",
"is",
"the",
"geometry",
"type",
"of",
"the",
"sub",
"-",
"geometry",
"pointed",
"to",
"by",
"the",
"given",
"index?",
"If",
"the",
"index",
"points",
"to",
"a",
"vertex",
"or",
"edge",
"the",
"geometry",
"type",
"at",
"the",
"parent",
"level",
... | train | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L317-L326 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/Convolution1DUtils.java | Convolution1DUtils.getSameModeTopLeftPadding | public static int getSameModeTopLeftPadding(int outSize, int inSize, int kernel, int strides, int dilation) {
"""
Get top padding for same mode only.
@param outSize Output size (length 2 array, height dimension first)
@param inSize Input size (length 2 array, height dimension first)
@param kernel Kernel ... | java | public static int getSameModeTopLeftPadding(int outSize, int inSize, int kernel, int strides, int dilation) {
int eKernel = effectiveKernelSize(kernel, dilation);
//Note that padBottom is 1 bigger than this if bracketed term is not divisible by 2
int outPad = ((outSize - 1) * strides + eKernel -... | [
"public",
"static",
"int",
"getSameModeTopLeftPadding",
"(",
"int",
"outSize",
",",
"int",
"inSize",
",",
"int",
"kernel",
",",
"int",
"strides",
",",
"int",
"dilation",
")",
"{",
"int",
"eKernel",
"=",
"effectiveKernelSize",
"(",
"kernel",
",",
"dilation",
... | Get top padding for same mode only.
@param outSize Output size (length 2 array, height dimension first)
@param inSize Input size (length 2 array, height dimension first)
@param kernel Kernel size (length 2 array, height dimension first)
@param strides Strides (length 2 array, height dimension first)
@param dila... | [
"Get",
"top",
"padding",
"for",
"same",
"mode",
"only",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/Convolution1DUtils.java#L201-L209 |
google/closure-templates | java/src/com/google/template/soy/pysrc/internal/InternalPyExprUtils.java | InternalPyExprUtils.wrapAsSanitizedContent | static PyExpr wrapAsSanitizedContent(SanitizedContentKind contentKind, PyExpr pyExpr) {
"""
Wraps an expression with the proper SanitizedContent constructor.
@param contentKind The kind of sanitized content.
@param pyExpr The expression to wrap.
"""
String sanitizer = NodeContentKinds.toPySanitizedCont... | java | static PyExpr wrapAsSanitizedContent(SanitizedContentKind contentKind, PyExpr pyExpr) {
String sanitizer = NodeContentKinds.toPySanitizedContentOrdainer(contentKind);
String approval =
"sanitize.IActuallyUnderstandSoyTypeSafetyAndHaveSecurityApproval("
+ "'Internally created Sanitization.')"... | [
"static",
"PyExpr",
"wrapAsSanitizedContent",
"(",
"SanitizedContentKind",
"contentKind",
",",
"PyExpr",
"pyExpr",
")",
"{",
"String",
"sanitizer",
"=",
"NodeContentKinds",
".",
"toPySanitizedContentOrdainer",
"(",
"contentKind",
")",
";",
"String",
"approval",
"=",
"... | Wraps an expression with the proper SanitizedContent constructor.
@param contentKind The kind of sanitized content.
@param pyExpr The expression to wrap. | [
"Wraps",
"an",
"expression",
"with",
"the",
"proper",
"SanitizedContent",
"constructor",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/internal/InternalPyExprUtils.java#L32-L39 |
google/closure-compiler | src/com/google/javascript/jscomp/graph/LinkedDirectedGraph.java | LinkedDirectedGraph.isConnectedInDirection | @Override
public boolean isConnectedInDirection(N n1, E edgeValue, N n2) {
"""
DiGraphNode look ups can be expensive for a large graph operation, prefer the
version below that takes DiGraphNodes, if you have them available.
"""
return isConnectedInDirection(n1, Predicates.equalTo(edgeValue), n2);
} | java | @Override
public boolean isConnectedInDirection(N n1, E edgeValue, N n2) {
return isConnectedInDirection(n1, Predicates.equalTo(edgeValue), n2);
} | [
"@",
"Override",
"public",
"boolean",
"isConnectedInDirection",
"(",
"N",
"n1",
",",
"E",
"edgeValue",
",",
"N",
"n2",
")",
"{",
"return",
"isConnectedInDirection",
"(",
"n1",
",",
"Predicates",
".",
"equalTo",
"(",
"edgeValue",
")",
",",
"n2",
")",
";",
... | DiGraphNode look ups can be expensive for a large graph operation, prefer the
version below that takes DiGraphNodes, if you have them available. | [
"DiGraphNode",
"look",
"ups",
"can",
"be",
"expensive",
"for",
"a",
"large",
"graph",
"operation",
"prefer",
"the",
"version",
"below",
"that",
"takes",
"DiGraphNodes",
"if",
"you",
"have",
"them",
"available",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/graph/LinkedDirectedGraph.java#L235-L238 |
jenkinsci/github-plugin | src/main/java/org/jenkinsci/plugins/github/webhook/subscriber/PingGHEventSubscriber.java | PingGHEventSubscriber.onEvent | @Override
protected void onEvent(GHEvent event, String payload) {
"""
Logs repo on ping event
@param event only PING event
@param payload payload of gh-event. Never blank
"""
GHEventPayload.Ping ping;
try {
ping = GitHub.offline().parseEventPayload(new StringReader(payload... | java | @Override
protected void onEvent(GHEvent event, String payload) {
GHEventPayload.Ping ping;
try {
ping = GitHub.offline().parseEventPayload(new StringReader(payload), GHEventPayload.Ping.class);
} catch (IOException e) {
LOGGER.warn("Received malformed PingEvent: " + ... | [
"@",
"Override",
"protected",
"void",
"onEvent",
"(",
"GHEvent",
"event",
",",
"String",
"payload",
")",
"{",
"GHEventPayload",
".",
"Ping",
"ping",
";",
"try",
"{",
"ping",
"=",
"GitHub",
".",
"offline",
"(",
")",
".",
"parseEventPayload",
"(",
"new",
"... | Logs repo on ping event
@param event only PING event
@param payload payload of gh-event. Never blank | [
"Logs",
"repo",
"on",
"ping",
"event"
] | train | https://github.com/jenkinsci/github-plugin/blob/4e05b9aeb488af5342c78f78aa3c55114e8d462a/src/main/java/org/jenkinsci/plugins/github/webhook/subscriber/PingGHEventSubscriber.java#L62-L83 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X500Name.java | X500Name.countQuotes | static int countQuotes(String string, int from, int to) {
"""
/*
Counts double quotes in string.
Escaped quotes are ignored.
"""
int count = 0;
int escape = 0;
for (int i = from; i < to; i++) {
if (string.charAt(i) == '"' && escape % 2 == 0) {
count++;
... | java | static int countQuotes(String string, int from, int to) {
int count = 0;
int escape = 0;
for (int i = from; i < to; i++) {
if (string.charAt(i) == '"' && escape % 2 == 0) {
count++;
}
escape = (string.charAt(i) == '\\') ? escape + 1 : 0;
... | [
"static",
"int",
"countQuotes",
"(",
"String",
"string",
",",
"int",
"from",
",",
"int",
"to",
")",
"{",
"int",
"count",
"=",
"0",
";",
"int",
"escape",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"from",
";",
"i",
"<",
"to",
";",
"i",
"++",
... | /*
Counts double quotes in string.
Escaped quotes are ignored. | [
"/",
"*",
"Counts",
"double",
"quotes",
"in",
"string",
".",
"Escaped",
"quotes",
"are",
"ignored",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X500Name.java#L1024-L1036 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/TableRow.java | TableRow.appendXMLToTable | public void appendXMLToTable(final XMLUtil util, final Appendable appendable) throws IOException {
"""
Write the XML dataStyles for this object.<br>
This is used while writing the ODS file.
@param util a util for XML writing
@param appendable where to write the XML
@throws IOException If an I/O error o... | java | public void appendXMLToTable(final XMLUtil util, final Appendable appendable) throws IOException {
this.appendRowOpenTag(util, appendable);
int nullFieldCounter = 0;
final int size = this.cells.usedSize();
for (int c = 0; c < size; c++) {
final TableCell cell = this.ce... | [
"public",
"void",
"appendXMLToTable",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"Appendable",
"appendable",
")",
"throws",
"IOException",
"{",
"this",
".",
"appendRowOpenTag",
"(",
"util",
",",
"appendable",
")",
";",
"int",
"nullFieldCounter",
"=",
"0",
... | Write the XML dataStyles for this object.<br>
This is used while writing the ODS file.
@param util a util for XML writing
@param appendable where to write the XML
@throws IOException If an I/O error occurs | [
"Write",
"the",
"XML",
"dataStyles",
"for",
"this",
"object",
".",
"<br",
">",
"This",
"is",
"used",
"while",
"writing",
"the",
"ODS",
"file",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TableRow.java#L113-L130 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.read | public static String read(FileChannel fileChannel, Charset charset) throws IORuntimeException {
"""
从FileChannel中读取内容
@param fileChannel 文件管道
@param charset 字符集
@return 内容
@throws IORuntimeException IO异常
"""
MappedByteBuffer buffer;
try {
buffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, ... | java | public static String read(FileChannel fileChannel, Charset charset) throws IORuntimeException {
MappedByteBuffer buffer;
try {
buffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, fileChannel.size()).load();
} catch (IOException e) {
throw new IORuntimeException(e);
}
return StrUtil.str(buf... | [
"public",
"static",
"String",
"read",
"(",
"FileChannel",
"fileChannel",
",",
"Charset",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"MappedByteBuffer",
"buffer",
";",
"try",
"{",
"buffer",
"=",
"fileChannel",
".",
"map",
"(",
"FileChannel",
".",
"MapMo... | 从FileChannel中读取内容
@param fileChannel 文件管道
@param charset 字符集
@return 内容
@throws IORuntimeException IO异常 | [
"从FileChannel中读取内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L505-L513 |
flow/caustic | api/src/main/java/com/flowpowered/caustic/api/util/TextureAtlas.java | TextureAtlas.findUsableRegion | private RegionData findUsableRegion(int width, int height) {
"""
Attempts to find a usable region of this {@link TextureAtlas}
@param width Width of the region
@param height Height of the region
@return The data for a valid region, null if none found.
"""
final int imageWidth = image.getWidth();
... | java | private RegionData findUsableRegion(int width, int height) {
final int imageWidth = image.getWidth();
final int imageHeight = image.getHeight();
for (int y = 0; y < imageHeight - height; y++) {
for (int x = 0; x < imageWidth - width; x++) {
final RegionData data = new... | [
"private",
"RegionData",
"findUsableRegion",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"final",
"int",
"imageWidth",
"=",
"image",
".",
"getWidth",
"(",
")",
";",
"final",
"int",
"imageHeight",
"=",
"image",
".",
"getHeight",
"(",
")",
";",
"f... | Attempts to find a usable region of this {@link TextureAtlas}
@param width Width of the region
@param height Height of the region
@return The data for a valid region, null if none found. | [
"Attempts",
"to",
"find",
"a",
"usable",
"region",
"of",
"this",
"{",
"@link",
"TextureAtlas",
"}"
] | train | https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/util/TextureAtlas.java#L108-L120 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/javax/crypto/Cipher.java | Cipher.update | public final int update(ByteBuffer input, ByteBuffer output)
throws ShortBufferException {
"""
Continues a multiple-part encryption or decryption operation
(depending on how this cipher was initialized), processing another data
part.
<p>All <code>input.remaining()</code> bytes starting at
<code>i... | java | public final int update(ByteBuffer input, ByteBuffer output)
throws ShortBufferException {
checkCipherState();
if ((input == null) || (output == null)) {
throw new IllegalArgumentException("Buffers must not be null");
}
if (input == output) {
throw ne... | [
"public",
"final",
"int",
"update",
"(",
"ByteBuffer",
"input",
",",
"ByteBuffer",
"output",
")",
"throws",
"ShortBufferException",
"{",
"checkCipherState",
"(",
")",
";",
"if",
"(",
"(",
"input",
"==",
"null",
")",
"||",
"(",
"output",
"==",
"null",
")",
... | Continues a multiple-part encryption or decryption operation
(depending on how this cipher was initialized), processing another data
part.
<p>All <code>input.remaining()</code> bytes starting at
<code>input.position()</code> are processed. The result is stored
in the output buffer.
Upon return, the input buffer's posi... | [
"Continues",
"a",
"multiple",
"-",
"part",
"encryption",
"or",
"decryption",
"operation",
"(",
"depending",
"on",
"how",
"this",
"cipher",
"was",
"initialized",
")",
"processing",
"another",
"data",
"part",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/javax/crypto/Cipher.java#L1885-L1902 |
czyzby/gdx-lml | kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/GdxUtilities.java | GdxUtilities.clearScreen | public static void clearScreen(final float r, final float g, final float b) {
"""
Clears the screen with the selected color.
@param r red color value.
@param g green color value.
@param b blue color value.
"""
Gdx.gl.glClearColor(r, g, b, 1f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
... | java | public static void clearScreen(final float r, final float g, final float b) {
Gdx.gl.glClearColor(r, g, b, 1f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
} | [
"public",
"static",
"void",
"clearScreen",
"(",
"final",
"float",
"r",
",",
"final",
"float",
"g",
",",
"final",
"float",
"b",
")",
"{",
"Gdx",
".",
"gl",
".",
"glClearColor",
"(",
"r",
",",
"g",
",",
"b",
",",
"1f",
")",
";",
"Gdx",
".",
"gl",
... | Clears the screen with the selected color.
@param r red color value.
@param g green color value.
@param b blue color value. | [
"Clears",
"the",
"screen",
"with",
"the",
"selected",
"color",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/GdxUtilities.java#L32-L35 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/accumulators/AccumulatorHelper.java | AccumulatorHelper.mergeInto | public static void mergeInto(Map<String, OptionalFailure<Accumulator<?, ?>>> target, Map<String, Accumulator<?, ?>> toMerge) {
"""
Merge two collections of accumulators. The second will be merged into the
first.
@param target
The collection of accumulators that will be updated
@param toMerge
The collection ... | java | public static void mergeInto(Map<String, OptionalFailure<Accumulator<?, ?>>> target, Map<String, Accumulator<?, ?>> toMerge) {
for (Map.Entry<String, Accumulator<?, ?>> otherEntry : toMerge.entrySet()) {
OptionalFailure<Accumulator<?, ?>> ownAccumulator = target.get(otherEntry.getKey());
if (ownAccumulator == n... | [
"public",
"static",
"void",
"mergeInto",
"(",
"Map",
"<",
"String",
",",
"OptionalFailure",
"<",
"Accumulator",
"<",
"?",
",",
"?",
">",
">",
">",
"target",
",",
"Map",
"<",
"String",
",",
"Accumulator",
"<",
"?",
",",
"?",
">",
">",
"toMerge",
")",
... | Merge two collections of accumulators. The second will be merged into the
first.
@param target
The collection of accumulators that will be updated
@param toMerge
The collection of accumulators that will be merged into the
other | [
"Merge",
"two",
"collections",
"of",
"accumulators",
".",
"The",
"second",
"will",
"be",
"merged",
"into",
"the",
"first",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/accumulators/AccumulatorHelper.java#L54-L78 |
jbundle/jbundle | model/base/src/main/java/org/jbundle/model/util/Util.java | Util.convertClassName | public static String convertClassName(String className, String stringToInsert) {
"""
Convert this class name by inserting this package after the domain.
ie., com.xyz.abc.ClassName -> com.xyz.newpackage.abc.ClassName.
@param className
@param stringToInsert
@return Converted string
"""
return Util.con... | java | public static String convertClassName(String className, String stringToInsert)
{
return Util.convertClassName(className, stringToInsert, 2);
} | [
"public",
"static",
"String",
"convertClassName",
"(",
"String",
"className",
",",
"String",
"stringToInsert",
")",
"{",
"return",
"Util",
".",
"convertClassName",
"(",
"className",
",",
"stringToInsert",
",",
"2",
")",
";",
"}"
] | Convert this class name by inserting this package after the domain.
ie., com.xyz.abc.ClassName -> com.xyz.newpackage.abc.ClassName.
@param className
@param stringToInsert
@return Converted string | [
"Convert",
"this",
"class",
"name",
"by",
"inserting",
"this",
"package",
"after",
"the",
"domain",
".",
"ie",
".",
"com",
".",
"xyz",
".",
"abc",
".",
"ClassName",
"-",
">",
"com",
".",
"xyz",
".",
"newpackage",
".",
"abc",
".",
"ClassName",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/model/base/src/main/java/org/jbundle/model/util/Util.java#L457-L460 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.toSpreadMap | public static SpreadMap toSpreadMap(List self) {
"""
Creates a spreadable map from this list.
<p>
@param self a list
@return a newly created SpreadMap
@see groovy.lang.SpreadMap#SpreadMap(java.util.List)
@see #toSpreadMap(java.util.Map)
@since 1.8.0
"""
if (self == null)
throw new Gro... | java | public static SpreadMap toSpreadMap(List self) {
if (self == null)
throw new GroovyRuntimeException("Fail to convert List to SpreadMap, because it is null.");
else if (self.size() % 2 != 0)
throw new GroovyRuntimeException("Fail to convert List to SpreadMap, because it's size is ... | [
"public",
"static",
"SpreadMap",
"toSpreadMap",
"(",
"List",
"self",
")",
"{",
"if",
"(",
"self",
"==",
"null",
")",
"throw",
"new",
"GroovyRuntimeException",
"(",
"\"Fail to convert List to SpreadMap, because it is null.\"",
")",
";",
"else",
"if",
"(",
"self",
"... | Creates a spreadable map from this list.
<p>
@param self a list
@return a newly created SpreadMap
@see groovy.lang.SpreadMap#SpreadMap(java.util.List)
@see #toSpreadMap(java.util.Map)
@since 1.8.0 | [
"Creates",
"a",
"spreadable",
"map",
"from",
"this",
"list",
".",
"<p",
">"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L8559-L8566 |
apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/plan/SingleInputPlanNode.java | SingleInputPlanNode.setDriverKeyInfo | public void setDriverKeyInfo(FieldList keys, boolean[] sortOrder, int id) {
"""
Sets the key field information for the specified driver comparator.
@param keys The key field indexes for the specified driver comparator.
@param sortOrder The key sort order for the specified driver comparator.
@param id The ID o... | java | public void setDriverKeyInfo(FieldList keys, boolean[] sortOrder, int id) {
if(id < 0 || id >= driverKeys.length) {
throw new CompilerException("Invalid id for driver key information. DriverStrategy requires only "
+super.getDriverStrategy().getNumRequiredComparators()+" comparators.");
}
this.drive... | [
"public",
"void",
"setDriverKeyInfo",
"(",
"FieldList",
"keys",
",",
"boolean",
"[",
"]",
"sortOrder",
",",
"int",
"id",
")",
"{",
"if",
"(",
"id",
"<",
"0",
"||",
"id",
">=",
"driverKeys",
".",
"length",
")",
"{",
"throw",
"new",
"CompilerException",
... | Sets the key field information for the specified driver comparator.
@param keys The key field indexes for the specified driver comparator.
@param sortOrder The key sort order for the specified driver comparator.
@param id The ID of the driver comparator. | [
"Sets",
"the",
"key",
"field",
"information",
"for",
"the",
"specified",
"driver",
"comparator",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/plan/SingleInputPlanNode.java#L143-L150 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/chart/builder/DJXYAreaChartBuilder.java | DJXYAreaChartBuilder.addSerie | public DJXYAreaChartBuilder addSerie(AbstractColumn column, StringExpression labelExpression) {
"""
Adds the specified serie column to the dataset with custom label.
@param column the serie column
"""
getDataset().addSerie(column, labelExpression);
return this;
} | java | public DJXYAreaChartBuilder addSerie(AbstractColumn column, StringExpression labelExpression) {
getDataset().addSerie(column, labelExpression);
return this;
} | [
"public",
"DJXYAreaChartBuilder",
"addSerie",
"(",
"AbstractColumn",
"column",
",",
"StringExpression",
"labelExpression",
")",
"{",
"getDataset",
"(",
")",
".",
"addSerie",
"(",
"column",
",",
"labelExpression",
")",
";",
"return",
"this",
";",
"}"
] | Adds the specified serie column to the dataset with custom label.
@param column the serie column | [
"Adds",
"the",
"specified",
"serie",
"column",
"to",
"the",
"dataset",
"with",
"custom",
"label",
"."
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/chart/builder/DJXYAreaChartBuilder.java#L384-L387 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java | DataFrameJoiner.leftOuter | public Table leftOuter(Table table2, String[] col2Names) {
"""
Joins the joiner to the table2, using the given columns for the second table and returns the resulting table
@param table2 The table to join with
@param col2Names The columns to join on. If a name refers to a double column, the join is performed... | java | public Table leftOuter(Table table2, String[] col2Names) {
return leftOuter(table2, false, col2Names);
} | [
"public",
"Table",
"leftOuter",
"(",
"Table",
"table2",
",",
"String",
"[",
"]",
"col2Names",
")",
"{",
"return",
"leftOuter",
"(",
"table2",
",",
"false",
",",
"col2Names",
")",
";",
"}"
] | Joins the joiner to the table2, using the given columns for the second table and returns the resulting table
@param table2 The table to join with
@param col2Names The columns to join on. If a name refers to a double column, the join is performed after
rounding to integers.
@return The resulting table | [
"Joins",
"the",
"joiner",
"to",
"the",
"table2",
"using",
"the",
"given",
"columns",
"for",
"the",
"second",
"table",
"and",
"returns",
"the",
"resulting",
"table"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java#L514-L516 |
apache/groovy | subprojects/groovy-xml/src/main/java/groovy/xml/NamespaceBuilderSupport.java | NamespaceBuilderSupport.invokeMethod | @Override
public Object invokeMethod(String methodName, Object args) {
"""
Allow automatic detection of namespace declared in the attributes
"""
// detect namespace declared on the added node like xmlns:foo="http:/foo"
Map attributes = findAttributes(args);
for (Iterator<Map.Entry> iter =... | java | @Override
public Object invokeMethod(String methodName, Object args) {
// detect namespace declared on the added node like xmlns:foo="http:/foo"
Map attributes = findAttributes(args);
for (Iterator<Map.Entry> iter = attributes.entrySet().iterator(); iter.hasNext();) {
Map.Entry entry = iter.... | [
"@",
"Override",
"public",
"Object",
"invokeMethod",
"(",
"String",
"methodName",
",",
"Object",
"args",
")",
"{",
"// detect namespace declared on the added node like xmlns:foo=\"http:/foo\"",
"Map",
"attributes",
"=",
"findAttributes",
"(",
"args",
")",
";",
"for",
"(... | Allow automatic detection of namespace declared in the attributes | [
"Allow",
"automatic",
"detection",
"of",
"namespace",
"declared",
"in",
"the",
"attributes"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/xml/NamespaceBuilderSupport.java#L119-L135 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java | VelocityParser.isVarEscaped | private boolean isVarEscaped(char[] array, int currentIndex) {
"""
Look in previous characters of the array to find if the current var is escaped (like \$var).
@param array the source to parse
@param currentIndex the current index in the <code>array</code>
@return the parser context to put some informations
... | java | private boolean isVarEscaped(char[] array, int currentIndex)
{
int i = currentIndex - 1;
while (i >= 0 && array[i] == '\\') {
--i;
}
return (currentIndex - i) % 2 == 0;
} | [
"private",
"boolean",
"isVarEscaped",
"(",
"char",
"[",
"]",
"array",
",",
"int",
"currentIndex",
")",
"{",
"int",
"i",
"=",
"currentIndex",
"-",
"1",
";",
"while",
"(",
"i",
">=",
"0",
"&&",
"array",
"[",
"i",
"]",
"==",
"'",
"'",
")",
"{",
"--"... | Look in previous characters of the array to find if the current var is escaped (like \$var).
@param array the source to parse
@param currentIndex the current index in the <code>array</code>
@return the parser context to put some informations | [
"Look",
"in",
"previous",
"characters",
"of",
"the",
"array",
"to",
"find",
"if",
"the",
"current",
"var",
"is",
"escaped",
"(",
"like",
"\\",
"$var",
")",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java#L426-L435 |
jbundle/jbundle | base/message/core/src/main/java/org/jbundle/base/message/core/trx/TrxMessageHeader.java | TrxMessageHeader.init | public void init(String strQueueName, String strQueueType, Object source, Map<String,Object> properties) {
"""
Constructor.
@param strQueueName Name of the queue.
@param strQueueType Type of queue - remote or local.
@param source usually the object sending or listening for the message, to reduce echos.
"""
... | java | public void init(String strQueueName, String strQueueType, Object source, Map<String,Object> properties)
{
m_mapMessageHeader = properties;
m_mapMessageTransport = null;
m_mapMessageInfo = null;
super.init(strQueueName, MessageConstants.INTERNET_QUEUE, source, properties);
} | [
"public",
"void",
"init",
"(",
"String",
"strQueueName",
",",
"String",
"strQueueType",
",",
"Object",
"source",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"m_mapMessageHeader",
"=",
"properties",
";",
"m_mapMessageTransport",
"=",
... | Constructor.
@param strQueueName Name of the queue.
@param strQueueType Type of queue - remote or local.
@param source usually the object sending or listening for the message, to reduce echos. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/core/src/main/java/org/jbundle/base/message/core/trx/TrxMessageHeader.java#L233-L239 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/document/impl/DotPatternMapHelpers.java | DotPatternMapHelpers.flatten | public static String flatten(String left, String right) {
"""
Links the two field names into a single left.right field name.
If the left field is empty, right is returned
@param left one field name
@param right the other field name
@return left.right or right if left is an empty string
"""
return lef... | java | public static String flatten(String left, String right) {
return left == null || left.isEmpty() ? right : left + "." + right;
} | [
"public",
"static",
"String",
"flatten",
"(",
"String",
"left",
",",
"String",
"right",
")",
"{",
"return",
"left",
"==",
"null",
"||",
"left",
".",
"isEmpty",
"(",
")",
"?",
"right",
":",
"left",
"+",
"\".\"",
"+",
"right",
";",
"}"
] | Links the two field names into a single left.right field name.
If the left field is empty, right is returned
@param left one field name
@param right the other field name
@return left.right or right if left is an empty string | [
"Links",
"the",
"two",
"field",
"names",
"into",
"a",
"single",
"left",
".",
"right",
"field",
"name",
".",
"If",
"the",
"left",
"field",
"is",
"empty",
"right",
"is",
"returned"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/document/impl/DotPatternMapHelpers.java#L100-L102 |
finmath/finmath-lib | src/main/java/net/finmath/functions/LinearAlgebra.java | LinearAlgebra.factorReductionUsingCommonsMath | public static double[][] factorReductionUsingCommonsMath(double[][] correlationMatrix, int numberOfFactors) {
"""
Returns a correlation matrix which has rank < n and for which the first n factors agree with the factors of correlationMatrix.
@param correlationMatrix The given correlation matrix.
@param numbe... | java | public static double[][] factorReductionUsingCommonsMath(double[][] correlationMatrix, int numberOfFactors) {
// Extract factors corresponding to the largest eigenvalues
double[][] factorMatrix = getFactorMatrix(correlationMatrix, numberOfFactors);
// Renormalize rows
for (int row = 0; row < correlationMatrix... | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"factorReductionUsingCommonsMath",
"(",
"double",
"[",
"]",
"[",
"]",
"correlationMatrix",
",",
"int",
"numberOfFactors",
")",
"{",
"// Extract factors corresponding to the largest eigenvalues",
"double",
"[",
"]",
"["... | Returns a correlation matrix which has rank < n and for which the first n factors agree with the factors of correlationMatrix.
@param correlationMatrix The given correlation matrix.
@param numberOfFactors The requested number of factors (Eigenvectors).
@return Factor reduced correlation matrix. | [
"Returns",
"a",
"correlation",
"matrix",
"which",
"has",
"rank",
"<",
";",
"n",
"and",
"for",
"which",
"the",
"first",
"n",
"factors",
"agree",
"with",
"the",
"factors",
"of",
"correlationMatrix",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/functions/LinearAlgebra.java#L438-L466 |
google/closure-compiler | src/com/google/javascript/jscomp/DestructuringGlobalNameExtractor.java | DestructuringGlobalNameExtractor.makeNewRvalueForDestructuringKey | private static Node makeNewRvalueForDestructuringKey(
Node stringKey, Node rvalue, Set<AstChange> newNodes, Ref ref) {
"""
Makes a default value expression from the rvalue, or otherwise just returns it
<p>e.g. for `const {x = defaultValue} = y;`, and the new rvalue `rvalue`, returns `void 0 ===
rvalue ? ... | java | private static Node makeNewRvalueForDestructuringKey(
Node stringKey, Node rvalue, Set<AstChange> newNodes, Ref ref) {
if (stringKey.getOnlyChild().isDefaultValue()) {
Node defaultValue = stringKey.getFirstChild().getSecondChild().detach();
// Assume `rvalue` has no side effects since it's a qname... | [
"private",
"static",
"Node",
"makeNewRvalueForDestructuringKey",
"(",
"Node",
"stringKey",
",",
"Node",
"rvalue",
",",
"Set",
"<",
"AstChange",
">",
"newNodes",
",",
"Ref",
"ref",
")",
"{",
"if",
"(",
"stringKey",
".",
"getOnlyChild",
"(",
")",
".",
"isDefau... | Makes a default value expression from the rvalue, or otherwise just returns it
<p>e.g. for `const {x = defaultValue} = y;`, and the new rvalue `rvalue`, returns `void 0 ===
rvalue ? defaultValue : rvalue` | [
"Makes",
"a",
"default",
"value",
"expression",
"from",
"the",
"rvalue",
"or",
"otherwise",
"just",
"returns",
"it"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DestructuringGlobalNameExtractor.java#L176-L192 |
Alluxio/alluxio | underfs/oss/src/main/java/alluxio/underfs/oss/OSSUnderFileSystem.java | OSSUnderFileSystem.createInstance | public static OSSUnderFileSystem createInstance(AlluxioURI uri,
UnderFileSystemConfiguration conf, AlluxioConfiguration alluxioConf) throws Exception {
"""
Constructs a new instance of {@link OSSUnderFileSystem}.
@param uri the {@link AlluxioURI} for this UFS
@param conf the configuration for this UFS
@... | java | public static OSSUnderFileSystem createInstance(AlluxioURI uri,
UnderFileSystemConfiguration conf, AlluxioConfiguration alluxioConf) throws Exception {
String bucketName = UnderFileSystemUtils.getBucketName(uri);
Preconditions.checkArgument(conf.isSet(PropertyKey.OSS_ACCESS_KEY),
"Property %s is r... | [
"public",
"static",
"OSSUnderFileSystem",
"createInstance",
"(",
"AlluxioURI",
"uri",
",",
"UnderFileSystemConfiguration",
"conf",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"throws",
"Exception",
"{",
"String",
"bucketName",
"=",
"UnderFileSystemUtils",
".",
"getBu... | Constructs a new instance of {@link OSSUnderFileSystem}.
@param uri the {@link AlluxioURI} for this UFS
@param conf the configuration for this UFS
@param alluxioConf Alluxio configuration
@return the created {@link OSSUnderFileSystem} instance | [
"Constructs",
"a",
"new",
"instance",
"of",
"{",
"@link",
"OSSUnderFileSystem",
"}",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/oss/src/main/java/alluxio/underfs/oss/OSSUnderFileSystem.java#L69-L86 |
javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/i/IntTuples.java | IntTuples.createSubTuple | static MutableIntTuple createSubTuple(
MutableIntTuple parent, int fromIndex, int toIndex) {
"""
Creates a new tuple that is a <i>view</i>
on the specified portion of the given parent. Changes in the
parent will be visible in the returned tuple, and vice versa.
@param parent The parent tuple
@param ... | java | static MutableIntTuple createSubTuple(
MutableIntTuple parent, int fromIndex, int toIndex)
{
return new MutableSubIntTuple(parent, fromIndex, toIndex);
} | [
"static",
"MutableIntTuple",
"createSubTuple",
"(",
"MutableIntTuple",
"parent",
",",
"int",
"fromIndex",
",",
"int",
"toIndex",
")",
"{",
"return",
"new",
"MutableSubIntTuple",
"(",
"parent",
",",
"fromIndex",
",",
"toIndex",
")",
";",
"}"
] | Creates a new tuple that is a <i>view</i>
on the specified portion of the given parent. Changes in the
parent will be visible in the returned tuple, and vice versa.
@param parent The parent tuple
@param fromIndex The start index in the parent, inclusive
@param toIndex The end index in the parent, exclusive
@throws Nul... | [
"Creates",
"a",
"new",
"tuple",
"that",
"is",
"a",
"<i",
">",
"view<",
"/",
"i",
">",
"on",
"the",
"specified",
"portion",
"of",
"the",
"given",
"parent",
".",
"Changes",
"in",
"the",
"parent",
"will",
"be",
"visible",
"in",
"the",
"returned",
"tuple",... | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/i/IntTuples.java#L250-L254 |
Netflix/eureka | eureka-client/src/main/java/com/netflix/appinfo/ApplicationInfoManager.java | ApplicationInfoManager.setInstanceStatus | public synchronized void setInstanceStatus(InstanceStatus status) {
"""
Set the status of this instance. Application can use this to indicate
whether it is ready to receive traffic. Setting the status here also notifies all registered listeners
of a status change event.
@param status Status of the instance
... | java | public synchronized void setInstanceStatus(InstanceStatus status) {
InstanceStatus next = instanceStatusMapper.map(status);
if (next == null) {
return;
}
InstanceStatus prev = instanceInfo.setStatus(next);
if (prev != null) {
for (StatusChangeListener lis... | [
"public",
"synchronized",
"void",
"setInstanceStatus",
"(",
"InstanceStatus",
"status",
")",
"{",
"InstanceStatus",
"next",
"=",
"instanceStatusMapper",
".",
"map",
"(",
"status",
")",
";",
"if",
"(",
"next",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Inst... | Set the status of this instance. Application can use this to indicate
whether it is ready to receive traffic. Setting the status here also notifies all registered listeners
of a status change event.
@param status Status of the instance | [
"Set",
"the",
"status",
"of",
"this",
"instance",
".",
"Application",
"can",
"use",
"this",
"to",
"indicate",
"whether",
"it",
"is",
"ready",
"to",
"receive",
"traffic",
".",
"Setting",
"the",
"status",
"here",
"also",
"notifies",
"all",
"registered",
"liste... | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/appinfo/ApplicationInfoManager.java#L167-L183 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java | SubWriterHolderWriter.addSummaryType | public void addSummaryType(AbstractMemberWriter mw, Element member, Content tdSummaryType) {
"""
Add the summary type for the member.
@param mw the writer for the member being documented
@param member the member to be documented
@param tdSummaryType the content tree to which the type will be added
"""
... | java | public void addSummaryType(AbstractMemberWriter mw, Element member, Content tdSummaryType) {
mw.addSummaryType(member, tdSummaryType);
} | [
"public",
"void",
"addSummaryType",
"(",
"AbstractMemberWriter",
"mw",
",",
"Element",
"member",
",",
"Content",
"tdSummaryType",
")",
"{",
"mw",
".",
"addSummaryType",
"(",
"member",
",",
"tdSummaryType",
")",
";",
"}"
] | Add the summary type for the member.
@param mw the writer for the member being documented
@param member the member to be documented
@param tdSummaryType the content tree to which the type will be added | [
"Add",
"the",
"summary",
"type",
"for",
"the",
"member",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java#L217-L219 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.resetAsync | public Observable<VirtualNetworkGatewayInner> resetAsync(String resourceGroupName, String virtualNetworkGatewayName) {
"""
Resets the primary of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the... | java | public Observable<VirtualNetworkGatewayInner> resetAsync(String resourceGroupName, String virtualNetworkGatewayName) {
return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1<ServiceResponse<VirtualNetworkGatewayInner>, VirtualNetworkGatewayInner>() {
@Overri... | [
"public",
"Observable",
"<",
"VirtualNetworkGatewayInner",
">",
"resetAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
")",
"{",
"return",
"resetWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayName",
")",
... | Resets the primary of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the ... | [
"Resets",
"the",
"primary",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L1184-L1191 |
jinahya/hex-codec | src/main/java/com/github/jinahya/codec/HexDecoder.java | HexDecoder.decodeSingle | public static int decodeSingle(final byte[] input, final int inoff) {
"""
Decodes two nibbles in given input array and returns the decoded octet.
@param input the input array of nibbles.
@param inoff the offset in the array.
@return the decoded octet.
"""
if (input == null) {
throw ... | java | public static int decodeSingle(final byte[] input, final int inoff) {
if (input == null) {
throw new NullPointerException("input");
}
if (input.length < 2) {
// not required by (inoff >= input.length -1) checked below
throw new IllegalArgumentException(
... | [
"public",
"static",
"int",
"decodeSingle",
"(",
"final",
"byte",
"[",
"]",
"input",
",",
"final",
"int",
"inoff",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"input\"",
")",
";",
"}",
"if",
"(",
... | Decodes two nibbles in given input array and returns the decoded octet.
@param input the input array of nibbles.
@param inoff the offset in the array.
@return the decoded octet. | [
"Decodes",
"two",
"nibbles",
"in",
"given",
"input",
"array",
"and",
"returns",
"the",
"decoded",
"octet",
"."
] | train | https://github.com/jinahya/hex-codec/blob/159aa54010821655496177e76a3ef35a49fbd433/src/main/java/com/github/jinahya/codec/HexDecoder.java#L91-L115 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/io/GrassRasterReader.java | GrassRasterReader.readUncompressedFPRowByNumber | private void readUncompressedFPRowByNumber( ByteBuffer rowdata, int rn, RandomAccessFile thefile, int typeBytes )
throws IOException, DataFormatException {
"""
read a row of data from an uncompressed floating point map
@param rn
@param outFile
@param typeBytes
@return the ByteBuffer containing th... | java | private void readUncompressedFPRowByNumber( ByteBuffer rowdata, int rn, RandomAccessFile thefile, int typeBytes )
throws IOException, DataFormatException {
int datanumber = fileWindow.getCols() * typeBytes;
thefile.seek((rn * datanumber));
thefile.read(rowdata.array());
} | [
"private",
"void",
"readUncompressedFPRowByNumber",
"(",
"ByteBuffer",
"rowdata",
",",
"int",
"rn",
",",
"RandomAccessFile",
"thefile",
",",
"int",
"typeBytes",
")",
"throws",
"IOException",
",",
"DataFormatException",
"{",
"int",
"datanumber",
"=",
"fileWindow",
".... | read a row of data from an uncompressed floating point map
@param rn
@param outFile
@param typeBytes
@return the ByteBuffer containing the data
@throws IOException
@throws DataFormatException | [
"read",
"a",
"row",
"of",
"data",
"from",
"an",
"uncompressed",
"floating",
"point",
"map"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/io/GrassRasterReader.java#L1104-L1110 |
Wadpam/guja | guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java | GeneratedDContactDaoImpl.queryBySecondaryCustomIndex | public Iterable<DContact> queryBySecondaryCustomIndex(Object parent, java.lang.String secondaryCustomIndex) {
"""
query-by method for field secondaryCustomIndex
@param secondaryCustomIndex the specified attribute
@return an Iterable of DContacts for the specified secondaryCustomIndex
"""
return queryByFi... | java | public Iterable<DContact> queryBySecondaryCustomIndex(Object parent, java.lang.String secondaryCustomIndex) {
return queryByField(parent, DContactMapper.Field.SECONDARYCUSTOMINDEX.getFieldName(), secondaryCustomIndex);
} | [
"public",
"Iterable",
"<",
"DContact",
">",
"queryBySecondaryCustomIndex",
"(",
"Object",
"parent",
",",
"java",
".",
"lang",
".",
"String",
"secondaryCustomIndex",
")",
"{",
"return",
"queryByField",
"(",
"parent",
",",
"DContactMapper",
".",
"Field",
".",
"SEC... | query-by method for field secondaryCustomIndex
@param secondaryCustomIndex the specified attribute
@return an Iterable of DContacts for the specified secondaryCustomIndex | [
"query",
"-",
"by",
"method",
"for",
"field",
"secondaryCustomIndex"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java#L259-L261 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONObject.java | JSONObject.findTargetClass | private static Class findTargetClass( String key, Map classMap ) {
"""
Locates a Class associated to a specifi key.<br>
The key may be a regexp.
"""
// try get first
Class targetClass = (Class) classMap.get( key );
if( targetClass == null ){
// try with regexp
// this will ... | java | private static Class findTargetClass( String key, Map classMap ) {
// try get first
Class targetClass = (Class) classMap.get( key );
if( targetClass == null ){
// try with regexp
// this will hit performance as it must iterate over all the keys
// and create a RegexpMatcher ... | [
"private",
"static",
"Class",
"findTargetClass",
"(",
"String",
"key",
",",
"Map",
"classMap",
")",
"{",
"// try get first",
"Class",
"targetClass",
"=",
"(",
"Class",
")",
"classMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"targetClass",
"==",
"null... | Locates a Class associated to a specifi key.<br>
The key may be a regexp. | [
"Locates",
"a",
"Class",
"associated",
"to",
"a",
"specifi",
"key",
".",
"<br",
">",
"The",
"key",
"may",
"be",
"a",
"regexp",
"."
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONObject.java#L1262-L1281 |
Omertron/api-rottentomatoes | src/main/java/com/omertron/rottentomatoesapi/tools/ApiBuilder.java | ApiBuilder.validateProperty | public static boolean validateProperty(String key, String value) {
"""
Validate the key and value of a property
@param key
@param value
@return
"""
return !StringUtils.isBlank(key) && !StringUtils.isBlank(value);
} | java | public static boolean validateProperty(String key, String value) {
return !StringUtils.isBlank(key) && !StringUtils.isBlank(value);
} | [
"public",
"static",
"boolean",
"validateProperty",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"return",
"!",
"StringUtils",
".",
"isBlank",
"(",
"key",
")",
"&&",
"!",
"StringUtils",
".",
"isBlank",
"(",
"value",
")",
";",
"}"
] | Validate the key and value of a property
@param key
@param value
@return | [
"Validate",
"the",
"key",
"and",
"value",
"of",
"a",
"property"
] | train | https://github.com/Omertron/api-rottentomatoes/blob/abaf1833acafc6ada593d52b14ff1bacb4e441ee/src/main/java/com/omertron/rottentomatoesapi/tools/ApiBuilder.java#L124-L126 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MsgDestEncodingUtilsImpl.java | MsgDestEncodingUtilsImpl.convertPropertyToType | final static Object convertPropertyToType(String longPropertyName, String stringValue) {
"""
convertPropertyToType
Convert a property from its stringified form into an Object of the appropriate
type. Called by URIDestinationCreator.
@param longPropertyName The long name of the property
@param stringValue... | java | final static Object convertPropertyToType(String longPropertyName, String stringValue) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "convertPropertyToType", new Object[]{longPropertyName, stringValue});
// If the value is null or already a String we won't have anything to ... | [
"final",
"static",
"Object",
"convertPropertyToType",
"(",
"String",
"longPropertyName",
",",
"String",
"stringValue",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
... | convertPropertyToType
Convert a property from its stringified form into an Object of the appropriate
type. Called by URIDestinationCreator.
@param longPropertyName The long name of the property
@param stringValue The stringified property value
@return Object Description of returned value | [
"convertPropertyToType",
"Convert",
"a",
"property",
"from",
"its",
"stringified",
"form",
"into",
"an",
"Object",
"of",
"the",
"appropriate",
"type",
".",
"Called",
"by",
"URIDestinationCreator",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MsgDestEncodingUtilsImpl.java#L332-L349 |
zaproxy/zaproxy | src/org/parosproxy/paros/view/AbstractFrame.java | AbstractFrame.restoreWindowLocation | private Point restoreWindowLocation() {
"""
Loads and set the saved position preferences for this frame.
@return the size of the frame OR null, if there wasn't any preference.
"""
Point result = null;
final String sizestr = preferences.get(prefnzPrefix+PREF_WINDOW_POSITION, null);
if (sizestr != nu... | java | private Point restoreWindowLocation() {
Point result = null;
final String sizestr = preferences.get(prefnzPrefix+PREF_WINDOW_POSITION, null);
if (sizestr != null) {
int x = 0;
int y = 0;
final String[] sizes = sizestr.split("[,]");
try {
x = Integer.parseInt(sizes[0].trim());
y = Inte... | [
"private",
"Point",
"restoreWindowLocation",
"(",
")",
"{",
"Point",
"result",
"=",
"null",
";",
"final",
"String",
"sizestr",
"=",
"preferences",
".",
"get",
"(",
"prefnzPrefix",
"+",
"PREF_WINDOW_POSITION",
",",
"null",
")",
";",
"if",
"(",
"sizestr",
"!="... | Loads and set the saved position preferences for this frame.
@return the size of the frame OR null, if there wasn't any preference. | [
"Loads",
"and",
"set",
"the",
"saved",
"position",
"preferences",
"for",
"this",
"frame",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/AbstractFrame.java#L243-L263 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/SynchronousQueue.java | SynchronousQueue.offer | public boolean offer(E e, long timeout, TimeUnit unit)
throws InterruptedException {
"""
Inserts the specified element into this queue, waiting if necessary
up to the specified wait time for another thread to receive it.
@return {@code true} if successful, or {@code false} if the
specified waiting tim... | java | public boolean offer(E e, long timeout, TimeUnit unit)
throws InterruptedException {
if (e == null) throw new NullPointerException();
if (transferer.transfer(e, true, unit.toNanos(timeout)) != null)
return true;
if (!Thread.interrupted())
return false;
thr... | [
"public",
"boolean",
"offer",
"(",
"E",
"e",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"e",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"if",
"(",
"transferer",
"... | Inserts the specified element into this queue, waiting if necessary
up to the specified wait time for another thread to receive it.
@return {@code true} if successful, or {@code false} if the
specified waiting time elapses before a consumer appears
@throws InterruptedException {@inheritDoc}
@throws NullPointerExceptio... | [
"Inserts",
"the",
"specified",
"element",
"into",
"this",
"queue",
"waiting",
"if",
"necessary",
"up",
"to",
"the",
"specified",
"wait",
"time",
"for",
"another",
"thread",
"to",
"receive",
"it",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/SynchronousQueue.java#L895-L903 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_ips_GET | public ArrayList<OvhDatetimeAndIpvalue> billingAccount_line_serviceName_ips_GET(String billingAccount, String serviceName) throws IOException {
"""
Listing of last ips registry
REST: GET /telephony/{billingAccount}/line/{serviceName}/ips
@param billingAccount [required] The name of your billingAccount
@param ... | java | public ArrayList<OvhDatetimeAndIpvalue> billingAccount_line_serviceName_ips_GET(String billingAccount, String serviceName) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/ips";
StringBuilder sb = path(qPath, billingAccount, serviceName);
String resp = exec(qPath, "GET", sb.toSt... | [
"public",
"ArrayList",
"<",
"OvhDatetimeAndIpvalue",
">",
"billingAccount_line_serviceName_ips_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/line/{serviceName}/ips\"... | Listing of last ips registry
REST: GET /telephony/{billingAccount}/line/{serviceName}/ips
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Listing",
"of",
"last",
"ips",
"registry"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L1723-L1728 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.