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 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/priority/Tree.java | Tree.changeNodePriority | public synchronized boolean changeNodePriority(int streamID, int newPriority) {
"""
Change the priority of the desired stream/node.
Reset all the sibling weighted priorities and re-sort the siblings, since once on priority changes, all priority ratios need to be updated and changed.
@param streamID
@param new... | java | public synchronized boolean changeNodePriority(int streamID, int newPriority) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "changeNodePriority entry: streamID to change: " + streamID + " new Priority: " + newPriority);
}
Node nodeToChange = root... | [
"public",
"synchronized",
"boolean",
"changeNodePriority",
"(",
"int",
"streamID",
",",
"int",
"newPriority",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debu... | Change the priority of the desired stream/node.
Reset all the sibling weighted priorities and re-sort the siblings, since once on priority changes, all priority ratios need to be updated and changed.
@param streamID
@param newPriority
@return the Node that was changed, null if the node could not be found | [
"Change",
"the",
"priority",
"of",
"the",
"desired",
"stream",
"/",
"node",
".",
"Reset",
"all",
"the",
"sibling",
"weighted",
"priorities",
"and",
"re",
"-",
"sort",
"the",
"siblings",
"since",
"once",
"on",
"priority",
"changes",
"all",
"priority",
"ratios... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/priority/Tree.java#L225-L252 |
dmak/jaxb-xew-plugin | src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java | CommonUtils.addAnnotation | public static void addAnnotation(JVar field, JAnnotationUse annotation) {
"""
Append the given {@code annotation} to list of annotations for the given {@code field}.
"""
List<JAnnotationUse> annotations = getPrivateField(field, "annotations");
annotations.add(annotation);
} | java | public static void addAnnotation(JVar field, JAnnotationUse annotation) {
List<JAnnotationUse> annotations = getPrivateField(field, "annotations");
annotations.add(annotation);
} | [
"public",
"static",
"void",
"addAnnotation",
"(",
"JVar",
"field",
",",
"JAnnotationUse",
"annotation",
")",
"{",
"List",
"<",
"JAnnotationUse",
">",
"annotations",
"=",
"getPrivateField",
"(",
"field",
",",
"\"annotations\"",
")",
";",
"annotations",
".",
"add"... | Append the given {@code annotation} to list of annotations for the given {@code field}. | [
"Append",
"the",
"given",
"{"
] | train | https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java#L116-L119 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getGuildStashInfo | public void getGuildStashInfo(String id, String api, Callback<List<GuildStash>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on guild stash API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id/stash">here</a><br/>
Give user the access to {@link Callback#onResponse(Cal... | java | public void getGuildStashInfo(String id, String api, Callback<List<GuildStash>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api));
gw2API.getGuildStashInfo(id, api).enqueue(callback);
} | [
"public",
"void",
"getGuildStashInfo",
"(",
"String",
"id",
",",
"String",
"api",
",",
"Callback",
"<",
"List",
"<",
"GuildStash",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChe... | For more info on guild stash API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id/stash">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions<br/>
@param id guild id
@param api Guild lead... | [
"For",
"more",
"info",
"on",
"guild",
"stash",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"guild",
"/",
":",
"id",
"/",
"stash",
">",
"here<",
"/",
"a",
">"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1535-L1538 |
mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/internal/CoreRemoteMongoCollectionImpl.java | CoreRemoteMongoCollectionImpl.findOne | public DocumentT findOne(final Bson filter, final RemoteFindOptions options) {
"""
Finds a document in the collection.
@param filter the query filter
@param options A RemoteFindOptions struct
@return the resulting document
"""
return executeFindOne(filter, options, documentClass);
} | java | public DocumentT findOne(final Bson filter, final RemoteFindOptions options) {
return executeFindOne(filter, options, documentClass);
} | [
"public",
"DocumentT",
"findOne",
"(",
"final",
"Bson",
"filter",
",",
"final",
"RemoteFindOptions",
"options",
")",
"{",
"return",
"executeFindOne",
"(",
"filter",
",",
"options",
",",
"documentClass",
")",
";",
"}"
] | Finds a document in the collection.
@param filter the query filter
@param options A RemoteFindOptions struct
@return the resulting document | [
"Finds",
"a",
"document",
"in",
"the",
"collection",
"."
] | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/internal/CoreRemoteMongoCollectionImpl.java#L217-L219 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/model/BucketReplicationConfiguration.java | BucketReplicationConfiguration.setRules | public void setRules(Map<String, ReplicationRule> rules) {
"""
Sets the replication rules for the Amazon S3 bucket.
@param rules
the replication rules for the Amazon S3 bucket.
@throws IllegalArgumentException
if the rules are null.
"""
if (rules == null) {
throw new IllegalArgumentEx... | java | public void setRules(Map<String, ReplicationRule> rules) {
if (rules == null) {
throw new IllegalArgumentException(
"Replication rules cannot be null");
}
this.rules = new HashMap<String, ReplicationRule>(rules);
} | [
"public",
"void",
"setRules",
"(",
"Map",
"<",
"String",
",",
"ReplicationRule",
">",
"rules",
")",
"{",
"if",
"(",
"rules",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Replication rules cannot be null\"",
")",
";",
"}",
"this",... | Sets the replication rules for the Amazon S3 bucket.
@param rules
the replication rules for the Amazon S3 bucket.
@throws IllegalArgumentException
if the rules are null. | [
"Sets",
"the",
"replication",
"rules",
"for",
"the",
"Amazon",
"S3",
"bucket",
"."
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/model/BucketReplicationConfiguration.java#L93-L99 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.waitForView | public boolean waitForView(Object tag, int minimumNumberOfMatches, int timeout) {
"""
Waits for a View matching the specified tag.
@param tag the {@link View#getTag() tag} of the {@link View} to wait for
@param minimumNumberOfMatches the minimum number of matches that are expected to be found. {@code 0} means ... | java | public boolean waitForView(Object tag, int minimumNumberOfMatches, int timeout){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+tag+", "+minimumNumberOfMatches+", "+timeout+")");
}
return waitForView(tag, minimumNumberOfMatches, timeout, true);
} | [
"public",
"boolean",
"waitForView",
"(",
"Object",
"tag",
",",
"int",
"minimumNumberOfMatches",
",",
"int",
"timeout",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"waitForVi... | Waits for a View matching the specified tag.
@param tag the {@link View#getTag() tag} of the {@link View} to wait for
@param minimumNumberOfMatches the minimum number of matches that are expected to be found. {@code 0} means any number of matches
@param timeout the amount of time in milliseconds to wait
@return {@code... | [
"Waits",
"for",
"a",
"View",
"matching",
"the",
"specified",
"tag",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L523-L529 |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/authorization/impl/AccessDeniedHandlerImpl.java | AccessDeniedHandlerImpl.handle | @Override
public void handle(RequestContext context, AccessDeniedException e) throws SecurityProviderException, IOException {
"""
Forwards to the error page, but if not error page was specified, a 403 error is sent.
@param context the request context
@param e the exception with the reason of the acce... | java | @Override
public void handle(RequestContext context, AccessDeniedException e) throws SecurityProviderException, IOException {
saveException(context, e);
if (StringUtils.isNotEmpty(getErrorPageUrl())) {
forwardToErrorPage(context);
} else {
sendError(e, context);
... | [
"@",
"Override",
"public",
"void",
"handle",
"(",
"RequestContext",
"context",
",",
"AccessDeniedException",
"e",
")",
"throws",
"SecurityProviderException",
",",
"IOException",
"{",
"saveException",
"(",
"context",
",",
"e",
")",
";",
"if",
"(",
"StringUtils",
... | Forwards to the error page, but if not error page was specified, a 403 error is sent.
@param context the request context
@param e the exception with the reason of the access deny | [
"Forwards",
"to",
"the",
"error",
"page",
"but",
"if",
"not",
"error",
"page",
"was",
"specified",
"a",
"403",
"error",
"is",
"sent",
"."
] | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/authorization/impl/AccessDeniedHandlerImpl.java#L67-L76 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/UriBuilder.java | UriBuilder.setPath | public UriBuilder setPath(final String str) {
"""
Sets the path part of the URI.
@param str the path part of the URI
@return a reference to the builder
"""
final String[] parts;
if (str.startsWith("/")) {
parts = new String[]{str};
} else {
final String base ... | java | public UriBuilder setPath(final String str) {
final String[] parts;
if (str.startsWith("/")) {
parts = new String[]{str};
} else {
final String base = getPath().toString();
parts = new String[]{base, base.endsWith("/") ? "" : "/", str};
}
retu... | [
"public",
"UriBuilder",
"setPath",
"(",
"final",
"String",
"str",
")",
"{",
"final",
"String",
"[",
"]",
"parts",
";",
"if",
"(",
"str",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
"parts",
"=",
"new",
"String",
"[",
"]",
"{",
"str",
"}",
";",
... | Sets the path part of the URI.
@param str the path part of the URI
@return a reference to the builder | [
"Sets",
"the",
"path",
"part",
"of",
"the",
"URI",
"."
] | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/UriBuilder.java#L167-L177 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.eligibility_streets_GET | public ArrayList<OvhStreet> eligibility_streets_GET(String inseeCode, String partialName) throws IOException {
"""
Get the streets from a city inseeCode and partial street name
REST: GET /xdsl/eligibility/streets
@param inseeCode [required] The inseeCode of the city
@param partialName [required] The partial n... | java | public ArrayList<OvhStreet> eligibility_streets_GET(String inseeCode, String partialName) throws IOException {
String qPath = "/xdsl/eligibility/streets";
StringBuilder sb = path(qPath);
query(sb, "inseeCode", inseeCode);
query(sb, "partialName", partialName);
String resp = exec(qPath, "GET", sb.toString(), n... | [
"public",
"ArrayList",
"<",
"OvhStreet",
">",
"eligibility_streets_GET",
"(",
"String",
"inseeCode",
",",
"String",
"partialName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/eligibility/streets\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(... | Get the streets from a city inseeCode and partial street name
REST: GET /xdsl/eligibility/streets
@param inseeCode [required] The inseeCode of the city
@param partialName [required] The partial name to match against the name of the street
@deprecated | [
"Get",
"the",
"streets",
"from",
"a",
"city",
"inseeCode",
"and",
"partial",
"street",
"name"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L304-L311 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/PerlinNoise.java | PerlinNoise.Noise | private double Noise(int x, int y) {
"""
Ordinary noise function.
@param x X Value.
@param y Y Value.
@return
"""
int n = x + y * 57;
n = (n << 13) ^ n;
return (1.0 - ((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0);
} | java | private double Noise(int x, int y) {
int n = x + y * 57;
n = (n << 13) ^ n;
return (1.0 - ((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0);
} | [
"private",
"double",
"Noise",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"n",
"=",
"x",
"+",
"y",
"*",
"57",
";",
"n",
"=",
"(",
"n",
"<<",
"13",
")",
"^",
"n",
";",
"return",
"(",
"1.0",
"-",
"(",
"(",
"n",
"*",
"(",
"n",
"*",
... | Ordinary noise function.
@param x X Value.
@param y Y Value.
@return | [
"Ordinary",
"noise",
"function",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/PerlinNoise.java#L204-L209 |
apache/groovy | subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java | DateTimeExtensions.plus | public static Month plus(final Month self, int months) {
"""
Returns the {@link java.time.Month} that is {@code months} months after this month.
@param self a Month
@param months the number of months move forward
@return the Month
@since 2.5.0
"""
int monthsPerYear = Month.values().length;
... | java | public static Month plus(final Month self, int months) {
int monthsPerYear = Month.values().length;
int val = ((self.getValue() + months - 1) % monthsPerYear) + 1;
return Month.of(val > 0 ? val : monthsPerYear + val);
} | [
"public",
"static",
"Month",
"plus",
"(",
"final",
"Month",
"self",
",",
"int",
"months",
")",
"{",
"int",
"monthsPerYear",
"=",
"Month",
".",
"values",
"(",
")",
".",
"length",
";",
"int",
"val",
"=",
"(",
"(",
"self",
".",
"getValue",
"(",
")",
"... | Returns the {@link java.time.Month} that is {@code months} months after this month.
@param self a Month
@param months the number of months move forward
@return the Month
@since 2.5.0 | [
"Returns",
"the",
"{",
"@link",
"java",
".",
"time",
".",
"Month",
"}",
"that",
"is",
"{",
"@code",
"months",
"}",
"months",
"after",
"this",
"month",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java#L2029-L2033 |
janus-project/guava.janusproject.io | guava/src/com/google/common/collect/Multisets.java | Multisets.removeOccurrences | public static boolean removeOccurrences(
Multiset<?> multisetToModify, Iterable<?> occurrencesToRemove) {
"""
For each occurrence of an element {@code e} in {@code occurrencesToRemove},
removes one occurrence of {@code e} in {@code multisetToModify}.
<p>Equivalently, this method modifies {@code multisetT... | java | public static boolean removeOccurrences(
Multiset<?> multisetToModify, Iterable<?> occurrencesToRemove) {
if (occurrencesToRemove instanceof Multiset) {
return removeOccurrencesImpl(
multisetToModify, (Multiset<?>) occurrencesToRemove);
} else {
return removeOccurrencesImpl(multisetT... | [
"public",
"static",
"boolean",
"removeOccurrences",
"(",
"Multiset",
"<",
"?",
">",
"multisetToModify",
",",
"Iterable",
"<",
"?",
">",
"occurrencesToRemove",
")",
"{",
"if",
"(",
"occurrencesToRemove",
"instanceof",
"Multiset",
")",
"{",
"return",
"removeOccurren... | For each occurrence of an element {@code e} in {@code occurrencesToRemove},
removes one occurrence of {@code e} in {@code multisetToModify}.
<p>Equivalently, this method modifies {@code multisetToModify} so that
{@code multisetToModify.count(e)} is set to
{@code Math.max(0, multisetToModify.count(e) -
occurrencesToRem... | [
"For",
"each",
"occurrence",
"of",
"an",
"element",
"{",
"@code",
"e",
"}",
"in",
"{",
"@code",
"occurrencesToRemove",
"}",
"removes",
"one",
"occurrence",
"of",
"{",
"@code",
"e",
"}",
"in",
"{",
"@code",
"multisetToModify",
"}",
"."
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/collect/Multisets.java#L729-L737 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/ConversionSchemas.java | ConversionSchemas.v1Builder | public static Builder v1Builder(String name) {
"""
A ConversionSchema builder that defaults to building {@link #V1}.
"""
return new Builder(name, V1MarshallerSet.marshallers(), V1MarshallerSet.setMarshallers(),
StandardUnmarshallerSet.unmarshallers(),
... | java | public static Builder v1Builder(String name) {
return new Builder(name, V1MarshallerSet.marshallers(), V1MarshallerSet.setMarshallers(),
StandardUnmarshallerSet.unmarshallers(),
StandardUnmarshallerSet.setUnmarshallers());
} | [
"public",
"static",
"Builder",
"v1Builder",
"(",
"String",
"name",
")",
"{",
"return",
"new",
"Builder",
"(",
"name",
",",
"V1MarshallerSet",
".",
"marshallers",
"(",
")",
",",
"V1MarshallerSet",
".",
"setMarshallers",
"(",
")",
",",
"StandardUnmarshallerSet",
... | A ConversionSchema builder that defaults to building {@link #V1}. | [
"A",
"ConversionSchema",
"builder",
"that",
"defaults",
"to",
"building",
"{"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/ConversionSchemas.java#L156-L160 |
jglobus/JGlobus | axis/src/main/java/org/globus/axis/transport/HTTPUtils.java | HTTPUtils.setDisableChunking | public static void setDisableChunking(Stub stub, boolean disable) {
"""
Sets on option on the stub to use to disable chunking
(only if used with HTTP 1.1).
@param stub The stub to set the property on
@param disable If true, chunking will be disabled. Otherwise chunking
will be performed (if HTTP 1.1 will be ... | java | public static void setDisableChunking(Stub stub, boolean disable) {
stub._setProperty(DISABLE_CHUNKING,
(disable)
? Boolean.TRUE
: Boolean.FALSE);
Hashtable headers = getRequestHeaders(stub);
headers.put(HTTPConstants.... | [
"public",
"static",
"void",
"setDisableChunking",
"(",
"Stub",
"stub",
",",
"boolean",
"disable",
")",
"{",
"stub",
".",
"_setProperty",
"(",
"DISABLE_CHUNKING",
",",
"(",
"disable",
")",
"?",
"Boolean",
".",
"TRUE",
":",
"Boolean",
".",
"FALSE",
")",
";",... | Sets on option on the stub to use to disable chunking
(only if used with HTTP 1.1).
@param stub The stub to set the property on
@param disable If true, chunking will be disabled. Otherwise chunking
will be performed (if HTTP 1.1 will be used). | [
"Sets",
"on",
"option",
"on",
"the",
"stub",
"to",
"use",
"to",
"disable",
"chunking",
"(",
"only",
"if",
"used",
"with",
"HTTP",
"1",
".",
"1",
")",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/axis/src/main/java/org/globus/axis/transport/HTTPUtils.java#L108-L116 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.computePnPwithEPnP | public static Estimate1ofPnP computePnPwithEPnP(int numIterations, double magicNumber) {
"""
Returns a solution to the PnP problem for 4 or more points using EPnP. Fast and fairly
accurate algorithm. Can handle general and planar scenario automatically.
<p>NOTE: Observations are in normalized image coordinate... | java | public static Estimate1ofPnP computePnPwithEPnP(int numIterations, double magicNumber) {
PnPLepetitEPnP alg = new PnPLepetitEPnP(magicNumber);
alg.setNumIterations(numIterations);
return new WrapPnPLepetitEPnP(alg);
} | [
"public",
"static",
"Estimate1ofPnP",
"computePnPwithEPnP",
"(",
"int",
"numIterations",
",",
"double",
"magicNumber",
")",
"{",
"PnPLepetitEPnP",
"alg",
"=",
"new",
"PnPLepetitEPnP",
"(",
"magicNumber",
")",
";",
"alg",
".",
"setNumIterations",
"(",
"numIterations"... | Returns a solution to the PnP problem for 4 or more points using EPnP. Fast and fairly
accurate algorithm. Can handle general and planar scenario automatically.
<p>NOTE: Observations are in normalized image coordinates NOT pixels.</p>
@see PnPLepetitEPnP
@param numIterations If more then zero then non-linear optimi... | [
"Returns",
"a",
"solution",
"to",
"the",
"PnP",
"problem",
"for",
"4",
"or",
"more",
"points",
"using",
"EPnP",
".",
"Fast",
"and",
"fairly",
"accurate",
"algorithm",
".",
"Can",
"handle",
"general",
"and",
"planar",
"scenario",
"automatically",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L511-L515 |
tuenti/ButtonMenu | sample/src/main/java/com/tuenti/buttonmenu/sample/ui/activity/MainActivity.java | MainActivity.initializeScrollAnimator | private void initializeScrollAnimator() {
"""
Initialize ScrollAnimator to work with ButtonMenu custom view, the ListView used in this sample and an
animation duration of 200 milliseconds.
"""
ScrollAnimator scrollAnimator = new ScrollAnimator(button_menu, new ObjectAnimatorFactory());
scrollAnimator.conf... | java | private void initializeScrollAnimator() {
ScrollAnimator scrollAnimator = new ScrollAnimator(button_menu, new ObjectAnimatorFactory());
scrollAnimator.configureListView(lv_contacts);
scrollAnimator.setDurationInMillis(300);
} | [
"private",
"void",
"initializeScrollAnimator",
"(",
")",
"{",
"ScrollAnimator",
"scrollAnimator",
"=",
"new",
"ScrollAnimator",
"(",
"button_menu",
",",
"new",
"ObjectAnimatorFactory",
"(",
")",
")",
";",
"scrollAnimator",
".",
"configureListView",
"(",
"lv_contacts",... | Initialize ScrollAnimator to work with ButtonMenu custom view, the ListView used in this sample and an
animation duration of 200 milliseconds. | [
"Initialize",
"ScrollAnimator",
"to",
"work",
"with",
"ButtonMenu",
"custom",
"view",
"the",
"ListView",
"used",
"in",
"this",
"sample",
"and",
"an",
"animation",
"duration",
"of",
"200",
"milliseconds",
"."
] | train | https://github.com/tuenti/ButtonMenu/blob/95791383f6f976933496542b54e8c6dbdd73e669/sample/src/main/java/com/tuenti/buttonmenu/sample/ui/activity/MainActivity.java#L105-L109 |
js-lib-com/commons | src/main/java/js/util/Params.java | Params.notEmpty | public static void notEmpty(String parameter, String name) throws IllegalArgumentException {
"""
Test if string parameter is strict not empty. If parameter to test is null this test method does not rise exception.
@param parameter invocation string parameter,
@param name the name of invocation parameter.
@thr... | java | public static void notEmpty(String parameter, String name) throws IllegalArgumentException {
if (parameter != null && parameter.isEmpty()) {
throw new IllegalArgumentException(name + " is empty.");
}
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"String",
"parameter",
",",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"parameter",
"!=",
"null",
"&&",
"parameter",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalAr... | Test if string parameter is strict not empty. If parameter to test is null this test method does not rise exception.
@param parameter invocation string parameter,
@param name the name of invocation parameter.
@throws IllegalArgumentException if <code>parameter</code> is empty. | [
"Test",
"if",
"string",
"parameter",
"is",
"strict",
"not",
"empty",
".",
"If",
"parameter",
"to",
"test",
"is",
"null",
"this",
"test",
"method",
"does",
"not",
"rise",
"exception",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L81-L85 |
microfocus-idol/java-configuration-impl | src/main/java/com/hp/autonomy/frontend/configuration/AbstractConfig.java | AbstractConfig.getValidationMap | @Override
@JsonIgnore
public Map<String, OptionalConfigurationComponent<?>> getValidationMap() {
"""
/*
Uses reflection so as to reduce the number of places the names must be typed in by hand
"""
// Use getDeclaredFields as the fields will probably be private
final Field[] fields = get... | java | @Override
@JsonIgnore
public Map<String, OptionalConfigurationComponent<?>> getValidationMap() {
// Use getDeclaredFields as the fields will probably be private
final Field[] fields = getClass().getDeclaredFields();
final Map<String, OptionalConfigurationComponent<?>> result = new HashMa... | [
"@",
"Override",
"@",
"JsonIgnore",
"public",
"Map",
"<",
"String",
",",
"OptionalConfigurationComponent",
"<",
"?",
">",
">",
"getValidationMap",
"(",
")",
"{",
"// Use getDeclaredFields as the fields will probably be private",
"final",
"Field",
"[",
"]",
"fields",
"... | /*
Uses reflection so as to reduce the number of places the names must be typed in by hand | [
"/",
"*",
"Uses",
"reflection",
"so",
"as",
"to",
"reduce",
"the",
"number",
"of",
"places",
"the",
"names",
"must",
"be",
"typed",
"in",
"by",
"hand"
] | train | https://github.com/microfocus-idol/java-configuration-impl/blob/cd9d744cacfaaae3c76cacc211e65742bbc7b00a/src/main/java/com/hp/autonomy/frontend/configuration/AbstractConfig.java#L29-L66 |
BioPAX/Paxtools | sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/L3ToSBGNPDConverter.java | L3ToSBGNPDConverter.handlePEGroup | private Glyph handlePEGroup(Set<PhysicalEntity> pes, String context) {
"""
/*
Prepares the necessary construct for adding the given PhysicalEntity set to the Control
being drawn.
@param pes entities to use in control
@return the glyph to connect to the appropriate place
"""
int sz = pes.size();
if ... | java | private Glyph handlePEGroup(Set<PhysicalEntity> pes, String context) {
int sz = pes.size();
if (sz > 1) {
List<Glyph> gs = getGlyphsOfPEs(pes, context);
return connectWithAND(gs);
} else if (sz == 1) {
PhysicalEntity pe = pes.iterator().next();
if(glyphMap.containsKey(convertID(pe.getUri())))
re... | [
"private",
"Glyph",
"handlePEGroup",
"(",
"Set",
"<",
"PhysicalEntity",
">",
"pes",
",",
"String",
"context",
")",
"{",
"int",
"sz",
"=",
"pes",
".",
"size",
"(",
")",
";",
"if",
"(",
"sz",
">",
"1",
")",
"{",
"List",
"<",
"Glyph",
">",
"gs",
"="... | /*
Prepares the necessary construct for adding the given PhysicalEntity set to the Control
being drawn.
@param pes entities to use in control
@return the glyph to connect to the appropriate place | [
"/",
"*",
"Prepares",
"the",
"necessary",
"construct",
"for",
"adding",
"the",
"given",
"PhysicalEntity",
"set",
"to",
"the",
"Control",
"being",
"drawn",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/L3ToSBGNPDConverter.java#L1136-L1149 |
trellis-ldp/trellis | core/http/src/main/java/org/trellisldp/http/impl/MutatingLdpHandler.java | MutatingLdpHandler.checkConstraint | protected void checkConstraint(final Optional<Graph> graph, final IRI type, final RDFSyntax syntax) {
"""
Check the constraints of a graph.
@param graph the graph
@param type the LDP interaction model
@param syntax the output syntax
"""
graph.ifPresent(g -> {
final List<ConstraintViolati... | java | protected void checkConstraint(final Optional<Graph> graph, final IRI type, final RDFSyntax syntax) {
graph.ifPresent(g -> {
final List<ConstraintViolation> violations = constraintServices.stream().parallel()
.flatMap(svc -> svc.constrainedBy(type, g)).collect(toList());
... | [
"protected",
"void",
"checkConstraint",
"(",
"final",
"Optional",
"<",
"Graph",
">",
"graph",
",",
"final",
"IRI",
"type",
",",
"final",
"RDFSyntax",
"syntax",
")",
"{",
"graph",
".",
"ifPresent",
"(",
"g",
"->",
"{",
"final",
"List",
"<",
"ConstraintViola... | Check the constraints of a graph.
@param graph the graph
@param type the LDP interaction model
@param syntax the output syntax | [
"Check",
"the",
"constraints",
"of",
"a",
"graph",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/impl/MutatingLdpHandler.java#L229-L246 |
Erudika/para | para-server/src/main/java/com/erudika/para/security/CachedCsrfTokenRepository.java | CachedCsrfTokenRepository.saveToken | public void saveToken(CsrfToken t, HttpServletRequest request, HttpServletResponse response) {
"""
Saves a CSRF token in cache.
@param t (ignored)
@param request HTTP request
@param response HTTP response
"""
String ident = getIdentifierFromCookie(request);
if (ident != null) {
String key = ident.con... | java | public void saveToken(CsrfToken t, HttpServletRequest request, HttpServletResponse response) {
String ident = getIdentifierFromCookie(request);
if (ident != null) {
String key = ident.concat(parameterName);
CsrfToken token = loadToken(request);
if (token == null) {
token = generateToken(null);
if (... | [
"public",
"void",
"saveToken",
"(",
"CsrfToken",
"t",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"String",
"ident",
"=",
"getIdentifierFromCookie",
"(",
"request",
")",
";",
"if",
"(",
"ident",
"!=",
"null",
")",
"{... | Saves a CSRF token in cache.
@param t (ignored)
@param request HTTP request
@param response HTTP response | [
"Saves",
"a",
"CSRF",
"token",
"in",
"cache",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/security/CachedCsrfTokenRepository.java#L76-L91 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CouponSetUrl.java | CouponSetUrl.updateCouponSetUrl | public static MozuUrl updateCouponSetUrl(String couponSetCode, String responseFields) {
"""
Get Resource Url for UpdateCouponSet
@param couponSetCode The unique identifier of the coupon set.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside ... | java | public static MozuUrl updateCouponSetUrl(String couponSetCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/couponsets/{couponSetCode}?responseFields={responseFields}");
formatter.formatUrl("couponSetCode", couponSetCode);
formatter.formatUrl("responseFields... | [
"public",
"static",
"MozuUrl",
"updateCouponSetUrl",
"(",
"String",
"couponSetCode",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/couponsets/{couponSetCode}?responseFields={responseFields}\... | Get Resource Url for UpdateCouponSet
@param couponSetCode The unique identifier of the coupon set.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using... | [
"Get",
"Resource",
"Url",
"for",
"UpdateCouponSet"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CouponSetUrl.java#L96-L102 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/CSTransformer.java | CSTransformer.transformInfoTopic | protected static InfoTopic transformInfoTopic(final CSNodeWrapper parentNode, final CSInfoNodeWrapper node) {
"""
Transform a Topic CSNode entity object into an InfoTopic Object that can be added to a Content Specification.
@param node The CSNode entity object to be transformed.
@return The tr... | java | protected static InfoTopic transformInfoTopic(final CSNodeWrapper parentNode, final CSInfoNodeWrapper node) {
final InfoTopic infoTopic = new InfoTopic(node.getTopicId(), null);
// Basic data
infoTopic.setRevision(node.getTopicRevision());
infoTopic.setConditionStatement(node.getConditi... | [
"protected",
"static",
"InfoTopic",
"transformInfoTopic",
"(",
"final",
"CSNodeWrapper",
"parentNode",
",",
"final",
"CSInfoNodeWrapper",
"node",
")",
"{",
"final",
"InfoTopic",
"infoTopic",
"=",
"new",
"InfoTopic",
"(",
"node",
".",
"getTopicId",
"(",
")",
",",
... | Transform a Topic CSNode entity object into an InfoTopic Object that can be added to a Content Specification.
@param node The CSNode entity object to be transformed.
@return The transformed InfoTopic entity. | [
"Transform",
"a",
"Topic",
"CSNode",
"entity",
"object",
"into",
"an",
"InfoTopic",
"Object",
"that",
"can",
"be",
"added",
"to",
"a",
"Content",
"Specification",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/CSTransformer.java#L518-L527 |
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/Main.java | Main.extractFromJar | private static File extractFromJar(String resource, String fileName, String suffix)
throws IOException {
"""
Extract a resource from jar, mark it for deletion upon exit, and return its location.
"""
final URL res = Main.class.getResource(resource);
// put this jar in a file system so that we can lo... | java | private static File extractFromJar(String resource, String fileName, String suffix)
throws IOException {
final URL res = Main.class.getResource(resource);
// put this jar in a file system so that we can load jars from there
final File tmp;
try {
tmp = File.createTempFile(fileName, suffix);
} ca... | [
"private",
"static",
"File",
"extractFromJar",
"(",
"String",
"resource",
",",
"String",
"fileName",
",",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"final",
"URL",
"res",
"=",
"Main",
".",
"class",
".",
"getResource",
"(",
"resource",
")",
";",
... | Extract a resource from jar, mark it for deletion upon exit, and return its location. | [
"Extract",
"a",
"resource",
"from",
"jar",
"mark",
"it",
"for",
"deletion",
"upon",
"exit",
"and",
"return",
"its",
"location",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/Main.java#L256-L282 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/IterableOfProtosSubject.java | IterableOfProtosSubject.withPartialScope | public IterableOfProtosFluentAssertion<M> withPartialScope(FieldScope fieldScope) {
"""
Limits the comparison of Protocol buffers to the defined {@link FieldScope}.
<p>This method is additive and has well-defined ordering semantics. If the invoking {@link
ProtoFluentAssertion} is already scoped to a {@link Fie... | java | public IterableOfProtosFluentAssertion<M> withPartialScope(FieldScope fieldScope) {
return usingConfig(config.withPartialScope(checkNotNull(fieldScope, "fieldScope")));
} | [
"public",
"IterableOfProtosFluentAssertion",
"<",
"M",
">",
"withPartialScope",
"(",
"FieldScope",
"fieldScope",
")",
"{",
"return",
"usingConfig",
"(",
"config",
".",
"withPartialScope",
"(",
"checkNotNull",
"(",
"fieldScope",
",",
"\"fieldScope\"",
")",
")",
")",
... | Limits the comparison of Protocol buffers to the defined {@link FieldScope}.
<p>This method is additive and has well-defined ordering semantics. If the invoking {@link
ProtoFluentAssertion} is already scoped to a {@link FieldScope} {@code X}, and this method is
invoked with {@link FieldScope} {@code Y}, the resultant ... | [
"Limits",
"the",
"comparison",
"of",
"Protocol",
"buffers",
"to",
"the",
"defined",
"{",
"@link",
"FieldScope",
"}",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/IterableOfProtosSubject.java#L878-L880 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.startUploadFileSingle | public Uploader startUploadFileSingle(String targetPath, DbxWriteMode writeMode, long numBytes)
throws DbxException {
"""
Similar to {@link #uploadFile}, except always uses the /files_put API call.
One difference is that {@code numBytes} must not be negative.
"""
DbxPathV1.checkArg("targetPath... | java | public Uploader startUploadFileSingle(String targetPath, DbxWriteMode writeMode, long numBytes)
throws DbxException
{
DbxPathV1.checkArg("targetPath", targetPath);
if (numBytes < 0) throw new IllegalArgumentException("numBytes must be zero or greater");
String host = this.host.getCo... | [
"public",
"Uploader",
"startUploadFileSingle",
"(",
"String",
"targetPath",
",",
"DbxWriteMode",
"writeMode",
",",
"long",
"numBytes",
")",
"throws",
"DbxException",
"{",
"DbxPathV1",
".",
"checkArg",
"(",
"\"targetPath\"",
",",
"targetPath",
")",
";",
"if",
"(",
... | Similar to {@link #uploadFile}, except always uses the /files_put API call.
One difference is that {@code numBytes} must not be negative. | [
"Similar",
"to",
"{"
] | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L736-L752 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/buff/BaseBuffer.java | BaseBuffer.bufferToFields | public int bufferToFields(FieldList record, int iFieldsTypes, boolean bDisplayOption, int iMoveMode) {
"""
Move the output buffer to all the fields.
This is the same as the bufferToFields method, specifying the fieldTypes to move.
@param record The target record.
@param iFieldTypes The field types to move.
@pa... | java | public int bufferToFields(FieldList record, int iFieldsTypes, boolean bDisplayOption, int iMoveMode)
{
m_iFieldsTypes = iFieldsTypes;
return this.bufferToFields(record, bDisplayOption, iMoveMode);
} | [
"public",
"int",
"bufferToFields",
"(",
"FieldList",
"record",
",",
"int",
"iFieldsTypes",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"m_iFieldsTypes",
"=",
"iFieldsTypes",
";",
"return",
"this",
".",
"bufferToFields",
"(",
"record",
",... | Move the output buffer to all the fields.
This is the same as the bufferToFields method, specifying the fieldTypes to move.
@param record The target record.
@param iFieldTypes The field types to move.
@param bDisplayOption The display option for the movetofield call.
@param iMoveMove The move mode for the movetofield c... | [
"Move",
"the",
"output",
"buffer",
"to",
"all",
"the",
"fields",
".",
"This",
"is",
"the",
"same",
"as",
"the",
"bufferToFields",
"method",
"specifying",
"the",
"fieldTypes",
"to",
"move",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/buff/BaseBuffer.java#L198-L202 |
rzwitserloot/lombok | src/utils/lombok/javac/Javac.java | Javac.calculateGuess | public static Object calculateGuess(JCExpression expr) {
"""
Turns an expression into a guessed intended literal. Only works for
literals, as you can imagine.
Will for example turn a TrueLiteral into 'Boolean.valueOf(true)'.
"""
if (expr instanceof JCLiteral) {
JCLiteral lit = (JCLiteral) expr;
if ... | java | public static Object calculateGuess(JCExpression expr) {
if (expr instanceof JCLiteral) {
JCLiteral lit = (JCLiteral) expr;
if (lit.getKind() == com.sun.source.tree.Tree.Kind.BOOLEAN_LITERAL) {
return ((Number) lit.value).intValue() == 0 ? false : true;
}
return lit.value;
}
if (expr instanceof... | [
"public",
"static",
"Object",
"calculateGuess",
"(",
"JCExpression",
"expr",
")",
"{",
"if",
"(",
"expr",
"instanceof",
"JCLiteral",
")",
"{",
"JCLiteral",
"lit",
"=",
"(",
"JCLiteral",
")",
"expr",
";",
"if",
"(",
"lit",
".",
"getKind",
"(",
")",
"==",
... | Turns an expression into a guessed intended literal. Only works for
literals, as you can imagine.
Will for example turn a TrueLiteral into 'Boolean.valueOf(true)'. | [
"Turns",
"an",
"expression",
"into",
"a",
"guessed",
"intended",
"literal",
".",
"Only",
"works",
"for",
"literals",
"as",
"you",
"can",
"imagine",
"."
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/utils/lombok/javac/Javac.java#L148-L166 |
aws/aws-sdk-java | aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/message/Utils.java | Utils.confirmSubscription | static ConfirmSubscriptionResult confirmSubscription(HttpClient httpClient, String subscribeUrl) {
"""
Confirms a subscription by visiting the provided URL.
@param httpClient Client to use to visit URL.
@param subscribeUrl Confirmation URL.
@return Result of subscription confirmation.
"""
try {
... | java | static ConfirmSubscriptionResult confirmSubscription(HttpClient httpClient, String subscribeUrl) {
try {
HttpGet request = new HttpGet(subscribeUrl);
HttpResponse response = httpClient.execute(request);
if (ApacheUtils.isRequestSuccessful(response)) {
return n... | [
"static",
"ConfirmSubscriptionResult",
"confirmSubscription",
"(",
"HttpClient",
"httpClient",
",",
"String",
"subscribeUrl",
")",
"{",
"try",
"{",
"HttpGet",
"request",
"=",
"new",
"HttpGet",
"(",
"subscribeUrl",
")",
";",
"HttpResponse",
"response",
"=",
"httpClie... | Confirms a subscription by visiting the provided URL.
@param httpClient Client to use to visit URL.
@param subscribeUrl Confirmation URL.
@return Result of subscription confirmation. | [
"Confirms",
"a",
"subscription",
"by",
"visiting",
"the",
"provided",
"URL",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/message/Utils.java#L54-L67 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Gabor.java | Gabor.Function2D | public static ComplexNumber Function2D(int x, int y, double wavelength, double orientation, double phaseOffset, double gaussVariance, double aspectRatio) {
"""
2-D Complex Gabor function.
@param x X axis coordinate.
@param y Y axis coordinate.
@param wavelength Wavelength.
@param o... | java | public static ComplexNumber Function2D(int x, int y, double wavelength, double orientation, double phaseOffset, double gaussVariance, double aspectRatio) {
double X = x * Math.cos(orientation) + y * Math.sin(orientation);
double Y = -x * Math.sin(orientation) + y * Math.cos(orientation);
doubl... | [
"public",
"static",
"ComplexNumber",
"Function2D",
"(",
"int",
"x",
",",
"int",
"y",
",",
"double",
"wavelength",
",",
"double",
"orientation",
",",
"double",
"phaseOffset",
",",
"double",
"gaussVariance",
",",
"double",
"aspectRatio",
")",
"{",
"double",
"X",... | 2-D Complex Gabor function.
@param x X axis coordinate.
@param y Y axis coordinate.
@param wavelength Wavelength.
@param orientation Orientation.
@param phaseOffset Phase offset.
@param gaussVariance Gaussian variance.
@param aspectRatio Aspect ratio.
@return Gabor response. | [
"2",
"-",
"D",
"Complex",
"Gabor",
"function",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Gabor.java#L96-L106 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/graph/DirectedGraph.java | DirectedGraph.setEdge | public void setEdge(Object vertex1, Object vertex2, Weight weight) {
"""
Set the edge between two vertices. If the two given vertices don't exist,
nothing happens. A <code>null</code> <code>weight</code> unsets the
edge.
@param vertex1
a vertex.
@param vertex2
a vertex.
@param weight
the value of the edg... | java | public void setEdge(Object vertex1, Object vertex2, Weight weight) {
VertexMetadata vm1 = (VertexMetadata) vertices.get(vertex1);
VertexMetadata vm2 = (VertexMetadata) vertices.get(vertex2);
if (vm1 == null || vm2 == null) {
return;
}
int index1 = vm1.index;
i... | [
"public",
"void",
"setEdge",
"(",
"Object",
"vertex1",
",",
"Object",
"vertex2",
",",
"Weight",
"weight",
")",
"{",
"VertexMetadata",
"vm1",
"=",
"(",
"VertexMetadata",
")",
"vertices",
".",
"get",
"(",
"vertex1",
")",
";",
"VertexMetadata",
"vm2",
"=",
"(... | Set the edge between two vertices. If the two given vertices don't exist,
nothing happens. A <code>null</code> <code>weight</code> unsets the
edge.
@param vertex1
a vertex.
@param vertex2
a vertex.
@param weight
the value of the edge. | [
"Set",
"the",
"edge",
"between",
"two",
"vertices",
".",
"If",
"the",
"two",
"given",
"vertices",
"don",
"t",
"exist",
"nothing",
"happens",
".",
"A",
"<code",
">",
"null<",
"/",
"code",
">",
"<code",
">",
"weight<",
"/",
"code",
">",
"unsets",
"the",
... | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/graph/DirectedGraph.java#L246-L262 |
Syncleus/aparapi | src/main/java/com/aparapi/Range.java | Range.create3D | public static Range create3D(Device _device, int _globalWidth, int _globalHeight, int _globalDepth, int _localWidth,
int _localHeight, int _localDepth) {
"""
Create a two dimensional range <code>0.._globalWidth * 0.._globalHeight *0../_globalDepth</code>
in groups defined by <code>localWidth</code> * <c... | java | public static Range create3D(Device _device, int _globalWidth, int _globalHeight, int _globalDepth, int _localWidth,
int _localHeight, int _localDepth) {
final Range range = new Range(_device, 3);
range.setGlobalSize_0(_globalWidth);
range.setLocalSize_0(_localWidth);
range.setGlobalSi... | [
"public",
"static",
"Range",
"create3D",
"(",
"Device",
"_device",
",",
"int",
"_globalWidth",
",",
"int",
"_globalHeight",
",",
"int",
"_globalDepth",
",",
"int",
"_localWidth",
",",
"int",
"_localHeight",
",",
"int",
"_localDepth",
")",
"{",
"final",
"Range"... | Create a two dimensional range <code>0.._globalWidth * 0.._globalHeight *0../_globalDepth</code>
in groups defined by <code>localWidth</code> * <code>localHeight</code> * <code>localDepth</code>.
<p>
Note that for this range to be valid <code>_globalWidth > 0 && _globalHeight >0 _globalDepth >0 && _localWidth>0 && _... | [
"Create",
"a",
"two",
"dimensional",
"range",
"<code",
">",
"0",
"..",
"_globalWidth",
"*",
"0",
"..",
"_globalHeight",
"*",
"0",
"..",
"/",
"_globalDepth<",
"/",
"code",
">",
"in",
"groups",
"defined",
"by",
"<code",
">",
"localWidth<",
"/",
"code",
">"... | train | https://github.com/Syncleus/aparapi/blob/6d5892c8e69854b3968c541023de37cf4762bd24/src/main/java/com/aparapi/Range.java#L313-L333 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/buffer/factory/CudaDataBufferFactory.java | CudaDataBufferFactory.createHalf | @Override
public DataBuffer createHalf(long offset, double[] data, boolean copy) {
"""
Creates a half-precision data buffer
@param offset
@param data the data to create the buffer from
@param copy
@return the new buffer
"""
return new CudaHalfDataBuffer(data, copy, offset);
} | java | @Override
public DataBuffer createHalf(long offset, double[] data, boolean copy) {
return new CudaHalfDataBuffer(data, copy, offset);
} | [
"@",
"Override",
"public",
"DataBuffer",
"createHalf",
"(",
"long",
"offset",
",",
"double",
"[",
"]",
"data",
",",
"boolean",
"copy",
")",
"{",
"return",
"new",
"CudaHalfDataBuffer",
"(",
"data",
",",
"copy",
",",
"offset",
")",
";",
"}"
] | Creates a half-precision data buffer
@param offset
@param data the data to create the buffer from
@param copy
@return the new buffer | [
"Creates",
"a",
"half",
"-",
"precision",
"data",
"buffer"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/buffer/factory/CudaDataBufferFactory.java#L637-L640 |
google/flogger | api/src/main/java/com/google/common/flogger/util/FastStackGetter.java | FastStackGetter.getStackTraceElement | public StackTraceElement getStackTraceElement(Throwable throwable, int n) {
"""
Mimics a direct call to {@code getStackTraceElement()} on the JavaLangAccess interface without
requiring the Java runtime to directly reference the method (which may not exist on some
JVMs).
"""
try {
return (StackTrace... | java | public StackTraceElement getStackTraceElement(Throwable throwable, int n) {
try {
return (StackTraceElement) getElementMethod.invoke(javaLangAccess, throwable, n);
} catch (InvocationTargetException e) {
// The only case we should expect to see here normally is a wrapped IndexOutOfBoundsException.
... | [
"public",
"StackTraceElement",
"getStackTraceElement",
"(",
"Throwable",
"throwable",
",",
"int",
"n",
")",
"{",
"try",
"{",
"return",
"(",
"StackTraceElement",
")",
"getElementMethod",
".",
"invoke",
"(",
"javaLangAccess",
",",
"throwable",
",",
"n",
")",
";",
... | Mimics a direct call to {@code getStackTraceElement()} on the JavaLangAccess interface without
requiring the Java runtime to directly reference the method (which may not exist on some
JVMs). | [
"Mimics",
"a",
"direct",
"call",
"to",
"{"
] | train | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/util/FastStackGetter.java#L84-L101 |
samskivert/pythagoras | src/main/java/pythagoras/f/Matrix3.java | Matrix3.setToReflection | public Matrix3 setToReflection (float x, float y, float z) {
"""
Sets this to a reflection across a plane intersecting the origin with the supplied normal.
@return a reference to this matrix, for chaining.
"""
float x2 = -2f*x, y2 = -2f*y, z2 = -2f*z;
float xy2 = x2*y, xz2 = x2*z, yz2 = y2*z... | java | public Matrix3 setToReflection (float x, float y, float z) {
float x2 = -2f*x, y2 = -2f*y, z2 = -2f*z;
float xy2 = x2*y, xz2 = x2*z, yz2 = y2*z;
return set(1f + x2*x, xy2, xz2,
xy2, 1f + y2*y, yz2,
xz2, yz2, 1f + z2*z);
} | [
"public",
"Matrix3",
"setToReflection",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"float",
"x2",
"=",
"-",
"2f",
"*",
"x",
",",
"y2",
"=",
"-",
"2f",
"*",
"y",
",",
"z2",
"=",
"-",
"2f",
"*",
"z",
";",
"float",
"xy2",... | Sets this to a reflection across a plane intersecting the origin with the supplied normal.
@return a reference to this matrix, for chaining. | [
"Sets",
"this",
"to",
"a",
"reflection",
"across",
"a",
"plane",
"intersecting",
"the",
"origin",
"with",
"the",
"supplied",
"normal",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Matrix3.java#L243-L249 |
ben-manes/caffeine | simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/admission/countmin4/CountMin4.java | CountMin4.incrementAt | boolean incrementAt(int i, int j, long step) {
"""
Increments the specified counter by 1 if it is not already at the maximum value (15).
@param i the table index (16 counters)
@param j the counter to increment
@param step the increase amount
@return if incremented
"""
int offset = j << 2;
long ma... | java | boolean incrementAt(int i, int j, long step) {
int offset = j << 2;
long mask = (0xfL << offset);
if ((table[i] & mask) != mask) {
long current = (table[i] & mask) >>> offset;
long update = Math.min(current + step, 15);
table[i] = (table[i] & ~mask) | (update << offset);
return true;... | [
"boolean",
"incrementAt",
"(",
"int",
"i",
",",
"int",
"j",
",",
"long",
"step",
")",
"{",
"int",
"offset",
"=",
"j",
"<<",
"2",
";",
"long",
"mask",
"=",
"(",
"0xf",
"L",
"<<",
"offset",
")",
";",
"if",
"(",
"(",
"table",
"[",
"i",
"]",
"&",... | Increments the specified counter by 1 if it is not already at the maximum value (15).
@param i the table index (16 counters)
@param j the counter to increment
@param step the increase amount
@return if incremented | [
"Increments",
"the",
"specified",
"counter",
"by",
"1",
"if",
"it",
"is",
"not",
"already",
"at",
"the",
"maximum",
"value",
"(",
"15",
")",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/admission/countmin4/CountMin4.java#L166-L176 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusLine.java | BusLine.getBusItinerary | public BusItinerary getBusItinerary(String name, Comparator<String> nameComparator) {
"""
Replies the bus itinerary with the specified name.
@param name is the desired name
@param nameComparator is used to compare the names.
@return a bus itinerary or <code>null</code>
"""
if (name == null) {
return ... | java | public BusItinerary getBusItinerary(String name, Comparator<String> nameComparator) {
if (name == null) {
return null;
}
final Comparator<String> cmp = nameComparator == null ? BusNetworkUtilities.NAME_COMPARATOR : nameComparator;
for (final BusItinerary itinerary : this.itineraries) {
if (cmp.compare(nam... | [
"public",
"BusItinerary",
"getBusItinerary",
"(",
"String",
"name",
",",
"Comparator",
"<",
"String",
">",
"nameComparator",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"Comparator",
"<",
"String",
">",
"cmp",
... | Replies the bus itinerary with the specified name.
@param name is the desired name
@param nameComparator is used to compare the names.
@return a bus itinerary or <code>null</code> | [
"Replies",
"the",
"bus",
"itinerary",
"with",
"the",
"specified",
"name",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusLine.java#L606-L617 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcUtils.java | RpcUtils.terminateRpcService | public static void terminateRpcService(RpcService rpcService, Time timeout) throws InterruptedException, ExecutionException, TimeoutException {
"""
Shuts the given rpc service down and waits for its termination.
@param rpcService to shut down
@param timeout for this operation
@throws InterruptedException if t... | java | public static void terminateRpcService(RpcService rpcService, Time timeout) throws InterruptedException, ExecutionException, TimeoutException {
rpcService.stopService().get(timeout.toMilliseconds(), TimeUnit.MILLISECONDS);
} | [
"public",
"static",
"void",
"terminateRpcService",
"(",
"RpcService",
"rpcService",
",",
"Time",
"timeout",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
",",
"TimeoutException",
"{",
"rpcService",
".",
"stopService",
"(",
")",
".",
"get",
"(",
... | Shuts the given rpc service down and waits for its termination.
@param rpcService to shut down
@param timeout for this operation
@throws InterruptedException if the operation has been interrupted
@throws ExecutionException if a problem occurred
@throws TimeoutException if a timeout occurred | [
"Shuts",
"the",
"given",
"rpc",
"service",
"down",
"and",
"waits",
"for",
"its",
"termination",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcUtils.java#L89-L91 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java | PRJUtil.writePRJ | public static void writePRJ(Connection connection, TableLocation location, String geomField, File fileName) throws SQLException, FileNotFoundException {
"""
Write a prj file according the SRID code of an input table
@param connection database connection
@param location input table name
@param geomField geometry... | java | public static void writePRJ(Connection connection, TableLocation location, String geomField, File fileName) throws SQLException, FileNotFoundException {
int srid = SFSUtilities.getSRID(connection, location, geomField);
writePRJ(connection, srid, fileName);
} | [
"public",
"static",
"void",
"writePRJ",
"(",
"Connection",
"connection",
",",
"TableLocation",
"location",
",",
"String",
"geomField",
",",
"File",
"fileName",
")",
"throws",
"SQLException",
",",
"FileNotFoundException",
"{",
"int",
"srid",
"=",
"SFSUtilities",
".... | Write a prj file according the SRID code of an input table
@param connection database connection
@param location input table name
@param geomField geometry field name
@param fileName path of the prj file
@throws SQLException
@throws FileNotFoundException | [
"Write",
"a",
"prj",
"file",
"according",
"the",
"SRID",
"code",
"of",
"an",
"input",
"table"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java#L132-L135 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/color/ColorHsv.java | ColorHsv.rgbToHsv | public static void rgbToHsv( float r , float g , float b , float []hsv ) {
"""
Convert RGB color into HSV color
@param r red
@param g green
@param b blue
@param hsv (Output) HSV value.
"""
// Maximum value
float max = r > g ? ( r > b ? r : b) : ( g > b ? g : b );
// Minimum value
float min = r < ... | java | public static void rgbToHsv( float r , float g , float b , float []hsv ) {
// Maximum value
float max = r > g ? ( r > b ? r : b) : ( g > b ? g : b );
// Minimum value
float min = r < g ? ( r < b ? r : b) : ( g < b ? g : b );
float delta = max - min;
hsv[2] = max;
if( max != 0 )
hsv[1] = delta / max;
... | [
"public",
"static",
"void",
"rgbToHsv",
"(",
"float",
"r",
",",
"float",
"g",
",",
"float",
"b",
",",
"float",
"[",
"]",
"hsv",
")",
"{",
"// Maximum value",
"float",
"max",
"=",
"r",
">",
"g",
"?",
"(",
"r",
">",
"b",
"?",
"r",
":",
"b",
")",
... | Convert RGB color into HSV color
@param r red
@param g green
@param b blue
@param hsv (Output) HSV value. | [
"Convert",
"RGB",
"color",
"into",
"HSV",
"color"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorHsv.java#L247-L277 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/blockdata/BlockDataHandler.java | BlockDataHandler.setData | public static <T> void setData(String identifier, IBlockAccess world, BlockPos pos, T data, boolean sendToClients) {
"""
Sets the custom data to be stored at the {@link BlockPos} for the specified identifier and eventually sends the data to the clients
watching the chunk.
@param <T> the generic type
@param id... | java | public static <T> void setData(String identifier, IBlockAccess world, BlockPos pos, T data, boolean sendToClients)
{
World w = instance.world(world);
ChunkData<T> chunkData = instance.<T> chunkData(identifier, w, pos);
if (chunkData == null)
chunkData = instance.<T> createChunkData(identifier, instance.world(... | [
"public",
"static",
"<",
"T",
">",
"void",
"setData",
"(",
"String",
"identifier",
",",
"IBlockAccess",
"world",
",",
"BlockPos",
"pos",
",",
"T",
"data",
",",
"boolean",
"sendToClients",
")",
"{",
"World",
"w",
"=",
"instance",
".",
"world",
"(",
"world... | Sets the custom data to be stored at the {@link BlockPos} for the specified identifier and eventually sends the data to the clients
watching the chunk.
@param <T> the generic type
@param identifier the identifier
@param world the world
@param pos the pos
@param data the data
@param sendToClients the send to clients | [
"Sets",
"the",
"custom",
"data",
"to",
"be",
"stored",
"at",
"the",
"{",
"@link",
"BlockPos",
"}",
"for",
"the",
"specified",
"identifier",
"and",
"eventually",
"sends",
"the",
"data",
"to",
"the",
"clients",
"watching",
"the",
"chunk",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/blockdata/BlockDataHandler.java#L321-L335 |
jbundle/jbundle | thin/base/screen/cal/sample/remote/src/main/java/org/jbundle/thin/base/screen/cal/sample/message/CalendarProduct.java | CalendarProduct.changeRemoteDate | public void changeRemoteDate(Application application, String strParams, CachedItem productItem, Date dateStart, Date dateEnd) {
"""
Change the date of the actual data.
Override this to change the date.
"""
//+ this.setIcon(BaseApplet.getSharedInstance().loadImageIcon("tour/buttons/Lookup.gif", "Lookup"), ... | java | public void changeRemoteDate(Application application, String strParams, CachedItem productItem, Date dateStart, Date dateEnd)
{
//+ this.setIcon(BaseApplet.getSharedInstance().loadImageIcon("tour/buttons/Lookup.gif", "Lookup"), CalendarConstants.START_ICON + 1);
//x this.setIcon(BaseApplet.getSharedInstance... | [
"public",
"void",
"changeRemoteDate",
"(",
"Application",
"application",
",",
"String",
"strParams",
",",
"CachedItem",
"productItem",
",",
"Date",
"dateStart",
",",
"Date",
"dateEnd",
")",
"{",
"//+ this.setIcon(BaseApplet.getSharedInstance().loadImageIcon(\"tour/buttons... | Change the date of the actual data.
Override this to change the date. | [
"Change",
"the",
"date",
"of",
"the",
"actual",
"data",
".",
"Override",
"this",
"to",
"change",
"the",
"date",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/cal/sample/remote/src/main/java/org/jbundle/thin/base/screen/cal/sample/message/CalendarProduct.java#L98-L143 |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/parser/JSONParser.java | JSONParser.parse | public <T> T parse(byte[] in, Class<T> mapTo) throws ParseException {
"""
use to return Primitive Type, or String, Or JsonObject or JsonArray
generated by a ContainerFactory
"""
return getPBytes().parse(in, JSONValue.defaultReader.getMapper(mapTo));
} | java | public <T> T parse(byte[] in, Class<T> mapTo) throws ParseException {
return getPBytes().parse(in, JSONValue.defaultReader.getMapper(mapTo));
} | [
"public",
"<",
"T",
">",
"T",
"parse",
"(",
"byte",
"[",
"]",
"in",
",",
"Class",
"<",
"T",
">",
"mapTo",
")",
"throws",
"ParseException",
"{",
"return",
"getPBytes",
"(",
")",
".",
"parse",
"(",
"in",
",",
"JSONValue",
".",
"defaultReader",
".",
"... | use to return Primitive Type, or String, Or JsonObject or JsonArray
generated by a ContainerFactory | [
"use",
"to",
"return",
"Primitive",
"Type",
"or",
"String",
"Or",
"JsonObject",
"or",
"JsonArray",
"generated",
"by",
"a",
"ContainerFactory"
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/parser/JSONParser.java#L205-L207 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/svg/inkscape/Util.java | Util.getNonGeometricData | static NonGeometricData getNonGeometricData(Element element) {
"""
Get the non-geometric data information from an XML element
@param element The element to be processed
@return The non-geometric data (i.e. stroke, fill, etc)
"""
String meta = getMetaData(element);
NonGeometricData data = new Inks... | java | static NonGeometricData getNonGeometricData(Element element) {
String meta = getMetaData(element);
NonGeometricData data = new InkscapeNonGeometricData(meta, element);
data.addAttribute(NonGeometricData.ID, element.getAttribute("id"));
data.addAttribute(NonGeometricData.FILL, getStyle(element, NonGeomet... | [
"static",
"NonGeometricData",
"getNonGeometricData",
"(",
"Element",
"element",
")",
"{",
"String",
"meta",
"=",
"getMetaData",
"(",
"element",
")",
";",
"NonGeometricData",
"data",
"=",
"new",
"InkscapeNonGeometricData",
"(",
"meta",
",",
"element",
")",
";",
"... | Get the non-geometric data information from an XML element
@param element The element to be processed
@return The non-geometric data (i.e. stroke, fill, etc) | [
"Get",
"the",
"non",
"-",
"geometric",
"data",
"information",
"from",
"an",
"XML",
"element"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/svg/inkscape/Util.java#L29-L44 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java | FlowController.execute | public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response )
throws Exception {
"""
Perform decision logic to determine the next URI to be displayed.
@param mapping the Struts ActionMapping for the ... | java | public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response )
throws Exception
{
//
// Don't actually run the action (and perform the associated synchronization) if there are too many
... | [
"public",
"ActionForward",
"execute",
"(",
"ActionMapping",
"mapping",
",",
"ActionForm",
"form",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"Exception",
"{",
"//",
"// Don't actually run the action (and perform the associated... | Perform decision logic to determine the next URI to be displayed.
@param mapping the Struts ActionMapping for the current action being processed.
@param form the form-bean (if any) associated with the Struts action being processed. May be null.
@param request the current HttpServletRequest.
@param response the curren... | [
"Perform",
"decision",
"logic",
"to",
"determine",
"the",
"next",
"URI",
"to",
"be",
"displayed",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java#L307-L366 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupsImpl.java | PersonGroupsImpl.createAsync | public Observable<Void> createAsync(String personGroupId, CreatePersonGroupsOptionalParameter createOptionalParameter) {
"""
Create a new person group with specified personGroupId, name and user-provided userData.
@param personGroupId Id referencing a particular person group.
@param createOptionalParameter the... | java | public Observable<Void> createAsync(String personGroupId, CreatePersonGroupsOptionalParameter createOptionalParameter) {
return createWithServiceResponseAsync(personGroupId, createOptionalParameter).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse... | [
"public",
"Observable",
"<",
"Void",
">",
"createAsync",
"(",
"String",
"personGroupId",
",",
"CreatePersonGroupsOptionalParameter",
"createOptionalParameter",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"personGroupId",
",",
"createOptionalParameter",
")",
"... | Create a new person group with specified personGroupId, name and user-provided userData.
@param personGroupId Id referencing a particular person group.
@param createOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters ... | [
"Create",
"a",
"new",
"person",
"group",
"with",
"specified",
"personGroupId",
"name",
"and",
"user",
"-",
"provided",
"userData",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupsImpl.java#L133-L140 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java | FDBigInteger.add | private FDBigInteger add(FDBigInteger other) {
"""
/*@
@ assignable \nothing;
@ ensures \result.value() == \old(this.value() + other.value());
@
"""
FDBigInteger big, small;
int bigLen, smallLen;
int tSize = this.size();
int oSize = other.size();
if (tSize >= oSize) {... | java | private FDBigInteger add(FDBigInteger other) {
FDBigInteger big, small;
int bigLen, smallLen;
int tSize = this.size();
int oSize = other.size();
if (tSize >= oSize) {
big = this;
bigLen = tSize;
small = other;
smallLen = oSize;
... | [
"private",
"FDBigInteger",
"add",
"(",
"FDBigInteger",
"other",
")",
"{",
"FDBigInteger",
"big",
",",
"small",
";",
"int",
"bigLen",
",",
"smallLen",
";",
"int",
"tSize",
"=",
"this",
".",
"size",
"(",
")",
";",
"int",
"oSize",
"=",
"other",
".",
"size... | /*@
@ assignable \nothing;
@ ensures \result.value() == \old(this.value() + other.value());
@ | [
"/",
"*"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java#L1181-L1213 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/common/ProjectNodeSupport.java | ProjectNodeSupport.listPluginConfigurations | public static List<ExtPluginConfiguration> listPluginConfigurations(
final Map<String, String> props,
final String keyprefix,
final String serviceName
) {
"""
Return a list of resource model configuration
@param serviceName service name
@param props properties
@pa... | java | public static List<ExtPluginConfiguration> listPluginConfigurations(
final Map<String, String> props,
final String keyprefix,
final String serviceName
)
{
return listPluginConfigurations(props, keyprefix, serviceName, false);
} | [
"public",
"static",
"List",
"<",
"ExtPluginConfiguration",
">",
"listPluginConfigurations",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"props",
",",
"final",
"String",
"keyprefix",
",",
"final",
"String",
"serviceName",
")",
"{",
"return",
"listPlug... | Return a list of resource model configuration
@param serviceName service name
@param props properties
@param keyprefix prefix for properties
@return List of Maps, each map containing "type": String, "props":Properties | [
"Return",
"a",
"list",
"of",
"resource",
"model",
"configuration"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/common/ProjectNodeSupport.java#L712-L720 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.createMessageReceiverFromEntityPathAsync | public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync(String namespaceName, String entityPath, ClientSettings clientSettings) {
"""
Asynchronously creates a message receiver to the entity using the client settings in PeekLock mode
@param namespaceName namespace of entity
@par... | java | public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync(String namespaceName, String entityPath, ClientSettings clientSettings) {
return createMessageReceiverFromEntityPathAsync(namespaceName, entityPath, clientSettings, DEFAULTRECEIVEMODE);
} | [
"public",
"static",
"CompletableFuture",
"<",
"IMessageReceiver",
">",
"createMessageReceiverFromEntityPathAsync",
"(",
"String",
"namespaceName",
",",
"String",
"entityPath",
",",
"ClientSettings",
"clientSettings",
")",
"{",
"return",
"createMessageReceiverFromEntityPathAsync... | Asynchronously creates a message receiver to the entity using the client settings in PeekLock mode
@param namespaceName namespace of entity
@param entityPath path of entity
@param clientSettings client settings
@return a CompletableFuture representing the pending creation of message receiver | [
"Asynchronously",
"creates",
"a",
"message",
"receiver",
"to",
"the",
"entity",
"using",
"the",
"client",
"settings",
"in",
"PeekLock",
"mode"
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L406-L408 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java | UnionPathIterator.loadLocationPaths | protected void loadLocationPaths(Compiler compiler, int opPos, int count)
throws javax.xml.transform.TransformerException {
"""
Initialize the location path iterators. Recursive.
@param compiler The Compiler which is creating
this expression.
@param opPos The position of this iterator in the
opcod... | java | protected void loadLocationPaths(Compiler compiler, int opPos, int count)
throws javax.xml.transform.TransformerException
{
// TODO: Handle unwrapped FilterExpr
int steptype = compiler.getOp(opPos);
if (steptype == OpCodes.OP_LOCATIONPATH)
{
loadLocationPaths(compiler, compiler.getNe... | [
"protected",
"void",
"loadLocationPaths",
"(",
"Compiler",
"compiler",
",",
"int",
"opPos",
",",
"int",
"count",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"// TODO: Handle unwrapped FilterExpr",
"int",
"steptype",
"=",
... | Initialize the location path iterators. Recursive.
@param compiler The Compiler which is creating
this expression.
@param opPos The position of this iterator in the
opcode list from the compiler.
@param count The insert position of the iterator.
@throws javax.xml.transform.TransformerException | [
"Initialize",
"the",
"location",
"path",
"iterators",
".",
"Recursive",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java#L329-L373 |
stripe/stripe-android | stripe/src/main/java/com/stripe/android/model/ModelUtils.java | ModelUtils.hasYearPassed | static boolean hasYearPassed(int year, @NonNull Calendar now) {
"""
Determines whether or not the input year has already passed.
@param year the input year, as a two or four-digit integer
@param now, the current time
@return {@code true} if the input year has passed the year of the specified current time
{@c... | java | static boolean hasYearPassed(int year, @NonNull Calendar now) {
int normalized = normalizeYear(year, now);
return normalized < now.get(Calendar.YEAR);
} | [
"static",
"boolean",
"hasYearPassed",
"(",
"int",
"year",
",",
"@",
"NonNull",
"Calendar",
"now",
")",
"{",
"int",
"normalized",
"=",
"normalizeYear",
"(",
"year",
",",
"now",
")",
";",
"return",
"normalized",
"<",
"now",
".",
"get",
"(",
"Calendar",
"."... | Determines whether or not the input year has already passed.
@param year the input year, as a two or four-digit integer
@param now, the current time
@return {@code true} if the input year has passed the year of the specified current time
{@code false} otherwise. | [
"Determines",
"whether",
"or",
"not",
"the",
"input",
"year",
"has",
"already",
"passed",
"."
] | train | https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/model/ModelUtils.java#L52-L55 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRulesInner.java | InboundNatRulesInner.beginCreateOrUpdate | public InboundNatRuleInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) {
"""
Creates or updates a load balancer inbound nat rule.
@param resourceGroupName The name of the resource group.
@param loadBalancerName ... | java | public InboundNatRuleInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).toBlo... | [
"public",
"InboundNatRuleInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"loadBalancerName",
",",
"String",
"inboundNatRuleName",
",",
"InboundNatRuleInner",
"inboundNatRuleParameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseA... | Creates or updates a load balancer inbound nat rule.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@param inboundNatRuleName The name of the inbound nat rule.
@param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule o... | [
"Creates",
"or",
"updates",
"a",
"load",
"balancer",
"inbound",
"nat",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRulesInner.java#L654-L656 |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java | XmlStreamReaderUtils.optionalByteAttribute | public static byte optionalByteAttribute(
final XMLStreamReader reader,
final String localName,
final byte defaultValue) {
"""
Returns the value of an attribute as a byte. If the attribute is empty, this method returns
the default value provided.
@param reader
<code>XMLStre... | java | public static byte optionalByteAttribute(
final XMLStreamReader reader,
final String localName,
final byte defaultValue) {
return optionalByteAttribute(reader, null, localName, defaultValue);
} | [
"public",
"static",
"byte",
"optionalByteAttribute",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"String",
"localName",
",",
"final",
"byte",
"defaultValue",
")",
"{",
"return",
"optionalByteAttribute",
"(",
"reader",
",",
"null",
",",
"localName",
",... | Returns the value of an attribute as a byte. If the attribute is empty, this method returns
the default value provided.
@param reader
<code>XMLStreamReader</code> that contains attribute values.
@param localName
local name of attribute (the namespace is ignored).
@param defaultValue
default value
@return value of attr... | [
"Returns",
"the",
"value",
"of",
"an",
"attribute",
"as",
"a",
"byte",
".",
"If",
"the",
"attribute",
"is",
"empty",
"this",
"method",
"returns",
"the",
"default",
"value",
"provided",
"."
] | train | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java#L606-L611 |
OpenLiberty/open-liberty | dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ExecutorServiceImpl.java | ExecutorServiceImpl.createExecutor | private synchronized void createExecutor() {
"""
Create a thread pool executor with the configured attributes from this
component config.
"""
if (componentConfig == null) {
// this is a completely normal occurrence and can happen if a ThreadFactory is bound prior to
// componen... | java | private synchronized void createExecutor() {
if (componentConfig == null) {
// this is a completely normal occurrence and can happen if a ThreadFactory is bound prior to
// component activation... the proper thing to do is to do nothing and wait for activation
return;
... | [
"private",
"synchronized",
"void",
"createExecutor",
"(",
")",
"{",
"if",
"(",
"componentConfig",
"==",
"null",
")",
"{",
"// this is a completely normal occurrence and can happen if a ThreadFactory is bound prior to",
"// component activation... the proper thing to do is to do nothin... | Create a thread pool executor with the configured attributes from this
component config. | [
"Create",
"a",
"thread",
"pool",
"executor",
"with",
"the",
"configured",
"attributes",
"from",
"this",
"component",
"config",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ExecutorServiceImpl.java#L177-L219 |
auth0/Lock.Android | lib/src/main/java/com/auth0/android/lock/views/SocialButton.java | SocialButton.setStyle | public void setStyle(AuthConfig config, @AuthMode int mode) {
"""
Configures the button with the given connection information.
@param config contains the connection information.
@param mode the current button mode. Used to prefix the title with "Log In" or "Sign Up".
"""
final Drawable logo = con... | java | public void setStyle(AuthConfig config, @AuthMode int mode) {
final Drawable logo = config.getLogo(getContext());
final int backgroundColor = config.getBackgroundColor(getContext());
Drawable touchBackground = getTouchFeedbackBackground(backgroundColor, smallSize ? ViewUtils.Corners.ALL : ViewUt... | [
"public",
"void",
"setStyle",
"(",
"AuthConfig",
"config",
",",
"@",
"AuthMode",
"int",
"mode",
")",
"{",
"final",
"Drawable",
"logo",
"=",
"config",
".",
"getLogo",
"(",
"getContext",
"(",
")",
")",
";",
"final",
"int",
"backgroundColor",
"=",
"config",
... | Configures the button with the given connection information.
@param config contains the connection information.
@param mode the current button mode. Used to prefix the title with "Log In" or "Sign Up". | [
"Configures",
"the",
"button",
"with",
"the",
"given",
"connection",
"information",
"."
] | train | https://github.com/auth0/Lock.Android/blob/8eb2a979048d2eb6cf0ec631e82e6c3fe6e7d220/lib/src/main/java/com/auth0/android/lock/views/SocialButton.java#L71-L96 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/decorators/DecoratorRegistryImpl.java | DecoratorRegistryImpl.configure | private void configure() {
"""
leon: replace this hard-wired-method with a property or xml config one day
"""
addDecorator(ServiceStats.class, new ServiceStatsDecorator());
addDecorator(ActionStats.class, new ActionStatsDecorator());
addDecorator(ServletStats.class, new ServletStatsDecorator());
addDec... | java | private void configure(){
addDecorator(ServiceStats.class, new ServiceStatsDecorator());
addDecorator(ActionStats.class, new ActionStatsDecorator());
addDecorator(ServletStats.class, new ServletStatsDecorator());
addDecorator(FilterStats.class, new FilterStatsDecorator());
addDecorator(CacheStats.class, new C... | [
"private",
"void",
"configure",
"(",
")",
"{",
"addDecorator",
"(",
"ServiceStats",
".",
"class",
",",
"new",
"ServiceStatsDecorator",
"(",
")",
")",
";",
"addDecorator",
"(",
"ActionStats",
".",
"class",
",",
"new",
"ActionStatsDecorator",
"(",
")",
")",
";... | leon: replace this hard-wired-method with a property or xml config one day | [
"leon",
":",
"replace",
"this",
"hard",
"-",
"wired",
"-",
"method",
"with",
"a",
"property",
"or",
"xml",
"config",
"one",
"day"
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/decorators/DecoratorRegistryImpl.java#L156-L181 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java | MithraManager.executeTransactionalCommand | public <R> R executeTransactionalCommand(final TransactionalCommand<R> command, final TransactionStyle style)
throws MithraBusinessException {
"""
executes the given transactional command with the custom transaction style.
@param command
@param style
@throws MithraBusinessException
"""
... | java | public <R> R executeTransactionalCommand(final TransactionalCommand<R> command, final TransactionStyle style)
throws MithraBusinessException
{
String commandName = command.getClass().getName();
MithraTransaction tx = this.getCurrentTransaction();
if (tx != null)
{
... | [
"public",
"<",
"R",
">",
"R",
"executeTransactionalCommand",
"(",
"final",
"TransactionalCommand",
"<",
"R",
">",
"command",
",",
"final",
"TransactionStyle",
"style",
")",
"throws",
"MithraBusinessException",
"{",
"String",
"commandName",
"=",
"command",
".",
"ge... | executes the given transactional command with the custom transaction style.
@param command
@param style
@throws MithraBusinessException | [
"executes",
"the",
"given",
"transactional",
"command",
"with",
"the",
"custom",
"transaction",
"style",
"."
] | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java#L524-L566 |
OpenTSDB/opentsdb | src/tools/CliUtils.java | CliUtils.getMaxMetricID | static long getMaxMetricID(final TSDB tsdb) {
"""
Returns the max metric ID from the UID table
@param tsdb The TSDB to use for data access
@return The max metric ID as an integer value, may be 0 if the UID table
hasn't been initialized or is missing the UID row or metrics column.
@throws IllegalStateException ... | java | static long getMaxMetricID(final TSDB tsdb) {
// first up, we need the max metric ID so we can split up the data table
// amongst threads.
final GetRequest get = new GetRequest(tsdb.uidTable(), new byte[] { 0 });
get.family("id".getBytes(CHARSET));
get.qualifier("metrics".getBytes(CHARSET));
Arr... | [
"static",
"long",
"getMaxMetricID",
"(",
"final",
"TSDB",
"tsdb",
")",
"{",
"// first up, we need the max metric ID so we can split up the data table",
"// amongst threads.",
"final",
"GetRequest",
"get",
"=",
"new",
"GetRequest",
"(",
"tsdb",
".",
"uidTable",
"(",
")",
... | Returns the max metric ID from the UID table
@param tsdb The TSDB to use for data access
@return The max metric ID as an integer value, may be 0 if the UID table
hasn't been initialized or is missing the UID row or metrics column.
@throws IllegalStateException if the UID column can't be found or couldn't
be parsed | [
"Returns",
"the",
"max",
"metric",
"ID",
"from",
"the",
"UID",
"table"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/CliUtils.java#L102-L122 |
banq/jdonframework | src/main/java/com/jdon/util/UtilValidate.java | UtilValidate.isDate | public static boolean isDate(String year, String month, String day) {
"""
isDate returns true if string arguments year, month, and day form a valid date.
"""
// catch invalid years(not 2- or 4-digit) and invalid months and days.
if (!(isYear(year) && isMonth(month) && isDay(day))) return fals... | java | public static boolean isDate(String year, String month, String day) {
// catch invalid years(not 2- or 4-digit) and invalid months and days.
if (!(isYear(year) && isMonth(month) && isDay(day))) return false;
int intYear = Integer.parseInt(year);
int intMonth = Integer.parseInt(mont... | [
"public",
"static",
"boolean",
"isDate",
"(",
"String",
"year",
",",
"String",
"month",
",",
"String",
"day",
")",
"{",
"// catch invalid years(not 2- or 4-digit) and invalid months and days.\r",
"if",
"(",
"!",
"(",
"isYear",
"(",
"year",
")",
"&&",
"isMonth",
"(... | isDate returns true if string arguments year, month, and day form a valid date. | [
"isDate",
"returns",
"true",
"if",
"string",
"arguments",
"year",
"month",
"and",
"day",
"form",
"a",
"valid",
"date",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/UtilValidate.java#L746-L758 |
Sciss/abc4j | abc/src/main/java/abc/ui/swing/ScoreTemplate.java | ScoreTemplate.setAttributeSize | public void setAttributeSize(ScoreAttribute sa, float size) {
"""
Sets the size associated to an attribute, using the
attribute's default unit
"""
m_attributes.put(sa.getName(), new ScoreAttribute.Size(size,
((ScoreAttribute.Size) sa.getDefaultValue()).getUnit()));
notifyListeners();
} | java | public void setAttributeSize(ScoreAttribute sa, float size) {
m_attributes.put(sa.getName(), new ScoreAttribute.Size(size,
((ScoreAttribute.Size) sa.getDefaultValue()).getUnit()));
notifyListeners();
} | [
"public",
"void",
"setAttributeSize",
"(",
"ScoreAttribute",
"sa",
",",
"float",
"size",
")",
"{",
"m_attributes",
".",
"put",
"(",
"sa",
".",
"getName",
"(",
")",
",",
"new",
"ScoreAttribute",
".",
"Size",
"(",
"size",
",",
"(",
"(",
"ScoreAttribute",
"... | Sets the size associated to an attribute, using the
attribute's default unit | [
"Sets",
"the",
"size",
"associated",
"to",
"an",
"attribute",
"using",
"the",
"attribute",
"s",
"default",
"unit"
] | train | https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/ScoreTemplate.java#L728-L732 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.convertTimestamp | @Deprecated
protected static ValidationBuilder convertTimestamp(String attributeName, String format) {
"""
Converts a named attribute to <code>java.sql.Timestamp</code> if possible.
Acts as a validator if cannot make a conversion.
@param attributeName name of attribute to convert to <code>java.sql.Timestam... | java | @Deprecated
protected static ValidationBuilder convertTimestamp(String attributeName, String format){
return ModelDelegate.convertTimestamp(modelClass(), attributeName, format);
} | [
"@",
"Deprecated",
"protected",
"static",
"ValidationBuilder",
"convertTimestamp",
"(",
"String",
"attributeName",
",",
"String",
"format",
")",
"{",
"return",
"ModelDelegate",
".",
"convertTimestamp",
"(",
"modelClass",
"(",
")",
",",
"attributeName",
",",
"format"... | Converts a named attribute to <code>java.sql.Timestamp</code> if possible.
Acts as a validator if cannot make a conversion.
@param attributeName name of attribute to convert to <code>java.sql.Timestamp</code>.
@param format format for conversion. Refer to {@link java.text.SimpleDateFormat}
@return message passing for ... | [
"Converts",
"a",
"named",
"attribute",
"to",
"<code",
">",
"java",
".",
"sql",
".",
"Timestamp<",
"/",
"code",
">",
"if",
"possible",
".",
"Acts",
"as",
"a",
"validator",
"if",
"cannot",
"make",
"a",
"conversion",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L2094-L2097 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/MSTransactionFactory.java | MSTransactionFactory.createLocalTransaction | public ExternalLocalTransaction createLocalTransaction() {
"""
This method is used to create a LocalResource that can either be enlisted as
a particpant in a WebSphere LocalTransactionCoordination scope or used directly
to demarcate a one-phase Resource Manager Local Transaction.
@return An instance of Object... | java | public ExternalLocalTransaction createLocalTransaction()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createLocalTransaction");
ExternalLocalTransaction instance;
if (_persistenceSupports1PCOptimisation)
{
instance = new MS... | [
"public",
"ExternalLocalTransaction",
"createLocalTransaction",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createLocalTransaction\"",... | This method is used to create a LocalResource that can either be enlisted as
a particpant in a WebSphere LocalTransactionCoordination scope or used directly
to demarcate a one-phase Resource Manager Local Transaction.
@return An instance of Object | [
"This",
"method",
"is",
"used",
"to",
"create",
"a",
"LocalResource",
"that",
"can",
"either",
"be",
"enlisted",
"as",
"a",
"particpant",
"in",
"a",
"WebSphere",
"LocalTransactionCoordination",
"scope",
"or",
"used",
"directly",
"to",
"demarcate",
"a",
"one",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/MSTransactionFactory.java#L77-L94 |
Scalified/viewmover | viewmover/src/main/java/com/scalified/viewmover/movers/ViewMover.java | ViewMover.createAnimation | private Animation createAnimation(MovingParams params) {
"""
Creates the moving animation
<p>
Configures the moving animation based on moving params
@param params params, which is used to configure the moving animation
@return moving animation
"""
Animation animation = new TranslateAnimation(0, params.... | java | private Animation createAnimation(MovingParams params) {
Animation animation = new TranslateAnimation(0, params.getXAxisDelta(), 0, params.getYAxisDelta());
animation.setFillEnabled(true);
animation.setFillBefore(false);
animation.setDuration(params.getAnimationDuration());
Interpolator interpolator = params.... | [
"private",
"Animation",
"createAnimation",
"(",
"MovingParams",
"params",
")",
"{",
"Animation",
"animation",
"=",
"new",
"TranslateAnimation",
"(",
"0",
",",
"params",
".",
"getXAxisDelta",
"(",
")",
",",
"0",
",",
"params",
".",
"getYAxisDelta",
"(",
")",
... | Creates the moving animation
<p>
Configures the moving animation based on moving params
@param params params, which is used to configure the moving animation
@return moving animation | [
"Creates",
"the",
"moving",
"animation",
"<p",
">",
"Configures",
"the",
"moving",
"animation",
"based",
"on",
"moving",
"params"
] | train | https://github.com/Scalified/viewmover/blob/e2b35f7d8517a5533afe8b68a4c1ee352d9aec34/viewmover/src/main/java/com/scalified/viewmover/movers/ViewMover.java#L265-L276 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java | XmlResponsesSaxParser.parseListObjectsV2Response | public ListObjectsV2Handler parseListObjectsV2Response(InputStream inputStream, final boolean shouldSDKDecodeResponse)
throws IOException {
"""
Parses a ListBucketV2 response XML document from an input stream.
@param inputStream
XML data input stream.
@return the XML handler object populated with ... | java | public ListObjectsV2Handler parseListObjectsV2Response(InputStream inputStream, final boolean shouldSDKDecodeResponse)
throws IOException {
ListObjectsV2Handler handler = new ListObjectsV2Handler(shouldSDKDecodeResponse);
parseXmlInputStream(handler, sanitizeXmlDocument(handler, inputStream)... | [
"public",
"ListObjectsV2Handler",
"parseListObjectsV2Response",
"(",
"InputStream",
"inputStream",
",",
"final",
"boolean",
"shouldSDKDecodeResponse",
")",
"throws",
"IOException",
"{",
"ListObjectsV2Handler",
"handler",
"=",
"new",
"ListObjectsV2Handler",
"(",
"shouldSDKDeco... | Parses a ListBucketV2 response XML document from an input stream.
@param inputStream
XML data input stream.
@return the XML handler object populated with data parsed from the XML
stream.
@throws SdkClientException | [
"Parses",
"a",
"ListBucketV2",
"response",
"XML",
"document",
"from",
"an",
"input",
"stream",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L336-L342 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java | StaticTypeCheckingSupport.allParametersAndArgumentsMatchWithDefaultParams | static int allParametersAndArgumentsMatchWithDefaultParams(Parameter[] params, ClassNode[] args) {
"""
Checks that arguments and parameter types match, expecting that the number of parameters is strictly greater
than the number of arguments, allowing possible inclusion of default parameters.
@param params meth... | java | static int allParametersAndArgumentsMatchWithDefaultParams(Parameter[] params, ClassNode[] args) {
int dist = 0;
ClassNode ptype = null;
// we already know the lengths are equal
for (int i = 0, j = 0; i < params.length; i++) {
Parameter param = params[i];
ClassNod... | [
"static",
"int",
"allParametersAndArgumentsMatchWithDefaultParams",
"(",
"Parameter",
"[",
"]",
"params",
",",
"ClassNode",
"[",
"]",
"args",
")",
"{",
"int",
"dist",
"=",
"0",
";",
"ClassNode",
"ptype",
"=",
"null",
";",
"// we already know the lengths are equal",
... | Checks that arguments and parameter types match, expecting that the number of parameters is strictly greater
than the number of arguments, allowing possible inclusion of default parameters.
@param params method parameters
@param args type arguments
@return -1 if arguments do not match, 0 if arguments are of the exac... | [
"Checks",
"that",
"arguments",
"and",
"parameter",
"types",
"match",
"expecting",
"that",
"the",
"number",
"of",
"parameters",
"is",
"strictly",
"greater",
"than",
"the",
"number",
"of",
"arguments",
"allowing",
"possible",
"inclusion",
"of",
"default",
"parameter... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java#L384-L409 |
upwork/java-upwork | src/com/Upwork/api/Routers/Hr/Jobs.java | Jobs.postJob | public JSONObject postJob(HashMap<String, String> params) throws JSONException {
"""
Post a new job
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject}
"""
return oClient.post("/hr/v2/jobs", params);
} | java | public JSONObject postJob(HashMap<String, String> params) throws JSONException {
return oClient.post("/hr/v2/jobs", params);
} | [
"public",
"JSONObject",
"postJob",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"post",
"(",
"\"/hr/v2/jobs\"",
",",
"params",
")",
";",
"}"
] | Post a new job
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Post",
"a",
"new",
"job"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Hr/Jobs.java#L75-L77 |
CloudSlang/cs-actions | cs-date-time/src/main/java/io/cloudslang/content/datetime/services/DateTimeService.java | DateTimeService.getCurrentDateTime | public static String getCurrentDateTime(final String localeLang, final String localeCountry, final String timezone, final String dateFormat) throws Exception {
"""
Check the current date and time, and returns a java DateAndTime formatted string of it.
If locale is specified, it will return the date and time strin... | java | public static String getCurrentDateTime(final String localeLang, final String localeCountry, final String timezone, final String dateFormat) throws Exception {
final DateTimeFormatter formatter = getDateTimeFormatter(localeLang, localeCountry, timezone, dateFormat);
final DateTime datetime = DateTime.no... | [
"public",
"static",
"String",
"getCurrentDateTime",
"(",
"final",
"String",
"localeLang",
",",
"final",
"String",
"localeCountry",
",",
"final",
"String",
"timezone",
",",
"final",
"String",
"dateFormat",
")",
"throws",
"Exception",
"{",
"final",
"DateTimeFormatter"... | Check the current date and time, and returns a java DateAndTime formatted string of it.
If locale is specified, it will return the date and time string based on the locale.
Otherwise, default locale will be used.
@param localeLang The locale language for date and time string. If localeLang is 'unix' the
localeCount... | [
"Check",
"the",
"current",
"date",
"and",
"time",
"and",
"returns",
"a",
"java",
"DateAndTime",
"formatted",
"string",
"of",
"it",
".",
"If",
"locale",
"is",
"specified",
"it",
"will",
"return",
"the",
"date",
"and",
"time",
"string",
"based",
"on",
"the",... | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-date-time/src/main/java/io/cloudslang/content/datetime/services/DateTimeService.java#L55-L63 |
opencb/java-common-libs | commons-datastore/commons-datastore-core/src/main/java/org/opencb/commons/datastore/core/ObjectMap.java | ObjectMap.getMapAs | @Deprecated
public <T> Map<String, T> getMapAs(String field, final Class<T> clazz) {
"""
Some fields can be a Map, this method cast the Object to Map of type T. Gets the value of the given key, casting it to the given
{@code Class<T>}. This is useful to avoid having casts
in client code, though the effect i... | java | @Deprecated
public <T> Map<String, T> getMapAs(String field, final Class<T> clazz) {
return getMapAs(field, clazz, null);
} | [
"@",
"Deprecated",
"public",
"<",
"T",
">",
"Map",
"<",
"String",
",",
"T",
">",
"getMapAs",
"(",
"String",
"field",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"getMapAs",
"(",
"field",
",",
"clazz",
",",
"null",
")",
";",
... | Some fields can be a Map, this method cast the Object to Map of type T. Gets the value of the given key, casting it to the given
{@code Class<T>}. This is useful to avoid having casts
in client code, though the effect is the same. So to get the value of a key that is of type String, you would write
{@code String name... | [
"Some",
"fields",
"can",
"be",
"a",
"Map",
"this",
"method",
"cast",
"the",
"Object",
"to",
"Map",
"of",
"type",
"T",
".",
"Gets",
"the",
"value",
"of",
"the",
"given",
"key",
"casting",
"it",
"to",
"the",
"given",
"{",
"@code",
"Class<T",
">",
"}",
... | train | https://github.com/opencb/java-common-libs/blob/5c97682530d0be55828e1e4e374ff01fceb5f198/commons-datastore/commons-datastore-core/src/main/java/org/opencb/commons/datastore/core/ObjectMap.java#L442-L445 |
czyzby/gdx-lml | autumn/src/main/java/com/github/czyzby/autumn/context/ContextInitializer.java | ContextInitializer.processType | @SuppressWarnings( {
"""
Processes components' class annotations.
@param component its class annotations will be processed.
@param context used to resolve dependencies
@param contextDestroyer will register destruction callbacks.
""" "rawtypes", "unchecked" }) // Using correct types, but wildcards fail to ... | java | @SuppressWarnings({ "rawtypes", "unchecked" }) // Using correct types, but wildcards fail to see that.
private void processType(final Object component, final Context context, final ContextDestroyer contextDestroyer) {
final com.badlogic.gdx.utils.reflect.Annotation[] annotations = getAnnotations(component.g... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"// Using correct types, but wildcards fail to see that.",
"private",
"void",
"processType",
"(",
"final",
"Object",
"component",
",",
"final",
"Context",
"context",
",",
"final",
"Contex... | Processes components' class annotations.
@param component its class annotations will be processed.
@param context used to resolve dependencies
@param contextDestroyer will register destruction callbacks. | [
"Processes",
"components",
"class",
"annotations",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/autumn/src/main/java/com/github/czyzby/autumn/context/ContextInitializer.java#L545-L564 |
microfocus-idol/haven-search-components | core/src/main/java/com/hp/autonomy/searchcomponents/core/search/DocumentTitleResolver.java | DocumentTitleResolver.resolveTitle | public static String resolveTitle(final String title, final String reference) {
"""
Determine a title to use for a document, given it's title and reference fields.
@param title The document's title field
@param reference The document's reference field
@return The title to use (may be null if title and reference... | java | public static String resolveTitle(final String title, final String reference) {
if (StringUtils.isBlank(title) && !StringUtils.isBlank(reference)) {
// If there is no title, assume the reference is a path and take the last part (the "file name")
final String[] splitReference = PATH_SEPAR... | [
"public",
"static",
"String",
"resolveTitle",
"(",
"final",
"String",
"title",
",",
"final",
"String",
"reference",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"title",
")",
"&&",
"!",
"StringUtils",
".",
"isBlank",
"(",
"reference",
")",
")",... | Determine a title to use for a document, given it's title and reference fields.
@param title The document's title field
@param reference The document's reference field
@return The title to use (may be null if title and reference were null) | [
"Determine",
"a",
"title",
"to",
"use",
"for",
"a",
"document",
"given",
"it",
"s",
"title",
"and",
"reference",
"fields",
"."
] | train | https://github.com/microfocus-idol/haven-search-components/blob/6f5df74ba67ec0d3f86e73bc1dd0d6edd01a8e44/core/src/main/java/com/hp/autonomy/searchcomponents/core/search/DocumentTitleResolver.java#L20-L30 |
kiswanij/jk-util | src/main/java/com/jk/util/JKDateTimeUtil.java | JKDateTimeUtil.getSecondsDifference | public static long getSecondsDifference(Date startDate, Date endDate) {
"""
Gets the seconds difference.
@param startDate the start date
@param endDate the end date
@return the seconds difference
"""
long startTime = startDate.getTime();
long endTime = endDate.getTime();
long diffTime = endTime... | java | public static long getSecondsDifference(Date startDate, Date endDate) {
long startTime = startDate.getTime();
long endTime = endDate.getTime();
long diffTime = endTime - startTime;
long diffInSeconds = TimeUnit.MILLISECONDS.toSeconds(diffTime);
return diffInSeconds;
} | [
"public",
"static",
"long",
"getSecondsDifference",
"(",
"Date",
"startDate",
",",
"Date",
"endDate",
")",
"{",
"long",
"startTime",
"=",
"startDate",
".",
"getTime",
"(",
")",
";",
"long",
"endTime",
"=",
"endDate",
".",
"getTime",
"(",
")",
";",
"long",
... | Gets the seconds difference.
@param startDate the start date
@param endDate the end date
@return the seconds difference | [
"Gets",
"the",
"seconds",
"difference",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKDateTimeUtil.java#L442-L448 |
micronaut-projects/micronaut-core | tracing/src/main/java/io/micronaut/tracing/brave/instrument/http/HttpTracingFactory.java | HttpTracingFactory.httpClientHandler | @Singleton
HttpClientHandler<HttpRequest<?>, HttpResponse<?>> httpClientHandler(HttpTracing httpTracing) {
"""
The {@link HttpClientHandler} bean.
@param httpTracing The {@link HttpTracing} bean
@return The {@link HttpClientHandler} bean
"""
return HttpClientHandler.create(httpTracing, new Http... | java | @Singleton
HttpClientHandler<HttpRequest<?>, HttpResponse<?>> httpClientHandler(HttpTracing httpTracing) {
return HttpClientHandler.create(httpTracing, new HttpClientAdapter<HttpRequest<?>, HttpResponse<?>>() {
@Override
public String method(HttpRequest<?> request) {
... | [
"@",
"Singleton",
"HttpClientHandler",
"<",
"HttpRequest",
"<",
"?",
">",
",",
"HttpResponse",
"<",
"?",
">",
">",
"httpClientHandler",
"(",
"HttpTracing",
"httpTracing",
")",
"{",
"return",
"HttpClientHandler",
".",
"create",
"(",
"httpTracing",
",",
"new",
"... | The {@link HttpClientHandler} bean.
@param httpTracing The {@link HttpTracing} bean
@return The {@link HttpClientHandler} bean | [
"The",
"{",
"@link",
"HttpClientHandler",
"}",
"bean",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/brave/instrument/http/HttpTracingFactory.java#L61-L102 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-hbase/src/main/java/org/apache/hadoop/hbase/client/AbstractBigtableAdmin.java | AbstractBigtableAdmin.deleteRowRangeByPrefix | public void deleteRowRangeByPrefix(TableName tableName, byte[] prefix) throws IOException {
"""
<p>deleteRowRangeByPrefix.</p>
@param tableName a {@link org.apache.hadoop.hbase.TableName} object.
@param prefix an array of byte.
@throws java.io.IOException if any.
"""
try {
tableAdminClientWrappe... | java | public void deleteRowRangeByPrefix(TableName tableName, byte[] prefix) throws IOException {
try {
tableAdminClientWrapper.dropRowRange(tableName.getNameAsString(), Bytes.toString(prefix));
} catch (Throwable throwable) {
throw new IOException(
String.format("Failed to truncate table '%s'",... | [
"public",
"void",
"deleteRowRangeByPrefix",
"(",
"TableName",
"tableName",
",",
"byte",
"[",
"]",
"prefix",
")",
"throws",
"IOException",
"{",
"try",
"{",
"tableAdminClientWrapper",
".",
"dropRowRange",
"(",
"tableName",
".",
"getNameAsString",
"(",
")",
",",
"B... | <p>deleteRowRangeByPrefix.</p>
@param tableName a {@link org.apache.hadoop.hbase.TableName} object.
@param prefix an array of byte.
@throws java.io.IOException if any. | [
"<p",
">",
"deleteRowRangeByPrefix",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-hbase/src/main/java/org/apache/hadoop/hbase/client/AbstractBigtableAdmin.java#L765-L772 |
jalkanen/speed4j | src/main/java/com/ecyrd/speed4j/util/Percentile.java | Percentile.evaluate | public double evaluate(final double[] values, final int begin,
final int length, final double p) {
"""
Returns an estimate of the <code>p</code>th percentile of the values
in the <code>values</code> array, starting with the element in (0-based)
position <code>begin</code> in the array and including ... | java | public double evaluate(final double[] values, final int begin,
final int length, final double p) {
test(values, begin, length);
if ((p > 100) || (p <= 0)) {
throw new IllegalArgumentException("invalid quantile value: " + p);
}
if (length == 0) {
ret... | [
"public",
"double",
"evaluate",
"(",
"final",
"double",
"[",
"]",
"values",
",",
"final",
"int",
"begin",
",",
"final",
"int",
"length",
",",
"final",
"double",
"p",
")",
"{",
"test",
"(",
"values",
",",
"begin",
",",
"length",
")",
";",
"if",
"(",
... | Returns an estimate of the <code>p</code>th percentile of the values
in the <code>values</code> array, starting with the element in (0-based)
position <code>begin</code> in the array and including <code>length</code>
values.
<p>
Calls to this method do not modify the internal <code>quantile</code>
state of this statist... | [
"Returns",
"an",
"estimate",
"of",
"the",
"<code",
">",
"p<",
"/",
"code",
">",
"th",
"percentile",
"of",
"the",
"values",
"in",
"the",
"<code",
">",
"values<",
"/",
"code",
">",
"array",
"starting",
"with",
"the",
"element",
"in",
"(",
"0",
"-",
"ba... | train | https://github.com/jalkanen/speed4j/blob/1d2db9c9b9def869c25fedb9bbd7cf95c39023bd/src/main/java/com/ecyrd/speed4j/util/Percentile.java#L189-L210 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/MediaApi.java | MediaApi.removeMedia | public ApiSuccessResponse removeMedia(String mediatype, LogoutMediaData logoutMediaData) throws ApiException {
"""
Log out of a media channel
Log out the current agent on the specified media channels. You can make a [/media/{mediatype}/ready](/reference/workspace/Media/index.html#readyAgentState) or [/media/{medi... | java | public ApiSuccessResponse removeMedia(String mediatype, LogoutMediaData logoutMediaData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = removeMediaWithHttpInfo(mediatype, logoutMediaData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"removeMedia",
"(",
"String",
"mediatype",
",",
"LogoutMediaData",
"logoutMediaData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"removeMediaWithHttpInfo",
"(",
"mediatype",
",",
"logou... | Log out of a media channel
Log out the current agent on the specified media channels. You can make a [/media/{mediatype}/ready](/reference/workspace/Media/index.html#readyAgentState) or [/media/{mediatype}/not-ready](/reference/workspace/Media/index.html#notReadyAgentState) request to log in to the media channel again.... | [
"Log",
"out",
"of",
"a",
"media",
"channel",
"Log",
"out",
"the",
"current",
"agent",
"on",
"the",
"specified",
"media",
"channels",
".",
"You",
"can",
"make",
"a",
"[",
"/",
"media",
"/",
"{",
"mediatype",
"}",
"/",
"ready",
"]",
"(",
"/",
"referenc... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaApi.java#L3917-L3920 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java | DataSetUtils.sampleWithSize | public static <T> DataSet<T> sampleWithSize(
DataSet <T> input,
final boolean withReplacement,
final int numSamples) {
"""
Generate a sample of DataSet which contains fixed size elements.
<p><strong>NOTE:</strong> Sample with fixed size is not as efficient as sample with fraction, use sample with
fractio... | java | public static <T> DataSet<T> sampleWithSize(
DataSet <T> input,
final boolean withReplacement,
final int numSamples) {
return sampleWithSize(input, withReplacement, numSamples, Utils.RNG.nextLong());
} | [
"public",
"static",
"<",
"T",
">",
"DataSet",
"<",
"T",
">",
"sampleWithSize",
"(",
"DataSet",
"<",
"T",
">",
"input",
",",
"final",
"boolean",
"withReplacement",
",",
"final",
"int",
"numSamples",
")",
"{",
"return",
"sampleWithSize",
"(",
"input",
",",
... | Generate a sample of DataSet which contains fixed size elements.
<p><strong>NOTE:</strong> Sample with fixed size is not as efficient as sample with fraction, use sample with
fraction unless you need exact precision.
@param withReplacement Whether element can be selected more than once.
@param numSamples The ex... | [
"Generate",
"a",
"sample",
"of",
"DataSet",
"which",
"contains",
"fixed",
"size",
"elements",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java#L232-L238 |
webmetrics/browsermob-proxy | src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java | OnlineUpdateUASparser.getVersionFromServer | protected String getVersionFromServer() throws IOException {
"""
Gets the current version from user-agent-string.info
@return
@throws IOException
"""
URL url = new URL(VERSION_CHECK_URL);
InputStream is = url.openStream();
try {
byte[] buff = new byte[4048];
int len = is.read(buff);
return n... | java | protected String getVersionFromServer() throws IOException {
URL url = new URL(VERSION_CHECK_URL);
InputStream is = url.openStream();
try {
byte[] buff = new byte[4048];
int len = is.read(buff);
return new String(buff, 0, len);
} finally {
is.close();
}
} | [
"protected",
"String",
"getVersionFromServer",
"(",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"VERSION_CHECK_URL",
")",
";",
"InputStream",
"is",
"=",
"url",
".",
"openStream",
"(",
")",
";",
"try",
"{",
"byte",
"[",
"]",
"... | Gets the current version from user-agent-string.info
@return
@throws IOException | [
"Gets",
"the",
"current",
"version",
"from",
"user",
"-",
"agent",
"-",
"string",
".",
"info"
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java#L64-L74 |
pwheel/spring-security-oauth2-client | src/main/java/com/racquettrack/security/oauth/OAuth2AuthenticationProvider.java | OAuth2AuthenticationProvider.getAccessToken | protected String getAccessToken(Authentication authentication) {
"""
Exchange the current {@link Authentication}, which should be an instance of {@link OAuth2AuthenticationToken}
containing an OAuth2 code as the credential, for an OAuth2 token.
@param authentication Expected to be an instance of a {@link OAuth2A... | java | protected String getAccessToken(Authentication authentication) {
String accessToken;
try {
Response response = getResponseForAccessTokenRequestFrom(authentication);
if (!isOkay(response)) {
throw new AuthenticationServiceException("Got HTTP error code from OAuth... | [
"protected",
"String",
"getAccessToken",
"(",
"Authentication",
"authentication",
")",
"{",
"String",
"accessToken",
";",
"try",
"{",
"Response",
"response",
"=",
"getResponseForAccessTokenRequestFrom",
"(",
"authentication",
")",
";",
"if",
"(",
"!",
"isOkay",
"(",... | Exchange the current {@link Authentication}, which should be an instance of {@link OAuth2AuthenticationToken}
containing an OAuth2 code as the credential, for an OAuth2 token.
@param authentication Expected to be an instance of a {@link OAuth2AuthenticationToken}.
@return The OAuth2 token from the OAuth Provider. | [
"Exchange",
"the",
"current",
"{"
] | train | https://github.com/pwheel/spring-security-oauth2-client/blob/c0258823493e268495c9752c5d752f74c6809c6b/src/main/java/com/racquettrack/security/oauth/OAuth2AuthenticationProvider.java#L158-L186 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java | BpmnParse.parseSignalEventDefinition | protected EventSubscriptionDeclaration parseSignalEventDefinition(Element signalEventDefinitionElement, boolean isThrowing) {
"""
Parses the Signal Event Definition XML including payload definition.
@param signalEventDefinitionElement the Signal Event Definition element
@param isThrowing true if a Throwing sig... | java | protected EventSubscriptionDeclaration parseSignalEventDefinition(Element signalEventDefinitionElement, boolean isThrowing) {
String signalRef = signalEventDefinitionElement.attribute("signalRef");
if (signalRef == null) {
addError("signalEventDefinition does not have required property 'signalRef'", signa... | [
"protected",
"EventSubscriptionDeclaration",
"parseSignalEventDefinition",
"(",
"Element",
"signalEventDefinitionElement",
",",
"boolean",
"isThrowing",
")",
"{",
"String",
"signalRef",
"=",
"signalEventDefinitionElement",
".",
"attribute",
"(",
"\"signalRef\"",
")",
";",
"... | Parses the Signal Event Definition XML including payload definition.
@param signalEventDefinitionElement the Signal Event Definition element
@param isThrowing true if a Throwing signal event is being parsed
@return | [
"Parses",
"the",
"Signal",
"Event",
"Definition",
"XML",
"including",
"payload",
"definition",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3232-L3257 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java | IotHubResourcesInner.deleteEventHubConsumerGroupAsync | public Observable<Void> deleteEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) {
"""
Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.
Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.
@para... | java | public Observable<Void> deleteEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) {
return deleteEventHubConsumerGroupWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name).map(new Func1<ServiceResponse<Void>, Void>()... | [
"public",
"Observable",
"<",
"Void",
">",
"deleteEventHubConsumerGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"String",
"eventHubEndpointName",
",",
"String",
"name",
")",
"{",
"return",
"deleteEventHubConsumerGroupWithServiceResponse... | Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.
Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@param resourceName The name of the IoT hub.
@param eventHubEndpointName The name ... | [
"Delete",
"a",
"consumer",
"group",
"from",
"an",
"Event",
"Hub",
"-",
"compatible",
"endpoint",
"in",
"an",
"IoT",
"hub",
".",
"Delete",
"a",
"consumer",
"group",
"from",
"an",
"Event",
"Hub",
"-",
"compatible",
"endpoint",
"in",
"an",
"IoT",
"hub",
"."... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L2008-L2015 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/impl/ImplConvertRaster.java | ImplConvertRaster.bufferedToGray | public static void bufferedToGray(BufferedImage src, GrayI16 dst) {
"""
<p>
Converts a buffered image into an 16bit intensity image using the
BufferedImage's RGB interface.
</p>
<p>
This is much slower than working
directly with the BufferedImage's internal raster and should be
avoided if possible.
</p>
... | java | public static void bufferedToGray(BufferedImage src, GrayI16 dst) {
final int width = src.getWidth();
final int height = src.getHeight();
short[] data = dst.data;
if (src.getType() == BufferedImage.TYPE_BYTE_GRAY || src.getType() == BufferedImage.TYPE_USHORT_GRAY ) {
// If the buffered image is a gray scal... | [
"public",
"static",
"void",
"bufferedToGray",
"(",
"BufferedImage",
"src",
",",
"GrayI16",
"dst",
")",
"{",
"final",
"int",
"width",
"=",
"src",
".",
"getWidth",
"(",
")",
";",
"final",
"int",
"height",
"=",
"src",
".",
"getHeight",
"(",
")",
";",
"sho... | <p>
Converts a buffered image into an 16bit intensity image using the
BufferedImage's RGB interface.
</p>
<p>
This is much slower than working
directly with the BufferedImage's internal raster and should be
avoided if possible.
</p>
@param src Input image.
@param dst Output image. | [
"<p",
">",
"Converts",
"a",
"buffered",
"image",
"into",
"an",
"16bit",
"intensity",
"image",
"using",
"the",
"BufferedImage",
"s",
"RGB",
"interface",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"is",
"much",
"slower",
"than",
"working",
"directly",
"wi... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/impl/ImplConvertRaster.java#L634-L672 |
mockito/mockito | src/main/java/org/mockito/internal/stubbing/StrictnessSelector.java | StrictnessSelector.determineStrictness | public static Strictness determineStrictness(Stubbing stubbing, MockCreationSettings mockSettings, Strictness testLevelStrictness) {
"""
Determines the actual strictness in the following importance order:
1st - strictness configured when declaring stubbing;
2nd - strictness configured at mock level;
3rd - stric... | java | public static Strictness determineStrictness(Stubbing stubbing, MockCreationSettings mockSettings, Strictness testLevelStrictness) {
if (stubbing != null && stubbing.getStrictness() != null) {
return stubbing.getStrictness();
}
if (mockSettings.isLenient()) {
return Stri... | [
"public",
"static",
"Strictness",
"determineStrictness",
"(",
"Stubbing",
"stubbing",
",",
"MockCreationSettings",
"mockSettings",
",",
"Strictness",
"testLevelStrictness",
")",
"{",
"if",
"(",
"stubbing",
"!=",
"null",
"&&",
"stubbing",
".",
"getStrictness",
"(",
"... | Determines the actual strictness in the following importance order:
1st - strictness configured when declaring stubbing;
2nd - strictness configured at mock level;
3rd - strictness configured at test level (rule, mockito session)
@param stubbing stubbing to check for strictness. Null permitted.
@param mockSettings set... | [
"Determines",
"the",
"actual",
"strictness",
"in",
"the",
"following",
"importance",
"order",
":",
"1st",
"-",
"strictness",
"configured",
"when",
"declaring",
"stubbing",
";",
"2nd",
"-",
"strictness",
"configured",
"at",
"mock",
"level",
";",
"3rd",
"-",
"st... | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/stubbing/StrictnessSelector.java#L28-L38 |
cdapio/tigon | tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java | DatumWriterGenerator.doCast | private void doCast(GeneratorAdapter mg, TypeToken<?> outputType, Schema schema) {
"""
Optionally generates a type cast instruction based on the result of
{@link #getCallTypeToken(com.google.common.reflect.TypeToken, Schema)}.
@param mg A {@link org.objectweb.asm.commons.GeneratorAdapter} for generating instruct... | java | private void doCast(GeneratorAdapter mg, TypeToken<?> outputType, Schema schema) {
TypeToken<?> callTypeToken = getCallTypeToken(outputType, schema);
if (!Object.class.equals(callTypeToken.getRawType()) && !outputType.getRawType().isPrimitive()) {
mg.checkCast(Type.getType(callTypeToken.getRawType()));
... | [
"private",
"void",
"doCast",
"(",
"GeneratorAdapter",
"mg",
",",
"TypeToken",
"<",
"?",
">",
"outputType",
",",
"Schema",
"schema",
")",
"{",
"TypeToken",
"<",
"?",
">",
"callTypeToken",
"=",
"getCallTypeToken",
"(",
"outputType",
",",
"schema",
")",
";",
... | Optionally generates a type cast instruction based on the result of
{@link #getCallTypeToken(com.google.common.reflect.TypeToken, Schema)}.
@param mg A {@link org.objectweb.asm.commons.GeneratorAdapter} for generating instructions
@param outputType
@param schema | [
"Optionally",
"generates",
"a",
"type",
"cast",
"instruction",
"based",
"on",
"the",
"result",
"of",
"{"
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java#L923-L928 |
threerings/nenya | core/src/main/java/com/threerings/chat/ComicChatOverlay.java | ComicChatOverlay.positionRectIdeally | protected void positionRectIdeally (Rectangle r, int type, Point speaker) {
"""
Position the rectangle in its ideal location given the type and speaker positon (which may
be null).
"""
if (speaker != null) {
// center it on top of the speaker (it'll be moved..)
r.setLocation(sp... | java | protected void positionRectIdeally (Rectangle r, int type, Point speaker)
{
if (speaker != null) {
// center it on top of the speaker (it'll be moved..)
r.setLocation(speaker.x - (r.width / 2),
speaker.y - (r.height / 2));
return;
}
... | [
"protected",
"void",
"positionRectIdeally",
"(",
"Rectangle",
"r",
",",
"int",
"type",
",",
"Point",
"speaker",
")",
"{",
"if",
"(",
"speaker",
"!=",
"null",
")",
"{",
"// center it on top of the speaker (it'll be moved..)",
"r",
".",
"setLocation",
"(",
"speaker"... | Position the rectangle in its ideal location given the type and speaker positon (which may
be null). | [
"Position",
"the",
"rectangle",
"in",
"its",
"ideal",
"location",
"given",
"the",
"type",
"and",
"speaker",
"positon",
"(",
"which",
"may",
"be",
"null",
")",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ComicChatOverlay.java#L406-L434 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/lock/LockManager.java | LockManager.lockerWaitingOn | public boolean lockerWaitingOn(Locker locker, Locker target) {
"""
/*
Return true iff the given locker is waiting on the given target;
recurse as necessary.
"""
//-------------------------------------------------------------
// Locker can be waiting on at most one lock. If that lock
/... | java | public boolean lockerWaitingOn(Locker locker, Locker target)
{
//-------------------------------------------------------------
// Locker can be waiting on at most one lock. If that lock
// is held by target or if any of the holders of that lock
// is waiting on the target then locker... | [
"public",
"boolean",
"lockerWaitingOn",
"(",
"Locker",
"locker",
",",
"Locker",
"target",
")",
"{",
"//-------------------------------------------------------------",
"// Locker can be waiting on at most one lock. If that lock",
"// is held by target or if any of the holders of that lock",... | /*
Return true iff the given locker is waiting on the given target;
recurse as necessary. | [
"/",
"*",
"Return",
"true",
"iff",
"the",
"given",
"locker",
"is",
"waiting",
"on",
"the",
"given",
"target",
";",
"recurse",
"as",
"necessary",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/lock/LockManager.java#L412-L437 |
cternes/openkeepass | src/main/java/de/slackspace/openkeepass/KeePassDatabase.java | KeePassDatabase.getInstance | public static KeePassDatabase getInstance(File keePassDatabaseFile) {
"""
Retrieves a KeePassDatabase instance. The instance returned is based on
the given database file and tries to parse the database header of it.
@param keePassDatabaseFile
a KeePass database file, must not be NULL
@return a KeePassDatabas... | java | public static KeePassDatabase getInstance(File keePassDatabaseFile) {
if (keePassDatabaseFile == null) {
throw new IllegalArgumentException("You must provide a valid KeePass database file.");
}
InputStream keePassDatabaseStream = null;
try {
keePassDatabas... | [
"public",
"static",
"KeePassDatabase",
"getInstance",
"(",
"File",
"keePassDatabaseFile",
")",
"{",
"if",
"(",
"keePassDatabaseFile",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"You must provide a valid KeePass database file.\"",
")",
";",
... | Retrieves a KeePassDatabase instance. The instance returned is based on
the given database file and tries to parse the database header of it.
@param keePassDatabaseFile
a KeePass database file, must not be NULL
@return a KeePassDatabase | [
"Retrieves",
"a",
"KeePassDatabase",
"instance",
".",
"The",
"instance",
"returned",
"is",
"based",
"on",
"the",
"given",
"database",
"file",
"and",
"tries",
"to",
"parse",
"the",
"database",
"header",
"of",
"it",
"."
] | train | https://github.com/cternes/openkeepass/blob/4a354aecaea38af3c0dce5eb81b533f297e8d94f/src/main/java/de/slackspace/openkeepass/KeePassDatabase.java#L106-L126 |
JM-Lab/utils-java9 | src/main/java/kr/jm/utils/helper/JMJson.java | JMJson.withJsonFile | public static <T> T withJsonFile(File jsonFile, Class<T> c) {
"""
With json file t.
@param <T> the type parameter
@param jsonFile the json file
@param c the c
@return the t
"""
try {
return jsonMapper.readValue(jsonFile, c);
} catch (Exception e) {
retu... | java | public static <T> T withJsonFile(File jsonFile, Class<T> c) {
try {
return jsonMapper.readValue(jsonFile, c);
} catch (Exception e) {
return JMExceptionManager.handleExceptionAndReturnNull(log, e,
"withJsonFile", jsonFile);
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withJsonFile",
"(",
"File",
"jsonFile",
",",
"Class",
"<",
"T",
">",
"c",
")",
"{",
"try",
"{",
"return",
"jsonMapper",
".",
"readValue",
"(",
"jsonFile",
",",
"c",
")",
";",
"}",
"catch",
"(",
"Exception",
... | With json file t.
@param <T> the type parameter
@param jsonFile the json file
@param c the c
@return the t | [
"With",
"json",
"file",
"t",
"."
] | train | https://github.com/JM-Lab/utils-java9/blob/ee80235b2760396a616cf7563cbdc98d4affe8e1/src/main/java/kr/jm/utils/helper/JMJson.java#L233-L240 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/CMakeAnalyzer.java | CMakeAnalyzer.analyzeDependency | @Override
protected void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException {
"""
Analyzes python packages and adds evidence to the dependency.
@param dependency the dependency being analyzed
@param engine the engine being used to perform the scan
@throws AnalysisException th... | java | @Override
protected void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException {
dependency.setEcosystem(DEPENDENCY_ECOSYSTEM);
final File file = dependency.getActualFile();
final String name = file.getName();
final String contents;
try {
... | [
"@",
"Override",
"protected",
"void",
"analyzeDependency",
"(",
"Dependency",
"dependency",
",",
"Engine",
"engine",
")",
"throws",
"AnalysisException",
"{",
"dependency",
".",
"setEcosystem",
"(",
"DEPENDENCY_ECOSYSTEM",
")",
";",
"final",
"File",
"file",
"=",
"d... | Analyzes python packages and adds evidence to the dependency.
@param dependency the dependency being analyzed
@param engine the engine being used to perform the scan
@throws AnalysisException thrown if there is an unrecoverable error
analyzing the dependency | [
"Analyzes",
"python",
"packages",
"and",
"adds",
"evidence",
"to",
"the",
"dependency",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/CMakeAnalyzer.java#L146-L175 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java | TermOfUsePanel.newModificationsClausePanel | protected Component newModificationsClausePanel(final String id,
final IModel<HeaderContentListModelBean> model) {
"""
Factory method for creating the new {@link Component} for the modifications clause. This
method is invoked in the constructor from the derived classes and can be overridden so users
can provid... | java | protected Component newModificationsClausePanel(final String id,
final IModel<HeaderContentListModelBean> model)
{
return new ModificationsClausePanel(id, Model.of(model.getObject()));
} | [
"protected",
"Component",
"newModificationsClausePanel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"HeaderContentListModelBean",
">",
"model",
")",
"{",
"return",
"new",
"ModificationsClausePanel",
"(",
"id",
",",
"Model",
".",
"of",
"(",
"model",... | Factory method for creating the new {@link Component} for the modifications clause. This
method is invoked in the constructor from the derived classes and can be overridden so users
can provide their own version of a new {@link Component} for the modifications clause.
@param id
the id
@param model
the model
@return th... | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"Component",
"}",
"for",
"the",
"modifications",
"clause",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overr... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java#L329-L333 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java | MethodBuilder.buildSignature | public void buildSignature(XMLNode node, Content methodDocTree) {
"""
Build the signature.
@param node the XML element that specifies which components to document
@param methodDocTree the content tree to which the documentation will be added
"""
methodDocTree.addContent(writer.getSignature(currentM... | java | public void buildSignature(XMLNode node, Content methodDocTree) {
methodDocTree.addContent(writer.getSignature(currentMethod));
} | [
"public",
"void",
"buildSignature",
"(",
"XMLNode",
"node",
",",
"Content",
"methodDocTree",
")",
"{",
"methodDocTree",
".",
"addContent",
"(",
"writer",
".",
"getSignature",
"(",
"currentMethod",
")",
")",
";",
"}"
] | Build the signature.
@param node the XML element that specifies which components to document
@param methodDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"signature",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java#L165-L167 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/DojoHttpTransport.java | DojoHttpTransport.beforeModule | protected String beforeModule(HttpServletRequest request, ModuleInfo info) {
"""
Handles
{@link com.ibm.jaggr.core.transport.IHttpTransport.LayerContributionType#BEFORE_FIRST_MODULE}
and
{@link com.ibm.jaggr.core.transport.IHttpTransport.LayerContributionType#BEFORE_SUBSEQUENT_MODULE}
layer listener events.
... | java | protected String beforeModule(HttpServletRequest request, ModuleInfo info) {
StringBuffer sb = new StringBuffer();
if (!info.isScript()) {
// Text module. Wrap in AMD define function call
sb.append("define("); //$NON-NLS-1$
if (RequestUtil.isExportModuleName(request)) {
sb.append("'").append(inf... | [
"protected",
"String",
"beforeModule",
"(",
"HttpServletRequest",
"request",
",",
"ModuleInfo",
"info",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"if",
"(",
"!",
"info",
".",
"isScript",
"(",
")",
")",
"{",
"// Text module. ... | Handles
{@link com.ibm.jaggr.core.transport.IHttpTransport.LayerContributionType#BEFORE_FIRST_MODULE}
and
{@link com.ibm.jaggr.core.transport.IHttpTransport.LayerContributionType#BEFORE_SUBSEQUENT_MODULE}
layer listener events.
@param request
the http request object
@param info
the {@link com.ibm.jaggr.core.transport.... | [
"Handles",
"{",
"@link",
"com",
".",
"ibm",
".",
"jaggr",
".",
"core",
".",
"transport",
".",
"IHttpTransport",
".",
"LayerContributionType#BEFORE_FIRST_MODULE",
"}",
"and",
"{",
"@link",
"com",
".",
"ibm",
".",
"jaggr",
".",
"core",
".",
"transport",
".",
... | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/DojoHttpTransport.java#L218-L228 |
damianszczepanik/cucumber-reporting | src/main/java/net/masterthought/cucumber/util/Util.java | Util.formatAsPercentage | public static String formatAsPercentage(int value, int total) {
"""
Returns value converted to percentage format.
@param value value to convert
@param total sum of all values
@return converted values including '%' character
"""
// value '1F' is to force floating conversion instead of loosing decim... | java | public static String formatAsPercentage(int value, int total) {
// value '1F' is to force floating conversion instead of loosing decimal part
float average = total == 0 ? 0 : 1F * value / total;
return PERCENT_FORMATTER.format(average);
} | [
"public",
"static",
"String",
"formatAsPercentage",
"(",
"int",
"value",
",",
"int",
"total",
")",
"{",
"// value '1F' is to force floating conversion instead of loosing decimal part",
"float",
"average",
"=",
"total",
"==",
"0",
"?",
"0",
":",
"1F",
"*",
"value",
"... | Returns value converted to percentage format.
@param value value to convert
@param total sum of all values
@return converted values including '%' character | [
"Returns",
"value",
"converted",
"to",
"percentage",
"format",
"."
] | train | https://github.com/damianszczepanik/cucumber-reporting/blob/9ffe0d4a9c0aec161b0988a930a8312ba36dc742/src/main/java/net/masterthought/cucumber/util/Util.java#L55-L59 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/os/CommandLine.java | CommandLine.setEnvironmentVariables | public void setEnvironmentVariables(Map<String, String> environment) {
"""
Adds the specified environment variables.
@param environment the variables to add
@throws IllegalArgumentException if any value given is null (unsupported)
"""
for (Map.Entry<String, String> entry : environment.entrySet()) {
... | java | public void setEnvironmentVariables(Map<String, String> environment) {
for (Map.Entry<String, String> entry : environment.entrySet()) {
setEnvironmentVariable(entry.getKey(), entry.getValue());
}
} | [
"public",
"void",
"setEnvironmentVariables",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"environment",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"environment",
".",
"entrySet",
"(",
")",
")",
"{",
"... | Adds the specified environment variables.
@param environment the variables to add
@throws IllegalArgumentException if any value given is null (unsupported) | [
"Adds",
"the",
"specified",
"environment",
"variables",
"."
] | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/os/CommandLine.java#L61-L65 |
cdk/cdk | display/renderextra/src/main/java/org/openscience/cdk/renderer/generators/HighlightGenerator.java | HighlightGenerator.createAtomHighlight | private static Shape createAtomHighlight(IAtom atom, double radius) {
"""
Create the shape which will highlight the provided atom.
@param atom the atom to highlight
@param radius the specified radius
@return the shape which will highlight the atom
"""
double x = atom.getPoint2d().x;
doub... | java | private static Shape createAtomHighlight(IAtom atom, double radius) {
double x = atom.getPoint2d().x;
double y = atom.getPoint2d().y;
return new RoundRectangle2D.Double(x - radius, y - radius, 2 * radius, 2 * radius, 2 * radius, 2 * radius);
} | [
"private",
"static",
"Shape",
"createAtomHighlight",
"(",
"IAtom",
"atom",
",",
"double",
"radius",
")",
"{",
"double",
"x",
"=",
"atom",
".",
"getPoint2d",
"(",
")",
".",
"x",
";",
"double",
"y",
"=",
"atom",
".",
"getPoint2d",
"(",
")",
".",
"y",
"... | Create the shape which will highlight the provided atom.
@param atom the atom to highlight
@param radius the specified radius
@return the shape which will highlight the atom | [
"Create",
"the",
"shape",
"which",
"will",
"highlight",
"the",
"provided",
"atom",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderextra/src/main/java/org/openscience/cdk/renderer/generators/HighlightGenerator.java#L190-L195 |
spring-projects/spring-mobile | spring-mobile-device/src/main/java/org/springframework/mobile/device/util/ResolverUtils.java | ResolverUtils.isTablet | public static boolean isTablet(Device device, SitePreference sitePreference) {
"""
Should the combination of {@link Device} and {@link SitePreference} be handled
as a tablet device
@param device the resolved device
@param sitePreference the specified site preference
@return true if tablet
"""
return site... | java | public static boolean isTablet(Device device, SitePreference sitePreference) {
return sitePreference == SitePreference.TABLET || device != null && device.isTablet() && sitePreference == null;
} | [
"public",
"static",
"boolean",
"isTablet",
"(",
"Device",
"device",
",",
"SitePreference",
"sitePreference",
")",
"{",
"return",
"sitePreference",
"==",
"SitePreference",
".",
"TABLET",
"||",
"device",
"!=",
"null",
"&&",
"device",
".",
"isTablet",
"(",
")",
"... | Should the combination of {@link Device} and {@link SitePreference} be handled
as a tablet device
@param device the resolved device
@param sitePreference the specified site preference
@return true if tablet | [
"Should",
"the",
"combination",
"of",
"{"
] | train | https://github.com/spring-projects/spring-mobile/blob/a402cbcaf208e24288b957f44c9984bd6e8bf064/spring-mobile-device/src/main/java/org/springframework/mobile/device/util/ResolverUtils.java#L59-L61 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.findCodePointOffset | public static int findCodePointOffset(String source, int offset16) {
"""
Returns the UTF-32 offset corresponding to the first UTF-32 boundary at or after the given
UTF-16 offset. Used for random access. See the {@link UTF16 class description} for
notes on roundtripping.<br>
<i>Note: If the UTF-16 offset is into... | java | public static int findCodePointOffset(String source, int offset16) {
if (offset16 < 0 || offset16 > source.length()) {
throw new StringIndexOutOfBoundsException(offset16);
}
int result = 0;
char ch;
boolean hadLeadSurrogate = false;
for (int i = 0; i < offse... | [
"public",
"static",
"int",
"findCodePointOffset",
"(",
"String",
"source",
",",
"int",
"offset16",
")",
"{",
"if",
"(",
"offset16",
"<",
"0",
"||",
"offset16",
">",
"source",
".",
"length",
"(",
")",
")",
"{",
"throw",
"new",
"StringIndexOutOfBoundsException... | Returns the UTF-32 offset corresponding to the first UTF-32 boundary at or after the given
UTF-16 offset. Used for random access. See the {@link UTF16 class description} for
notes on roundtripping.<br>
<i>Note: If the UTF-16 offset is into the middle of a surrogate pair, then the UTF-32 offset
of the <strong>lead</stro... | [
"Returns",
"the",
"UTF",
"-",
"32",
"offset",
"corresponding",
"to",
"the",
"first",
"UTF",
"-",
"32",
"boundary",
"at",
"or",
"after",
"the",
"given",
"UTF",
"-",
"16",
"offset",
".",
"Used",
"for",
"random",
"access",
".",
"See",
"the",
"{",
"@link",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L833-L863 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/config/ZealotConfigManager.java | ZealotConfigManager.initLoad | public void initLoad(String configClass, String xmlLocations, String handlerLocations) {
"""
初始化加载Zealot的配置信息到缓存中.
@param configClass 系统中Zealot的class路径
@param xmlLocations zealot的XML文件所在的位置,多个用逗号隔开
@param handlerLocations zealot的自定义handler处理器所在的位置,多个用逗号隔开
"""
// 设置配置的文件路径的值,并开始加载ZealotConfig配置信息
... | java | public void initLoad(String configClass, String xmlLocations, String handlerLocations) {
// 设置配置的文件路径的值,并开始加载ZealotConfig配置信息
this.xmlLocations = xmlLocations;
this.handlerLocations = handlerLocations;
this.initLoad(configClass);
} | [
"public",
"void",
"initLoad",
"(",
"String",
"configClass",
",",
"String",
"xmlLocations",
",",
"String",
"handlerLocations",
")",
"{",
"// 设置配置的文件路径的值,并开始加载ZealotConfig配置信息",
"this",
".",
"xmlLocations",
"=",
"xmlLocations",
";",
"this",
".",
"handlerLocations",
"=",... | 初始化加载Zealot的配置信息到缓存中.
@param configClass 系统中Zealot的class路径
@param xmlLocations zealot的XML文件所在的位置,多个用逗号隔开
@param handlerLocations zealot的自定义handler处理器所在的位置,多个用逗号隔开 | [
"初始化加载Zealot的配置信息到缓存中",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/config/ZealotConfigManager.java#L78-L83 |
JodaOrg/joda-convert | src/main/java/org/joda/convert/RenameHandler.java | RenameHandler.renamedEnum | public void renamedEnum(String oldName, Enum<?> currentValue) {
"""
Register the fact that an enum constant was renamed.
<p>
This handles the use case where an enum constant is renamed, but the enum class remains the same.
@param oldName the old name of the enum constant, not null
@param currentValue the c... | java | public void renamedEnum(String oldName, Enum<?> currentValue) {
if (oldName == null) {
throw new IllegalArgumentException("oldName must not be null");
}
if (currentValue == null) {
throw new IllegalArgumentException("currentValue must not be null");
}
chec... | [
"public",
"void",
"renamedEnum",
"(",
"String",
"oldName",
",",
"Enum",
"<",
"?",
">",
"currentValue",
")",
"{",
"if",
"(",
"oldName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"oldName must not be null\"",
")",
";",
"}",
"if... | Register the fact that an enum constant was renamed.
<p>
This handles the use case where an enum constant is renamed, but the enum class remains the same.
@param oldName the old name of the enum constant, not null
@param currentValue the current enum constant, not null | [
"Register",
"the",
"fact",
"that",
"an",
"enum",
"constant",
"was",
"renamed",
".",
"<p",
">",
"This",
"handles",
"the",
"use",
"case",
"where",
"an",
"enum",
"constant",
"is",
"renamed",
"but",
"the",
"enum",
"class",
"remains",
"the",
"same",
"."
] | train | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/RenameHandler.java#L211-L226 |
appaloosa-store/appaloosa_client | src/main/java/com/appaloosastore/client/AppaloosaClient.java | AppaloosaClient.deployFile | public void deployFile(String filePath, String description, String groupNames, String changelog)
throws AppaloosaDeployException {
"""
{@link #deployFile(String, String, String, String)} with groupNames as String.
@param filePath Path to the binary
@param description Text changelog for this updat... | java | public void deployFile(String filePath, String description, String groupNames, String changelog)
throws AppaloosaDeployException {
deployFile(filePath, description, parseGroupNames(groupNames), changelog);
} | [
"public",
"void",
"deployFile",
"(",
"String",
"filePath",
",",
"String",
"description",
",",
"String",
"groupNames",
",",
"String",
"changelog",
")",
"throws",
"AppaloosaDeployException",
"{",
"deployFile",
"(",
"filePath",
",",
"description",
",",
"parseGroupNames... | {@link #deployFile(String, String, String, String)} with groupNames as String.
@param filePath Path to the binary
@param description Text changelog for this update. Can be empty.
@param groupNames
List of group names in a string format, group names should be
separated by '|'. Example: "Group 1 | Group 2"
@param changel... | [
"{"
] | train | https://github.com/appaloosa-store/appaloosa_client/blob/a914e0e064b13859e98a5dcbe6b3241c0418d534/src/main/java/com/appaloosastore/client/AppaloosaClient.java#L129-L132 |
cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/PDBPolymer.java | PDBPolymer.addAtom | public void addAtom(IPDBAtom oAtom, IMonomer oMonomer) {
"""
Adds the atom oAtom to a specified Monomer. Additionally, it keeps
record of the iCode.
@param oAtom The IPDBAtom to add
@param oMonomer The monomer the atom belongs to
"""
super.addAtom(oAtom, oMonomer);
if (!sequentialListOfM... | java | public void addAtom(IPDBAtom oAtom, IMonomer oMonomer) {
super.addAtom(oAtom, oMonomer);
if (!sequentialListOfMonomers.contains(oMonomer.getMonomerName()))
sequentialListOfMonomers.add(oMonomer.getMonomerName());
} | [
"public",
"void",
"addAtom",
"(",
"IPDBAtom",
"oAtom",
",",
"IMonomer",
"oMonomer",
")",
"{",
"super",
".",
"addAtom",
"(",
"oAtom",
",",
"oMonomer",
")",
";",
"if",
"(",
"!",
"sequentialListOfMonomers",
".",
"contains",
"(",
"oMonomer",
".",
"getMonomerName... | Adds the atom oAtom to a specified Monomer. Additionally, it keeps
record of the iCode.
@param oAtom The IPDBAtom to add
@param oMonomer The monomer the atom belongs to | [
"Adds",
"the",
"atom",
"oAtom",
"to",
"a",
"specified",
"Monomer",
".",
"Additionally",
"it",
"keeps",
"record",
"of",
"the",
"iCode",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/PDBPolymer.java#L93-L97 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.