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 |
|---|---|---|---|---|---|---|---|---|---|---|
aws/aws-sdk-java | aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/RegisterJobDefinitionRequest.java | RegisterJobDefinitionRequest.withParameters | public RegisterJobDefinitionRequest withParameters(java.util.Map<String, String> parameters) {
"""
<p>
Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value
pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding paramete... | java | public RegisterJobDefinitionRequest withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} | [
"public",
"RegisterJobDefinitionRequest",
"withParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"setParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value
pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from
the job definition.
</p>
@param parameters
Default parameter substitution placeholders to... | [
"<p",
">",
"Default",
"parameter",
"substitution",
"placeholders",
"to",
"set",
"in",
"the",
"job",
"definition",
".",
"Parameters",
"are",
"specified",
"as",
"a",
"key",
"-",
"value",
"pair",
"mapping",
".",
"Parameters",
"in",
"a",
"<code",
">",
"SubmitJob... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/RegisterJobDefinitionRequest.java#L254-L257 |
auth0/jwks-rsa-java | src/main/java/com/auth0/jwk/JwkProviderBuilder.java | JwkProviderBuilder.rateLimited | public JwkProviderBuilder rateLimited(long bucketSize, long refillRate, TimeUnit unit) {
"""
Enable the cache specifying size and expire time.
@param bucketSize max number of jwks to deliver in the given rate.
@param refillRate amount of time to wait before a jwk can the jwk will be cached
@param unit u... | java | public JwkProviderBuilder rateLimited(long bucketSize, long refillRate, TimeUnit unit) {
bucket = new BucketImpl(bucketSize, refillRate, unit);
return this;
} | [
"public",
"JwkProviderBuilder",
"rateLimited",
"(",
"long",
"bucketSize",
",",
"long",
"refillRate",
",",
"TimeUnit",
"unit",
")",
"{",
"bucket",
"=",
"new",
"BucketImpl",
"(",
"bucketSize",
",",
"refillRate",
",",
"unit",
")",
";",
"return",
"this",
";",
"}... | Enable the cache specifying size and expire time.
@param bucketSize max number of jwks to deliver in the given rate.
@param refillRate amount of time to wait before a jwk can the jwk will be cached
@param unit unit of time for the expire of jwk
@return the builder | [
"Enable",
"the",
"cache",
"specifying",
"size",
"and",
"expire",
"time",
"."
] | train | https://github.com/auth0/jwks-rsa-java/blob/9deba212be4278e50ae75a54b3bc6c96359b7e69/src/main/java/com/auth0/jwk/JwkProviderBuilder.java#L110-L113 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/CacheHashMap.java | CacheHashMap.createSessionAttributeKey | @Trivial
private static final String createSessionAttributeKey(String sessionId, String attributeId) {
"""
Create a key for a session attribute, of the form: SessionId.AttributeId
@param sessionId the session id
@param attributeId the session attribute
@return the key
"""
return new StringBuil... | java | @Trivial
private static final String createSessionAttributeKey(String sessionId, String attributeId) {
return new StringBuilder(sessionId.length() + 1 + attributeId.length())
.append(sessionId)
.append('.')
.append(attributeId)
... | [
"@",
"Trivial",
"private",
"static",
"final",
"String",
"createSessionAttributeKey",
"(",
"String",
"sessionId",
",",
"String",
"attributeId",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
"sessionId",
".",
"length",
"(",
")",
"+",
"1",
"+",
"attributeId",
... | Create a key for a session attribute, of the form: SessionId.AttributeId
@param sessionId the session id
@param attributeId the session attribute
@return the key | [
"Create",
"a",
"key",
"for",
"a",
"session",
"attribute",
"of",
"the",
"form",
":",
"SessionId",
".",
"AttributeId"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/CacheHashMap.java#L255-L262 |
haifengl/smile | demo/src/main/java/smile/demo/classification/ClassificationDemo.java | ClassificationDemo.paintOnCanvas | protected PlotCanvas paintOnCanvas(double[][] data, int[] label) {
"""
paint given data with label on canvas
@param data the data point(s) to paint, only support 2D or 3D features
@param label the data label for classification
"""
PlotCanvas canvas = ScatterPlot.plot(data, pointLegend);
for (... | java | protected PlotCanvas paintOnCanvas(double[][] data, int[] label) {
PlotCanvas canvas = ScatterPlot.plot(data, pointLegend);
for (int i = 0; i < data.length; i++) {
canvas.point(pointLegend, Palette.COLORS[label[i]], data[i]);
}
return canvas;
} | [
"protected",
"PlotCanvas",
"paintOnCanvas",
"(",
"double",
"[",
"]",
"[",
"]",
"data",
",",
"int",
"[",
"]",
"label",
")",
"{",
"PlotCanvas",
"canvas",
"=",
"ScatterPlot",
".",
"plot",
"(",
"data",
",",
"pointLegend",
")",
";",
"for",
"(",
"int",
"i",
... | paint given data with label on canvas
@param data the data point(s) to paint, only support 2D or 3D features
@param label the data label for classification | [
"paint",
"given",
"data",
"with",
"label",
"on",
"canvas"
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/demo/src/main/java/smile/demo/classification/ClassificationDemo.java#L123-L129 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java | ApiOvhHostingprivateDatabase.serviceName_whitelist_ip_GET | public OvhWhitelist serviceName_whitelist_ip_GET(String serviceName, String ip) throws IOException {
"""
Get this object properties
REST: GET /hosting/privateDatabase/{serviceName}/whitelist/{ip}
@param serviceName [required] The internal name of your private database
@param ip [required] The whitelisted IP i... | java | public OvhWhitelist serviceName_whitelist_ip_GET(String serviceName, String ip) throws IOException {
String qPath = "/hosting/privateDatabase/{serviceName}/whitelist/{ip}";
StringBuilder sb = path(qPath, serviceName, ip);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhWhitelist... | [
"public",
"OvhWhitelist",
"serviceName_whitelist_ip_GET",
"(",
"String",
"serviceName",
",",
"String",
"ip",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/privateDatabase/{serviceName}/whitelist/{ip}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(... | Get this object properties
REST: GET /hosting/privateDatabase/{serviceName}/whitelist/{ip}
@param serviceName [required] The internal name of your private database
@param ip [required] The whitelisted IP in your instance | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java#L804-L809 |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/ExpressionBuilderImpl.java | ExpressionBuilderImpl.eInit | public void eInit(EObject context, Procedure1<? super XExpression> setter, IJvmTypeProvider typeContext) {
"""
Initialize the expression.
@param context the context of the expressions.
@param setter the object that permits to assign the expression to the context.
"""
setTypeResolutionContext(typeContext);
... | java | public void eInit(EObject context, Procedure1<? super XExpression> setter, IJvmTypeProvider typeContext) {
setTypeResolutionContext(typeContext);
this.context = context;
this.setter = setter;
this.expr = null;
} | [
"public",
"void",
"eInit",
"(",
"EObject",
"context",
",",
"Procedure1",
"<",
"?",
"super",
"XExpression",
">",
"setter",
",",
"IJvmTypeProvider",
"typeContext",
")",
"{",
"setTypeResolutionContext",
"(",
"typeContext",
")",
";",
"this",
".",
"context",
"=",
"... | Initialize the expression.
@param context the context of the expressions.
@param setter the object that permits to assign the expression to the context. | [
"Initialize",
"the",
"expression",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/ExpressionBuilderImpl.java#L73-L78 |
tvesalainen/util | vfs/src/main/java/org/vesalainen/vfs/Env.java | Env.getDefaultSymbolicLinkFileAttributes | public static final FileAttribute<?>[] getDefaultSymbolicLinkFileAttributes(Map<String, ?> env) {
"""
Return default attributes for new symbolic link. Either from env or default
values.
@param env
@return
"""
FileAttribute<?>[] attrs = (FileAttribute<?>[]) env.get(DEFAULT_SYMBOLIC_LINK_FILE_ATTRIBU... | java | public static final FileAttribute<?>[] getDefaultSymbolicLinkFileAttributes(Map<String, ?> env)
{
FileAttribute<?>[] attrs = (FileAttribute<?>[]) env.get(DEFAULT_SYMBOLIC_LINK_FILE_ATTRIBUTES);
if (attrs == null)
{
attrs = new FileAttribute<?>[]{
PosixFilePe... | [
"public",
"static",
"final",
"FileAttribute",
"<",
"?",
">",
"[",
"]",
"getDefaultSymbolicLinkFileAttributes",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"env",
")",
"{",
"FileAttribute",
"<",
"?",
">",
"[",
"]",
"attrs",
"=",
"(",
"FileAttribute",
"<",
"... | Return default attributes for new symbolic link. Either from env or default
values.
@param env
@return | [
"Return",
"default",
"attributes",
"for",
"new",
"symbolic",
"link",
".",
"Either",
"from",
"env",
"or",
"default",
"values",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/vfs/src/main/java/org/vesalainen/vfs/Env.java#L158-L170 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java | Dialogs.showErrorDialog | public static DetailsDialog showErrorDialog (Stage stage, String text, String details) {
"""
Dialog with title "Error", provided text, and provided details available after pressing 'Details' button.
"""
DetailsDialog dialog = new DetailsDialog(text, Text.ERROR.get(), details);
stage.addActor(dialog.fadeIn(... | java | public static DetailsDialog showErrorDialog (Stage stage, String text, String details) {
DetailsDialog dialog = new DetailsDialog(text, Text.ERROR.get(), details);
stage.addActor(dialog.fadeIn());
return dialog;
} | [
"public",
"static",
"DetailsDialog",
"showErrorDialog",
"(",
"Stage",
"stage",
",",
"String",
"text",
",",
"String",
"details",
")",
"{",
"DetailsDialog",
"dialog",
"=",
"new",
"DetailsDialog",
"(",
"text",
",",
"Text",
".",
"ERROR",
".",
"get",
"(",
")",
... | Dialog with title "Error", provided text, and provided details available after pressing 'Details' button. | [
"Dialog",
"with",
"title",
"Error",
"provided",
"text",
"and",
"provided",
"details",
"available",
"after",
"pressing",
"Details",
"button",
"."
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java#L169-L173 |
JetBrains/xodus | openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java | EnvironmentConfig.setCipherKey | public EnvironmentConfig setCipherKey(final String cipherKey) {
"""
Sets the key which will be used to encrypt the database. The key is expected to be a hex string representing
a byte array which is passed to {@linkplain StreamCipher#init(byte[], long)}. Is applicable only if
{@linkplain #getCipherId()} returns ... | java | public EnvironmentConfig setCipherKey(final String cipherKey) {
if (cipherKey == null) {
return (EnvironmentConfig) removeSetting(CIPHER_KEY);
}
return setSetting(CIPHER_KEY, KryptKt.toBinaryKey(cipherKey));
} | [
"public",
"EnvironmentConfig",
"setCipherKey",
"(",
"final",
"String",
"cipherKey",
")",
"{",
"if",
"(",
"cipherKey",
"==",
"null",
")",
"{",
"return",
"(",
"EnvironmentConfig",
")",
"removeSetting",
"(",
"CIPHER_KEY",
")",
";",
"}",
"return",
"setSetting",
"(... | Sets the key which will be used to encrypt the database. The key is expected to be a hex string representing
a byte array which is passed to {@linkplain StreamCipher#init(byte[], long)}. Is applicable only if
{@linkplain #getCipherId()} returns not {@code null}. The setting cannot be changed for existing databases.
Def... | [
"Sets",
"the",
"key",
"which",
"will",
"be",
"used",
"to",
"encrypt",
"the",
"database",
".",
"The",
"key",
"is",
"expected",
"to",
"be",
"a",
"hex",
"string",
"representing",
"a",
"byte",
"array",
"which",
"is",
"passed",
"to",
"{",
"@linkplain",
"Strea... | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java#L812-L817 |
kaazing/gateway | transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpMergeRequestFilter.java | HttpMergeRequestFilter.writeHttpResponse | private WriteFuture writeHttpResponse(NextFilter nextFilter, IoSession session, HttpRequestMessage httpRequest, final HttpStatus httpStatus) {
"""
Write a fresh HttpResponse from this filter down the filter chain, based on the provided request, with the specified http status code.
@param nextFilter the next fi... | java | private WriteFuture writeHttpResponse(NextFilter nextFilter, IoSession session, HttpRequestMessage httpRequest, final HttpStatus httpStatus) {
return writeHttpResponse(nextFilter, session, httpRequest, httpStatus, null);
} | [
"private",
"WriteFuture",
"writeHttpResponse",
"(",
"NextFilter",
"nextFilter",
",",
"IoSession",
"session",
",",
"HttpRequestMessage",
"httpRequest",
",",
"final",
"HttpStatus",
"httpStatus",
")",
"{",
"return",
"writeHttpResponse",
"(",
"nextFilter",
",",
"session",
... | Write a fresh HttpResponse from this filter down the filter chain, based on the provided request, with the specified http status code.
@param nextFilter the next filter in the chain
@param session the IO session
@param httpRequest the request that the response corresponds to
@param httpStatus the desired status ... | [
"Write",
"a",
"fresh",
"HttpResponse",
"from",
"this",
"filter",
"down",
"the",
"filter",
"chain",
"based",
"on",
"the",
"provided",
"request",
"with",
"the",
"specified",
"http",
"status",
"code",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpMergeRequestFilter.java#L332-L334 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/rpc/runner/XmlRpcRemoteRunner.java | XmlRpcRemoteRunner.runReference | public Reference runReference(String projectName, String sutName, String requirementRepositoryId,
String requirementName, String locale)
throws GreenPepperServerException {
"""
<p>runReference.</p>
@param projectName a {@link java.lang.String} object.
@param sutName a {@link java.lang.String} obje... | java | public Reference runReference(String projectName, String sutName, String requirementRepositoryId,
String requirementName, String locale)
throws GreenPepperServerException
{
return runReference(projectName, sutName, requirementRepositoryId, requirementName, null, null, locale);
} | [
"public",
"Reference",
"runReference",
"(",
"String",
"projectName",
",",
"String",
"sutName",
",",
"String",
"requirementRepositoryId",
",",
"String",
"requirementName",
",",
"String",
"locale",
")",
"throws",
"GreenPepperServerException",
"{",
"return",
"runReference"... | <p>runReference.</p>
@param projectName a {@link java.lang.String} object.
@param sutName a {@link java.lang.String} object.
@param requirementRepositoryId a {@link java.lang.String} object.
@param requirementName a {@link java.lang.String} object.
@param locale a {@link java.lang.String} object.
@return a {@link com.... | [
"<p",
">",
"runReference",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/rpc/runner/XmlRpcRemoteRunner.java#L150-L155 |
overturetool/overture | core/parser/src/main/java/org/overture/parser/syntax/SyntaxReader.java | SyntaxReader.throwMessage | protected void throwMessage(int number, String message, ILexToken token)
throws ParserException {
"""
Raise a {@link ParserException} at the location of the token passed in.
@param number
The error number.
@param message
The error message.
@param token
The location of the error.
@throws ParserException... | java | protected void throwMessage(int number, String message, ILexToken token)
throws ParserException
{
throw new ParserException(number, message, token.getLocation(), reader.getTokensRead());
} | [
"protected",
"void",
"throwMessage",
"(",
"int",
"number",
",",
"String",
"message",
",",
"ILexToken",
"token",
")",
"throws",
"ParserException",
"{",
"throw",
"new",
"ParserException",
"(",
"number",
",",
"message",
",",
"token",
".",
"getLocation",
"(",
")",... | Raise a {@link ParserException} at the location of the token passed in.
@param number
The error number.
@param message
The error message.
@param token
The location of the error.
@throws ParserException | [
"Raise",
"a",
"{",
"@link",
"ParserException",
"}",
"at",
"the",
"location",
"of",
"the",
"token",
"passed",
"in",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/parser/src/main/java/org/overture/parser/syntax/SyntaxReader.java#L507-L511 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbCertifications.java | TmdbCertifications.getMoviesCertification | public ResultsMap<String, List<Certification>> getMoviesCertification() throws MovieDbException {
"""
Get a list of movies certification.
@return
@throws MovieDbException
"""
URL url = new ApiUrl(apiKey, MethodBase.CERTIFICATION).subMethod(MethodSub.MOVIE_LIST).buildUrl();
String webpage = ... | java | public ResultsMap<String, List<Certification>> getMoviesCertification() throws MovieDbException {
URL url = new ApiUrl(apiKey, MethodBase.CERTIFICATION).subMethod(MethodSub.MOVIE_LIST).buildUrl();
String webpage = httpTools.getRequest(url);
try {
JsonNode node = MAPPER.readTree(webp... | [
"public",
"ResultsMap",
"<",
"String",
",",
"List",
"<",
"Certification",
">",
">",
"getMoviesCertification",
"(",
")",
"throws",
"MovieDbException",
"{",
"URL",
"url",
"=",
"new",
"ApiUrl",
"(",
"apiKey",
",",
"MethodBase",
".",
"CERTIFICATION",
")",
".",
"... | Get a list of movies certification.
@return
@throws MovieDbException | [
"Get",
"a",
"list",
"of",
"movies",
"certification",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbCertifications.java#L60-L72 |
enioka/jqm | jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/Helpers.java | Helpers.createMessage | static void createMessage(String textMessage, JobInstance jobInstance, DbConn cnx) {
"""
Create a text message that will be stored in the database. Must be called inside a transaction.
"""
cnx.runUpdate("message_insert", jobInstance.getId(), textMessage);
} | java | static void createMessage(String textMessage, JobInstance jobInstance, DbConn cnx)
{
cnx.runUpdate("message_insert", jobInstance.getId(), textMessage);
} | [
"static",
"void",
"createMessage",
"(",
"String",
"textMessage",
",",
"JobInstance",
"jobInstance",
",",
"DbConn",
"cnx",
")",
"{",
"cnx",
".",
"runUpdate",
"(",
"\"message_insert\"",
",",
"jobInstance",
".",
"getId",
"(",
")",
",",
"textMessage",
")",
";",
... | Create a text message that will be stored in the database. Must be called inside a transaction. | [
"Create",
"a",
"text",
"message",
"that",
"will",
"be",
"stored",
"in",
"the",
"database",
".",
"Must",
"be",
"called",
"inside",
"a",
"transaction",
"."
] | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/Helpers.java#L190-L193 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java | JDBC4PreparedStatement.setObject | @Override
public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException {
"""
Sets the value of the designated parameter with the given object.
"""
checkParameterBounds(parameterIndex);
throw SQLError.noSupport();
} | java | @Override
public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException
{
checkParameterBounds(parameterIndex);
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"void",
"setObject",
"(",
"int",
"parameterIndex",
",",
"Object",
"x",
",",
"int",
"targetSqlType",
",",
"int",
"scaleOrLength",
")",
"throws",
"SQLException",
"{",
"checkParameterBounds",
"(",
"parameterIndex",
")",
";",
"throw",
"SQL... | Sets the value of the designated parameter with the given object. | [
"Sets",
"the",
"value",
"of",
"the",
"designated",
"parameter",
"with",
"the",
"given",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java#L510-L515 |
florent37/DaVinci | davinci/src/main/java/com/github/florent37/davinci/DaVinci.java | DaVinci.downloadBitmap | private void downloadBitmap(final String path, final Object into, final Transformation transformation) {
"""
Download bitmap from bluetooth asset and store it into LruCache and LruDiskCache
@param path the path or url of the image
@param into the destination object
"""
//download the bitmap from bl... | java | private void downloadBitmap(final String path, final Object into, final Transformation transformation) {
//download the bitmap from bluetooth
new AsyncTask<Void, Void, Bitmap>() {
@Override
protected Bitmap doInBackground(Void... params) {
Bitmap bitmap = getBitma... | [
"private",
"void",
"downloadBitmap",
"(",
"final",
"String",
"path",
",",
"final",
"Object",
"into",
",",
"final",
"Transformation",
"transformation",
")",
"{",
"//download the bitmap from bluetooth",
"new",
"AsyncTask",
"<",
"Void",
",",
"Void",
",",
"Bitmap",
">... | Download bitmap from bluetooth asset and store it into LruCache and LruDiskCache
@param path the path or url of the image
@param into the destination object | [
"Download",
"bitmap",
"from",
"bluetooth",
"asset",
"and",
"store",
"it",
"into",
"LruCache",
"and",
"LruDiskCache"
] | train | https://github.com/florent37/DaVinci/blob/9c6ce4aa2df8e2288cd6ee8b57d9091b1b770a7a/davinci/src/main/java/com/github/florent37/davinci/DaVinci.java#L485-L510 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsListItemWidget.java | CmsListItemWidget.setLockIcon | public void setLockIcon(LockIcon icon, String iconTitle) {
"""
Sets the lock icon.<p>
@param icon the icon to use
@param iconTitle the icon title
"""
if (m_lockIcon == null) {
m_lockIcon = new HTML();
m_lockIcon.addClickHandler(m_iconSuperClickHandler);
m_conten... | java | public void setLockIcon(LockIcon icon, String iconTitle) {
if (m_lockIcon == null) {
m_lockIcon = new HTML();
m_lockIcon.addClickHandler(m_iconSuperClickHandler);
m_contentPanel.add(m_lockIcon);
}
switch (icon) {
case CLOSED:
m_loc... | [
"public",
"void",
"setLockIcon",
"(",
"LockIcon",
"icon",
",",
"String",
"iconTitle",
")",
"{",
"if",
"(",
"m_lockIcon",
"==",
"null",
")",
"{",
"m_lockIcon",
"=",
"new",
"HTML",
"(",
")",
";",
"m_lockIcon",
".",
"addClickHandler",
"(",
"m_iconSuperClickHand... | Sets the lock icon.<p>
@param icon the icon to use
@param iconTitle the icon title | [
"Sets",
"the",
"lock",
"icon",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsListItemWidget.java#L789-L828 |
LearnLib/automatalib | commons/util/src/main/java/net/automatalib/commons/util/array/AWUtil.java | AWUtil.safeWrite | public static <T, U extends T> int safeWrite(int num, ArrayWritable<U> aw, T[] array) {
"""
Writes a given maximum amount of data items from a container to an array. This method ensures that the array's
capacity is not exceeded.
@param num
the number of elements to copy
@param aw
the container.
@param arra... | java | public static <T, U extends T> int safeWrite(int num, ArrayWritable<U> aw, T[] array) {
final int elementsToCopy = Math.min(num, Math.min(aw.size(), array.length));
if (elementsToCopy <= 0) {
return 0;
}
aw.writeToArray(0, array, 0, elementsToCopy);
return elements... | [
"public",
"static",
"<",
"T",
",",
"U",
"extends",
"T",
">",
"int",
"safeWrite",
"(",
"int",
"num",
",",
"ArrayWritable",
"<",
"U",
">",
"aw",
",",
"T",
"[",
"]",
"array",
")",
"{",
"final",
"int",
"elementsToCopy",
"=",
"Math",
".",
"min",
"(",
... | Writes a given maximum amount of data items from a container to an array. This method ensures that the array's
capacity is not exceeded.
@param num
the number of elements to copy
@param aw
the container.
@param array
the array
@return the number of elements copied | [
"Writes",
"a",
"given",
"maximum",
"amount",
"of",
"data",
"items",
"from",
"a",
"container",
"to",
"an",
"array",
".",
"This",
"method",
"ensures",
"that",
"the",
"array",
"s",
"capacity",
"is",
"not",
"exceeded",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/util/src/main/java/net/automatalib/commons/util/array/AWUtil.java#L71-L81 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.toLongBiFunction | public static <T, U> ToLongBiFunction<T, U> toLongBiFunction(CheckedToLongBiFunction<T, U> function) {
"""
Wrap a {@link CheckedToLongBiFunction} in a {@link ToLongBiFunction}.
"""
return toLongBiFunction(function, THROWABLE_TO_RUNTIME_EXCEPTION);
} | java | public static <T, U> ToLongBiFunction<T, U> toLongBiFunction(CheckedToLongBiFunction<T, U> function) {
return toLongBiFunction(function, THROWABLE_TO_RUNTIME_EXCEPTION);
} | [
"public",
"static",
"<",
"T",
",",
"U",
">",
"ToLongBiFunction",
"<",
"T",
",",
"U",
">",
"toLongBiFunction",
"(",
"CheckedToLongBiFunction",
"<",
"T",
",",
"U",
">",
"function",
")",
"{",
"return",
"toLongBiFunction",
"(",
"function",
",",
"THROWABLE_TO_RUN... | Wrap a {@link CheckedToLongBiFunction} in a {@link ToLongBiFunction}. | [
"Wrap",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L390-L392 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.findResult | public static Object findResult(Object self, Closure condition) {
"""
Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns null.
<p>
<pre class="groovyTestCase">
int[] numbers = [1, 2, 3]
assert numb... | java | public static Object findResult(Object self, Closure condition) {
for (Iterator iter = InvokerHelper.asIterator(self); iter.hasNext(); ) {
Object value = iter.next();
Object result = condition.call(value);
if (result != null) {
return result;
}
... | [
"public",
"static",
"Object",
"findResult",
"(",
"Object",
"self",
",",
"Closure",
"condition",
")",
"{",
"for",
"(",
"Iterator",
"iter",
"=",
"InvokerHelper",
".",
"asIterator",
"(",
"self",
")",
";",
"iter",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"... | Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns null.
<p>
<pre class="groovyTestCase">
int[] numbers = [1, 2, 3]
assert numbers.findResult { if(it {@code >} 1) return it } == 2
assert numbers.findResult ... | [
"Treats",
"the",
"object",
"as",
"iterable",
"iterating",
"through",
"the",
"values",
"it",
"represents",
"and",
"returns",
"the",
"first",
"non",
"-",
"null",
"result",
"obtained",
"from",
"calling",
"the",
"closure",
"otherwise",
"returns",
"null",
".",
"<p"... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L4409-L4418 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java | JobSchedulesImpl.existsAsync | public Observable<Boolean> existsAsync(String jobScheduleId) {
"""
Checks the specified job schedule exists.
@param jobScheduleId The ID of the job schedule which you want to check.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Boolean object
"""
... | java | public Observable<Boolean> existsAsync(String jobScheduleId) {
return existsWithServiceResponseAsync(jobScheduleId).map(new Func1<ServiceResponseWithHeaders<Boolean, JobScheduleExistsHeaders>, Boolean>() {
@Override
public Boolean call(ServiceResponseWithHeaders<Boolean, JobScheduleExist... | [
"public",
"Observable",
"<",
"Boolean",
">",
"existsAsync",
"(",
"String",
"jobScheduleId",
")",
"{",
"return",
"existsWithServiceResponseAsync",
"(",
"jobScheduleId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponseWithHeaders",
"<",
"Boolean",
",",
"J... | Checks the specified job schedule exists.
@param jobScheduleId The ID of the job schedule which you want to check.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Boolean object | [
"Checks",
"the",
"specified",
"job",
"schedule",
"exists",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java#L172-L179 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addCustomPrebuiltDomainWithServiceResponseAsync | public Observable<ServiceResponse<List<UUID>>> addCustomPrebuiltDomainWithServiceResponseAsync(UUID appId, String versionId, AddCustomPrebuiltDomainModelsOptionalParameter addCustomPrebuiltDomainOptionalParameter) {
"""
Adds a customizable prebuilt domain along with all of its models to this application.
@param... | java | public Observable<ServiceResponse<List<UUID>>> addCustomPrebuiltDomainWithServiceResponseAsync(UUID appId, String versionId, AddCustomPrebuiltDomainModelsOptionalParameter addCustomPrebuiltDomainOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter ... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"UUID",
">",
">",
">",
"addCustomPrebuiltDomainWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"AddCustomPrebuiltDomainModelsOptionalParameter",
"addCustomPrebuiltDomainOptiona... | Adds a customizable prebuilt domain along with all of its models to this application.
@param appId The application ID.
@param versionId The version ID.
@param addCustomPrebuiltDomainOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thro... | [
"Adds",
"a",
"customizable",
"prebuilt",
"domain",
"along",
"with",
"all",
"of",
"its",
"models",
"to",
"this",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L5588-L5601 |
spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java | CoreOAuthConsumerSupport.configureURLForProtectedAccess | protected URL configureURLForProtectedAccess(URL url, OAuthConsumerToken requestToken, ProtectedResourceDetails details, String httpMethod, Map<String, String> additionalParameters) {
"""
Internal use of configuring the URL for protected access, the resource details already having been loaded.
@param url ... | java | protected URL configureURLForProtectedAccess(URL url, OAuthConsumerToken requestToken, ProtectedResourceDetails details, String httpMethod, Map<String, String> additionalParameters) {
String file;
if (!"POST".equalsIgnoreCase(httpMethod) && !"PUT".equalsIgnoreCase(httpMethod) && !details.isAcceptsAuthorizationH... | [
"protected",
"URL",
"configureURLForProtectedAccess",
"(",
"URL",
"url",
",",
"OAuthConsumerToken",
"requestToken",
",",
"ProtectedResourceDetails",
"details",
",",
"String",
"httpMethod",
",",
"Map",
"<",
"String",
",",
"String",
">",
"additionalParameters",
")",
"{"... | Internal use of configuring the URL for protected access, the resource details already having been loaded.
@param url The URL.
@param requestToken The request token.
@param details The details.
@param httpMethod The http method.
@param additionalParameters Any additional request parameters.
@return The... | [
"Internal",
"use",
"of",
"configuring",
"the",
"URL",
"for",
"protected",
"access",
"the",
"resource",
"details",
"already",
"having",
"been",
"loaded",
"."
] | train | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java#L272-L300 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/transform/transformpolicy_stats.java | transformpolicy_stats.get | public static transformpolicy_stats get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch statistics of transformpolicy_stats resource of given name .
"""
transformpolicy_stats obj = new transformpolicy_stats();
obj.set_name(name);
transformpolicy_stats response = (transfor... | java | public static transformpolicy_stats get(nitro_service service, String name) throws Exception{
transformpolicy_stats obj = new transformpolicy_stats();
obj.set_name(name);
transformpolicy_stats response = (transformpolicy_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"transformpolicy_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"transformpolicy_stats",
"obj",
"=",
"new",
"transformpolicy_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
... | Use this API to fetch statistics of transformpolicy_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"transformpolicy_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/transform/transformpolicy_stats.java#L169-L174 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosGeoApi.java | PhotosGeoApi.getLocation | public Location getLocation(String photoId, boolean sign) throws JinxException {
"""
Get the geo data (latitude and longitude and the accuracy level) for a photo.
<br>
This method does not require authentication.
@param photoId (Required) The id of the photo you want to retrieve location data for.
@param sig... | java | public Location getLocation(String photoId, boolean sign) throws JinxException {
JinxUtils.validateParams(photoId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photos.geo.getLocation");
params.put("photo_id", photoId);
return jinx.flickrGet(params, Location.class);
} | [
"public",
"Location",
"getLocation",
"(",
"String",
"photoId",
",",
"boolean",
"sign",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photoId",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"TreeMap... | Get the geo data (latitude and longitude and the accuracy level) for a photo.
<br>
This method does not require authentication.
@param photoId (Required) The id of the photo you want to retrieve location data for.
@param sign if true, the request will be signed.
@return location data for the specified photo.
@throw... | [
"Get",
"the",
"geo",
"data",
"(",
"latitude",
"and",
"longitude",
"and",
"the",
"accuracy",
"level",
")",
"for",
"a",
"photo",
".",
"<br",
">",
"This",
"method",
"does",
"not",
"require",
"authentication",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosGeoApi.java#L126-L132 |
Waikato/moa | moa/src/main/java/moa/cluster/CFCluster.java | CFCluster.addVectors | public static void addVectors(double[] a1, double[] a2) {
"""
Adds the second array to the first array element by element. The arrays
must have the same length.
@param a1 Vector to which the second vector is added.
@param a2 Vector to be added. This vector does not change.
"""
assert (a1 != null);
ass... | java | public static void addVectors(double[] a1, double[] a2) {
assert (a1 != null);
assert (a2 != null);
assert (a1.length == a2.length) : "Adding two arrays of different "
+ "length";
for (int i = 0; i < a1.length; i++) {
a1[i] += a2[i];
}
} | [
"public",
"static",
"void",
"addVectors",
"(",
"double",
"[",
"]",
"a1",
",",
"double",
"[",
"]",
"a2",
")",
"{",
"assert",
"(",
"a1",
"!=",
"null",
")",
";",
"assert",
"(",
"a2",
"!=",
"null",
")",
";",
"assert",
"(",
"a1",
".",
"length",
"==",
... | Adds the second array to the first array element by element. The arrays
must have the same length.
@param a1 Vector to which the second vector is added.
@param a2 Vector to be added. This vector does not change. | [
"Adds",
"the",
"second",
"array",
"to",
"the",
"first",
"array",
"element",
"by",
"element",
".",
"The",
"arrays",
"must",
"have",
"the",
"same",
"length",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/cluster/CFCluster.java#L162-L171 |
loldevs/riotapi | rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/SummonerTeamService.java | SummonerTeamService.invitePlayer | public Team invitePlayer(long summonerId, TeamId teamId) {
"""
Invite a player to the target team
@param summonerId The id of the player
@param teamId The id of the team
@return The new team state
"""
return client.sendRpcAndWait(SERVICE, "invitePlayer", summonerId, teamId);
} | java | public Team invitePlayer(long summonerId, TeamId teamId) {
return client.sendRpcAndWait(SERVICE, "invitePlayer", summonerId, teamId);
} | [
"public",
"Team",
"invitePlayer",
"(",
"long",
"summonerId",
",",
"TeamId",
"teamId",
")",
"{",
"return",
"client",
".",
"sendRpcAndWait",
"(",
"SERVICE",
",",
"\"invitePlayer\"",
",",
"summonerId",
",",
"teamId",
")",
";",
"}"
] | Invite a player to the target team
@param summonerId The id of the player
@param teamId The id of the team
@return The new team state | [
"Invite",
"a",
"player",
"to",
"the",
"target",
"team"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/SummonerTeamService.java#L105-L107 |
wigforss/Ka-Commons-Jmx | core/src/main/java/org/kasource/commons/jmx/dynamic/AnnotationDynamicMBeanFactory.java | AnnotationDynamicMBeanFactory.getInfo | private MBeanInfo getInfo(Object object, ClassIntrospector classIntrospector) throws IntrospectionException {
"""
Create and return a MBeanInfo instance for the supplied object.
@param object Supplied object to inspect.
@param classIntrospector ClassIntrospector to use.
@return a MBeanInfo inst... | java | private MBeanInfo getInfo(Object object, ClassIntrospector classIntrospector) throws IntrospectionException {
JmxBean jmxBean = AnnotationUtils.getAnnotation(object.getClass(), JmxBean.class);
MBeanInfo beanInfo = new MBeanInfo(object.getClass().getName(),
... | [
"private",
"MBeanInfo",
"getInfo",
"(",
"Object",
"object",
",",
"ClassIntrospector",
"classIntrospector",
")",
"throws",
"IntrospectionException",
"{",
"JmxBean",
"jmxBean",
"=",
"AnnotationUtils",
".",
"getAnnotation",
"(",
"object",
".",
"getClass",
"(",
")",
","... | Create and return a MBeanInfo instance for the supplied object.
@param object Supplied object to inspect.
@param classIntrospector ClassIntrospector to use.
@return a MBeanInfo instance for the supplied object.
@throws IntrospectionException If failed to create Info object
@throws IllegalArgumentExce... | [
"Create",
"and",
"return",
"a",
"MBeanInfo",
"instance",
"for",
"the",
"supplied",
"object",
"."
] | train | https://github.com/wigforss/Ka-Commons-Jmx/blob/f31ceda37ff55746bb43a059919842cb92405b5d/core/src/main/java/org/kasource/commons/jmx/dynamic/AnnotationDynamicMBeanFactory.java#L95-L105 |
Tourenathan-G5organisation/SiliCompressor | silicompressor/src/main/java/com/iceteck/silicompressorr/FileUtils.java | FileUtils.getFile | public static File getFile(Context context, Uri uri) {
"""
Convert Uri into File, if possible.
@return file A local file that the Uri was pointing to, or null if the
Uri is unsupported or pointed to a remote resource.
@see #getPath(Context, Uri)
@author paulburke
"""
if (uri != null) {
... | java | public static File getFile(Context context, Uri uri) {
if (uri != null) {
String path = getPath(context, uri);
if (path != null && isLocal(path)) {
return new File(path);
}
}
return null;
} | [
"public",
"static",
"File",
"getFile",
"(",
"Context",
"context",
",",
"Uri",
"uri",
")",
"{",
"if",
"(",
"uri",
"!=",
"null",
")",
"{",
"String",
"path",
"=",
"getPath",
"(",
"context",
",",
"uri",
")",
";",
"if",
"(",
"path",
"!=",
"null",
"&&",
... | Convert Uri into File, if possible.
@return file A local file that the Uri was pointing to, or null if the
Uri is unsupported or pointed to a remote resource.
@see #getPath(Context, Uri)
@author paulburke | [
"Convert",
"Uri",
"into",
"File",
"if",
"possible",
"."
] | train | https://github.com/Tourenathan-G5organisation/SiliCompressor/blob/546f6cd7b2a7a783e1122df46c1e237f8938fe72/silicompressor/src/main/java/com/iceteck/silicompressorr/FileUtils.java#L342-L350 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpd/MPDUtility.java | MPDUtility.fileHexDump | public static final void fileHexDump(String fileName, InputStream is) {
"""
Writes a hex dump to a file from a POI input stream.
Note that this assumes that the complete size of the data in
the stream is returned by the available() method.
@param fileName output file name
@param is input stream
"""
... | java | public static final void fileHexDump(String fileName, InputStream is)
{
try
{
byte[] data = new byte[is.available()];
is.read(data);
fileHexDump(fileName, data);
}
catch (IOException ex)
{
ex.printStackTrace();
}
} | [
"public",
"static",
"final",
"void",
"fileHexDump",
"(",
"String",
"fileName",
",",
"InputStream",
"is",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"data",
"=",
"new",
"byte",
"[",
"is",
".",
"available",
"(",
")",
"]",
";",
"is",
".",
"read",
"(",
"d... | Writes a hex dump to a file from a POI input stream.
Note that this assumes that the complete size of the data in
the stream is returned by the available() method.
@param fileName output file name
@param is input stream | [
"Writes",
"a",
"hex",
"dump",
"to",
"a",
"file",
"from",
"a",
"POI",
"input",
"stream",
".",
"Note",
"that",
"this",
"assumes",
"that",
"the",
"complete",
"size",
"of",
"the",
"data",
"in",
"the",
"stream",
"is",
"returned",
"by",
"the",
"available",
"... | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPDUtility.java#L488-L501 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java | Uris.resolveParams | public static URI resolveParams(final URI uri,
final Map<String, String> params,
final boolean strict,
final boolean strictNorm) throws NormalizationException {
"""
Returns a new URI that is the given URI re... | java | public static URI resolveParams(final URI uri,
final Map<String, String> params,
final boolean strict,
final boolean strictNorm) throws NormalizationException {
return resolve(uri, "&" + PARAM_JOINER.join... | [
"public",
"static",
"URI",
"resolveParams",
"(",
"final",
"URI",
"uri",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"final",
"boolean",
"strict",
",",
"final",
"boolean",
"strictNorm",
")",
"throws",
"NormalizationException",
"{",
... | Returns a new URI that is the given URI resolved with the given query parameters resolved (appended). Both
the keys and values of each entry in the map will be normalized as queryParameter
@param uri the base URI to resolve against
@param params the query parameters to resolve
@param strict whether or not to perform ... | [
"Returns",
"a",
"new",
"URI",
"that",
"is",
"the",
"given",
"URI",
"resolved",
"with",
"the",
"given",
"query",
"parameters",
"resolved",
"(",
"appended",
")",
".",
"Both",
"the",
"keys",
"and",
"values",
"of",
"each",
"entry",
"in",
"the",
"map",
"will"... | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java#L377-L382 |
biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/WrapLayout.java | WrapLayout.addRow | private void addRow(Dimension dim, int rowWidth, int rowHeight) {
"""
/*
A new row has been completed. Use the dimensions of this row
to update the preferred size for the container.
@param dim update the width and height when appropriate
@param rowWidth the width of the row to add
@param rowHeight the heigh... | java | private void addRow(Dimension dim, int rowWidth, int rowHeight)
{
dim.width = Math.max(dim.width, rowWidth);
if (dim.height > 0)
{
dim.height += getVgap();
}
dim.height += rowHeight;
} | [
"private",
"void",
"addRow",
"(",
"Dimension",
"dim",
",",
"int",
"rowWidth",
",",
"int",
"rowHeight",
")",
"{",
"dim",
".",
"width",
"=",
"Math",
".",
"max",
"(",
"dim",
".",
"width",
",",
"rowWidth",
")",
";",
"if",
"(",
"dim",
".",
"height",
">"... | /*
A new row has been completed. Use the dimensions of this row
to update the preferred size for the container.
@param dim update the width and height when appropriate
@param rowWidth the width of the row to add
@param rowHeight the height of the row to add | [
"/",
"*",
"A",
"new",
"row",
"has",
"been",
"completed",
".",
"Use",
"the",
"dimensions",
"of",
"this",
"row",
"to",
"update",
"the",
"preferred",
"size",
"for",
"the",
"container",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/WrapLayout.java#L204-L214 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.checkMethod | private static Boolean checkMethod(NetworkInterface iface, Method toCheck) {
"""
Call a method and return the result as boolean. In case of problems, return false.
"""
if (toCheck != null) {
try {
return (Boolean) toCheck.invoke(iface, (Object[]) null);
} catch (... | java | private static Boolean checkMethod(NetworkInterface iface, Method toCheck) {
if (toCheck != null) {
try {
return (Boolean) toCheck.invoke(iface, (Object[]) null);
} catch (IllegalAccessException e) {
return false;
} catch (InvocationTargetExcep... | [
"private",
"static",
"Boolean",
"checkMethod",
"(",
"NetworkInterface",
"iface",
",",
"Method",
"toCheck",
")",
"{",
"if",
"(",
"toCheck",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"(",
"Boolean",
")",
"toCheck",
".",
"invoke",
"(",
"iface",
",",
"("... | Call a method and return the result as boolean. In case of problems, return false. | [
"Call",
"a",
"method",
"and",
"return",
"the",
"result",
"as",
"boolean",
".",
"In",
"case",
"of",
"problems",
"return",
"false",
"."
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L221-L233 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/Session.java | Session.setTransactionIsolation | public void setTransactionIsolation(int level) throws SQLException {
"""
设置事务的隔离级别<br>
Connection.TRANSACTION_NONE 驱动不支持事务<br>
Connection.TRANSACTION_READ_UNCOMMITTED 允许脏读、不可重复读和幻读<br>
Connection.TRANSACTION_READ_COMMITTED 禁止脏读,但允许不可重复读和幻读<br>
Connection.TRANSACTION_REPEATABLE_READ 禁止脏读和不可重复读,单运行幻读<br>
Conn... | java | public void setTransactionIsolation(int level) throws SQLException {
if (getConnection().getMetaData().supportsTransactionIsolationLevel(level) == false) {
throw new SQLException(StrUtil.format("Transaction isolation [{}] not support!", level));
}
getConnection().setTransactionIsolation(level);
} | [
"public",
"void",
"setTransactionIsolation",
"(",
"int",
"level",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"getConnection",
"(",
")",
".",
"getMetaData",
"(",
")",
".",
"supportsTransactionIsolationLevel",
"(",
"level",
")",
"==",
"false",
")",
"{",
"thr... | 设置事务的隔离级别<br>
Connection.TRANSACTION_NONE 驱动不支持事务<br>
Connection.TRANSACTION_READ_UNCOMMITTED 允许脏读、不可重复读和幻读<br>
Connection.TRANSACTION_READ_COMMITTED 禁止脏读,但允许不可重复读和幻读<br>
Connection.TRANSACTION_REPEATABLE_READ 禁止脏读和不可重复读,单运行幻读<br>
Connection.TRANSACTION_SERIALIZABLE 禁止脏读、不可重复读和幻读<br>
@param level 隔离级别
@throws SQLExce... | [
"设置事务的隔离级别<br",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/Session.java#L246-L251 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsync | public static <T1> Func1<T1, Observable<Void>> toAsync(Action1<? super T1> action) {
"""
Convert a synchronous action call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.an.png" alt="">
@param <T1> fi... | java | public static <T1> Func1<T1, Observable<Void>> toAsync(Action1<? super T1> action) {
return toAsync(action, Schedulers.computation());
} | [
"public",
"static",
"<",
"T1",
">",
"Func1",
"<",
"T1",
",",
"Observable",
"<",
"Void",
">",
">",
"toAsync",
"(",
"Action1",
"<",
"?",
"super",
"T1",
">",
"action",
")",
"{",
"return",
"toAsync",
"(",
"action",
",",
"Schedulers",
".",
"computation",
... | Convert a synchronous action call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.an.png" alt="">
@param <T1> first parameter type of the action
@param action the action to convert
@return a function that retur... | [
"Convert",
"a",
"synchronous",
"action",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki",
... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L191-L193 |
cache2k/cache2k | cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java | CacheConfigurationProviderImpl.handleSection | private boolean handleSection(
final ConfigurationContext ctx,
final Class<?> _type,
final ConfigurationWithSections cfg,
final ParsedConfiguration sc) {
"""
Create a new configuration section or reuse an existing section, if it is a singleton.
<p>No support for writing on existing sections, whi... | java | private boolean handleSection(
final ConfigurationContext ctx,
final Class<?> _type,
final ConfigurationWithSections cfg,
final ParsedConfiguration sc) {
String _containerName = sc.getContainer();
if (!"sections".equals(_containerName)) {
return false;
}
@SuppressWarnings("unchecke... | [
"private",
"boolean",
"handleSection",
"(",
"final",
"ConfigurationContext",
"ctx",
",",
"final",
"Class",
"<",
"?",
">",
"_type",
",",
"final",
"ConfigurationWithSections",
"cfg",
",",
"final",
"ParsedConfiguration",
"sc",
")",
"{",
"String",
"_containerName",
"=... | Create a new configuration section or reuse an existing section, if it is a singleton.
<p>No support for writing on existing sections, which means it is not possible to define a non singleton
in the defaults section and then override values later in the cache specific configuration.
This is not needed for version 1.0.... | [
"Create",
"a",
"new",
"configuration",
"section",
"or",
"reuse",
"an",
"existing",
"section",
"if",
"it",
"is",
"a",
"singleton",
"."
] | train | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java#L410-L430 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java | ConfigurationsInner.beginUpdate | public void beginUpdate(String resourceGroupName, String clusterName, String configurationName, Map<String, String> parameters) {
"""
Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead.
@param resourceGroupName The name of ... | java | public void beginUpdate(String resourceGroupName, String clusterName, String configurationName, Map<String, String> parameters) {
beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().single().body();
} | [
"public",
"void",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"configurationName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName... | Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param configurationName The name of the cluster configuration.
@param parame... | [
"Configures",
"the",
"HTTP",
"settings",
"on",
"the",
"specified",
"cluster",
".",
"This",
"API",
"is",
"deprecated",
"please",
"use",
"UpdateGatewaySettings",
"in",
"cluster",
"endpoint",
"instead",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java#L256-L258 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.lesserThan | @ArgumentsChecked
@Throws(IllegalNotLesserThanException.class)
public static byte lesserThan(final byte expected, final byte check, @Nonnull final String message) {
"""
Ensures that a passed {@code byte} is less than another {@code byte}.
@param expected
Expected value
@param check
Comparable to be checked... | java | @ArgumentsChecked
@Throws(IllegalNotLesserThanException.class)
public static byte lesserThan(final byte expected, final byte check, @Nonnull final String message) {
if (expected <= check) {
throw new IllegalNotLesserThanException(message, check);
}
return check;
} | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"IllegalNotLesserThanException",
".",
"class",
")",
"public",
"static",
"byte",
"lesserThan",
"(",
"final",
"byte",
"expected",
",",
"final",
"byte",
"check",
",",
"@",
"Nonnull",
"final",
"String",
"message",
")",
... | Ensures that a passed {@code byte} is less than another {@code byte}.
@param expected
Expected value
@param check
Comparable to be checked
@param message
an error message describing why the comparables must be less than a value (will be passed to
{@code IllegalNotLessThanException})
@return the passed {@code Comparabl... | [
"Ensures",
"that",
"a",
"passed",
"{",
"@code",
"byte",
"}",
"is",
"less",
"than",
"another",
"{",
"@code",
"byte",
"}",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L1395-L1403 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/swap/SwapFragmentPanel.java | SwapFragmentPanel.swapFragments | protected void swapFragments(final AjaxRequestTarget target, final Form<?> form) {
"""
Swaps the fragments.
@param target
the target
@param form
the form
"""
if (modeContext.equals(ModeContext.VIEW_MODE))
{
onSwapToEdit(target, form);
}
else
{
onSwapToView(target, form);
}
} | java | protected void swapFragments(final AjaxRequestTarget target, final Form<?> form)
{
if (modeContext.equals(ModeContext.VIEW_MODE))
{
onSwapToEdit(target, form);
}
else
{
onSwapToView(target, form);
}
} | [
"protected",
"void",
"swapFragments",
"(",
"final",
"AjaxRequestTarget",
"target",
",",
"final",
"Form",
"<",
"?",
">",
"form",
")",
"{",
"if",
"(",
"modeContext",
".",
"equals",
"(",
"ModeContext",
".",
"VIEW_MODE",
")",
")",
"{",
"onSwapToEdit",
"(",
"ta... | Swaps the fragments.
@param target
the target
@param form
the form | [
"Swaps",
"the",
"fragments",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/swap/SwapFragmentPanel.java#L182-L192 |
tango-controls/JTango | server/src/main/java/org/tango/server/events/EventManager.java | EventManager.bindEndpoints | private void bindEndpoints(ZMQ.Socket socket, Iterable<String> ipAddresses, Map<String, ZMQ.Socket> endpoints, SocketType socketType) {
"""
Binds given socket types to the list of addresses
@param socket
@param ipAddresses
@param endpoints
@param socketType
"""
xlogger.entry(ipAddresses, endpoint... | java | private void bindEndpoints(ZMQ.Socket socket, Iterable<String> ipAddresses, Map<String, ZMQ.Socket> endpoints, SocketType socketType) {
xlogger.entry(ipAddresses, endpoints, socketType);
for (String ipAddress : ipAddresses) {
final StringBuilder endpoint = new StringBuilder("tcp://").appen... | [
"private",
"void",
"bindEndpoints",
"(",
"ZMQ",
".",
"Socket",
"socket",
",",
"Iterable",
"<",
"String",
">",
"ipAddresses",
",",
"Map",
"<",
"String",
",",
"ZMQ",
".",
"Socket",
">",
"endpoints",
",",
"SocketType",
"socketType",
")",
"{",
"xlogger",
".",
... | Binds given socket types to the list of addresses
@param socket
@param ipAddresses
@param endpoints
@param socketType | [
"Binds",
"given",
"socket",
"types",
"to",
"the",
"list",
"of",
"addresses"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventManager.java#L229-L246 |
playn/playn | core/src/playn/core/json/JsonArray.java | JsonArray.getObject | public Json.Object getObject(int key, Json.Object default_) {
"""
Returns the {@link JsonObject} at the given index, or the default if it does not exist or is the wrong type.
"""
Object o = get(key);
return o instanceof Json.Object ? (Json.Object)get(key) : default_;
} | java | public Json.Object getObject(int key, Json.Object default_) {
Object o = get(key);
return o instanceof Json.Object ? (Json.Object)get(key) : default_;
} | [
"public",
"Json",
".",
"Object",
"getObject",
"(",
"int",
"key",
",",
"Json",
".",
"Object",
"default_",
")",
"{",
"Object",
"o",
"=",
"get",
"(",
"key",
")",
";",
"return",
"o",
"instanceof",
"Json",
".",
"Object",
"?",
"(",
"Json",
".",
"Object",
... | Returns the {@link JsonObject} at the given index, or the default if it does not exist or is the wrong type. | [
"Returns",
"the",
"{"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/json/JsonArray.java#L179-L182 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/endpoint/util/ByteBufJsonHelper.java | ByteBufJsonHelper.findNextCharNotPrefixedBy | public static final int findNextCharNotPrefixedBy(ByteBuf buf, char c, char prefix) {
"""
Find the number of bytes until next occurrence of the character c
from the current {@link ByteBuf#readerIndex() readerIndex} in buf,
with the twist that if this occurrence is prefixed by the prefix
character, we try to fin... | java | public static final int findNextCharNotPrefixedBy(ByteBuf buf, char c, char prefix) {
int found = buf.bytesBefore((byte) c);
if (found < 1) {
return found;
} else {
int from;
while (found > -1 && (char) buf.getByte(
buf.readerIndex() + fou... | [
"public",
"static",
"final",
"int",
"findNextCharNotPrefixedBy",
"(",
"ByteBuf",
"buf",
",",
"char",
"c",
",",
"char",
"prefix",
")",
"{",
"int",
"found",
"=",
"buf",
".",
"bytesBefore",
"(",
"(",
"byte",
")",
"c",
")",
";",
"if",
"(",
"found",
"<",
... | Find the number of bytes until next occurrence of the character c
from the current {@link ByteBuf#readerIndex() readerIndex} in buf,
with the twist that if this occurrence is prefixed by the prefix
character, we try to find another occurrence.
@param buf the {@link ByteBuf buffer} to look into.
@param c the character ... | [
"Find",
"the",
"number",
"of",
"bytes",
"until",
"next",
"occurrence",
"of",
"the",
"character",
"c",
"from",
"the",
"current",
"{",
"@link",
"ByteBuf#readerIndex",
"()",
"readerIndex",
"}",
"in",
"buf",
"with",
"the",
"twist",
"that",
"if",
"this",
"occurre... | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/util/ByteBufJsonHelper.java#L57-L77 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/util/TimestampPool.java | TimestampPool.getOrAddToCache | public Timestamp getOrAddToCache(Timestamp newValue, boolean hard) {
"""
return the pooled value
@param newValue the value to look up in the pool and add if not there
@return the pooled value
"""
if (newValue == null || newValue instanceof CachedImmutableTimestamp || newValue == NullDataTimestamp.... | java | public Timestamp getOrAddToCache(Timestamp newValue, boolean hard)
{
if (newValue == null || newValue instanceof CachedImmutableTimestamp || newValue == NullDataTimestamp.getInstance())
{
return newValue;
}
return (Timestamp) weakPool.getIfAbsentPut(newValue, hard);... | [
"public",
"Timestamp",
"getOrAddToCache",
"(",
"Timestamp",
"newValue",
",",
"boolean",
"hard",
")",
"{",
"if",
"(",
"newValue",
"==",
"null",
"||",
"newValue",
"instanceof",
"CachedImmutableTimestamp",
"||",
"newValue",
"==",
"NullDataTimestamp",
".",
"getInstance"... | return the pooled value
@param newValue the value to look up in the pool and add if not there
@return the pooled value | [
"return",
"the",
"pooled",
"value"
] | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/util/TimestampPool.java#L59-L66 |
apereo/cas | support/cas-server-support-actions/src/main/java/org/apereo/cas/web/flow/login/CreateTicketGrantingTicketAction.java | CreateTicketGrantingTicketAction.addMessageDescriptorToMessageContext | protected static void addMessageDescriptorToMessageContext(final MessageContext context, final MessageDescriptor warning) {
"""
Adds a warning message to the message context.
@param context Message context.
@param warning Warning message.
"""
val builder = new MessageBuilder()
.warning(... | java | protected static void addMessageDescriptorToMessageContext(final MessageContext context, final MessageDescriptor warning) {
val builder = new MessageBuilder()
.warning()
.code(warning.getCode())
.defaultText(warning.getDefaultMessage())
.args((Object[]) warning.ge... | [
"protected",
"static",
"void",
"addMessageDescriptorToMessageContext",
"(",
"final",
"MessageContext",
"context",
",",
"final",
"MessageDescriptor",
"warning",
")",
"{",
"val",
"builder",
"=",
"new",
"MessageBuilder",
"(",
")",
".",
"warning",
"(",
")",
".",
"code... | Adds a warning message to the message context.
@param context Message context.
@param warning Warning message. | [
"Adds",
"a",
"warning",
"message",
"to",
"the",
"message",
"context",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-actions/src/main/java/org/apereo/cas/web/flow/login/CreateTicketGrantingTicketAction.java#L78-L85 |
wildfly/wildfly-maven-plugin | core/src/main/java/org/wildfly/plugin/core/DeploymentOperations.java | DeploymentOperations.addRedeployOperationStep | private static void addRedeployOperationStep(final CompositeOperationBuilder builder, final DeploymentDescription deployment) {
"""
Adds a redeploy step to the composite operation.
@param builder the builder to add the step to
@param deployment the deployment being redeployed
"""
final String de... | java | private static void addRedeployOperationStep(final CompositeOperationBuilder builder, final DeploymentDescription deployment) {
final String deploymentName = deployment.getName();
final Set<String> serverGroups = deployment.getServerGroups();
if (serverGroups.isEmpty()) {
builder.add... | [
"private",
"static",
"void",
"addRedeployOperationStep",
"(",
"final",
"CompositeOperationBuilder",
"builder",
",",
"final",
"DeploymentDescription",
"deployment",
")",
"{",
"final",
"String",
"deploymentName",
"=",
"deployment",
".",
"getName",
"(",
")",
";",
"final"... | Adds a redeploy step to the composite operation.
@param builder the builder to add the step to
@param deployment the deployment being redeployed | [
"Adds",
"a",
"redeploy",
"step",
"to",
"the",
"composite",
"operation",
"."
] | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/DeploymentOperations.java#L422-L432 |
aol/cyclops | cyclops-futurestream/src/main/java/cyclops/futurestream/Pipes.java | Pipes.subscribeTo | public void subscribeTo(final K key, final Subscriber<V> subscriber) {
"""
Subscribe synchronously to a pipe
@param key for registered simple-react async.Adapter
@param subscriber Reactive Streams reactiveSubscriber for data on this pipe
"""
registered.get(key)
.stream()
... | java | public void subscribeTo(final K key, final Subscriber<V> subscriber) {
registered.get(key)
.stream()
.subscribe(subscriber);
} | [
"public",
"void",
"subscribeTo",
"(",
"final",
"K",
"key",
",",
"final",
"Subscriber",
"<",
"V",
">",
"subscriber",
")",
"{",
"registered",
".",
"get",
"(",
"key",
")",
".",
"stream",
"(",
")",
".",
"subscribe",
"(",
"subscriber",
")",
";",
"}"
] | Subscribe synchronously to a pipe
@param key for registered simple-react async.Adapter
@param subscriber Reactive Streams reactiveSubscriber for data on this pipe | [
"Subscribe",
"synchronously",
"to",
"a",
"pipe"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-futurestream/src/main/java/cyclops/futurestream/Pipes.java#L544-L549 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLocalizationPersistenceImpl.java | CPDefinitionLocalizationPersistenceImpl.findAll | @Override
public List<CPDefinitionLocalization> findAll() {
"""
Returns all the cp definition localizations.
@return the cp definition localizations
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPDefinitionLocalization> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionLocalization",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp definition localizations.
@return the cp definition localizations | [
"Returns",
"all",
"the",
"cp",
"definition",
"localizations",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLocalizationPersistenceImpl.java#L1420-L1423 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java | PolylineSplitMerge.increaseNumberOfSidesByOne | boolean increaseNumberOfSidesByOne(List<Point2D_I32> contour, boolean loops ) {
"""
Increase the number of sides in the polyline. This is done greedily selecting the side which would improve the
score by the most of it was split.
@param contour Contour
@return true if a split was selected and false if not
"... | java | boolean increaseNumberOfSidesByOne(List<Point2D_I32> contour, boolean loops ) {
// System.out.println("increase number of sides by one. list = "+list.size());
Element<Corner> selected = selectCornerToSplit(loops);
// No side can be split
if( selected == null )
return false;
// Update the corner who's side... | [
"boolean",
"increaseNumberOfSidesByOne",
"(",
"List",
"<",
"Point2D_I32",
">",
"contour",
",",
"boolean",
"loops",
")",
"{",
"//\t\tSystem.out.println(\"increase number of sides by one. list = \"+list.size());",
"Element",
"<",
"Corner",
">",
"selected",
"=",
"selectCornerToS... | Increase the number of sides in the polyline. This is done greedily selecting the side which would improve the
score by the most of it was split.
@param contour Contour
@return true if a split was selected and false if not | [
"Increase",
"the",
"number",
"of",
"sides",
"in",
"the",
"polyline",
".",
"This",
"is",
"done",
"greedily",
"selecting",
"the",
"side",
"which",
"would",
"improve",
"the",
"score",
"by",
"the",
"most",
"of",
"it",
"was",
"split",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L413-L444 |
jayantk/jklol | src/com/jayantkrish/jklol/tensor/DenseTensorBuilder.java | DenseTensorBuilder.getFactory | public static TensorFactory getFactory() {
"""
Gets a {@code TensorFactory} which creates {@code DenseTensorBuilder}s.
@return
"""
return new TensorFactory() {
@Override
public TensorBuilder getBuilder(int[] dimNums, int[] dimSizes) {
return new DenseTensorBuilder(dimNums, dimSizes);... | java | public static TensorFactory getFactory() {
return new TensorFactory() {
@Override
public TensorBuilder getBuilder(int[] dimNums, int[] dimSizes) {
return new DenseTensorBuilder(dimNums, dimSizes);
}
};
} | [
"public",
"static",
"TensorFactory",
"getFactory",
"(",
")",
"{",
"return",
"new",
"TensorFactory",
"(",
")",
"{",
"@",
"Override",
"public",
"TensorBuilder",
"getBuilder",
"(",
"int",
"[",
"]",
"dimNums",
",",
"int",
"[",
"]",
"dimSizes",
")",
"{",
"retur... | Gets a {@code TensorFactory} which creates {@code DenseTensorBuilder}s.
@return | [
"Gets",
"a",
"{",
"@code",
"TensorFactory",
"}",
"which",
"creates",
"{",
"@code",
"DenseTensorBuilder",
"}",
"s",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/tensor/DenseTensorBuilder.java#L495-L502 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_brvpx_image.java | xen_brvpx_image.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
xen_brvpx_image_responses result = (xen_brvpx_image_responses) service.... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_brvpx_image_responses result = (xen_brvpx_image_responses) service.get_payload_formatter().string_to_resource(xen_brvpx_image_responses.class, response);
if(result.errorcode != 0)
{
if (result... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_brvpx_image_responses",
"result",
"=",
"(",
"xen_brvpx_image_responses",
")",
"service",
".",
"get_payloa... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_brvpx_image.java#L264-L281 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java | CommerceTierPriceEntryPersistenceImpl.findByUUID_G | @Override
public CommerceTierPriceEntry findByUUID_G(String uuid, long groupId)
throws NoSuchTierPriceEntryException {
"""
Returns the commerce tier price entry where uuid = ? and groupId = ? or throws a {@link NoSuchTierPriceEntryException} if it could not be found.
@param uuid the uuid
@param grou... | java | @Override
public CommerceTierPriceEntry findByUUID_G(String uuid, long groupId)
throws NoSuchTierPriceEntryException {
CommerceTierPriceEntry commerceTierPriceEntry = fetchByUUID_G(uuid,
groupId);
if (commerceTierPriceEntry == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTI... | [
"@",
"Override",
"public",
"CommerceTierPriceEntry",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchTierPriceEntryException",
"{",
"CommerceTierPriceEntry",
"commerceTierPriceEntry",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
... | Returns the commerce tier price entry where uuid = ? and groupId = ? or throws a {@link NoSuchTierPriceEntryException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce tier price entry
@throws NoSuchTierPriceEntryException if a matching commerce tier pric... | [
"Returns",
"the",
"commerce",
"tier",
"price",
"entry",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchTierPriceEntryException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java#L671-L698 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlContainerPageFactory.java | CmsXmlContainerPageFactory.setCache | private static void setCache(CmsObject cms, CmsXmlContainerPage xmlCntPage, boolean keepEncoding) {
"""
Stores the given container page in the cache.<p>
@param cms the cms context
@param xmlCntPage the container page to cache
@param keepEncoding if the encoding was kept while unmarshalling
"""
if... | java | private static void setCache(CmsObject cms, CmsXmlContainerPage xmlCntPage, boolean keepEncoding) {
if (xmlCntPage.getFile() instanceof I_CmsHistoryResource) {
return;
}
boolean online = cms.getRequestContext().getCurrentProject().isOnlineProject();
getCache().setCacheContai... | [
"private",
"static",
"void",
"setCache",
"(",
"CmsObject",
"cms",
",",
"CmsXmlContainerPage",
"xmlCntPage",
",",
"boolean",
"keepEncoding",
")",
"{",
"if",
"(",
"xmlCntPage",
".",
"getFile",
"(",
")",
"instanceof",
"I_CmsHistoryResource",
")",
"{",
"return",
";"... | Stores the given container page in the cache.<p>
@param cms the cms context
@param xmlCntPage the container page to cache
@param keepEncoding if the encoding was kept while unmarshalling | [
"Stores",
"the",
"given",
"container",
"page",
"in",
"the",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlContainerPageFactory.java#L453-L463 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/CapsuleLauncher.java | CapsuleLauncher.newCapsule | public Capsule newCapsule(String mode, Path wrappedJar) {
"""
Creates a new capsule
@param mode the capsule mode, or {@code null} for the default mode
@param wrappedJar a path to a capsule JAR that will be launched (wrapped) by the empty capsule in {@code jarFile}
or {@code null} if no wrapped capsule i... | java | public Capsule newCapsule(String mode, Path wrappedJar) {
final String oldMode = properties.getProperty(PROP_MODE);
final ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(capsuleClass.getClassLoader());
try {
set... | [
"public",
"Capsule",
"newCapsule",
"(",
"String",
"mode",
",",
"Path",
"wrappedJar",
")",
"{",
"final",
"String",
"oldMode",
"=",
"properties",
".",
"getProperty",
"(",
"PROP_MODE",
")",
";",
"final",
"ClassLoader",
"oldCl",
"=",
"Thread",
".",
"currentThread"... | Creates a new capsule
@param mode the capsule mode, or {@code null} for the default mode
@param wrappedJar a path to a capsule JAR that will be launched (wrapped) by the empty capsule in {@code jarFile}
or {@code null} if no wrapped capsule is wanted
@return the capsule. | [
"Creates",
"a",
"new",
"capsule"
] | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/CapsuleLauncher.java#L137-L159 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.valueOf | public static BigDecimal valueOf(long val) {
"""
Translates a {@code long} value into a {@code BigDecimal}
with a scale of zero. This {@literal "static factory method"}
is provided in preference to a ({@code long}) constructor
because it allows for reuse of frequently used
{@code BigDecimal} values.
@param... | java | public static BigDecimal valueOf(long val) {
if (val >= 0 && val < zeroThroughTen.length)
return zeroThroughTen[(int)val];
else if (val != INFLATED)
return new BigDecimal(null, val, 0, 0);
return new BigDecimal(INFLATED_BIGINT, val, 0, 0);
} | [
"public",
"static",
"BigDecimal",
"valueOf",
"(",
"long",
"val",
")",
"{",
"if",
"(",
"val",
">=",
"0",
"&&",
"val",
"<",
"zeroThroughTen",
".",
"length",
")",
"return",
"zeroThroughTen",
"[",
"(",
"int",
")",
"val",
"]",
";",
"else",
"if",
"(",
"val... | Translates a {@code long} value into a {@code BigDecimal}
with a scale of zero. This {@literal "static factory method"}
is provided in preference to a ({@code long}) constructor
because it allows for reuse of frequently used
{@code BigDecimal} values.
@param val value of the {@code BigDecimal}.
@return a {@code BigDe... | [
"Translates",
"a",
"{",
"@code",
"long",
"}",
"value",
"into",
"a",
"{",
"@code",
"BigDecimal",
"}",
"with",
"a",
"scale",
"of",
"zero",
".",
"This",
"{",
"@literal",
"static",
"factory",
"method",
"}",
"is",
"provided",
"in",
"preference",
"to",
"a",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L1219-L1225 |
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.getJobAsync | public Observable<JobResponseInner> getJobAsync(String resourceGroupName, String resourceName, String jobId) {
"""
Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
Get the details of a job from an IoT hub. For more in... | java | public Observable<JobResponseInner> getJobAsync(String resourceGroupName, String resourceName, String jobId) {
return getJobWithServiceResponseAsync(resourceGroupName, resourceName, jobId).map(new Func1<ServiceResponse<JobResponseInner>, JobResponseInner>() {
@Override
public JobResponse... | [
"public",
"Observable",
"<",
"JobResponseInner",
">",
"getJobAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"String",
"jobId",
")",
"{",
"return",
"getJobWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",",
"j... | Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
@param resourceGroupName Th... | [
"Get",
"the",
"details",
"of",
"a",
"job",
"from",
"an",
"IoT",
"hub",
".",
"For",
"more",
"information",
"see",
":",
"https",
":",
"//",
"docs",
".",
"microsoft",
".",
"com",
"/",
"azure",
"/",
"iot",
"-",
"hub",
"/",
"iot",
"-",
"hub",
"-",
"de... | 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#L2237-L2244 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/context/constraint/ConstraintContextProperties.java | ConstraintContextProperties.addRoutingConstraint | public void addRoutingConstraint(String activity, AbstractConstraint<?> constraint) throws PropertyException {
"""
Adds a routing constraint for an activity.
@param activity The name of the activity for which the constraint is added.
@param constraint The routing constraint to add.
@throws ParameterException if... | java | public void addRoutingConstraint(String activity, AbstractConstraint<?> constraint) throws PropertyException{
Validate.notNull(activity);
Validate.notEmpty(activity);
Validate.notNull(constraint);
//1. Add constraint itself
// This also adds the constraint to the list of constraints
String propertyName... | [
"public",
"void",
"addRoutingConstraint",
"(",
"String",
"activity",
",",
"AbstractConstraint",
"<",
"?",
">",
"constraint",
")",
"throws",
"PropertyException",
"{",
"Validate",
".",
"notNull",
"(",
"activity",
")",
";",
"Validate",
".",
"notEmpty",
"(",
"activi... | Adds a routing constraint for an activity.
@param activity The name of the activity for which the constraint is added.
@param constraint The routing constraint to add.
@throws ParameterException if the given parameters are invalid.
@throws PropertyException if the given constraint cannot be added as a property.
@see #a... | [
"Adds",
"a",
"routing",
"constraint",
"for",
"an",
"activity",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/constraint/ConstraintContextProperties.java#L43-L60 |
aoindustries/aocode-public | src/main/java/com/aoindustries/util/StringUtility.java | StringUtility.compareToIgnoreCaseCarefulEquals | public static int compareToIgnoreCaseCarefulEquals(String S1, String S2) {
"""
Compares two strings in a case insensitive manner. However, if they are considered equals in the
case-insensitive manner, the case sensitive comparison is done.
"""
int diff=S1.compareToIgnoreCase(S2);
if(diff==0) diff=S1.comp... | java | public static int compareToIgnoreCaseCarefulEquals(String S1, String S2) {
int diff=S1.compareToIgnoreCase(S2);
if(diff==0) diff=S1.compareTo(S2);
return diff;
} | [
"public",
"static",
"int",
"compareToIgnoreCaseCarefulEquals",
"(",
"String",
"S1",
",",
"String",
"S2",
")",
"{",
"int",
"diff",
"=",
"S1",
".",
"compareToIgnoreCase",
"(",
"S2",
")",
";",
"if",
"(",
"diff",
"==",
"0",
")",
"diff",
"=",
"S1",
".",
"co... | Compares two strings in a case insensitive manner. However, if they are considered equals in the
case-insensitive manner, the case sensitive comparison is done. | [
"Compares",
"two",
"strings",
"in",
"a",
"case",
"insensitive",
"manner",
".",
"However",
"if",
"they",
"are",
"considered",
"equals",
"in",
"the",
"case",
"-",
"insensitive",
"manner",
"the",
"case",
"sensitive",
"comparison",
"is",
"done",
"."
] | train | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L1345-L1349 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/StringUtils.java | StringUtils.truncate | public static String truncate(int n, int smallestDigit, int biggestDigit) {
"""
This returns a string from decimal digit smallestDigit to decimal digit
biggest digit. Smallest digit is labeled 1, and the limits are
inclusive.
"""
int numDigits = biggestDigit - smallestDigit + 1;
char[] result = new... | java | public static String truncate(int n, int smallestDigit, int biggestDigit) {
int numDigits = biggestDigit - smallestDigit + 1;
char[] result = new char[numDigits];
for (int j = 1; j < smallestDigit; j++) {
n = n / 10;
}
for (int j = numDigits - 1; j >= 0; j--) {
result[j] = Charact... | [
"public",
"static",
"String",
"truncate",
"(",
"int",
"n",
",",
"int",
"smallestDigit",
",",
"int",
"biggestDigit",
")",
"{",
"int",
"numDigits",
"=",
"biggestDigit",
"-",
"smallestDigit",
"+",
"1",
";",
"char",
"[",
"]",
"result",
"=",
"new",
"char",
"[... | This returns a string from decimal digit smallestDigit to decimal digit
biggest digit. Smallest digit is labeled 1, and the limits are
inclusive. | [
"This",
"returns",
"a",
"string",
"from",
"decimal",
"digit",
"smallestDigit",
"to",
"decimal",
"digit",
"biggest",
"digit",
".",
"Smallest",
"digit",
"is",
"labeled",
"1",
"and",
"the",
"limits",
"are",
"inclusive",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L598-L609 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/MetatypeUtils.java | MetatypeUtils.evaluateDuration | @FFDCIgnore(NumberFormatException.class)
public static Long evaluateDuration(String strVal, TimeUnit endUnit) {
"""
Converts a string value representing a unit of time into a Long value.
@param strVal
A String representing a unit of time.
@param unit
The unit of time that the string value should be conve... | java | @FFDCIgnore(NumberFormatException.class)
public static Long evaluateDuration(String strVal, TimeUnit endUnit) {
// If the value is a number, simply return the numeric value as a long
try {
return Long.valueOf(strVal);
} catch (NumberFormatException ex) {
// ignore
... | [
"@",
"FFDCIgnore",
"(",
"NumberFormatException",
".",
"class",
")",
"public",
"static",
"Long",
"evaluateDuration",
"(",
"String",
"strVal",
",",
"TimeUnit",
"endUnit",
")",
"{",
"// If the value is a number, simply return the numeric value as a long",
"try",
"{",
"return... | Converts a string value representing a unit of time into a Long value.
@param strVal
A String representing a unit of time.
@param unit
The unit of time that the string value should be converted into
@return Long The value of the string in the desired time unit | [
"Converts",
"a",
"string",
"value",
"representing",
"a",
"unit",
"of",
"time",
"into",
"a",
"Long",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/MetatypeUtils.java#L495-L506 |
sarxos/win-registry | src/main/java/com/github/sarxos/winreg/WindowsRegistry.java | WindowsRegistry.createKey | public void createKey(HKey hk, String key) throws RegistryException {
"""
Create key in registry.
@param hk the HKEY
@param key the key
@throws RegistryException when something is not right
"""
int[] ret;
try {
ret = ReflectedMethods.createKey(hk.root(), hk.hex(), key);
} catch (Exception e) ... | java | public void createKey(HKey hk, String key) throws RegistryException {
int[] ret;
try {
ret = ReflectedMethods.createKey(hk.root(), hk.hex(), key);
} catch (Exception e) {
throw new RegistryException("Cannot create key " + key, e);
}
if (ret.length == 0) {
throw new RegistryException("Cannot c... | [
"public",
"void",
"createKey",
"(",
"HKey",
"hk",
",",
"String",
"key",
")",
"throws",
"RegistryException",
"{",
"int",
"[",
"]",
"ret",
";",
"try",
"{",
"ret",
"=",
"ReflectedMethods",
".",
"createKey",
"(",
"hk",
".",
"root",
"(",
")",
",",
"hk",
"... | Create key in registry.
@param hk the HKEY
@param key the key
@throws RegistryException when something is not right | [
"Create",
"key",
"in",
"registry",
"."
] | train | https://github.com/sarxos/win-registry/blob/5ccbe2157ae0ee894de7c41bec4bd7b1e0f5c437/src/main/java/com/github/sarxos/winreg/WindowsRegistry.java#L132-L145 |
pushtorefresh/storio | storio-sample-app/src/main/java/com/pushtorefresh/storio3/sample/db/DbModule.java | DbModule.provideStorIOSQLite | @Provides
@NonNull
@Singleton
public StorIOSQLite provideStorIOSQLite(@NonNull SQLiteOpenHelper sqLiteOpenHelper) {
"""
But keep in mind that different instances of StorIOSQLite won't share notifications!
"""
final CarStorIOSQLitePutResolver carStorIOSQLitePutResolver = new CarStorIOSQLiteP... | java | @Provides
@NonNull
@Singleton
public StorIOSQLite provideStorIOSQLite(@NonNull SQLiteOpenHelper sqLiteOpenHelper) {
final CarStorIOSQLitePutResolver carStorIOSQLitePutResolver = new CarStorIOSQLitePutResolver();
final CarStorIOSQLiteGetResolver carStorIOSQLiteGetResolver = new CarStorIOSQLit... | [
"@",
"Provides",
"@",
"NonNull",
"@",
"Singleton",
"public",
"StorIOSQLite",
"provideStorIOSQLite",
"(",
"@",
"NonNull",
"SQLiteOpenHelper",
"sqLiteOpenHelper",
")",
"{",
"final",
"CarStorIOSQLitePutResolver",
"carStorIOSQLitePutResolver",
"=",
"new",
"CarStorIOSQLitePutRes... | But keep in mind that different instances of StorIOSQLite won't share notifications! | [
"But",
"keep",
"in",
"mind",
"that",
"different",
"instances",
"of",
"StorIOSQLite",
"won",
"t",
"share",
"notifications!"
] | train | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-sample-app/src/main/java/com/pushtorefresh/storio3/sample/db/DbModule.java#L45-L80 |
qiniu/java-sdk | src/main/java/com/qiniu/streaming/StreamingManager.java | StreamingManager.listStreams | public StreamListing listStreams(boolean live, String prefix, String marker) throws QiniuException {
"""
获取直播流列表
@param live 是否直播中
@param prefix 流名称前缀
@param marker 下一次列举的位置
"""
StringMap map = new StringMap();
map.putWhen("liveonly", live, live);
map.putNotEmpty("prefix", prefi... | java | public StreamListing listStreams(boolean live, String prefix, String marker) throws QiniuException {
StringMap map = new StringMap();
map.putWhen("liveonly", live, live);
map.putNotEmpty("prefix", prefix);
map.putNotEmpty("marker", marker);
String path = "";
if (map.si... | [
"public",
"StreamListing",
"listStreams",
"(",
"boolean",
"live",
",",
"String",
"prefix",
",",
"String",
"marker",
")",
"throws",
"QiniuException",
"{",
"StringMap",
"map",
"=",
"new",
"StringMap",
"(",
")",
";",
"map",
".",
"putWhen",
"(",
"\"liveonly\"",
... | 获取直播流列表
@param live 是否直播中
@param prefix 流名称前缀
@param marker 下一次列举的位置 | [
"获取直播流列表"
] | train | https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/streaming/StreamingManager.java#L89-L102 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java | MapLayer.fireLayerAttributeChangedEvent | public void fireLayerAttributeChangedEvent(String attributeName, Object oldValue, Object newValue) {
"""
Forward to the parent layer the event that indicates the content of a child layer was changed.
Only the {@link MapLayerListener} and the container are notified.
@param attributeName is the name of the chang... | java | public void fireLayerAttributeChangedEvent(String attributeName, Object oldValue, Object newValue) {
if (isEventFirable()) {
final AttributeChangeEvent.Type eType;
if (oldValue == null && newValue != null) {
eType = AttributeChangeEvent.Type.ADDITION;
} else if (oldValue != null && newValue == null) {
... | [
"public",
"void",
"fireLayerAttributeChangedEvent",
"(",
"String",
"attributeName",
",",
"Object",
"oldValue",
",",
"Object",
"newValue",
")",
"{",
"if",
"(",
"isEventFirable",
"(",
")",
")",
"{",
"final",
"AttributeChangeEvent",
".",
"Type",
"eType",
";",
"if",... | Forward to the parent layer the event that indicates the content of a child layer was changed.
Only the {@link MapLayerListener} and the container are notified.
@param attributeName is the name of the changed attribute.
@param oldValue is the old value of the attribute.
@param newValue is the new value of the attribut... | [
"Forward",
"to",
"the",
"parent",
"layer",
"the",
"event",
"that",
"indicates",
"the",
"content",
"of",
"a",
"child",
"layer",
"was",
"changed",
".",
"Only",
"the",
"{",
"@link",
"MapLayerListener",
"}",
"and",
"the",
"container",
"are",
"notified",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java#L339-L359 |
stripe/stripe-java | src/main/java/com/stripe/net/OAuth.java | OAuth.getClientId | private static String getClientId(Map<String, Object> params, RequestOptions options)
throws AuthenticationException {
"""
Returns the client_id to use in OAuth requests.
@param params the request parameters.
@param options the request options.
@return the client_id.
"""
String clientId = Strip... | java | private static String getClientId(Map<String, Object> params, RequestOptions options)
throws AuthenticationException {
String clientId = Stripe.clientId;
if ((options != null) && (options.getClientId() != null)) {
clientId = options.getClientId();
}
if ((params != null) && (params.get("clien... | [
"private",
"static",
"String",
"getClientId",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"AuthenticationException",
"{",
"String",
"clientId",
"=",
"Stripe",
".",
"clientId",
";",
"if",
"(",
"(",
... | Returns the client_id to use in OAuth requests.
@param params the request parameters.
@param options the request options.
@return the client_id. | [
"Returns",
"the",
"client_id",
"to",
"use",
"in",
"OAuth",
"requests",
"."
] | train | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/OAuth.java#L90-L112 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/FeatureUtil.java | FeatureUtil.toOutcomeVector | public static INDArray toOutcomeVector(long index, long numOutcomes) {
"""
Creates an out come vector from the specified inputs
@param index the index of the label
@param numOutcomes the number of possible outcomes
@return a binary label matrix used for supervised learning
"""
if (index > In... | java | public static INDArray toOutcomeVector(long index, long numOutcomes) {
if (index > Integer.MAX_VALUE || numOutcomes > Integer.MAX_VALUE)
throw new UnsupportedOperationException();
val nums = new int[(int) numOutcomes];
nums[(int) index] = 1;
return NDArrayUtil.toNDArray(nums... | [
"public",
"static",
"INDArray",
"toOutcomeVector",
"(",
"long",
"index",
",",
"long",
"numOutcomes",
")",
"{",
"if",
"(",
"index",
">",
"Integer",
".",
"MAX_VALUE",
"||",
"numOutcomes",
">",
"Integer",
".",
"MAX_VALUE",
")",
"throw",
"new",
"UnsupportedOperati... | Creates an out come vector from the specified inputs
@param index the index of the label
@param numOutcomes the number of possible outcomes
@return a binary label matrix used for supervised learning | [
"Creates",
"an",
"out",
"come",
"vector",
"from",
"the",
"specified",
"inputs"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/FeatureUtil.java#L34-L41 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/TypeToStringUtils.java | TypeToStringUtils.toStringWithNamedGenerics | public static String toStringWithNamedGenerics(final Class<?> type) {
"""
Print class with generic variables. For example, {@code List<T>}.
@param type class to print
@return string containing class and it's declared generics
"""
return toStringType(new ParameterizedTypeImpl(type, type.getTypeParam... | java | public static String toStringWithNamedGenerics(final Class<?> type) {
return toStringType(new ParameterizedTypeImpl(type, type.getTypeParameters()), new PrintableGenericsMap());
} | [
"public",
"static",
"String",
"toStringWithNamedGenerics",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"toStringType",
"(",
"new",
"ParameterizedTypeImpl",
"(",
"type",
",",
"type",
".",
"getTypeParameters",
"(",
")",
")",
",",
"new",
"... | Print class with generic variables. For example, {@code List<T>}.
@param type class to print
@return string containing class and it's declared generics | [
"Print",
"class",
"with",
"generic",
"variables",
".",
"For",
"example",
"{",
"@code",
"List<T",
">",
"}",
"."
] | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/TypeToStringUtils.java#L97-L99 |
wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java | ContextFromVertx.parameterAsInteger | @Override
public Integer parameterAsInteger(String name, Integer defaultValue) {
"""
Like {@link #parameter(String, String)}, but converts the
parameter to Integer if found.
<p>
The parameter is decoded by default.
@param name The name of the parameter
@param defaultValue A default value if para... | java | @Override
public Integer parameterAsInteger(String name, Integer defaultValue) {
return request.parameterAsInteger(name, defaultValue);
} | [
"@",
"Override",
"public",
"Integer",
"parameterAsInteger",
"(",
"String",
"name",
",",
"Integer",
"defaultValue",
")",
"{",
"return",
"request",
".",
"parameterAsInteger",
"(",
"name",
",",
"defaultValue",
")",
";",
"}"
] | Like {@link #parameter(String, String)}, but converts the
parameter to Integer if found.
<p>
The parameter is decoded by default.
@param name The name of the parameter
@param defaultValue A default value if parameter not found.
@return The value of the parameter of the defaultValue if not found. | [
"Like",
"{",
"@link",
"#parameter",
"(",
"String",
"String",
")",
"}",
"but",
"converts",
"the",
"parameter",
"to",
"Integer",
"if",
"found",
".",
"<p",
">",
"The",
"parameter",
"is",
"decoded",
"by",
"default",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java#L294-L297 |
apiman/apiman | gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/connectors/ssl/SSLSessionStrategyFactory.java | SSLSessionStrategyFactory.buildUnsafe | public static SSLSessionStrategy buildUnsafe() {
"""
<strong><em>Do not use in production</em></strong>
<p>
Returns an SSLSessionStrategy that trusts any Certificate.
<p>
Naturally, this is vulnerable to a raft of MIITM and forgery attacks, so users should exercise extreme
caution and only use it for developm... | java | public static SSLSessionStrategy buildUnsafe() {
System.err.println("ATTENTION: SSLSessionStrategy will trust *any* certificate." //$NON-NLS-1$
+ " This is extremely unsafe for production. Caveat utilitor!"); //$NON-NLS-1$
try {
SSLContext sslContext = SSLContext.getInstance... | [
"public",
"static",
"SSLSessionStrategy",
"buildUnsafe",
"(",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"\"ATTENTION: SSLSessionStrategy will trust *any* certificate.\"",
"//$NON-NLS-1$",
"+",
"\" This is extremely unsafe for production. Caveat utilitor!\"",
")",
";",
... | <strong><em>Do not use in production</em></strong>
<p>
Returns an SSLSessionStrategy that trusts any Certificate.
<p>
Naturally, this is vulnerable to a raft of MIITM and forgery attacks, so users should exercise extreme
caution and only use it for development purposes.
@return the ssl strategy | [
"<strong",
">",
"<em",
">",
"Do",
"not",
"use",
"in",
"production<",
"/",
"em",
">",
"<",
"/",
"strong",
">",
"<p",
">",
"Returns",
"an",
"SSLSessionStrategy",
"that",
"trusts",
"any",
"Certificate",
".",
"<p",
">",
"Naturally",
"this",
"is",
"vulnerable... | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/connectors/ssl/SSLSessionStrategyFactory.java#L243-L273 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/transform/jdbc/TransformStringChar.java | TransformStringChar.transformOut | @Override
public String transformOut(JdbcPreparedStatementFactory jpsf, char[] attrObj) throws CpoException {
"""
Transforms the data from the class attribute to the object required by the datasource
@param cpoAdapter The CpoAdapter for the datasource where the attribute is being persisted
@param parentObjec... | java | @Override
public String transformOut(JdbcPreparedStatementFactory jpsf, char[] attrObj) throws CpoException {
return attrObj == null ? null : String.valueOf(attrObj);
} | [
"@",
"Override",
"public",
"String",
"transformOut",
"(",
"JdbcPreparedStatementFactory",
"jpsf",
",",
"char",
"[",
"]",
"attrObj",
")",
"throws",
"CpoException",
"{",
"return",
"attrObj",
"==",
"null",
"?",
"null",
":",
"String",
".",
"valueOf",
"(",
"attrObj... | Transforms the data from the class attribute to the object required by the datasource
@param cpoAdapter The CpoAdapter for the datasource where the attribute is being persisted
@param parentObject The object that contains the attribute being persisted.
@param attributeObject The object that represents the attribute be... | [
"Transforms",
"the",
"data",
"from",
"the",
"class",
"attribute",
"to",
"the",
"object",
"required",
"by",
"the",
"datasource"
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/transform/jdbc/TransformStringChar.java#L61-L64 |
gallandarakhneorg/afc | advanced/gis/giscorefx/src/main/java/org/arakhne/afc/gis/ui/drawers/AbstractMapMultiPointDrawer.java | AbstractMapMultiPointDrawer.defineSmallRectangles | protected void defineSmallRectangles(ZoomableGraphicsContext gc, T element) {
"""
Define a path that corresponds to the small rectangles around the points.
@param gc the graphics context that must be used for drawing.
@param element the map element.
"""
final double ptsSize = element.getPointSize() / 2.;... | java | protected void defineSmallRectangles(ZoomableGraphicsContext gc, T element) {
final double ptsSize = element.getPointSize() / 2.;
final Rectangle2afp<?, ?, ?, ?, ?, ?> visibleArea = gc.getVisibleArea();
for (final Point2d point : element.points()) {
if (visibleArea.contains(point)) {
final double x = point... | [
"protected",
"void",
"defineSmallRectangles",
"(",
"ZoomableGraphicsContext",
"gc",
",",
"T",
"element",
")",
"{",
"final",
"double",
"ptsSize",
"=",
"element",
".",
"getPointSize",
"(",
")",
"/",
"2.",
";",
"final",
"Rectangle2afp",
"<",
"?",
",",
"?",
",",... | Define a path that corresponds to the small rectangles around the points.
@param gc the graphics context that must be used for drawing.
@param element the map element. | [
"Define",
"a",
"path",
"that",
"corresponds",
"to",
"the",
"small",
"rectangles",
"around",
"the",
"points",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscorefx/src/main/java/org/arakhne/afc/gis/ui/drawers/AbstractMapMultiPointDrawer.java#L44-L60 |
jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageRecordDesc.java | BaseMessageRecordDesc.createMessageRecordDesc | public static BaseMessageRecordDesc createMessageRecordDesc(String strMessageDataClassName, MessageDataParent messageDataParent, String strKey) {
"""
Setup this message given this internal data structure.
@param data The data in an intermediate format.
"""
BaseMessageRecordDesc messageData = (BaseMess... | java | public static BaseMessageRecordDesc createMessageRecordDesc(String strMessageDataClassName, MessageDataParent messageDataParent, String strKey)
{
BaseMessageRecordDesc messageData = (BaseMessageRecordDesc)ClassServiceUtility.getClassService().makeObjectFromClassName(strMessageDataClassName);
if (mes... | [
"public",
"static",
"BaseMessageRecordDesc",
"createMessageRecordDesc",
"(",
"String",
"strMessageDataClassName",
",",
"MessageDataParent",
"messageDataParent",
",",
"String",
"strKey",
")",
"{",
"BaseMessageRecordDesc",
"messageData",
"=",
"(",
"BaseMessageRecordDesc",
")",
... | Setup this message given this internal data structure.
@param data The data in an intermediate format. | [
"Setup",
"this",
"message",
"given",
"this",
"internal",
"data",
"structure",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageRecordDesc.java#L395-L401 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/Serializers.java | Serializers.getContainedGenericTypes | private static void getContainedGenericTypes(CompositeType<?> typeInfo, List<GenericTypeInfo<?>> target) {
"""
Returns all GenericTypeInfos contained in a composite type.
@param typeInfo {@link CompositeType}
"""
for (int i = 0; i < typeInfo.getArity(); i++) {
TypeInformation<?> type = typeInfo.getType... | java | private static void getContainedGenericTypes(CompositeType<?> typeInfo, List<GenericTypeInfo<?>> target) {
for (int i = 0; i < typeInfo.getArity(); i++) {
TypeInformation<?> type = typeInfo.getTypeAt(i);
if (type instanceof CompositeType) {
getContainedGenericTypes((CompositeType<?>) type, target);
} els... | [
"private",
"static",
"void",
"getContainedGenericTypes",
"(",
"CompositeType",
"<",
"?",
">",
"typeInfo",
",",
"List",
"<",
"GenericTypeInfo",
"<",
"?",
">",
">",
"target",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"typeInfo",
".",
"ge... | Returns all GenericTypeInfos contained in a composite type.
@param typeInfo {@link CompositeType} | [
"Returns",
"all",
"GenericTypeInfos",
"contained",
"in",
"a",
"composite",
"type",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/Serializers.java#L135-L146 |
payneteasy/superfly | superfly-service/src/main/java/com/payneteasy/superfly/spring/velocity/VelocityEngineFactory.java | VelocityEngineFactory.setVelocityPropertiesMap | public void setVelocityPropertiesMap(Map<String, Object> velocityPropertiesMap) {
"""
Set Velocity properties as Map, to allow for non-String values
like "ds.resource.loader.instance".
@see #setVelocityProperties
"""
if (velocityPropertiesMap != null) {
this.velocityProperties.putAll(velocityPropertiesM... | java | public void setVelocityPropertiesMap(Map<String, Object> velocityPropertiesMap) {
if (velocityPropertiesMap != null) {
this.velocityProperties.putAll(velocityPropertiesMap);
}
} | [
"public",
"void",
"setVelocityPropertiesMap",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"velocityPropertiesMap",
")",
"{",
"if",
"(",
"velocityPropertiesMap",
"!=",
"null",
")",
"{",
"this",
".",
"velocityProperties",
".",
"putAll",
"(",
"velocityPropertiesMa... | Set Velocity properties as Map, to allow for non-String values
like "ds.resource.loader.instance".
@see #setVelocityProperties | [
"Set",
"Velocity",
"properties",
"as",
"Map",
"to",
"allow",
"for",
"non",
"-",
"String",
"values",
"like",
"ds",
".",
"resource",
".",
"loader",
".",
"instance",
"."
] | train | https://github.com/payneteasy/superfly/blob/4cad6d0f8e951a61f3c302c49b13a51d179076f8/superfly-service/src/main/java/com/payneteasy/superfly/spring/velocity/VelocityEngineFactory.java#L123-L127 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/DefaultJavaDocRenderer.java | DefaultJavaDocRenderer.renderJavaDocTag | protected String renderJavaDocTag(final String name, final String value, final SortableLocation location) {
"""
Override this method to yield another
@param name The name of a JavaDoc tag.
@param value The value of a JavaDoc tag.
@param location the SortableLocation where the JavaDocData was harvested.... | java | protected String renderJavaDocTag(final String name, final String value, final SortableLocation location) {
final String nameKey = name != null ? name.trim() : "";
final String valueKey = value != null ? value.trim() : "";
// All Done.
return "(" + nameKey + "): " + harmonizeNewlines(va... | [
"protected",
"String",
"renderJavaDocTag",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
",",
"final",
"SortableLocation",
"location",
")",
"{",
"final",
"String",
"nameKey",
"=",
"name",
"!=",
"null",
"?",
"name",
".",
"trim",
"(",
")",
... | Override this method to yield another
@param name The name of a JavaDoc tag.
@param value The value of a JavaDoc tag.
@param location the SortableLocation where the JavaDocData was harvested. Never {@code null}.
@return The XSD documentation for the supplied JavaDoc tag. | [
"Override",
"this",
"method",
"to",
"yield",
"another"
] | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/DefaultJavaDocRenderer.java#L81-L87 |
m-m-m/util | lang/src/main/java/net/sf/mmm/util/lang/api/CaseSyntax.java | CaseSyntax.of | public static CaseSyntax of(Character separator, CaseConversion allCharCase) {
"""
The constructor.
@param separator - see {@link #getWordSeparator()}.
@param allCharCase the {@link CaseConversion} used for {@link #getFirstCase() first}, {@link #getWordStartCase()
word-start}, and all {@link #getOtherCase() o... | java | public static CaseSyntax of(Character separator, CaseConversion allCharCase) {
return of(separator, allCharCase, allCharCase, allCharCase);
} | [
"public",
"static",
"CaseSyntax",
"of",
"(",
"Character",
"separator",
",",
"CaseConversion",
"allCharCase",
")",
"{",
"return",
"of",
"(",
"separator",
",",
"allCharCase",
",",
"allCharCase",
",",
"allCharCase",
")",
";",
"}"
] | The constructor.
@param separator - see {@link #getWordSeparator()}.
@param allCharCase the {@link CaseConversion} used for {@link #getFirstCase() first}, {@link #getWordStartCase()
word-start}, and all {@link #getOtherCase() other} alphabetic characters.
@return the requested {@link CaseSyntax}. | [
"The",
"constructor",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/lang/src/main/java/net/sf/mmm/util/lang/api/CaseSyntax.java#L382-L385 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryFileApi.java | RepositoryFileApi.getFile | public RepositoryFile getFile(Object projectIdOrPath, String filePath, String ref) throws GitLabApiException {
"""
Get file from repository. Allows you to receive information about file in repository like name, size, content.
Note that file content is Base64 encoded.
<pre><code>GitLab Endpoint: GET /projects/:... | java | public RepositoryFile getFile(Object projectIdOrPath, String filePath, String ref) throws GitLabApiException {
return (getFile(projectIdOrPath, filePath, ref, true));
} | [
"public",
"RepositoryFile",
"getFile",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"filePath",
",",
"String",
"ref",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"getFile",
"(",
"projectIdOrPath",
",",
"filePath",
",",
"ref",
",",
"true",
")",
... | Get file from repository. Allows you to receive information about file in repository like name, size, content.
Note that file content is Base64 encoded.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/files</code></pre>
@param projectIdOrPath the id, path of the project, or a Project instance holding the pro... | [
"Get",
"file",
"from",
"repository",
".",
"Allows",
"you",
"to",
"receive",
"information",
"about",
"file",
"in",
"repository",
"like",
"name",
"size",
"content",
".",
"Note",
"that",
"file",
"content",
"is",
"Base64",
"encoded",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryFileApi.java#L114-L116 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/FieldDescriptorConstraints.java | FieldDescriptorConstraints.checkLocking | private void checkLocking(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException {
"""
Checks that locking and update-lock are only used for fields of TIMESTAMP or INTEGER type.
@param fieldDef The field descriptor
@param checkLevel The current check level (this constraint is checked in bas... | java | private void checkLocking(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
String jdbcType = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE);
if (!"TIMESTAMP".eq... | [
"private",
"void",
"checkLocking",
"(",
"FieldDescriptorDef",
"fieldDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"CHECKLEVEL_NONE",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"String",
"jdbcTy... | Checks that locking and update-lock are only used for fields of TIMESTAMP or INTEGER type.
@param fieldDef The field descriptor
@param checkLevel The current check level (this constraint is checked in basic and strict)
@exception ConstraintException If the constraint has been violated | [
"Checks",
"that",
"locking",
"and",
"update",
"-",
"lock",
"are",
"only",
"used",
"for",
"fields",
"of",
"TIMESTAMP",
"or",
"INTEGER",
"type",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/FieldDescriptorConstraints.java#L310-L330 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.getDate | @Deprecated
public static Date getDate(HttpMessage message, Date defaultValue) {
"""
@deprecated Use {@link #getTimeMillis(CharSequence, long)} instead.
Returns the value of the {@code "Date"} header. If there is no such
header or the header is not a formatted date, the {@code defaultValue}
is returned.
... | java | @Deprecated
public static Date getDate(HttpMessage message, Date defaultValue) {
return getDateHeader(message, HttpHeaderNames.DATE, defaultValue);
} | [
"@",
"Deprecated",
"public",
"static",
"Date",
"getDate",
"(",
"HttpMessage",
"message",
",",
"Date",
"defaultValue",
")",
"{",
"return",
"getDateHeader",
"(",
"message",
",",
"HttpHeaderNames",
".",
"DATE",
",",
"defaultValue",
")",
";",
"}"
] | @deprecated Use {@link #getTimeMillis(CharSequence, long)} instead.
Returns the value of the {@code "Date"} header. If there is no such
header or the header is not a formatted date, the {@code defaultValue}
is returned. | [
"@deprecated",
"Use",
"{",
"@link",
"#getTimeMillis",
"(",
"CharSequence",
"long",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L1059-L1062 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsCheckableDatePanel.java | CmsCheckableDatePanel.setDates | public void setDates(SortedSet<Date> dates, boolean checked) {
"""
Sets all dates in the list.
@param dates the dates to set
@param checked flag, indicating if all should be checked or unchecked.
"""
m_checkBoxes.clear();
for (Date date : dates) {
CmsCheckBox cb = generateCheckBo... | java | public void setDates(SortedSet<Date> dates, boolean checked) {
m_checkBoxes.clear();
for (Date date : dates) {
CmsCheckBox cb = generateCheckBox(date, checked);
m_checkBoxes.add(cb);
}
reInitLayoutElements();
setDatesInternal(dates);
} | [
"public",
"void",
"setDates",
"(",
"SortedSet",
"<",
"Date",
">",
"dates",
",",
"boolean",
"checked",
")",
"{",
"m_checkBoxes",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Date",
"date",
":",
"dates",
")",
"{",
"CmsCheckBox",
"cb",
"=",
"generateCheckBox",... | Sets all dates in the list.
@param dates the dates to set
@param checked flag, indicating if all should be checked or unchecked. | [
"Sets",
"all",
"dates",
"in",
"the",
"list",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsCheckableDatePanel.java#L240-L249 |
citrusframework/citrus | tools/remote/citrus-remote-server/src/main/java/com/consol/citrus/remote/CitrusRemoteApplication.java | CitrusRemoteApplication.getJUnitReportsFolder | private String getJUnitReportsFolder() {
"""
Find reports folder based in unit testing framework present on classpath.
@return
"""
if (ClassUtils.isPresent("org.testng.annotations.Test", getClass().getClassLoader())) {
return "test-output" + File.separator + "junitreports";
} else ... | java | private String getJUnitReportsFolder() {
if (ClassUtils.isPresent("org.testng.annotations.Test", getClass().getClassLoader())) {
return "test-output" + File.separator + "junitreports";
} else if (ClassUtils.isPresent("org.junit.Test", getClass().getClassLoader())) {
JUnitReporter... | [
"private",
"String",
"getJUnitReportsFolder",
"(",
")",
"{",
"if",
"(",
"ClassUtils",
".",
"isPresent",
"(",
"\"org.testng.annotations.Test\"",
",",
"getClass",
"(",
")",
".",
"getClassLoader",
"(",
")",
")",
")",
"{",
"return",
"\"test-output\"",
"+",
"File",
... | Find reports folder based in unit testing framework present on classpath.
@return | [
"Find",
"reports",
"folder",
"based",
"in",
"unit",
"testing",
"framework",
"present",
"on",
"classpath",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/tools/remote/citrus-remote-server/src/main/java/com/consol/citrus/remote/CitrusRemoteApplication.java#L259-L268 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitHidden | @Override
public R visitHidden(HiddenTree node, P p) {
"""
{@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction}
"""
return defaultAction(node, p);
} | java | @Override
public R visitHidden(HiddenTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitHidden",
"(",
"HiddenTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L213-L216 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.GET | public ArrayList<String> GET(String description, String ip, String routedTo_serviceName, OvhIpTypeEnum type) throws IOException {
"""
Your OVH IPs
REST: GET /ip
@param description [required] Filter the value of description property (like)
@param ip [required] Filter the value of ip property (contains or equal... | java | public ArrayList<String> GET(String description, String ip, String routedTo_serviceName, OvhIpTypeEnum type) throws IOException {
String qPath = "/ip";
StringBuilder sb = path(qPath);
query(sb, "description", description);
query(sb, "ip", ip);
query(sb, "routedTo.serviceName", routedTo_serviceName);
query(s... | [
"public",
"ArrayList",
"<",
"String",
">",
"GET",
"(",
"String",
"description",
",",
"String",
"ip",
",",
"String",
"routedTo_serviceName",
",",
"OvhIpTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip\"",
";",
"StringBuilder",
... | Your OVH IPs
REST: GET /ip
@param description [required] Filter the value of description property (like)
@param ip [required] Filter the value of ip property (contains or equals)
@param routedTo_serviceName [required] Filter the value of routedTo.serviceName property (like)
@param type [required] Filter the value of t... | [
"Your",
"OVH",
"IPs"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L1244-L1253 |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java | AbstractMoskitoAspect.createClassLevelAccumulators | private void createClassLevelAccumulators(final OnDemandStatsProducer<S> producer, final Class producerClass) {
"""
Create accumulators for class.
@param producer
{@link OnDemandStatsProducer}
@param producerClass
producer class
"""
//several @AccumulateWithSubClasses in accumulators holder
final Ac... | java | private void createClassLevelAccumulators(final OnDemandStatsProducer<S> producer, final Class producerClass) {
//several @AccumulateWithSubClasses in accumulators holder
final AccumulatesWithSubClasses accWSCAnnotationHolder = AnnotationUtils.findAnnotation(producerClass, AccumulatesWithSubClasses.class);
if (a... | [
"private",
"void",
"createClassLevelAccumulators",
"(",
"final",
"OnDemandStatsProducer",
"<",
"S",
">",
"producer",
",",
"final",
"Class",
"producerClass",
")",
"{",
"//several @AccumulateWithSubClasses in accumulators holder",
"final",
"AccumulatesWithSubClasses",
"accWSCAnno... | Create accumulators for class.
@param producer
{@link OnDemandStatsProducer}
@param producerClass
producer class | [
"Create",
"accumulators",
"for",
"class",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java#L232-L253 |
deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ndarrayholder/InMemoryNDArrayHolder.java | InMemoryNDArrayHolder.getTad | @Override
public INDArray getTad(int idx, int... dimensions) {
"""
Retrieve a partial view of the ndarray.
This method uses tensor along dimension internally
Note this will call dup()
@param idx the index of the tad to get
@param dimensions the dimensions to use
@return the tensor along dimension... | java | @Override
public INDArray getTad(int idx, int... dimensions) {
return arr.get().tensorAlongDimension(idx, dimensions);
} | [
"@",
"Override",
"public",
"INDArray",
"getTad",
"(",
"int",
"idx",
",",
"int",
"...",
"dimensions",
")",
"{",
"return",
"arr",
".",
"get",
"(",
")",
".",
"tensorAlongDimension",
"(",
"idx",
",",
"dimensions",
")",
";",
"}"
] | Retrieve a partial view of the ndarray.
This method uses tensor along dimension internally
Note this will call dup()
@param idx the index of the tad to get
@param dimensions the dimensions to use
@return the tensor along dimension based on the index and dimensions
from the master array. | [
"Retrieve",
"a",
"partial",
"view",
"of",
"the",
"ndarray",
".",
"This",
"method",
"uses",
"tensor",
"along",
"dimension",
"internally",
"Note",
"this",
"will",
"call",
"dup",
"()"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ndarrayholder/InMemoryNDArrayHolder.java#L92-L95 |
JodaOrg/joda-time | src/main/java/org/joda/time/base/BasePeriod.java | BasePeriod.toDurationFrom | public Duration toDurationFrom(ReadableInstant startInstant) {
"""
Gets the total millisecond duration of this period relative to a start instant.
<p>
This method adds the period to the specified instant in order to
calculate the duration.
<p>
An instant must be supplied as the duration of a period varies.
F... | java | public Duration toDurationFrom(ReadableInstant startInstant) {
long startMillis = DateTimeUtils.getInstantMillis(startInstant);
Chronology chrono = DateTimeUtils.getInstantChronology(startInstant);
long endMillis = chrono.add(this, startMillis, 1);
return new Duration(startMillis, endMil... | [
"public",
"Duration",
"toDurationFrom",
"(",
"ReadableInstant",
"startInstant",
")",
"{",
"long",
"startMillis",
"=",
"DateTimeUtils",
".",
"getInstantMillis",
"(",
"startInstant",
")",
";",
"Chronology",
"chrono",
"=",
"DateTimeUtils",
".",
"getInstantChronology",
"(... | Gets the total millisecond duration of this period relative to a start instant.
<p>
This method adds the period to the specified instant in order to
calculate the duration.
<p>
An instant must be supplied as the duration of a period varies.
For example, a period of 1 month could vary between the equivalent of
28 and 31... | [
"Gets",
"the",
"total",
"millisecond",
"duration",
"of",
"this",
"period",
"relative",
"to",
"a",
"start",
"instant",
".",
"<p",
">",
"This",
"method",
"adds",
"the",
"period",
"to",
"the",
"specified",
"instant",
"in",
"order",
"to",
"calculate",
"the",
"... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BasePeriod.java#L349-L354 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/util/ClickCallback.java | ClickCallback.addConfirmPopupMessage | protected int addConfirmPopupMessage (SmartTable contents, int row) {
"""
Adds the message area for the confirmation popup to the given row and returns the row to
insert next.
"""
if (_confirmHTML) {
contents.setHTML(row, 0, _confirmMessage, 2, "Message");
} else {
cont... | java | protected int addConfirmPopupMessage (SmartTable contents, int row)
{
if (_confirmHTML) {
contents.setHTML(row, 0, _confirmMessage, 2, "Message");
} else {
contents.setText(row, 0, _confirmMessage, 2, "Message");
}
return row + 1;
} | [
"protected",
"int",
"addConfirmPopupMessage",
"(",
"SmartTable",
"contents",
",",
"int",
"row",
")",
"{",
"if",
"(",
"_confirmHTML",
")",
"{",
"contents",
".",
"setHTML",
"(",
"row",
",",
"0",
",",
"_confirmMessage",
",",
"2",
",",
"\"Message\"",
")",
";",... | Adds the message area for the confirmation popup to the given row and returns the row to
insert next. | [
"Adds",
"the",
"message",
"area",
"for",
"the",
"confirmation",
"popup",
"to",
"the",
"given",
"row",
"and",
"returns",
"the",
"row",
"to",
"insert",
"next",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/ClickCallback.java#L222-L230 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_tts_id_PUT | public void billingAccount_ovhPabx_serviceName_tts_id_PUT(String billingAccount, String serviceName, Long id, OvhOvhPabxTts body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/ovhPabx/{serviceName}/tts/{id}
@param body [required] New object properties
@param billi... | java | public void billingAccount_ovhPabx_serviceName_tts_id_PUT(String billingAccount, String serviceName, Long id, OvhOvhPabxTts body) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/tts/{id}";
StringBuilder sb = path(qPath, billingAccount, serviceName, id);
exec(qPath, "PUT", sb... | [
"public",
"void",
"billingAccount_ovhPabx_serviceName_tts_id_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"id",
",",
"OvhOvhPabxTts",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/ovh... | Alter this object properties
REST: PUT /telephony/{billingAccount}/ovhPabx/{serviceName}/tts/{id}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param id [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7637-L7641 |
landawn/AbacusUtil | src/com/landawn/abacus/android/util/SQLiteExecutor.java | SQLiteExecutor.toList | static <T> List<T> toList(Class<T> targetClass, Cursor cursor, int offset, int count) {
"""
Returns values from all rows associated with the specified <code>targetClass</code> if the specified <code>targetClass</code> is an entity class, otherwise, only returns values from first column.
@param targetClass entit... | java | static <T> List<T> toList(Class<T> targetClass, Cursor cursor, int offset, int count) {
if (N.isEntity(targetClass)) {
final DataSet ds = extractData(targetClass, cursor, offset, count);
if (ds == null || ds.isEmpty()) {
return new ArrayList<>();
} else... | [
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"toList",
"(",
"Class",
"<",
"T",
">",
"targetClass",
",",
"Cursor",
"cursor",
",",
"int",
"offset",
",",
"int",
"count",
")",
"{",
"if",
"(",
"N",
".",
"isEntity",
"(",
"targetClass",
")",
")",
"{"... | Returns values from all rows associated with the specified <code>targetClass</code> if the specified <code>targetClass</code> is an entity class, otherwise, only returns values from first column.
@param targetClass entity class or specific column type.
@param cursor
@param offset
@param count
@return | [
"Returns",
"values",
"from",
"all",
"rows",
"associated",
"with",
"the",
"specified",
"<code",
">",
"targetClass<",
"/",
"code",
">",
"if",
"the",
"specified",
"<code",
">",
"targetClass<",
"/",
"code",
">",
"is",
"an",
"entity",
"class",
"otherwise",
"only"... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/android/util/SQLiteExecutor.java#L282-L294 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Phrase.java | Phrase.addChunk | protected boolean addChunk(Chunk chunk) {
"""
Adds a Chunk.
<p>
This method is a hack to solve a problem I had with phrases that were split between chunks
in the wrong place.
@param chunk a Chunk to add to the Phrase
@return true if adding the Chunk succeeded
"""
Font f = chunk.getFont();
String... | java | protected boolean addChunk(Chunk chunk) {
Font f = chunk.getFont();
String c = chunk.getContent();
if (font != null && !font.isStandardFont()) {
f = font.difference(chunk.getFont());
}
if (size() > 0 && !chunk.hasAttributes()) {
try {
Chunk previ... | [
"protected",
"boolean",
"addChunk",
"(",
"Chunk",
"chunk",
")",
"{",
"Font",
"f",
"=",
"chunk",
".",
"getFont",
"(",
")",
";",
"String",
"c",
"=",
"chunk",
".",
"getContent",
"(",
")",
";",
"if",
"(",
"font",
"!=",
"null",
"&&",
"!",
"font",
".",
... | Adds a Chunk.
<p>
This method is a hack to solve a problem I had with phrases that were split between chunks
in the wrong place.
@param chunk a Chunk to add to the Phrase
@return true if adding the Chunk succeeded | [
"Adds",
"a",
"Chunk",
".",
"<p",
">",
"This",
"method",
"is",
"a",
"hack",
"to",
"solve",
"a",
"problem",
"I",
"had",
"with",
"phrases",
"that",
"were",
"split",
"between",
"chunks",
"in",
"the",
"wrong",
"place",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Phrase.java#L380-L407 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/seg/Segment.java | Segment.removeFromWordNet | private static void removeFromWordNet(Vertex cur, WordNet wordNetAll, int line, int length) {
"""
将一个词语从词网中彻底抹除
@param cur 词语
@param wordNetAll 词网
@param line 当前扫描的行数
@param length 当前缓冲区的长度
"""
LinkedList<Vertex>[] vertexes = wordNetAll.getVertexes();
// 将其从wordNet中删除
for (Vertex ve... | java | private static void removeFromWordNet(Vertex cur, WordNet wordNetAll, int line, int length)
{
LinkedList<Vertex>[] vertexes = wordNetAll.getVertexes();
// 将其从wordNet中删除
for (Vertex vertex : vertexes[line + length])
{
if (vertex.from == cur)
vertex.from = n... | [
"private",
"static",
"void",
"removeFromWordNet",
"(",
"Vertex",
"cur",
",",
"WordNet",
"wordNetAll",
",",
"int",
"line",
",",
"int",
"length",
")",
"{",
"LinkedList",
"<",
"Vertex",
">",
"[",
"]",
"vertexes",
"=",
"wordNetAll",
".",
"getVertexes",
"(",
")... | 将一个词语从词网中彻底抹除
@param cur 词语
@param wordNetAll 词网
@param line 当前扫描的行数
@param length 当前缓冲区的长度 | [
"将一个词语从词网中彻底抹除"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/Segment.java#L468-L483 |
prestodb/presto | presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloClient.java | AccumuloClient.getScanAuthorizations | private Authorizations getScanAuthorizations(ConnectorSession session, String schema,
String table)
throws AccumuloException, AccumuloSecurityException {
"""
Gets the scan authorizations to use for scanning tables.
<p>
In order of priority: session username authorizations, then table prop... | java | private Authorizations getScanAuthorizations(ConnectorSession session, String schema,
String table)
throws AccumuloException, AccumuloSecurityException
{
String sessionScanUser = AccumuloSessionProperties.getScanUsername(session);
if (sessionScanUser != null) {
Au... | [
"private",
"Authorizations",
"getScanAuthorizations",
"(",
"ConnectorSession",
"session",
",",
"String",
"schema",
",",
"String",
"table",
")",
"throws",
"AccumuloException",
",",
"AccumuloSecurityException",
"{",
"String",
"sessionScanUser",
"=",
"AccumuloSessionProperties... | Gets the scan authorizations to use for scanning tables.
<p>
In order of priority: session username authorizations, then table property, then the default connector auths.
@param session Current session
@param schema Schema name
@param table Table Name
@return Scan authorizations
@throws AccumuloException If a generic ... | [
"Gets",
"the",
"scan",
"authorizations",
"to",
"use",
"for",
"scanning",
"tables",
".",
"<p",
">",
"In",
"order",
"of",
"priority",
":",
"session",
"username",
"authorizations",
"then",
"table",
"property",
"then",
"the",
"default",
"connector",
"auths",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloClient.java#L729-L754 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslservicegroup.java | sslservicegroup.get | public static sslservicegroup get(nitro_service service, String servicegroupname) throws Exception {
"""
Use this API to fetch sslservicegroup resource of given name .
"""
sslservicegroup obj = new sslservicegroup();
obj.set_servicegroupname(servicegroupname);
sslservicegroup response = (sslservicegroup)... | java | public static sslservicegroup get(nitro_service service, String servicegroupname) throws Exception{
sslservicegroup obj = new sslservicegroup();
obj.set_servicegroupname(servicegroupname);
sslservicegroup response = (sslservicegroup) obj.get_resource(service);
return response;
} | [
"public",
"static",
"sslservicegroup",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"servicegroupname",
")",
"throws",
"Exception",
"{",
"sslservicegroup",
"obj",
"=",
"new",
"sslservicegroup",
"(",
")",
";",
"obj",
".",
"set_servicegroupname",
"(",
"ser... | Use this API to fetch sslservicegroup resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"sslservicegroup",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslservicegroup.java#L607-L612 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/io/fixed/FixedWidthReader.java | FixedWidthReader.detectColumnTypes | public ColumnType[] detectColumnTypes(Reader reader, FixedWidthReadOptions options) {
"""
Estimates and returns the type for each column in the delimited text file {@code file}
<p>
The type is determined by checking a sample of the data in the file. Because only a sample of the data is
checked,
the types may b... | java | public ColumnType[] detectColumnTypes(Reader reader, FixedWidthReadOptions options) {
boolean header = options.header();
int linesToSkip = header ? 1 : 0;
AbstractParser<?> parser = fixedWidthParser(options);
try {
return getTypes(reader, options, linesToSkip, parser);
... | [
"public",
"ColumnType",
"[",
"]",
"detectColumnTypes",
"(",
"Reader",
"reader",
",",
"FixedWidthReadOptions",
"options",
")",
"{",
"boolean",
"header",
"=",
"options",
".",
"header",
"(",
")",
";",
"int",
"linesToSkip",
"=",
"header",
"?",
"1",
":",
"0",
"... | Estimates and returns the type for each column in the delimited text file {@code file}
<p>
The type is determined by checking a sample of the data in the file. Because only a sample of the data is
checked,
the types may be incorrect. If that is the case a Parse Exception will be thrown.
<p>
The method {@code printColum... | [
"Estimates",
"and",
"returns",
"the",
"type",
"for",
"each",
"column",
"in",
"the",
"delimited",
"text",
"file",
"{"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/io/fixed/FixedWidthReader.java#L145-L158 |
Coveros/selenified | src/main/java/com/coveros/selenified/application/WaitFor.java | WaitFor.popupEquals | private double popupEquals(double seconds, String expectedPopupText) {
"""
Wait for a popup to have the expected text, and then returns the
amount of time that was waited
@param seconds - maximum amount of time to wait in seconds
@param expectedPopupText - the expected text to wait for
@return doub... | java | private double popupEquals(double seconds, String expectedPopupText) {
double end = System.currentTimeMillis() + (seconds * 1000);
while (!app.get().alert().equals(expectedPopupText) && System.currentTimeMillis() < end) ;
return Math.min((seconds * 1000) - (end - System.currentTimeMillis()), sec... | [
"private",
"double",
"popupEquals",
"(",
"double",
"seconds",
",",
"String",
"expectedPopupText",
")",
"{",
"double",
"end",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"(",
"seconds",
"*",
"1000",
")",
";",
"while",
"(",
"!",
"app",
".",
"ge... | Wait for a popup to have the expected text, and then returns the
amount of time that was waited
@param seconds - maximum amount of time to wait in seconds
@param expectedPopupText - the expected text to wait for
@return double: the total time waited | [
"Wait",
"for",
"a",
"popup",
"to",
"have",
"the",
"expected",
"text",
"and",
"then",
"returns",
"the",
"amount",
"of",
"time",
"that",
"was",
"waited"
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/WaitFor.java#L418-L422 |
soi-toolkit/soi-toolkit-mule | commons/components/module-logger/src/main/java/org/soitoolkit/commons/module/logger/SoitoolkitLoggerModule.java | SoitoolkitLoggerModule.logError | @Processor
public Object logError(
String message,
@Optional String integrationScenario,
@Optional String contractId,
@Optional String correlationId,
@Optional Map<String, String> extra) {
"""
Log processor for level ERROR
{@sample.xml ../../../doc/SoitoolkitLogger-connector.xml.... | java | @Processor
public Object logError(
String message,
@Optional String integrationScenario,
@Optional String contractId,
@Optional String correlationId,
@Optional Map<String, String> extra) {
return doLog(LogLevelType.ERROR, message, integrationScenario, contractId, correlationId, ext... | [
"@",
"Processor",
"public",
"Object",
"logError",
"(",
"String",
"message",
",",
"@",
"Optional",
"String",
"integrationScenario",
",",
"@",
"Optional",
"String",
"contractId",
",",
"@",
"Optional",
"String",
"correlationId",
",",
"@",
"Optional",
"Map",
"<",
... | Log processor for level ERROR
{@sample.xml ../../../doc/SoitoolkitLogger-connector.xml.sample soitoolkitlogger:log}
@param message Log-message to be processed
@param integrationScenario Optional name of the integration scenario or business process
@param contractId Optional name of the contract in use
@param correlat... | [
"Log",
"processor",
"for",
"level",
"ERROR"
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/module-logger/src/main/java/org/soitoolkit/commons/module/logger/SoitoolkitLoggerModule.java#L190-L199 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/APIClient.java | APIClient.getLogs | public JSONObject getLogs(int offset, int length, LogType logType, RequestOptions requestOptions) throws AlgoliaException {
"""
Return last logs entries.
@param offset Specify the first entry to retrieve (0-based, 0 is the most recent log entry).
@param length Specify the maximum number of entr... | java | public JSONObject getLogs(int offset, int length, LogType logType, RequestOptions requestOptions) throws AlgoliaException {
String type = null;
switch (logType) {
case LOG_BUILD:
type = "build";
break;
case LOG_QUERY:
type = "query";
break;
case LOG_ERROR:
... | [
"public",
"JSONObject",
"getLogs",
"(",
"int",
"offset",
",",
"int",
"length",
",",
"LogType",
"logType",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"String",
"type",
"=",
"null",
";",
"switch",
"(",
"logType",
")",
"{",
... | Return last logs entries.
@param offset Specify the first entry to retrieve (0-based, 0 is the most recent log entry).
@param length Specify the maximum number of entries to retrieve starting at offset. Maximum allowed value: 1000.
@param logType Specify the type of log to retrieve
@param reques... | [
"Return",
"last",
"logs",
"entries",
"."
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L484-L501 |
mapsforge/mapsforge | mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/ReadBuffer.java | ReadBuffer.readUTF8EncodedString | public String readUTF8EncodedString(int stringLength) {
"""
Decodes the given amount of bytes from the read buffer to a string.
@param stringLength the length of the string in bytes.
@return the UTF-8 decoded string (may be null).
"""
if (stringLength > 0 && this.bufferPosition + stringLength <= th... | java | public String readUTF8EncodedString(int stringLength) {
if (stringLength > 0 && this.bufferPosition + stringLength <= this.bufferData.length) {
this.bufferPosition += stringLength;
try {
return new String(this.bufferData, this.bufferPosition - stringLength, stringLength, ... | [
"public",
"String",
"readUTF8EncodedString",
"(",
"int",
"stringLength",
")",
"{",
"if",
"(",
"stringLength",
">",
"0",
"&&",
"this",
".",
"bufferPosition",
"+",
"stringLength",
"<=",
"this",
".",
"bufferData",
".",
"length",
")",
"{",
"this",
".",
"bufferPo... | Decodes the given amount of bytes from the read buffer to a string.
@param stringLength the length of the string in bytes.
@return the UTF-8 decoded string (may be null). | [
"Decodes",
"the",
"given",
"amount",
"of",
"bytes",
"from",
"the",
"read",
"buffer",
"to",
"a",
"string",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/ReadBuffer.java#L272-L283 |
ModeShape/modeshape | sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/StandardDdlParser.java | StandardDdlParser.parseColumnDefinition | protected void parseColumnDefinition( DdlTokenStream tokens,
AstNode tableNode,
boolean isAlterTable ) throws ParsingException {
"""
Utility method to parse the actual column definition. SQL-92 Structural Specification <column defi... | java | protected void parseColumnDefinition( DdlTokenStream tokens,
AstNode tableNode,
boolean isAlterTable ) throws ParsingException {
assert tokens != null;
assert tableNode != null;
tokens.canConsume("COLUMN");
... | [
"protected",
"void",
"parseColumnDefinition",
"(",
"DdlTokenStream",
"tokens",
",",
"AstNode",
"tableNode",
",",
"boolean",
"isAlterTable",
")",
"throws",
"ParsingException",
"{",
"assert",
"tokens",
"!=",
"null",
";",
"assert",
"tableNode",
"!=",
"null",
";",
"to... | Utility method to parse the actual column definition. SQL-92 Structural Specification <column definition> ::= <column name>
{ <data type> | <domain name> } [ <default clause> ] [ <column constraint definition>... ] [ <collate clause> ]
@param tokens the {@link DdlTokenStream} representing the tokenized DDL content; ma... | [
"Utility",
"method",
"to",
"parse",
"the",
"actual",
"column",
"definition",
".",
"SQL",
"-",
"92",
"Structural",
"Specification",
"<column",
"definition",
">",
"::",
"=",
"<column",
"name",
">",
"{",
"<data",
"type",
">",
"|",
"<domain",
"name",
">",
"}",... | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/StandardDdlParser.java#L1387-L1424 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/archivalurl/FastArchivalUrlReplayParseEventHandler.java | FastArchivalUrlReplayParseEventHandler.handleJSIncludeNode | private void handleJSIncludeNode(ReplayParseContext context, TagNode tagNode) {
"""
kludgy support for selectively disabling JavaScript that messes up
replay.
<p>
If {@code jsBlockTrans.transform} returns {@code null} or empty for
{@code SCRIPT/@SRC}, {@code SCRIPT} element is disabled by replacing
{@code SRC... | java | private void handleJSIncludeNode(ReplayParseContext context, TagNode tagNode) {
String file = tagNode.getAttribute("SRC");
if (file != null) {
String result = jsBlockTrans.transform(context, file);
// URL rewrite is done by AttributeRewriter, which should ignore
// empty value.
if (result == null || res... | [
"private",
"void",
"handleJSIncludeNode",
"(",
"ReplayParseContext",
"context",
",",
"TagNode",
"tagNode",
")",
"{",
"String",
"file",
"=",
"tagNode",
".",
"getAttribute",
"(",
"\"SRC\"",
")",
";",
"if",
"(",
"file",
"!=",
"null",
")",
"{",
"String",
"result... | kludgy support for selectively disabling JavaScript that messes up
replay.
<p>
If {@code jsBlockTrans.transform} returns {@code null} or empty for
{@code SCRIPT/@SRC}, {@code SCRIPT} element is disabled by replacing
{@code SRC} attribute with empty value. {@link DisableJSIncludeRewriteRule}
provides one implementation ... | [
"kludgy",
"support",
"for",
"selectively",
"disabling",
"JavaScript",
"that",
"messes",
"up",
"replay",
".",
"<p",
">",
"If",
"{"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/archivalurl/FastArchivalUrlReplayParseEventHandler.java#L246-L256 |
UrielCh/ovh-java-sdk | ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java | ApiOvhSms.serviceName_exceptions_GET | public ArrayList<OvhException> serviceName_exceptions_GET(String serviceName, String receiver) throws IOException {
"""
Describe filter exceptions in sms sending from a specific receiver.
REST: GET /sms/{serviceName}/exceptions
@param receiver [required] The receiver number to check
@param serviceName [requir... | java | public ArrayList<OvhException> serviceName_exceptions_GET(String serviceName, String receiver) throws IOException {
String qPath = "/sms/{serviceName}/exceptions";
StringBuilder sb = path(qPath, serviceName);
query(sb, "receiver", receiver);
String resp = exec(qPath, "GET", sb.toString(), null);
return conver... | [
"public",
"ArrayList",
"<",
"OvhException",
">",
"serviceName_exceptions_GET",
"(",
"String",
"serviceName",
",",
"String",
"receiver",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/sms/{serviceName}/exceptions\"",
";",
"StringBuilder",
"sb",
"=",
"pa... | Describe filter exceptions in sms sending from a specific receiver.
REST: GET /sms/{serviceName}/exceptions
@param receiver [required] The receiver number to check
@param serviceName [required] The internal name of your SMS offer | [
"Describe",
"filter",
"exceptions",
"in",
"sms",
"sending",
"from",
"a",
"specific",
"receiver",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L1439-L1445 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.