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 |
|---|---|---|---|---|---|---|---|---|---|---|
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java | StringIterate.allSatisfy | @Deprecated
public static boolean allSatisfy(String string, CodePointPredicate predicate) {
"""
@return true if all of the code points in the {@code string} answer true for the specified {@code predicate}.
@deprecated since 7.0. Use {@link #allSatisfyCodePoint(String, CodePointPredicate)} instead.
"""
... | java | @Deprecated
public static boolean allSatisfy(String string, CodePointPredicate predicate)
{
return StringIterate.allSatisfyCodePoint(string, predicate);
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"allSatisfy",
"(",
"String",
"string",
",",
"CodePointPredicate",
"predicate",
")",
"{",
"return",
"StringIterate",
".",
"allSatisfyCodePoint",
"(",
"string",
",",
"predicate",
")",
";",
"}"
] | @return true if all of the code points in the {@code string} answer true for the specified {@code predicate}.
@deprecated since 7.0. Use {@link #allSatisfyCodePoint(String, CodePointPredicate)} instead. | [
"@return",
"true",
"if",
"all",
"of",
"the",
"code",
"points",
"in",
"the",
"{",
"@code",
"string",
"}",
"answer",
"true",
"for",
"the",
"specified",
"{",
"@code",
"predicate",
"}",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L879-L883 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java | CPDefinitionSpecificationOptionValuePersistenceImpl.findByGroupId | @Override
public List<CPDefinitionSpecificationOptionValue> findByGroupId(
long groupId) {
"""
Returns all the cp definition specification option values where groupId = ?.
@param groupId the group ID
@return the matching cp definition specification option values
"""
return findByGroupId(groupId, Q... | java | @Override
public List<CPDefinitionSpecificationOptionValue> findByGroupId(
long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionSpecificationOptionValue",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")... | Returns all the cp definition specification option values where groupId = ?.
@param groupId the group ID
@return the matching cp definition specification option values | [
"Returns",
"all",
"the",
"cp",
"definition",
"specification",
"option",
"values",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java#L1551-L1555 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java | SARLOperationHelper._hasSideEffects | protected Boolean _hasSideEffects(XCastedExpression expression, ISideEffectContext context) {
"""
Test if the given expression has side effects.
@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects.
"""
return hasSideEf... | java | protected Boolean _hasSideEffects(XCastedExpression expression, ISideEffectContext context) {
return hasSideEffects(expression.getTarget(), context);
} | [
"protected",
"Boolean",
"_hasSideEffects",
"(",
"XCastedExpression",
"expression",
",",
"ISideEffectContext",
"context",
")",
"{",
"return",
"hasSideEffects",
"(",
"expression",
".",
"getTarget",
"(",
")",
",",
"context",
")",
";",
"}"
] | Test if the given expression has side effects.
@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects. | [
"Test",
"if",
"the",
"given",
"expression",
"has",
"side",
"effects",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java#L274-L276 |
netty/netty | transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java | AbstractKQueueStreamChannel.doWriteMultiple | private int doWriteMultiple(ChannelOutboundBuffer in) throws Exception {
"""
Attempt to write multiple {@link ByteBuf} objects.
@param in the collection which contains objects to write.
@return The value that should be decremented from the write quantum which starts at
{@link ChannelConfig#getWriteSpinCount()}.... | java | private int doWriteMultiple(ChannelOutboundBuffer in) throws Exception {
final long maxBytesPerGatheringWrite = config().getMaxBytesPerGatheringWrite();
IovArray array = ((KQueueEventLoop) eventLoop()).cleanArray();
array.maxBytes(maxBytesPerGatheringWrite);
in.forEachFlushedMessage(arra... | [
"private",
"int",
"doWriteMultiple",
"(",
"ChannelOutboundBuffer",
"in",
")",
"throws",
"Exception",
"{",
"final",
"long",
"maxBytesPerGatheringWrite",
"=",
"config",
"(",
")",
".",
"getMaxBytesPerGatheringWrite",
"(",
")",
";",
"IovArray",
"array",
"=",
"(",
"(",... | Attempt to write multiple {@link ByteBuf} objects.
@param in the collection which contains objects to write.
@return The value that should be decremented from the write quantum which starts at
{@link ChannelConfig#getWriteSpinCount()}. The typical use cases are as follows:
<ul>
<li>0 - if no write was attempted. This i... | [
"Attempt",
"to",
"write",
"multiple",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java#L348-L361 |
wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/RouteUtils.java | RouteUtils.getPrefixedUri | public static String getPrefixedUri(String prefix, String uri) {
"""
Prepends the given prefix to the given uri.
@param prefix the prefix
@param uri the uri
@return the full uri
"""
String localURI = uri;
if (localURI.length() > 0) {
// Put a / between the prefix and the tai... | java | public static String getPrefixedUri(String prefix, String uri) {
String localURI = uri;
if (localURI.length() > 0) {
// Put a / between the prefix and the tail only if:
// the prefix does not ends with a /
// the tail does not start with a /
// the tail st... | [
"public",
"static",
"String",
"getPrefixedUri",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"{",
"String",
"localURI",
"=",
"uri",
";",
"if",
"(",
"localURI",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"// Put a / between the prefix and the tail only... | Prepends the given prefix to the given uri.
@param prefix the prefix
@param uri the uri
@return the full uri | [
"Prepends",
"the",
"given",
"prefix",
"to",
"the",
"given",
"uri",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/RouteUtils.java#L204-L223 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/CommandUtil.java | CommandUtil.getCommand | public static Command getCommand(String commandName, boolean forceCreate) {
"""
Returns a command from the command registry.
@param commandName Name of the command.
@param forceCreate If true and the named command does not exist, one will be created and
added to the command registry.
@return The command obje... | java | public static Command getCommand(String commandName, boolean forceCreate) {
return CommandRegistry.getInstance().get(commandName, forceCreate);
} | [
"public",
"static",
"Command",
"getCommand",
"(",
"String",
"commandName",
",",
"boolean",
"forceCreate",
")",
"{",
"return",
"CommandRegistry",
".",
"getInstance",
"(",
")",
".",
"get",
"(",
"commandName",
",",
"forceCreate",
")",
";",
"}"
] | Returns a command from the command registry.
@param commandName Name of the command.
@param forceCreate If true and the named command does not exist, one will be created and
added to the command registry.
@return The command object corresponding to the specified command name. | [
"Returns",
"a",
"command",
"from",
"the",
"command",
"registry",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/CommandUtil.java#L236-L238 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.utils/src/com/ibm/ws/jca/utils/xml/metatype/MetatypeOcd.java | MetatypeOcd.addInternalMetatypeAd | public void addInternalMetatypeAd(String id, String value) {
"""
Adds an internal, ibm:final metatype ad
@param id id
@param value default value
"""
MetatypeAd ad = new MetatypeAd(metaTypeProviderFactory);
ad.setId(id);
ad.setType("String");
ad.setDefault(value);
ad.... | java | public void addInternalMetatypeAd(String id, String value) {
MetatypeAd ad = new MetatypeAd(metaTypeProviderFactory);
ad.setId(id);
ad.setType("String");
ad.setDefault(value);
ad.setFinal(true);
ad.setName("internal");
ad.setDescription("internal use only");
... | [
"public",
"void",
"addInternalMetatypeAd",
"(",
"String",
"id",
",",
"String",
"value",
")",
"{",
"MetatypeAd",
"ad",
"=",
"new",
"MetatypeAd",
"(",
"metaTypeProviderFactory",
")",
";",
"ad",
".",
"setId",
"(",
"id",
")",
";",
"ad",
".",
"setType",
"(",
... | Adds an internal, ibm:final metatype ad
@param id id
@param value default value | [
"Adds",
"an",
"internal",
"ibm",
":",
"final",
"metatype",
"ad"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.utils/src/com/ibm/ws/jca/utils/xml/metatype/MetatypeOcd.java#L153-L162 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.sameHqSearchUrl | public JSONObject sameHqSearchUrl(String url, HashMap<String, String> options) {
"""
相同图检索—检索接口
完成入库后,可使用该接口实现相同图检索。**支持传入指定分类维度(具体变量tags)进行检索,返回结果支持翻页(具体变量pn、rn)。****请注意,检索接口不返回原图,仅反馈当前填写的brief信息,请调用入库接口时尽量填写可关联至本地图库的图片id或者图片url等信息。**
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最... | java | public JSONObject sameHqSearchUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(ImageSearchCo... | [
"public",
"JSONObject",
"sameHqSearchUrl",
"(",
"String",
"url",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",
... | 相同图检索—检索接口
完成入库后,可使用该接口实现相同图检索。**支持传入指定分类维度(具体变量tags)进行检索,返回结果支持翻页(具体变量pn、rn)。****请注意,检索接口不返回原图,仅反馈当前填写的brief信息,请调用入库接口时尽量填写可关联至本地图库的图片id或者图片url等信息。**
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
optio... | [
"相同图检索—检索接口",
"完成入库后,可使用该接口实现相同图检索。",
"**",
"支持传入指定分类维度(具体变量tags)进行检索,返回结果支持翻页(具体变量pn、rn)。",
"****",
"请注意,检索接口不返回原图,仅反馈当前填写的brief信息,请调用入库接口时尽量填写可关联至本地图库的图片id或者图片url等信息。",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L165-L176 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/repository/jdbc/JdbcRepository.java | JdbcRepository.setProperties | private void setProperties(final JSONObject jsonObject, final List<Object> paramlist, final StringBuilder sql) {
"""
setProperties.
@param jsonObject jsonObject
@param paramlist paramlist
@param sql sql
"""
final Iterator<String> keys = jsonObject.keys();
final StringBuilder inser... | java | private void setProperties(final JSONObject jsonObject, final List<Object> paramlist, final StringBuilder sql) {
final Iterator<String> keys = jsonObject.keys();
final StringBuilder insertString = new StringBuilder();
final StringBuilder wildcardString = new StringBuilder();
boolean is... | [
"private",
"void",
"setProperties",
"(",
"final",
"JSONObject",
"jsonObject",
",",
"final",
"List",
"<",
"Object",
">",
"paramlist",
",",
"final",
"StringBuilder",
"sql",
")",
"{",
"final",
"Iterator",
"<",
"String",
">",
"keys",
"=",
"jsonObject",
".",
"key... | setProperties.
@param jsonObject jsonObject
@param paramlist paramlist
@param sql sql | [
"setProperties",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/repository/jdbc/JdbcRepository.java#L194-L226 |
apache/incubator-druid | core/src/main/java/org/apache/druid/java/util/common/StringUtils.java | StringUtils.replaceChar | public static String replaceChar(String s, char c, String replacement) {
"""
Replaces all occurrences of the given char in the given string with the given replacement string. This method is an
optimal version of {@link String#replace(CharSequence, CharSequence) s.replace("c", replacement)}.
"""
int pos = ... | java | public static String replaceChar(String s, char c, String replacement)
{
int pos = s.indexOf(c);
if (pos < 0) {
return s;
}
StringBuilder sb = new StringBuilder(s.length() - 1 + replacement.length());
int prevPos = 0;
do {
sb.append(s, prevPos, pos);
sb.append(replacement);
... | [
"public",
"static",
"String",
"replaceChar",
"(",
"String",
"s",
",",
"char",
"c",
",",
"String",
"replacement",
")",
"{",
"int",
"pos",
"=",
"s",
".",
"indexOf",
"(",
"c",
")",
";",
"if",
"(",
"pos",
"<",
"0",
")",
"{",
"return",
"s",
";",
"}",
... | Replaces all occurrences of the given char in the given string with the given replacement string. This method is an
optimal version of {@link String#replace(CharSequence, CharSequence) s.replace("c", replacement)}. | [
"Replaces",
"all",
"occurrences",
"of",
"the",
"given",
"char",
"in",
"the",
"given",
"string",
"with",
"the",
"given",
"replacement",
"string",
".",
"This",
"method",
"is",
"an",
"optimal",
"version",
"of",
"{"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/common/StringUtils.java#L223-L239 |
RestExpress/PluginExpress | metrics/src/main/java/com/strategicgains/restexpress/plugin/metrics/MetricsPlugin.java | MetricsPlugin.process | @Override
public void process(Request request, Response response) {
"""
Set the 'X-Response-Time' header to the response time in milliseconds.
"""
Long duration = computeDurationMillis(START_TIMES_BY_CORRELATION_ID.get(request.getCorrelationId()));
if (duration != null && duration.longValue() > 0)
{
... | java | @Override
public void process(Request request, Response response)
{
Long duration = computeDurationMillis(START_TIMES_BY_CORRELATION_ID.get(request.getCorrelationId()));
if (duration != null && duration.longValue() > 0)
{
response.addHeader("X-Response-Time", String.valueOf(duration));
}
} | [
"@",
"Override",
"public",
"void",
"process",
"(",
"Request",
"request",
",",
"Response",
"response",
")",
"{",
"Long",
"duration",
"=",
"computeDurationMillis",
"(",
"START_TIMES_BY_CORRELATION_ID",
".",
"get",
"(",
"request",
".",
"getCorrelationId",
"(",
")",
... | Set the 'X-Response-Time' header to the response time in milliseconds. | [
"Set",
"the",
"X",
"-",
"Response",
"-",
"Time",
"header",
"to",
"the",
"response",
"time",
"in",
"milliseconds",
"."
] | train | https://github.com/RestExpress/PluginExpress/blob/aeb13907c23bf31ef2b2b17ae4c0ca4a6f5bee69/metrics/src/main/java/com/strategicgains/restexpress/plugin/metrics/MetricsPlugin.java#L235-L244 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/values/JcNumber.java | JcNumber.plus | public JcNumber plus(Number val) {
"""
<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>return the result of adding two numbers, return a <b>JcNumber</b></i></div>
<br/>
"""
JcNumber ret = new JcNumber(val, this, OPERA... | java | public JcNumber plus(Number val) {
JcNumber ret = new JcNumber(val, this, OPERATOR.Number.PLUS);
QueryRecorder.recordInvocationConditional(this, "plus", ret, QueryRecorder.literal(val));
return ret;
} | [
"public",
"JcNumber",
"plus",
"(",
"Number",
"val",
")",
"{",
"JcNumber",
"ret",
"=",
"new",
"JcNumber",
"(",
"val",
",",
"this",
",",
"OPERATOR",
".",
"Number",
".",
"PLUS",
")",
";",
"QueryRecorder",
".",
"recordInvocationConditional",
"(",
"this",
",",
... | <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>return the result of adding two numbers, return a <b>JcNumber</b></i></div>
<br/> | [
"<div",
"color",
"=",
"red",
"style",
"=",
"font",
"-",
"size",
":",
"24px",
";",
"color",
":",
"red",
">",
"<b",
">",
"<i",
">",
"<u",
">",
"JCYPHER<",
"/",
"u",
">",
"<",
"/",
"i",
">",
"<",
"/",
"b",
">",
"<",
"/",
"div",
">",
"<div",
... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/JcNumber.java#L69-L73 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java | DockerUtils.getFsLayers | private static JsonNode getFsLayers(JsonNode manifest, boolean isSchemeVersion1) {
"""
Return blob sum depend on scheme version.
@param manifest
@param isSchemeVersion1
@return
"""
JsonNode fsLayers;
if (isSchemeVersion1) {
fsLayers = manifest.get("fsLayers");
} else {
... | java | private static JsonNode getFsLayers(JsonNode manifest, boolean isSchemeVersion1) {
JsonNode fsLayers;
if (isSchemeVersion1) {
fsLayers = manifest.get("fsLayers");
} else {
fsLayers = manifest.get("layers");
}
if (fsLayers == null) {
throw new ... | [
"private",
"static",
"JsonNode",
"getFsLayers",
"(",
"JsonNode",
"manifest",
",",
"boolean",
"isSchemeVersion1",
")",
"{",
"JsonNode",
"fsLayers",
";",
"if",
"(",
"isSchemeVersion1",
")",
"{",
"fsLayers",
"=",
"manifest",
".",
"get",
"(",
"\"fsLayers\"",
")",
... | Return blob sum depend on scheme version.
@param manifest
@param isSchemeVersion1
@return | [
"Return",
"blob",
"sum",
"depend",
"on",
"scheme",
"version",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java#L173-L185 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/Tesseract.java | Tesseract.doOCR | private String doOCR(IIOImage oimage, String filename, Rectangle rect, int pageNum) throws TesseractException {
"""
Performs OCR operation.
<br>
Note: <code>init()</code> and <code>setTessVariables()</code> must be
called before use; <code>dispose()</code> should be called afterwards.
@param oimage an <code>... | java | private String doOCR(IIOImage oimage, String filename, Rectangle rect, int pageNum) throws TesseractException {
String text = "";
try {
setImage(oimage.getRenderedImage(), rect);
text = getOCRText(filename, pageNum);
} catch (IOException ioe) {
// skip... | [
"private",
"String",
"doOCR",
"(",
"IIOImage",
"oimage",
",",
"String",
"filename",
",",
"Rectangle",
"rect",
",",
"int",
"pageNum",
")",
"throws",
"TesseractException",
"{",
"String",
"text",
"=",
"\"\"",
";",
"try",
"{",
"setImage",
"(",
"oimage",
".",
"... | Performs OCR operation.
<br>
Note: <code>init()</code> and <code>setTessVariables()</code> must be
called before use; <code>dispose()</code> should be called afterwards.
@param oimage an <code>IIOImage</code> object
@param filename input file nam
@param rect the bounding rectangle defines the region of the image to be... | [
"Performs",
"OCR",
"operation",
".",
"<br",
">",
"Note",
":",
"<code",
">",
"init",
"()",
"<",
"/",
"code",
">",
"and",
"<code",
">",
"setTessVariables",
"()",
"<",
"/",
"code",
">",
"must",
"be",
"called",
"before",
"use",
";",
"<code",
">",
"dispos... | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract.java#L353-L365 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseConditionExpression | private Expr parseConditionExpression(EnclosingScope scope, boolean terminated) {
"""
Parse a condition expression.
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param terminated
This indicates tha... | java | private Expr parseConditionExpression(EnclosingScope scope, boolean terminated) {
int start = index;
Token lookahead;
// First, attempt to parse quantifiers (e.g. some, all, no, etc)
if ((lookahead = tryAndMatch(terminated, Some, All)) != null) {
return parseQuantifierExpression(lookahead, scope, terminated... | [
"private",
"Expr",
"parseConditionExpression",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
";",
"Token",
"lookahead",
";",
"// First, attempt to parse quantifiers (e.g. some, all, no, etc)",
"if",
"(",
"(",
"look... | Parse a condition expression.
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param terminated
This indicates that the expression is known to be terminated
(or not). An expression that's known to be terminated i... | [
"Parse",
"a",
"condition",
"expression",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L1856-L1902 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/Actions.java | Actions.sendKeys | public Actions sendKeys(CharSequence... keys) {
"""
Sends keys to the active element. This differs from calling
{@link WebElement#sendKeys(CharSequence...)} on the active element in two ways:
<ul>
<li>The modifier keys included in this call are not released.</li>
<li>There is no attempt to re-focus the element... | java | public Actions sendKeys(CharSequence... keys) {
if (isBuildingActions()) {
action.addAction(new SendKeysAction(jsonKeyboard, jsonMouse, null, keys));
}
return sendKeysInTicks(keys);
} | [
"public",
"Actions",
"sendKeys",
"(",
"CharSequence",
"...",
"keys",
")",
"{",
"if",
"(",
"isBuildingActions",
"(",
")",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"SendKeysAction",
"(",
"jsonKeyboard",
",",
"jsonMouse",
",",
"null",
",",
"keys",
")... | Sends keys to the active element. This differs from calling
{@link WebElement#sendKeys(CharSequence...)} on the active element in two ways:
<ul>
<li>The modifier keys included in this call are not released.</li>
<li>There is no attempt to re-focus the element - so sendKeys(Keys.TAB) for switching
elements should work. ... | [
"Sends",
"keys",
"to",
"the",
"active",
"element",
".",
"This",
"differs",
"from",
"calling",
"{",
"@link",
"WebElement#sendKeys",
"(",
"CharSequence",
"...",
")",
"}",
"on",
"the",
"active",
"element",
"in",
"two",
"ways",
":",
"<ul",
">",
"<li",
">",
"... | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L161-L167 |
apache/incubator-druid | extensions-contrib/materialized-view-selection/src/main/java/org/apache/druid/query/materializedview/DerivativeDataSourceManager.java | DerivativeDataSourceManager.getAvgSizePerGranularity | private long getAvgSizePerGranularity(String datasource) {
"""
calculate the average data size per segment granularity for a given datasource.
e.g. for a datasource, there're 5 segments as follows,
interval = "2018-04-01/2017-04-02", segment size = 1024 * 1024 * 2
interval = "2018-04-01/2017-04-02", segment s... | java | private long getAvgSizePerGranularity(String datasource)
{
return connector.retryWithHandle(
new HandleCallback<Long>() {
Set<Interval> intervals = new HashSet<>();
long totalSize = 0;
@Override
public Long withHandle(Handle handle)
{
handle.cr... | [
"private",
"long",
"getAvgSizePerGranularity",
"(",
"String",
"datasource",
")",
"{",
"return",
"connector",
".",
"retryWithHandle",
"(",
"new",
"HandleCallback",
"<",
"Long",
">",
"(",
")",
"{",
"Set",
"<",
"Interval",
">",
"intervals",
"=",
"new",
"HashSet",... | calculate the average data size per segment granularity for a given datasource.
e.g. for a datasource, there're 5 segments as follows,
interval = "2018-04-01/2017-04-02", segment size = 1024 * 1024 * 2
interval = "2018-04-01/2017-04-02", segment size = 1024 * 1024 * 2
interval = "2018-04-02/2017-04-03", segment size =... | [
"calculate",
"the",
"average",
"data",
"size",
"per",
"segment",
"granularity",
"for",
"a",
"given",
"datasource",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-contrib/materialized-view-selection/src/main/java/org/apache/druid/query/materializedview/DerivativeDataSourceManager.java#L227-L265 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/query/KunderaQuery.java | KunderaQuery.addDiscriminatorClause | private void addDiscriminatorClause(List<String> clauses, EntityType entityType) {
"""
Adds the discriminator clause.
@param clauses
the clauses
@param entityType
the entity type
"""
if (((AbstractManagedType) entityType).isInherited()) {
String discrColumn = ((AbstractManagedType) en... | java | private void addDiscriminatorClause(List<String> clauses, EntityType entityType) {
if (((AbstractManagedType) entityType).isInherited()) {
String discrColumn = ((AbstractManagedType) entityType).getDiscriminatorColumn();
String discrValue = ((AbstractManagedType) entityType).getDiscrimin... | [
"private",
"void",
"addDiscriminatorClause",
"(",
"List",
"<",
"String",
">",
"clauses",
",",
"EntityType",
"entityType",
")",
"{",
"if",
"(",
"(",
"(",
"AbstractManagedType",
")",
"entityType",
")",
".",
"isInherited",
"(",
")",
")",
"{",
"String",
"discrCo... | Adds the discriminator clause.
@param clauses
the clauses
@param entityType
the entity type | [
"Adds",
"the",
"discriminator",
"clause",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/query/KunderaQuery.java#L665-L679 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/apple/XcodeProjectWriter.java | XcodeProjectWriter.createXCBuildConfiguration | private static PBXObjectRef createXCBuildConfiguration(final String name, final Map<String, ?> buildSettings) {
"""
Create XCBuildConfiguration.
@param name
name.
@param buildSettings
build settings.
@return build configuration.
"""
final Map map = new HashMap();
map.put("isa", "XCBuildConfigura... | java | private static PBXObjectRef createXCBuildConfiguration(final String name, final Map<String, ?> buildSettings) {
final Map map = new HashMap();
map.put("isa", "XCBuildConfiguration");
map.put("buildSettings", buildSettings);
map.put("name", name);
return new PBXObjectRef(map);
} | [
"private",
"static",
"PBXObjectRef",
"createXCBuildConfiguration",
"(",
"final",
"String",
"name",
",",
"final",
"Map",
"<",
"String",
",",
"?",
">",
"buildSettings",
")",
"{",
"final",
"Map",
"map",
"=",
"new",
"HashMap",
"(",
")",
";",
"map",
".",
"put",... | Create XCBuildConfiguration.
@param name
name.
@param buildSettings
build settings.
@return build configuration. | [
"Create",
"XCBuildConfiguration",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/apple/XcodeProjectWriter.java#L372-L378 |
pravega/pravega | common/src/main/java/io/pravega/common/util/btree/BTreePage.java | BTreePage.splitIfNecessary | List<BTreePage> splitIfNecessary() {
"""
If necessary, splits the contents of this BTreePage instance into multiple BTreePages. This instance will not be
modified as a result of this operation (all new BTreePages will be copies).
The resulting pages will be about half full each, and when combined in order, the... | java | List<BTreePage> splitIfNecessary() {
if (this.contents.getLength() <= this.config.getMaxPageSize()) {
// Nothing to do.
return null;
}
// Calculate how many pages to split into. While doing so, take care to account that we may only have whole entries
// in each p... | [
"List",
"<",
"BTreePage",
">",
"splitIfNecessary",
"(",
")",
"{",
"if",
"(",
"this",
".",
"contents",
".",
"getLength",
"(",
")",
"<=",
"this",
".",
"config",
".",
"getMaxPageSize",
"(",
")",
")",
"{",
"// Nothing to do.",
"return",
"null",
";",
"}",
"... | If necessary, splits the contents of this BTreePage instance into multiple BTreePages. This instance will not be
modified as a result of this operation (all new BTreePages will be copies).
The resulting pages will be about half full each, and when combined in order, they will contain the same elements
as this BTreePag... | [
"If",
"necessary",
"splits",
"the",
"contents",
"of",
"this",
"BTreePage",
"instance",
"into",
"multiple",
"BTreePages",
".",
"This",
"instance",
"will",
"not",
"be",
"modified",
"as",
"a",
"result",
"of",
"this",
"operation",
"(",
"all",
"new",
"BTreePages",
... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/BTreePage.java#L331-L363 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsLinkWarningPanel.java | CmsLinkWarningPanel.createTreeItem | protected CmsTreeItem createTreeItem(CmsBrokenLinkBean brokenLinkBean) {
"""
Helper method for creating a tree item from a bean.<p>
@param brokenLinkBean the bean containing the data for the tree item
@return a tree item
"""
CmsListItemWidget itemWidget = createListItemWidget(brokenLinkBean);
... | java | protected CmsTreeItem createTreeItem(CmsBrokenLinkBean brokenLinkBean) {
CmsListItemWidget itemWidget = createListItemWidget(brokenLinkBean);
CmsTreeItem item = new CmsTreeItem(false, itemWidget);
for (CmsBrokenLinkBean child : brokenLinkBean.getChildren()) {
CmsListItemWidget child... | [
"protected",
"CmsTreeItem",
"createTreeItem",
"(",
"CmsBrokenLinkBean",
"brokenLinkBean",
")",
"{",
"CmsListItemWidget",
"itemWidget",
"=",
"createListItemWidget",
"(",
"brokenLinkBean",
")",
";",
"CmsTreeItem",
"item",
"=",
"new",
"CmsTreeItem",
"(",
"false",
",",
"i... | Helper method for creating a tree item from a bean.<p>
@param brokenLinkBean the bean containing the data for the tree item
@return a tree item | [
"Helper",
"method",
"for",
"creating",
"a",
"tree",
"item",
"from",
"a",
"bean",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsLinkWarningPanel.java#L137-L151 |
belaban/JGroups | src/org/jgroups/blocks/MessageDispatcher.java | MessageDispatcher.installUpHandler | protected <X extends MessageDispatcher> X installUpHandler(UpHandler handler, boolean canReplace) {
"""
Sets the given UpHandler as the UpHandler for the channel. If the relevant handler is already installed,
the {@code canReplace} controls whether this method replaces it (after logging a WARN) or simply
leaves ... | java | protected <X extends MessageDispatcher> X installUpHandler(UpHandler handler, boolean canReplace) {
UpHandler existing = channel.getUpHandler();
if (existing == null)
channel.setUpHandler(handler);
else if(canReplace) {
log.warn("Channel already has an up handler installe... | [
"protected",
"<",
"X",
"extends",
"MessageDispatcher",
">",
"X",
"installUpHandler",
"(",
"UpHandler",
"handler",
",",
"boolean",
"canReplace",
")",
"{",
"UpHandler",
"existing",
"=",
"channel",
".",
"getUpHandler",
"(",
")",
";",
"if",
"(",
"existing",
"==",
... | Sets the given UpHandler as the UpHandler for the channel. If the relevant handler is already installed,
the {@code canReplace} controls whether this method replaces it (after logging a WARN) or simply
leaves {@code handler} uninstalled.<p>
Passing {@code false} as the {@code canReplace} value allows callers to use thi... | [
"Sets",
"the",
"given",
"UpHandler",
"as",
"the",
"UpHandler",
"for",
"the",
"channel",
".",
"If",
"the",
"relevant",
"handler",
"is",
"already",
"installed",
"the",
"{",
"@code",
"canReplace",
"}",
"controls",
"whether",
"this",
"method",
"replaces",
"it",
... | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/blocks/MessageDispatcher.java#L212-L221 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_virtualMac_POST | public OvhTask serviceName_virtualMac_POST(String serviceName, String ipAddress, OvhVmacTypeEnum type, String virtualMachineName) throws IOException {
"""
Add a virtual mac to an IP address
REST: POST /dedicated/server/{serviceName}/virtualMac
@param type [required] vmac address type
@param virtualMachineName... | java | public OvhTask serviceName_virtualMac_POST(String serviceName, String ipAddress, OvhVmacTypeEnum type, String virtualMachineName) throws IOException {
String qPath = "/dedicated/server/{serviceName}/virtualMac";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();... | [
"public",
"OvhTask",
"serviceName_virtualMac_POST",
"(",
"String",
"serviceName",
",",
"String",
"ipAddress",
",",
"OvhVmacTypeEnum",
"type",
",",
"String",
"virtualMachineName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}... | Add a virtual mac to an IP address
REST: POST /dedicated/server/{serviceName}/virtualMac
@param type [required] vmac address type
@param virtualMachineName [required] Friendly name of your Virtual Machine behind this IP/MAC
@param ipAddress [required] Ip address to link with this virtualMac
@param serviceName [require... | [
"Add",
"a",
"virtual",
"mac",
"to",
"an",
"IP",
"address"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L541-L550 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/process/ProcessEngineDriver.java | ProcessEngineDriver.invokeService | public String invokeService(Long processId, String ownerType,
Long ownerId, String masterRequestId, String masterRequest,
Map<String,String> parameters, String responseVarName, Map<String,String> headers) throws Exception {
"""
Invoke a real-time service process.
@return the service respon... | java | public String invokeService(Long processId, String ownerType,
Long ownerId, String masterRequestId, String masterRequest,
Map<String,String> parameters, String responseVarName, Map<String,String> headers) throws Exception {
return invokeService(processId, ownerType, ownerId, masterReques... | [
"public",
"String",
"invokeService",
"(",
"Long",
"processId",
",",
"String",
"ownerType",
",",
"Long",
"ownerId",
",",
"String",
"masterRequestId",
",",
"String",
"masterRequest",
",",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"String",
"re... | Invoke a real-time service process.
@return the service response | [
"Invoke",
"a",
"real",
"-",
"time",
"service",
"process",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/process/ProcessEngineDriver.java#L695-L699 |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java | AbstractMoskitoAspect.createMethodLevelAccumulators | private void createMethodLevelAccumulators(final OnDemandStatsProducer<S> producer, final Method method) {
"""
Create method level accumulators.
@param producer
{@link OnDemandStatsProducer}
@param method
annotated method
"""
//several @Accumulators in accumulators holder
final Accumulates accAnnotat... | java | private void createMethodLevelAccumulators(final OnDemandStatsProducer<S> producer, final Method method) {
//several @Accumulators in accumulators holder
final Accumulates accAnnotationHolderMethods = AnnotationUtils.findAnnotation(method, Accumulates.class);
if (accAnnotationHolderMethods != null)
createAccum... | [
"private",
"void",
"createMethodLevelAccumulators",
"(",
"final",
"OnDemandStatsProducer",
"<",
"S",
">",
"producer",
",",
"final",
"Method",
"method",
")",
"{",
"//several @Accumulators in accumulators holder",
"final",
"Accumulates",
"accAnnotationHolderMethods",
"=",
"An... | Create method level accumulators.
@param producer
{@link OnDemandStatsProducer}
@param method
annotated method | [
"Create",
"method",
"level",
"accumulators",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java#L213-L222 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/layout/DragPane.java | DragPane.removeActor | @Override
public boolean removeActor (final Actor actor, final boolean unfocus) {
"""
Removes an actor from this group. If the actor will not be used again and has actions, they should be
{@link Actor#clearActions() cleared} so the actions will be returned to their
{@link Action#setPool(com.badlogic.gdx.utils.P... | java | @Override
public boolean removeActor (final Actor actor, final boolean unfocus) {
if (getActor().getChildren().contains(actor, true)) {
// Stage input focus causes problems, as touchUp is called in Draggable. Reproducing input unfocus after stage removed.
Stage stage = actor.getStage();
getActor().removeAct... | [
"@",
"Override",
"public",
"boolean",
"removeActor",
"(",
"final",
"Actor",
"actor",
",",
"final",
"boolean",
"unfocus",
")",
"{",
"if",
"(",
"getActor",
"(",
")",
".",
"getChildren",
"(",
")",
".",
"contains",
"(",
"actor",
",",
"true",
")",
")",
"{",... | Removes an actor from this group. If the actor will not be used again and has actions, they should be
{@link Actor#clearActions() cleared} so the actions will be returned to their
{@link Action#setPool(com.badlogic.gdx.utils.Pool) pool}, if any. This is not done automatically.
<p>
Note that the direct parent of {@link ... | [
"Removes",
"an",
"actor",
"from",
"this",
"group",
".",
"If",
"the",
"actor",
"will",
"not",
"be",
"used",
"again",
"and",
"has",
"actions",
"they",
"should",
"be",
"{"
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/layout/DragPane.java#L290-L302 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/Util.java | Util.cardinalityInBitmapWordRange | @Deprecated
public static int cardinalityInBitmapWordRange(long[] bitmap, int start, int end) {
"""
Hamming weight of the 64-bit words involved in the range
start, start+1,..., end-1, that is, it will compute the
cardinality of the bitset from index (floor(start/64) to floor((end-1)/64))
inclusively.
@para... | java | @Deprecated
public static int cardinalityInBitmapWordRange(long[] bitmap, int start, int end) {
if (start >= end) {
return 0;
}
int firstword = start / 64;
int endword = (end - 1) / 64;
int answer = 0;
for (int i = firstword; i <= endword; i++) {
answer += Long.bitCount(bitmap[i]);... | [
"@",
"Deprecated",
"public",
"static",
"int",
"cardinalityInBitmapWordRange",
"(",
"long",
"[",
"]",
"bitmap",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"start",
">=",
"end",
")",
"{",
"return",
"0",
";",
"}",
"int",
"firstword",
"="... | Hamming weight of the 64-bit words involved in the range
start, start+1,..., end-1, that is, it will compute the
cardinality of the bitset from index (floor(start/64) to floor((end-1)/64))
inclusively.
@param bitmap array of words representing a bitset
@param start first index (inclusive)
@param end last index (exclu... | [
"Hamming",
"weight",
"of",
"the",
"64",
"-",
"bit",
"words",
"involved",
"in",
"the",
"range",
"start",
"start",
"+",
"1",
"...",
"end",
"-",
"1",
"that",
"is",
"it",
"will",
"compute",
"the",
"cardinality",
"of",
"the",
"bitset",
"from",
"index",
"(",... | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/Util.java#L313-L325 |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandler.java | DefaultErrorWebExceptionHandler.getHttpStatus | protected HttpStatus getHttpStatus(Map<String, Object> errorAttributes) {
"""
Get the HTTP error status information from the error map.
@param errorAttributes the current error information
@return the error HTTP status
"""
int statusCode = (int) errorAttributes.get("status");
return HttpStatus.valueOf(st... | java | protected HttpStatus getHttpStatus(Map<String, Object> errorAttributes) {
int statusCode = (int) errorAttributes.get("status");
return HttpStatus.valueOf(statusCode);
} | [
"protected",
"HttpStatus",
"getHttpStatus",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"errorAttributes",
")",
"{",
"int",
"statusCode",
"=",
"(",
"int",
")",
"errorAttributes",
".",
"get",
"(",
"\"status\"",
")",
";",
"return",
"HttpStatus",
".",
"value... | Get the HTTP error status information from the error map.
@param errorAttributes the current error information
@return the error HTTP status | [
"Get",
"the",
"HTTP",
"error",
"status",
"information",
"from",
"the",
"error",
"map",
"."
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandler.java#L165-L168 |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/util/Slice.java | Slice.setBytes | public int setBytes(int index, ScatteringByteChannel in, int length)
throws IOException {
"""
Transfers the content of the specified source channel to this buffer
starting at the specified absolute {@code index}.
@param length the maximum number of bytes to transfer
@return the actual number of by... | java | public int setBytes(int index, ScatteringByteChannel in, int length)
throws IOException
{
checkPositionIndexes(index, index + length, this.length);
index += offset;
ByteBuffer buf = ByteBuffer.wrap(data, index, length);
int readBytes = 0;
do {
int loc... | [
"public",
"int",
"setBytes",
"(",
"int",
"index",
",",
"ScatteringByteChannel",
"in",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"checkPositionIndexes",
"(",
"index",
",",
"index",
"+",
"length",
",",
"this",
".",
"length",
")",
";",
"index",
... | Transfers the content of the specified source channel to this buffer
starting at the specified absolute {@code index}.
@param length the maximum number of bytes to transfer
@return the actual number of bytes read in from the specified channel.
{@code -1} if the specified channel is closed.
@throws IndexOutOfBoundsExce... | [
"Transfers",
"the",
"content",
"of",
"the",
"specified",
"source",
"channel",
"to",
"this",
"buffer",
"starting",
"at",
"the",
"specified",
"absolute",
"{",
"@code",
"index",
"}",
"."
] | train | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/Slice.java#L452-L483 |
Jacksgong/JKeyboardPanelSwitch | library/src/main/java/cn/dreamtobe/kpswitch/util/KPSwitchConflictUtil.java | KPSwitchConflictUtil.showKeyboard | public static void showKeyboard(final View panelLayout, final View focusView) {
"""
To show the keyboard(hide the panel automatically if the panel is showing) with
non-layout-conflict.
@param panelLayout the layout of panel.
@param focusView the view will be focused.
"""
final Activity activity ... | java | public static void showKeyboard(final View panelLayout, final View focusView) {
final Activity activity = (Activity) panelLayout.getContext();
KeyboardUtil.showKeyboard(focusView);
if (isHandleByPlaceholder(activity)) {
panelLayout.setVisibility(View.INVISIBLE);
} else if (m... | [
"public",
"static",
"void",
"showKeyboard",
"(",
"final",
"View",
"panelLayout",
",",
"final",
"View",
"focusView",
")",
"{",
"final",
"Activity",
"activity",
"=",
"(",
"Activity",
")",
"panelLayout",
".",
"getContext",
"(",
")",
";",
"KeyboardUtil",
".",
"s... | To show the keyboard(hide the panel automatically if the panel is showing) with
non-layout-conflict.
@param panelLayout the layout of panel.
@param focusView the view will be focused. | [
"To",
"show",
"the",
"keyboard",
"(",
"hide",
"the",
"panel",
"automatically",
"if",
"the",
"panel",
"is",
"showing",
")",
"with",
"non",
"-",
"layout",
"-",
"conflict",
"."
] | train | https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/092128023e824c85da63540780c79088b37a0c74/library/src/main/java/cn/dreamtobe/kpswitch/util/KPSwitchConflictUtil.java#L202-L211 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereoLinePt.java | HomographyInducedStereoLinePt.process | public void process(PairLineNorm line, AssociatedPair point) {
"""
Computes the homography based on a line and point on the plane
@param line Line on the plane
@param point Point on the plane
"""
// t0 = (F*x) cross l'
GeometryMath_F64.mult(F,point.p1,Fx);
GeometryMath_F64.cross(Fx,line.getL2(),t0);
... | java | public void process(PairLineNorm line, AssociatedPair point) {
// t0 = (F*x) cross l'
GeometryMath_F64.mult(F,point.p1,Fx);
GeometryMath_F64.cross(Fx,line.getL2(),t0);
// t1 = x' cross ((f*x) cross l')
GeometryMath_F64.cross(point.p2, t0, t1);
// t0 = x' cross e'
GeometryMath_F64.cross(point.p2,e2,t0);
... | [
"public",
"void",
"process",
"(",
"PairLineNorm",
"line",
",",
"AssociatedPair",
"point",
")",
"{",
"// t0 = (F*x) cross l'",
"GeometryMath_F64",
".",
"mult",
"(",
"F",
",",
"point",
".",
"p1",
",",
"Fx",
")",
";",
"GeometryMath_F64",
".",
"cross",
"(",
"Fx"... | Computes the homography based on a line and point on the plane
@param line Line on the plane
@param point Point on the plane | [
"Computes",
"the",
"homography",
"based",
"on",
"a",
"line",
"and",
"point",
"on",
"the",
"plane"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereoLinePt.java#L93-L115 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Row.java | Row.addElement | int addElement(Object element, int column) {
"""
Adds an element to the <CODE>Row</CODE> at the position given.
@param element the element to add. (currently only Cells and Tables supported
@param column the position where to add the cell.
@return the column position the <CODE>Cell</CODE> wa... | java | int addElement(Object element, int column) {
if (element == null) throw new NullPointerException("addCell - null argument");
if ((column < 0) || (column > columns)) throw new IndexOutOfBoundsException("addCell - illegal column argument");
if ( !((getObjectID(element) == CELL) || (getObjectID(ele... | [
"int",
"addElement",
"(",
"Object",
"element",
",",
"int",
"column",
")",
"{",
"if",
"(",
"element",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"addCell - null argument\"",
")",
";",
"if",
"(",
"(",
"column",
"<",
"0",
")",
"||",
"... | Adds an element to the <CODE>Row</CODE> at the position given.
@param element the element to add. (currently only Cells and Tables supported
@param column the position where to add the cell.
@return the column position the <CODE>Cell</CODE> was added,
or <CODE>-1</CODE> if the <CODE>Cell</CODE> could... | [
"Adds",
"an",
"element",
"to",
"the",
"<CODE",
">",
"Row<",
"/",
"CODE",
">",
"at",
"the",
"position",
"given",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Row.java#L221-L236 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/charset/Charset.java | Charset.forName | public static Charset forName(String charsetName) {
"""
Returns a {@code Charset} instance for the named charset.
@param charsetName a charset name (either canonical or an alias)
@throws IllegalCharsetNameException
if the specified charset name is illegal.
@throws UnsupportedCharsetException
if the desired ... | java | public static Charset forName(String charsetName) {
// Is this charset in our cache?
Charset cs;
synchronized (CACHED_CHARSETS) {
cs = CACHED_CHARSETS.get(charsetName);
if (cs != null) {
return cs;
}
}
if (charsetName == null) ... | [
"public",
"static",
"Charset",
"forName",
"(",
"String",
"charsetName",
")",
"{",
"// Is this charset in our cache?",
"Charset",
"cs",
";",
"synchronized",
"(",
"CACHED_CHARSETS",
")",
"{",
"cs",
"=",
"CACHED_CHARSETS",
".",
"get",
"(",
"charsetName",
")",
";",
... | Returns a {@code Charset} instance for the named charset.
@param charsetName a charset name (either canonical or an alias)
@throws IllegalCharsetNameException
if the specified charset name is illegal.
@throws UnsupportedCharsetException
if the desired charset is not supported by this runtime. | [
"Returns",
"a",
"{",
"@code",
"Charset",
"}",
"instance",
"for",
"the",
"named",
"charset",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/charset/Charset.java#L253-L275 |
cbeust/jcommander | src/main/java/com/beust/jcommander/Parameterized.java | Parameterized.describeClassTree | private static Set<Class<?>> describeClassTree(Class<?> inputClass) {
"""
Given an object return the set of classes that it extends
or implements.
@param inputClass object to describe
@return set of classes that are implemented or extended by that object
"""
if(inputClass == null) {
return Colle... | java | private static Set<Class<?>> describeClassTree(Class<?> inputClass) {
if(inputClass == null) {
return Collections.emptySet();
}
// create result collector
Set<Class<?>> classes = Sets.newLinkedHashSet();
// describe tree
describeClassTree(inputClass, classes);
return classes;
} | [
"private",
"static",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"describeClassTree",
"(",
"Class",
"<",
"?",
">",
"inputClass",
")",
"{",
"if",
"(",
"inputClass",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
"}",
"//... | Given an object return the set of classes that it extends
or implements.
@param inputClass object to describe
@return set of classes that are implemented or extended by that object | [
"Given",
"an",
"object",
"return",
"the",
"set",
"of",
"classes",
"that",
"it",
"extends",
"or",
"implements",
"."
] | train | https://github.com/cbeust/jcommander/blob/85cb6f7217e15f62225185ffd97491f34b7b49bb/src/main/java/com/beust/jcommander/Parameterized.java#L78-L90 |
michael-rapp/AndroidMaterialDialog | example/src/main/java/de/mrapp/android/dialog/example/PreferenceFragment.java | PreferenceFragment.createSingleChoiceListener | private OnClickListener createSingleChoiceListener() {
"""
Creates and returns a listener, which allows to show a toast, which indicates when a single
choice list item of a dialog has been selected or unselected.
@return The listener, which has been created, as an instance of the type {@link
OnClickListener}
... | java | private OnClickListener createSingleChoiceListener() {
return new OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int position) {
String text = getString(R.string.single_choice_listener_text);
showToast(String.format(... | [
"private",
"OnClickListener",
"createSingleChoiceListener",
"(",
")",
"{",
"return",
"new",
"OnClickListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onClick",
"(",
"final",
"DialogInterface",
"dialog",
",",
"final",
"int",
"position",
")",
"{",
"Str... | Creates and returns a listener, which allows to show a toast, which indicates when a single
choice list item of a dialog has been selected or unselected.
@return The listener, which has been created, as an instance of the type {@link
OnClickListener} | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"show",
"a",
"toast",
"which",
"indicates",
"when",
"a",
"single",
"choice",
"list",
"item",
"of",
"a",
"dialog",
"has",
"been",
"selected",
"or",
"unselected",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/example/src/main/java/de/mrapp/android/dialog/example/PreferenceFragment.java#L496-L506 |
cloudiator/sword | core/src/main/java/de/uniulm/omi/cloudiator/sword/domain/TemplateOptionsBuilder.java | TemplateOptionsBuilder.addOption | public TemplateOptionsBuilder addOption(Object field, Object value) {
"""
Adds a generic option to the template
@param field key of the option
@param value value of the option
@return fluid interface
"""
additionalOptions.put(field, value);
return this;
} | java | public TemplateOptionsBuilder addOption(Object field, Object value) {
additionalOptions.put(field, value);
return this;
} | [
"public",
"TemplateOptionsBuilder",
"addOption",
"(",
"Object",
"field",
",",
"Object",
"value",
")",
"{",
"additionalOptions",
".",
"put",
"(",
"field",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a generic option to the template
@param field key of the option
@param value value of the option
@return fluid interface | [
"Adds",
"a",
"generic",
"option",
"to",
"the",
"template"
] | train | https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/core/src/main/java/de/uniulm/omi/cloudiator/sword/domain/TemplateOptionsBuilder.java#L88-L91 |
unbescape/unbescape | src/main/java/org/unbescape/java/JavaEscapeUtil.java | JavaEscapeUtil.requiresUnicodeUnescape | static boolean requiresUnicodeUnescape(final char[] text, final int offset, final int len) {
"""
/*
Determine whether we will need unicode unescape or not, so that we avoid creating a writer object
if it is not needed.
"""
if (text == null) {
return false;
}
final int ma... | java | static boolean requiresUnicodeUnescape(final char[] text, final int offset, final int len) {
if (text == null) {
return false;
}
final int max = (offset + len);
for (int i = offset; i < max; i++) {
final char c = text[i];
if (c != ESCAPE_PREFIX ||... | [
"static",
"boolean",
"requiresUnicodeUnescape",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"final",
"int",
"max",
... | /*
Determine whether we will need unicode unescape or not, so that we avoid creating a writer object
if it is not needed. | [
"/",
"*",
"Determine",
"whether",
"we",
"will",
"need",
"unicode",
"unescape",
"or",
"not",
"so",
"that",
"we",
"avoid",
"creating",
"a",
"writer",
"object",
"if",
"it",
"is",
"not",
"needed",
"."
] | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/java/JavaEscapeUtil.java#L863-L894 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/launchable/LaunchableConfig.java | LaunchableConfig.imports | public static LaunchableConfig imports(Xml node) {
"""
Import the launchable data from node.
@param node The node reference (must not be <code>null</code>).
@return The launchable data.
@throws LionEngineException If unable to read node.
"""
Check.notNull(node);
final String media = no... | java | public static LaunchableConfig imports(Xml node)
{
Check.notNull(node);
final String media = node.readString(ATT_MEDIA);
final int delay = node.readInteger(ATT_DELAY);
final int ox = node.readInteger(0, ATT_OFFSET_X);
final int oy = node.readInteger(0, ATT_OFFSET_Y);
... | [
"public",
"static",
"LaunchableConfig",
"imports",
"(",
"Xml",
"node",
")",
"{",
"Check",
".",
"notNull",
"(",
"node",
")",
";",
"final",
"String",
"media",
"=",
"node",
".",
"readString",
"(",
"ATT_MEDIA",
")",
";",
"final",
"int",
"delay",
"=",
"node",... | Import the launchable data from node.
@param node The node reference (must not be <code>null</code>).
@return The launchable data.
@throws LionEngineException If unable to read node. | [
"Import",
"the",
"launchable",
"data",
"from",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/launchable/LaunchableConfig.java#L55-L65 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java | RestClientUtil.updateDocument | public String updateDocument(String index, Object params, UpdateOptions updateOptions) throws ElasticSearchException {
"""
根据路径更新文档
For Elasticsearch 7 and 7+
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html
@param index test/_doc/1
test/_doc/1/_update
@param params
@param up... | java | public String updateDocument(String index, Object params, UpdateOptions updateOptions) throws ElasticSearchException{
return updateDocument( index, (String) null,params, updateOptions);
} | [
"public",
"String",
"updateDocument",
"(",
"String",
"index",
",",
"Object",
"params",
",",
"UpdateOptions",
"updateOptions",
")",
"throws",
"ElasticSearchException",
"{",
"return",
"updateDocument",
"(",
"index",
",",
"(",
"String",
")",
"null",
",",
"params",
... | 根据路径更新文档
For Elasticsearch 7 and 7+
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html
@param index test/_doc/1
test/_doc/1/_update
@param params
@param updateOptions 指定更新的相关参数
refresh=wait_for
refresh=false
refresh=true
refresh
Empty string or true
Refresh the relevant primary and replic... | [
"根据路径更新文档",
"For",
"Elasticsearch",
"7",
"and",
"7",
"+",
"https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"docs",
"-",
"update",
".",
"html",
"@param",
"index",... | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java#L5217-L5220 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/SoundStore.java | SoundStore.getOgg | public Audio getOgg(String ref) throws IOException {
"""
Get the Sound based on a specified OGG file
@param ref The reference to the OGG file in the classpath
@return The Sound read from the OGG file
@throws IOException Indicates a failure to load the OGG
"""
return getOgg(ref, ResourceLoader.getResour... | java | public Audio getOgg(String ref) throws IOException {
return getOgg(ref, ResourceLoader.getResourceAsStream(ref));
} | [
"public",
"Audio",
"getOgg",
"(",
"String",
"ref",
")",
"throws",
"IOException",
"{",
"return",
"getOgg",
"(",
"ref",
",",
"ResourceLoader",
".",
"getResourceAsStream",
"(",
"ref",
")",
")",
";",
"}"
] | Get the Sound based on a specified OGG file
@param ref The reference to the OGG file in the classpath
@return The Sound read from the OGG file
@throws IOException Indicates a failure to load the OGG | [
"Get",
"the",
"Sound",
"based",
"on",
"a",
"specified",
"OGG",
"file"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/SoundStore.java#L792-L794 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java | ZipUtil.unzip | @SuppressWarnings("unchecked")
public static File unzip(File zipFile, File outFile, Charset charset) throws UtilException {
"""
解压
@param zipFile zip文件
@param outFile 解压到的目录
@param charset 编码
@return 解压的目录
@throws UtilException IO异常
@since 3.2.2
"""
charset = (null == charset) ? DEFAULT_CHARSET : ... | java | @SuppressWarnings("unchecked")
public static File unzip(File zipFile, File outFile, Charset charset) throws UtilException {
charset = (null == charset) ? DEFAULT_CHARSET : charset;
ZipFile zipFileObj = null;
try {
zipFileObj = new ZipFile(zipFile, charset);
final Enumeration<ZipEntry> em = (Enumera... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"File",
"unzip",
"(",
"File",
"zipFile",
",",
"File",
"outFile",
",",
"Charset",
"charset",
")",
"throws",
"UtilException",
"{",
"charset",
"=",
"(",
"null",
"==",
"charset",
")",
"?",
... | 解压
@param zipFile zip文件
@param outFile 解压到的目录
@param charset 编码
@return 解压的目录
@throws UtilException IO异常
@since 3.2.2 | [
"解压"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L384-L411 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java | AmazonS3Client.populateRequestWithMfaDetails | private void populateRequestWithMfaDetails(Request<?> request, MultiFactorAuthentication mfa) {
"""
<p>
Populates the specified request with the specified Multi-Factor
Authentication (MFA) details. This includes the MFA header with device serial
number and generated token. Since all requests which include the M... | java | private void populateRequestWithMfaDetails(Request<?> request, MultiFactorAuthentication mfa) {
if (mfa == null) return;
String endpoint = request.getEndpoint().toString();
if (endpoint.startsWith("http://")) {
String httpsEndpoint = endpoint.replace("http://", "https://");
... | [
"private",
"void",
"populateRequestWithMfaDetails",
"(",
"Request",
"<",
"?",
">",
"request",
",",
"MultiFactorAuthentication",
"mfa",
")",
"{",
"if",
"(",
"mfa",
"==",
"null",
")",
"return",
";",
"String",
"endpoint",
"=",
"request",
".",
"getEndpoint",
"(",
... | <p>
Populates the specified request with the specified Multi-Factor
Authentication (MFA) details. This includes the MFA header with device serial
number and generated token. Since all requests which include the MFA
header must be sent over HTTPS, this operation also configures the request object to
use HTTPS instead of... | [
"<p",
">",
"Populates",
"the",
"specified",
"request",
"with",
"the",
"specified",
"Multi",
"-",
"Factor",
"Authentication",
"(",
"MFA",
")",
"details",
".",
"This",
"includes",
"the",
"MFA",
"header",
"with",
"device",
"serial",
"number",
"and",
"generated",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4217-L4230 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/PropertiesUtils.java | PropertiesUtils.getDouble | public static double getDouble(Properties props, String key, double defaultValue) {
"""
Load a double property. If the key is not present, returns defaultValue.
"""
String value = props.getProperty(key);
if (value != null) {
return Double.parseDouble(value);
} else {
return defaul... | java | public static double getDouble(Properties props, String key, double defaultValue) {
String value = props.getProperty(key);
if (value != null) {
return Double.parseDouble(value);
} else {
return defaultValue;
}
} | [
"public",
"static",
"double",
"getDouble",
"(",
"Properties",
"props",
",",
"String",
"key",
",",
"double",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"props",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
... | Load a double property. If the key is not present, returns defaultValue. | [
"Load",
"a",
"double",
"property",
".",
"If",
"the",
"key",
"is",
"not",
"present",
"returns",
"defaultValue",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/PropertiesUtils.java#L148-L155 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java | DefaultFeatureForm.getValue | @Api
public void getValue(String name, LongAttribute attribute) {
"""
Get a long value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1
"""
attribute.setValue(toLong(formWidget.getValue(name)));
} | java | @Api
public void getValue(String name, LongAttribute attribute) {
attribute.setValue(toLong(formWidget.getValue(name)));
} | [
"@",
"Api",
"public",
"void",
"getValue",
"(",
"String",
"name",
",",
"LongAttribute",
"attribute",
")",
"{",
"attribute",
".",
"setValue",
"(",
"toLong",
"(",
"formWidget",
".",
"getValue",
"(",
"name",
")",
")",
")",
";",
"}"
] | Get a long value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1 | [
"Get",
"a",
"long",
"value",
"from",
"the",
"form",
"and",
"place",
"it",
"in",
"<code",
">",
"attribute<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java#L683-L686 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationChangeListener.java | DestinationChangeListener.getDestinationLocalitySet | private Set getDestinationLocalitySet (BaseDestinationHandler destinationHandler, Capability capability) {
"""
Retrieve the Locality Set defined in Admin.
@param destinationHandler
@param capability
@return
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "get... | java | private Set getDestinationLocalitySet (BaseDestinationHandler destinationHandler, Capability capability)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getDestinationLocalitySet",
new Object[]{destinationHandler, capability});
// Check if the localisat... | [
"private",
"Set",
"getDestinationLocalitySet",
"(",
"BaseDestinationHandler",
"destinationHandler",
",",
"Capability",
"capability",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr... | Retrieve the Locality Set defined in Admin.
@param destinationHandler
@param capability
@return | [
"Retrieve",
"the",
"Locality",
"Set",
"defined",
"in",
"Admin",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationChangeListener.java#L302-L330 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.setIcon | public static boolean setIcon(MarkerOptions markerOptions, IconRow icon, float density) {
"""
Set the icon into the marker options
@param markerOptions marker options
@param icon icon row
@param density display density: {@link android.util.DisplayMetrics#density}
@return true if icon was set i... | java | public static boolean setIcon(MarkerOptions markerOptions, IconRow icon, float density) {
return setIcon(markerOptions, icon, density, null);
} | [
"public",
"static",
"boolean",
"setIcon",
"(",
"MarkerOptions",
"markerOptions",
",",
"IconRow",
"icon",
",",
"float",
"density",
")",
"{",
"return",
"setIcon",
"(",
"markerOptions",
",",
"icon",
",",
"density",
",",
"null",
")",
";",
"}"
] | Set the icon into the marker options
@param markerOptions marker options
@param icon icon row
@param density display density: {@link android.util.DisplayMetrics#density}
@return true if icon was set into the marker options | [
"Set",
"the",
"icon",
"into",
"the",
"marker",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L251-L253 |
stripe/stripe-android | stripe/src/main/java/com/stripe/android/PaymentSession.java | PaymentSession.handlePaymentData | public boolean handlePaymentData(int requestCode, int resultCode, @NonNull Intent data) {
"""
Method to handle Activity results from Stripe activities. Pass data here from your
host Activity's {@link Activity#onActivityResult(int, int, Intent)} function.
@param requestCode the request code used to open the res... | java | public boolean handlePaymentData(int requestCode, int resultCode, @NonNull Intent data) {
if (resultCode == Activity.RESULT_CANCELED) {
fetchCustomer();
return false;
} else if (resultCode == Activity.RESULT_OK) {
switch (requestCode) {
case PAYMENT_ME... | [
"public",
"boolean",
"handlePaymentData",
"(",
"int",
"requestCode",
",",
"int",
"resultCode",
",",
"@",
"NonNull",
"Intent",
"data",
")",
"{",
"if",
"(",
"resultCode",
"==",
"Activity",
".",
"RESULT_CANCELED",
")",
"{",
"fetchCustomer",
"(",
")",
";",
"retu... | Method to handle Activity results from Stripe activities. Pass data here from your
host Activity's {@link Activity#onActivityResult(int, int, Intent)} function.
@param requestCode the request code used to open the resulting activity
@param resultCode a result code representing the success of the intended action
@param... | [
"Method",
"to",
"handle",
"Activity",
"results",
"from",
"Stripe",
"activities",
".",
"Pass",
"data",
"here",
"from",
"your",
"host",
"Activity",
"s",
"{",
"@link",
"Activity#onActivityResult",
"(",
"int",
"int",
"Intent",
")",
"}",
"function",
"."
] | train | https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/PaymentSession.java#L83-L109 |
kikinteractive/ice | ice/src/main/java/com/kik/config/ice/ConfigSystem.java | ConfigSystem.configModule | public static <C> Module configModule(final Class<C> configInterface, Named name) {
"""
Generates a Guice Module for use with Injector creation. The generated Guice Module binds a number of support
classes to service a dynamically generated implementation of the provided configuration interface. See
{@link Confi... | java | public static <C> Module configModule(final Class<C> configInterface, Named name)
{
checkNotNull(configInterface);
checkNotNull(name);
return ConfigBuilder.configModule(configInterface, Optional.of(name));
} | [
"public",
"static",
"<",
"C",
">",
"Module",
"configModule",
"(",
"final",
"Class",
"<",
"C",
">",
"configInterface",
",",
"Named",
"name",
")",
"{",
"checkNotNull",
"(",
"configInterface",
")",
";",
"checkNotNull",
"(",
"name",
")",
";",
"return",
"Config... | Generates a Guice Module for use with Injector creation. The generated Guice Module binds a number of support
classes to service a dynamically generated implementation of the provided configuration interface. See
{@link ConfigBuilder} for more information.
@param <C> The configuration interface type to be ... | [
"Generates",
"a",
"Guice",
"Module",
"for",
"use",
"with",
"Injector",
"creation",
".",
"The",
"generated",
"Guice",
"Module",
"binds",
"a",
"number",
"of",
"support",
"classes",
"to",
"service",
"a",
"dynamically",
"generated",
"implementation",
"of",
"the",
... | train | https://github.com/kikinteractive/ice/blob/0c58d7bf2d9f6504892d0768d6022fcfa6df7514/ice/src/main/java/com/kik/config/ice/ConfigSystem.java#L88-L93 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.getRelativeURI | public static String getRelativeURI( HttpServletRequest request, PageFlowController relativeTo ) {
"""
Get the request URI, relative to the URI of the given PageFlowController.
@param request the current HttpServletRequest.
@param relativeTo a PageFlowController to which the returned URI should be relative, or... | java | public static String getRelativeURI( HttpServletRequest request, PageFlowController relativeTo )
{
if ( relativeTo == null ) return InternalUtils.getDecodedServletPath( request );
return getRelativeURI( request, InternalUtils.getDecodedURI( request ), relativeTo );
} | [
"public",
"static",
"String",
"getRelativeURI",
"(",
"HttpServletRequest",
"request",
",",
"PageFlowController",
"relativeTo",
")",
"{",
"if",
"(",
"relativeTo",
"==",
"null",
")",
"return",
"InternalUtils",
".",
"getDecodedServletPath",
"(",
"request",
")",
";",
... | Get the request URI, relative to the URI of the given PageFlowController.
@param request the current HttpServletRequest.
@param relativeTo a PageFlowController to which the returned URI should be relative, or
<code>null</code> if the returned URI should be relative to the webapp root. | [
"Get",
"the",
"request",
"URI",
"relative",
"to",
"the",
"URI",
"of",
"the",
"given",
"PageFlowController",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L136-L140 |
googleapis/google-api-java-client | google-api-client/src/main/java/com/google/api/client/googleapis/apache/GoogleApacheHttpTransport.java | GoogleApacheHttpTransport.newTrustedTransport | public static ApacheHttpTransport newTrustedTransport() throws GeneralSecurityException,
IOException {
"""
Returns a new instance of {@link ApacheHttpTransport} that uses
{@link GoogleUtils#getCertificateTrustStore()} for the trusted certificates.
"""
// Set socket buffer sizes to 8192
SocketCon... | java | public static ApacheHttpTransport newTrustedTransport() throws GeneralSecurityException,
IOException {
// Set socket buffer sizes to 8192
SocketConfig socketConfig =
SocketConfig.custom()
.setRcvBufSize(8192)
.setSndBufSize(8192)
.build();
PoolingHttpClient... | [
"public",
"static",
"ApacheHttpTransport",
"newTrustedTransport",
"(",
")",
"throws",
"GeneralSecurityException",
",",
"IOException",
"{",
"// Set socket buffer sizes to 8192",
"SocketConfig",
"socketConfig",
"=",
"SocketConfig",
".",
"custom",
"(",
")",
".",
"setRcvBufSize... | Returns a new instance of {@link ApacheHttpTransport} that uses
{@link GoogleUtils#getCertificateTrustStore()} for the trusted certificates. | [
"Returns",
"a",
"new",
"instance",
"of",
"{"
] | train | https://github.com/googleapis/google-api-java-client/blob/88decfd14fc40cae6eb6729a45c7d56a1132e450/google-api-client/src/main/java/com/google/api/client/googleapis/apache/GoogleApacheHttpTransport.java#L47-L80 |
ogaclejapan/SmartTabLayout | utils-v4/src/main/java/com/ogaclejapan/smarttablayout/utils/v4/Bundler.java | Bundler.putStringArrayList | public Bundler putStringArrayList(String key, ArrayList<String> value) {
"""
Inserts an ArrayList<String> value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value an ArrayList<String> object, or null
@re... | java | public Bundler putStringArrayList(String key, ArrayList<String> value) {
bundle.putStringArrayList(key, value);
return this;
} | [
"public",
"Bundler",
"putStringArrayList",
"(",
"String",
"key",
",",
"ArrayList",
"<",
"String",
">",
"value",
")",
"{",
"bundle",
".",
"putStringArrayList",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts an ArrayList<String> value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value an ArrayList<String> object, or null
@return this | [
"Inserts",
"an",
"ArrayList<String",
">",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/ogaclejapan/SmartTabLayout/blob/712e81a92f1e12a3c33dcbda03d813e0162e8589/utils-v4/src/main/java/com/ogaclejapan/smarttablayout/utils/v4/Bundler.java#L238-L241 |
lightblueseas/net-extensions | src/main/java/de/alpharogroup/net/socket/SocketExtensions.java | SocketExtensions.writeObject | public static void writeObject(final InetAddress inetAddress, final int port,
final Object objectToSend) throws IOException {
"""
Writes the given Object to the given InetAddress who listen to the given port.
@param inetAddress
the inet address
@param port
The port who listen the receiver.
@param objectT... | java | public static void writeObject(final InetAddress inetAddress, final int port,
final Object objectToSend) throws IOException
{
Socket socketToClient = null;
ObjectOutputStream oos = null;
try
{
socketToClient = new Socket(inetAddress, port);
oos = new ObjectOutputStream(
new BufferedOutpu... | [
"public",
"static",
"void",
"writeObject",
"(",
"final",
"InetAddress",
"inetAddress",
",",
"final",
"int",
"port",
",",
"final",
"Object",
"objectToSend",
")",
"throws",
"IOException",
"{",
"Socket",
"socketToClient",
"=",
"null",
";",
"ObjectOutputStream",
"oos"... | Writes the given Object to the given InetAddress who listen to the given port.
@param inetAddress
the inet address
@param port
The port who listen the receiver.
@param objectToSend
The Object to send.
@throws IOException
Signals that an I/O exception has occurred. | [
"Writes",
"the",
"given",
"Object",
"to",
"the",
"given",
"InetAddress",
"who",
"listen",
"to",
"the",
"given",
"port",
"."
] | train | https://github.com/lightblueseas/net-extensions/blob/771757a93fa9ad13ce0fe061c158e5cba43344cb/src/main/java/de/alpharogroup/net/socket/SocketExtensions.java#L351-L387 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optBoolean | public static boolean optBoolean(@Nullable Bundle bundle, @Nullable String key) {
"""
Returns a optional boolean value. In other words, returns the value mapped by key if it exists and is a boolean.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns false.
@param bundle... | java | public static boolean optBoolean(@Nullable Bundle bundle, @Nullable String key) {
return optBoolean(bundle, key, false);
} | [
"public",
"static",
"boolean",
"optBoolean",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
")",
"{",
"return",
"optBoolean",
"(",
"bundle",
",",
"key",
",",
"false",
")",
";",
"}"
] | Returns a optional boolean value. In other words, returns the value mapped by key if it exists and is a boolean.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns false.
@param bundle a bundle. If the bundle is null, this method will return false.
@param key a key for the val... | [
"Returns",
"a",
"optional",
"boolean",
"value",
".",
"In",
"other",
"words",
"returns",
"the",
"value",
"mapped",
"by",
"key",
"if",
"it",
"exists",
"and",
"is",
"a",
"boolean",
".",
"The",
"bundle",
"argument",
"is",
"allowed",
"to",
"be",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L125-L127 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectRayLine | public static float intersectRayLine(Vector2fc origin, Vector2fc dir, Vector2fc point, Vector2fc normal, float epsilon) {
"""
Test whether the ray with given <code>origin</code> and direction <code>dir</code> intersects the line
containing the given <code>point</code> and having the given <code>normal</code>, and... | java | public static float intersectRayLine(Vector2fc origin, Vector2fc dir, Vector2fc point, Vector2fc normal, float epsilon) {
return intersectRayLine(origin.x(), origin.y(), dir.x(), dir.y(), point.x(), point.y(), normal.x(), normal.y(), epsilon);
} | [
"public",
"static",
"float",
"intersectRayLine",
"(",
"Vector2fc",
"origin",
",",
"Vector2fc",
"dir",
",",
"Vector2fc",
"point",
",",
"Vector2fc",
"normal",
",",
"float",
"epsilon",
")",
"{",
"return",
"intersectRayLine",
"(",
"origin",
".",
"x",
"(",
")",
"... | Test whether the ray with given <code>origin</code> and direction <code>dir</code> intersects the line
containing the given <code>point</code> and having the given <code>normal</code>, and return the
value of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the intersection point.
<p>
This m... | [
"Test",
"whether",
"the",
"ray",
"with",
"given",
"<code",
">",
"origin<",
"/",
"code",
">",
"and",
"direction",
"<code",
">",
"dir<",
"/",
"code",
">",
"intersects",
"the",
"line",
"containing",
"the",
"given",
"<code",
">",
"point<",
"/",
"code",
">",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L3950-L3952 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/PersistableImpl.java | PersistableImpl.updateMetaDataOnly | public void updateMetaDataOnly(Transaction tran, Persistable persistable) throws PersistenceException, ObjectManagerException {
"""
Only update the persistent copy of the meta data associated with this Persistable.
This variant is for a cached persistable in which the lock ID has been cached by the task.
@para... | java | public void updateMetaDataOnly(Transaction tran, Persistable persistable) throws PersistenceException, ObjectManagerException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "updateMetaDataOnly", new Object[] { "Tran=" + tran, "Persistable=" + persistable... | [
"public",
"void",
"updateMetaDataOnly",
"(",
"Transaction",
"tran",
",",
"Persistable",
"persistable",
")",
"throws",
"PersistenceException",
",",
"ObjectManagerException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isE... | Only update the persistent copy of the meta data associated with this Persistable.
This variant is for a cached persistable in which the lock ID has been cached by the task.
@param tran The ObjectManager transaction under which the update of the data is carried out.
@exception ObjectManagerException | [
"Only",
"update",
"the",
"persistent",
"copy",
"of",
"the",
"meta",
"data",
"associated",
"with",
"this",
"Persistable",
".",
"This",
"variant",
"is",
"for",
"a",
"cached",
"persistable",
"in",
"which",
"the",
"lock",
"ID",
"has",
"been",
"cached",
"by",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/PersistableImpl.java#L679-L702 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/serialization/SerializationUtils.java | SerializationUtils.decodeAndDeserializeObject | @SneakyThrows
public static <T extends Serializable> T decodeAndDeserializeObject(final byte[] object,
final CipherExecutor cipher,
final Class<T> type) {
"""
Decode a... | java | @SneakyThrows
public static <T extends Serializable> T decodeAndDeserializeObject(final byte[] object,
final CipherExecutor cipher,
final Class<T> type) {
return de... | [
"@",
"SneakyThrows",
"public",
"static",
"<",
"T",
"extends",
"Serializable",
">",
"T",
"decodeAndDeserializeObject",
"(",
"final",
"byte",
"[",
"]",
"object",
",",
"final",
"CipherExecutor",
"cipher",
",",
"final",
"Class",
"<",
"T",
">",
"type",
")",
"{",
... | Decode and deserialize object t.
@param <T> the type parameter
@param object the object
@param cipher the cipher
@param type the type
@return the t | [
"Decode",
"and",
"deserialize",
"object",
"t",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/serialization/SerializationUtils.java#L150-L155 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/util/Util.java | Util.setEquals | public static boolean setEquals(List<String> a, List<String> b) {
"""
setEquals determines whether two string sets are identical.
@param a the first set.
@param b the second set.
@return whether a equals to b.
"""
if (a == null) {
a = new ArrayList<>();
}
if (b == null)... | java | public static boolean setEquals(List<String> a, List<String> b) {
if (a == null) {
a = new ArrayList<>();
}
if (b == null) {
b = new ArrayList<>();
}
if (a.size() != b.size()) {
return false;
}
Collections.sort(a);
Coll... | [
"public",
"static",
"boolean",
"setEquals",
"(",
"List",
"<",
"String",
">",
"a",
",",
"List",
"<",
"String",
">",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"null",
")",
"{",
"a",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"}",
"if",
"(",
"b",
... | setEquals determines whether two string sets are identical.
@param a the first set.
@param b the second set.
@return whether a equals to b. | [
"setEquals",
"determines",
"whether",
"two",
"string",
"sets",
"are",
"identical",
"."
] | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/util/Util.java#L182-L202 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/durableexecutor/impl/TaskRingBuffer.java | TaskRingBuffer.replaceTaskWithResult | void replaceTaskWithResult(int sequence, Object response) {
"""
Replaces the task with its response
If the sequence does not correspond to a task then the call is ignored
@param sequence The sequence
@param response The response
"""
int index = toIndex(sequence);
// If sequence is not equa... | java | void replaceTaskWithResult(int sequence, Object response) {
int index = toIndex(sequence);
// If sequence is not equal then it is disposed externally
if (sequences[index] != sequence) {
return;
}
ringItems[index] = response;
isTask[index] = false;
call... | [
"void",
"replaceTaskWithResult",
"(",
"int",
"sequence",
",",
"Object",
"response",
")",
"{",
"int",
"index",
"=",
"toIndex",
"(",
"sequence",
")",
";",
"// If sequence is not equal then it is disposed externally",
"if",
"(",
"sequences",
"[",
"index",
"]",
"!=",
... | Replaces the task with its response
If the sequence does not correspond to a task then the call is ignored
@param sequence The sequence
@param response The response | [
"Replaces",
"the",
"task",
"with",
"its",
"response",
"If",
"the",
"sequence",
"does",
"not",
"correspond",
"to",
"a",
"task",
"then",
"the",
"call",
"is",
"ignored"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/durableexecutor/impl/TaskRingBuffer.java#L117-L126 |
Jasig/uPortal | uPortal-spring/src/main/java/org/springframework/web/portlet/HeaderHandlingDispatcherPortlet.java | HeaderHandlingDispatcherPortlet.doHeaders | @Override
protected void doHeaders(RenderRequest request, RenderResponse response) {
"""
Used by the render method to set the response properties and headers.
<p>The portlet should override this method and set its response header using this method in
order to ensure that they are set before anything is wri... | java | @Override
protected void doHeaders(RenderRequest request, RenderResponse response) {
try {
doDispatch(request, response);
} catch (IOException | PortletException ex) {
logger.error(
"Exception rendering headers for portlet "
+ g... | [
"@",
"Override",
"protected",
"void",
"doHeaders",
"(",
"RenderRequest",
"request",
",",
"RenderResponse",
"response",
")",
"{",
"try",
"{",
"doDispatch",
"(",
"request",
",",
"response",
")",
";",
"}",
"catch",
"(",
"IOException",
"|",
"PortletException",
"ex... | Used by the render method to set the response properties and headers.
<p>The portlet should override this method and set its response header using this method in
order to ensure that they are set before anything is written to the output stream.
<p>
@param request the render request
@param response the render respons... | [
"Used",
"by",
"the",
"render",
"method",
"to",
"set",
"the",
"response",
"properties",
"and",
"headers",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-spring/src/main/java/org/springframework/web/portlet/HeaderHandlingDispatcherPortlet.java#L40-L51 |
lessthanoptimal/ddogleg | src/org/ddogleg/nn/alg/searches/KdTreeSearchBestBinFirst.java | KdTreeSearchBestBinFirst.addToQueue | protected void addToQueue(double closestDistanceSq , KdTree.Node node , P target ) {
"""
Adds a node to the priority queue.
@param closestDistanceSq The closest distance that a point in the region could possibly be target
"""
if( !node.isLeaf() ) {
Helper h;
if( unused.isEmpty() ) {
h = new Hel... | java | protected void addToQueue(double closestDistanceSq , KdTree.Node node , P target ) {
if( !node.isLeaf() ) {
Helper h;
if( unused.isEmpty() ) {
h = new Helper();
} else {
h = unused.remove( unused.size()-1 );
}
h.closestPossibleSq = closestDistanceSq;
h.node = node;
queue.add(h);
} el... | [
"protected",
"void",
"addToQueue",
"(",
"double",
"closestDistanceSq",
",",
"KdTree",
".",
"Node",
"node",
",",
"P",
"target",
")",
"{",
"if",
"(",
"!",
"node",
".",
"isLeaf",
"(",
")",
")",
"{",
"Helper",
"h",
";",
"if",
"(",
"unused",
".",
"isEmpty... | Adds a node to the priority queue.
@param closestDistanceSq The closest distance that a point in the region could possibly be target | [
"Adds",
"a",
"node",
"to",
"the",
"priority",
"queue",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/nn/alg/searches/KdTreeSearchBestBinFirst.java#L171-L188 |
spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/common/DefaultOAuth2AccessToken.java | DefaultOAuth2AccessToken.setAdditionalInformation | public void setAdditionalInformation(Map<String, Object> additionalInformation) {
"""
Additional information that token granters would like to add to the token, e.g. to support new token types. If
the values in the map are primitive then remote communication is going to always work. It should also be safe to
use... | java | public void setAdditionalInformation(Map<String, Object> additionalInformation) {
this.additionalInformation = new LinkedHashMap<String, Object>(additionalInformation);
} | [
"public",
"void",
"setAdditionalInformation",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"additionalInformation",
")",
"{",
"this",
".",
"additionalInformation",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"Object",
">",
"(",
"additionalInformation",
")",... | Additional information that token granters would like to add to the token, e.g. to support new token types. If
the values in the map are primitive then remote communication is going to always work. It should also be safe to
use maps (nested if desired), or something that is explicitly serializable by Jackson.
@param a... | [
"Additional",
"information",
"that",
"token",
"granters",
"would",
"like",
"to",
"add",
"to",
"the",
"token",
"e",
".",
"g",
".",
"to",
"support",
"new",
"token",
"types",
".",
"If",
"the",
"values",
"in",
"the",
"map",
"are",
"primitive",
"then",
"remot... | train | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/common/DefaultOAuth2AccessToken.java#L235-L237 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/OverviewMap.java | OverviewMap.setDrawTargetMaxExtent | @Api
public void setDrawTargetMaxExtent(boolean drawTargetMaxExtent) {
"""
Determine whether or not a rectangle that shows the target map's maximum extent should be shown.
@param drawTargetMaxExtent
should the max extent be marked on the map?
@since 1.8.0
"""
this.drawTargetMaxExtent = drawTargetMaxExt... | java | @Api
public void setDrawTargetMaxExtent(boolean drawTargetMaxExtent) {
this.drawTargetMaxExtent = drawTargetMaxExtent;
// Immediately draw or remove the max extent rectangle:
if (drawTargetMaxExtent) {
targetMaxExtentRectangle = new GfxGeometry("targetMaxExtentRectangle");
targetMaxExtentRectangle.setStyl... | [
"@",
"Api",
"public",
"void",
"setDrawTargetMaxExtent",
"(",
"boolean",
"drawTargetMaxExtent",
")",
"{",
"this",
".",
"drawTargetMaxExtent",
"=",
"drawTargetMaxExtent",
";",
"// Immediately draw or remove the max extent rectangle:",
"if",
"(",
"drawTargetMaxExtent",
")",
"{... | Determine whether or not a rectangle that shows the target map's maximum extent should be shown.
@param drawTargetMaxExtent
should the max extent be marked on the map?
@since 1.8.0 | [
"Determine",
"whether",
"or",
"not",
"a",
"rectangle",
"that",
"shows",
"the",
"target",
"map",
"s",
"maximum",
"extent",
"should",
"be",
"shown",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/OverviewMap.java#L265-L291 |
bitcoinj/bitcoinj | wallettemplate/src/main/java/wallettemplate/utils/QRCodeImages.java | QRCodeImages.matrixFromString | private static BitMatrix matrixFromString(String uri, int width, int height) {
"""
Create a BitMatrix from a Bitcoin URI
@param uri Bitcoin URI
@return A BitMatrix for the QRCode for the URI
"""
Writer qrWriter = new QRCodeWriter();
BitMatrix matrix;
try {
matrix = qrWrite... | java | private static BitMatrix matrixFromString(String uri, int width, int height) {
Writer qrWriter = new QRCodeWriter();
BitMatrix matrix;
try {
matrix = qrWriter.encode(uri, BarcodeFormat.QR_CODE, width, height);
} catch (WriterException e) {
throw new RuntimeExcepti... | [
"private",
"static",
"BitMatrix",
"matrixFromString",
"(",
"String",
"uri",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Writer",
"qrWriter",
"=",
"new",
"QRCodeWriter",
"(",
")",
";",
"BitMatrix",
"matrix",
";",
"try",
"{",
"matrix",
"=",
"qrWrit... | Create a BitMatrix from a Bitcoin URI
@param uri Bitcoin URI
@return A BitMatrix for the QRCode for the URI | [
"Create",
"a",
"BitMatrix",
"from",
"a",
"Bitcoin",
"URI"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/wallettemplate/src/main/java/wallettemplate/utils/QRCodeImages.java#L48-L57 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiMessageImpl.java | JsApiMessageImpl.getIdentifierValue | @Override
public Object getIdentifierValue(Identifier id,
boolean ignoreType)
throws BadMessageFormatMatchingException {
"""
/*
Evaluate the message field determined by the given Identifier
See the following method for more information.
Javadoc desc... | java | @Override
public Object getIdentifierValue(Identifier id,
boolean ignoreType)
throws BadMessageFormatMatchingException {
return getIdentifierValue(id, ignoreType, null, false);
} | [
"@",
"Override",
"public",
"Object",
"getIdentifierValue",
"(",
"Identifier",
"id",
",",
"boolean",
"ignoreType",
")",
"throws",
"BadMessageFormatMatchingException",
"{",
"return",
"getIdentifierValue",
"(",
"id",
",",
"ignoreType",
",",
"null",
",",
"false",
")",
... | /*
Evaluate the message field determined by the given Identifier
See the following method for more information.
Javadoc description supplied by MatchSpaceKey interface. | [
"/",
"*",
"Evaluate",
"the",
"message",
"field",
"determined",
"by",
"the",
"given",
"Identifier",
"See",
"the",
"following",
"method",
"for",
"more",
"information",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiMessageImpl.java#L480-L485 |
indeedeng/util | urlparsing/src/main/java/com/indeed/util/urlparsing/ParseUtils.java | ParseUtils.parseUnsignedLong | public static long parseUnsignedLong(CharSequence s, final int start, final int end) throws NumberFormatException {
"""
Parses out a long value from the provided string, equivalent to Long.parseLong(s.substring(start, end)),
but has significantly less overhead, no object creation and later garbage collection requ... | java | public static long parseUnsignedLong(CharSequence s, final int start, final int end) throws NumberFormatException {
long ret = 0;
for (int i = start; i < end; i++) {
final char c = s.charAt(i);
if (c < '0' || c > '9') {
throw new NumberFormatException("Not a valid... | [
"public",
"static",
"long",
"parseUnsignedLong",
"(",
"CharSequence",
"s",
",",
"final",
"int",
"start",
",",
"final",
"int",
"end",
")",
"throws",
"NumberFormatException",
"{",
"long",
"ret",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i"... | Parses out a long value from the provided string, equivalent to Long.parseLong(s.substring(start, end)),
but has significantly less overhead, no object creation and later garbage collection required
@throws {@link NumberFormatException} if it encounters any character that is not [0-9]. | [
"Parses",
"out",
"a",
"long",
"value",
"from",
"the",
"provided",
"string",
"equivalent",
"to",
"Long",
".",
"parseLong",
"(",
"s",
".",
"substring",
"(",
"start",
"end",
"))",
"but",
"has",
"significantly",
"less",
"overhead",
"no",
"object",
"creation",
... | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/urlparsing/src/main/java/com/indeed/util/urlparsing/ParseUtils.java#L80-L91 |
hellosign/hellosign-java-sdk | src/main/java/com/hellosign/sdk/resource/TemplateDraft.java | TemplateDraft.addSignerRole | public void addSignerRole(String role, int order) throws HelloSignException {
"""
Adds the signer role with the given order to the list of signers for this
request. NOTE: The order refers to the 1-base index, not 0-base. This is
to reflect the indexing used by the HelloSign API. This means that adding
an item a... | java | public void addSignerRole(String role, int order) throws HelloSignException {
try {
signerRoles.add((order - 1), role);
} catch (Exception ex) {
throw new HelloSignException(ex);
}
} | [
"public",
"void",
"addSignerRole",
"(",
"String",
"role",
",",
"int",
"order",
")",
"throws",
"HelloSignException",
"{",
"try",
"{",
"signerRoles",
".",
"add",
"(",
"(",
"order",
"-",
"1",
")",
",",
"role",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex... | Adds the signer role with the given order to the list of signers for this
request. NOTE: The order refers to the 1-base index, not 0-base. This is
to reflect the indexing used by the HelloSign API. This means that adding
an item at order 1 will place it in the 0th index of the list (it will be
the first item).
@param ... | [
"Adds",
"the",
"signer",
"role",
"with",
"the",
"given",
"order",
"to",
"the",
"list",
"of",
"signers",
"for",
"this",
"request",
".",
"NOTE",
":",
"The",
"order",
"refers",
"to",
"the",
"1",
"-",
"base",
"index",
"not",
"0",
"-",
"base",
".",
"This"... | train | https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/resource/TemplateDraft.java#L131-L137 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/WorkspacesApi.java | WorkspacesApi.listWorkspaceFolderItems | public WorkspaceFolderContents listWorkspaceFolderItems(String accountId, String workspaceId, String folderId, WorkspacesApi.ListWorkspaceFolderItemsOptions options) throws ApiException {
"""
List Workspace Folder Contents
Retrieves workspace folder contents, which can include sub folders and files.
@param accou... | java | public WorkspaceFolderContents listWorkspaceFolderItems(String accountId, String workspaceId, String folderId, WorkspacesApi.ListWorkspaceFolderItemsOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
... | [
"public",
"WorkspaceFolderContents",
"listWorkspaceFolderItems",
"(",
"String",
"accountId",
",",
"String",
"workspaceId",
",",
"String",
"folderId",
",",
"WorkspacesApi",
".",
"ListWorkspaceFolderItemsOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"lo... | List Workspace Folder Contents
Retrieves workspace folder contents, which can include sub folders and files.
@param accountId The external account number (int) or account ID Guid. (required)
@param workspaceId Specifies the workspace ID GUID. (required)
@param folderId The ID of the folder being accessed. (required)
@p... | [
"List",
"Workspace",
"Folder",
"Contents",
"Retrieves",
"workspace",
"folder",
"contents",
"which",
"can",
"include",
"sub",
"folders",
"and",
"files",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/WorkspacesApi.java#L657-L711 |
OpenLiberty/open-liberty | dev/com.ibm.ws.org.apache.myfaces.2.3/src/com/ibm/ws/jsf/extprocessor/JSFExtensionFactory.java | JSFExtensionFactory.registerListener | private boolean registerListener(IServletContext webapp, String listenerClassName, ClassLoader classLoader) {
"""
/*
attempts to register a webapp lifecycle listener for the application. returns true if registration successful, false if not
"""
try {
ServletContextListener listener = (Serv... | java | private boolean registerListener(IServletContext webapp, String listenerClassName, ClassLoader classLoader) {
try {
ServletContextListener listener = (ServletContextListener) Class.forName(listenerClassName, true, classLoader).newInstance();
webapp.addLifecycleListener(listener);
... | [
"private",
"boolean",
"registerListener",
"(",
"IServletContext",
"webapp",
",",
"String",
"listenerClassName",
",",
"ClassLoader",
"classLoader",
")",
"{",
"try",
"{",
"ServletContextListener",
"listener",
"=",
"(",
"ServletContextListener",
")",
"Class",
".",
"forNa... | /*
attempts to register a webapp lifecycle listener for the application. returns true if registration successful, false if not | [
"/",
"*",
"attempts",
"to",
"register",
"a",
"webapp",
"lifecycle",
"listener",
"for",
"the",
"application",
".",
"returns",
"true",
"if",
"registration",
"successful",
"false",
"if",
"not"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.myfaces.2.3/src/com/ibm/ws/jsf/extprocessor/JSFExtensionFactory.java#L278-L290 |
geomajas/geomajas-project-server | plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/PdfContext.java | PdfContext.fillRectangle | public void fillRectangle(Rectangle rect, Color color) {
"""
Draw a rectangle's interior with this color.
@param rect rectangle
@param color colour
"""
template.saveState();
setFill(color);
template.rectangle(origX + rect.getLeft(), origY + rect.getBottom(), rect.getWidth(), rect.getHeight());
temp... | java | public void fillRectangle(Rectangle rect, Color color) {
template.saveState();
setFill(color);
template.rectangle(origX + rect.getLeft(), origY + rect.getBottom(), rect.getWidth(), rect.getHeight());
template.fill();
template.restoreState();
} | [
"public",
"void",
"fillRectangle",
"(",
"Rectangle",
"rect",
",",
"Color",
"color",
")",
"{",
"template",
".",
"saveState",
"(",
")",
";",
"setFill",
"(",
"color",
")",
";",
"template",
".",
"rectangle",
"(",
"origX",
"+",
"rect",
".",
"getLeft",
"(",
... | Draw a rectangle's interior with this color.
@param rect rectangle
@param color colour | [
"Draw",
"a",
"rectangle",
"s",
"interior",
"with",
"this",
"color",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/PdfContext.java#L248-L254 |
orbisgis/h2gis | postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java | JtsBinaryParser.parseGeometryArray | private void parseGeometryArray(ValueGetter data, Geometry[] container, int srid) {
"""
Parse the given {@link org.postgis.binary.ValueGetter} into an array of JTS
{@link org.locationtech.jts.geom.Geometry} with the given SRID.
@param data {@link org.postgis.binary.ValueGetter} to parse.
@param container Arra... | java | private void parseGeometryArray(ValueGetter data, Geometry[] container, int srid) {
for(int i = 0; i < container.length; ++i) {
container[i] = this.parseGeometry(data, srid, true);
}
} | [
"private",
"void",
"parseGeometryArray",
"(",
"ValueGetter",
"data",
",",
"Geometry",
"[",
"]",
"container",
",",
"int",
"srid",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"container",
".",
"length",
";",
"++",
"i",
")",
"{",
"contain... | Parse the given {@link org.postgis.binary.ValueGetter} into an array of JTS
{@link org.locationtech.jts.geom.Geometry} with the given SRID.
@param data {@link org.postgis.binary.ValueGetter} to parse.
@param container Array of {@link org.locationtech.jts.geom.Geometry} which will contains the parsed ones.
@param srid ... | [
"Parse",
"the",
"given",
"{",
"@link",
"org",
".",
"postgis",
".",
"binary",
".",
"ValueGetter",
"}",
"into",
"an",
"array",
"of",
"JTS",
"{",
"@link",
"org",
".",
"locationtech",
".",
"jts",
".",
"geom",
".",
"Geometry",
"}",
"with",
"the",
"given",
... | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java#L193-L198 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java | PathOverrideService.setGroupsForPath | public void setGroupsForPath(Integer[] groups, int pathId) {
"""
Set the groups assigned to a path
@param groups group IDs to set
@param pathId ID of path
"""
String newGroups = Arrays.toString(groups);
newGroups = newGroups.substring(1, newGroups.length() - 1).replaceAll("\\s", "");
... | java | public void setGroupsForPath(Integer[] groups, int pathId) {
String newGroups = Arrays.toString(groups);
newGroups = newGroups.substring(1, newGroups.length() - 1).replaceAll("\\s", "");
logger.info("adding groups={}, to pathId={}", newGroups, pathId);
EditService.updatePathTable(Consta... | [
"public",
"void",
"setGroupsForPath",
"(",
"Integer",
"[",
"]",
"groups",
",",
"int",
"pathId",
")",
"{",
"String",
"newGroups",
"=",
"Arrays",
".",
"toString",
"(",
"groups",
")",
";",
"newGroups",
"=",
"newGroups",
".",
"substring",
"(",
"1",
",",
"new... | Set the groups assigned to a path
@param groups group IDs to set
@param pathId ID of path | [
"Set",
"the",
"groups",
"assigned",
"to",
"a",
"path"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java#L295-L301 |
apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/modules/restli/GobblinServiceFlowConfigResourceHandler.java | GobblinServiceFlowConfigResourceHandler.deleteFlowConfig | @Override
public UpdateResponse deleteFlowConfig(FlowId flowId, Properties header)
throws FlowConfigLoggedException {
"""
Deleting {@link FlowConfig} should check if current node is active (master).
If current node is active, call {@link FlowConfigResourceLocalHandler#deleteFlowConfig(FlowId, Properties)}... | java | @Override
public UpdateResponse deleteFlowConfig(FlowId flowId, Properties header)
throws FlowConfigLoggedException {
String flowName = flowId.getFlowName();
String flowGroup = flowId.getFlowGroup();
checkHelixConnection(ServiceConfigKeys.HELIX_FLOWSPEC_REMOVE, flowName, flowGroup);
try {
... | [
"@",
"Override",
"public",
"UpdateResponse",
"deleteFlowConfig",
"(",
"FlowId",
"flowId",
",",
"Properties",
"header",
")",
"throws",
"FlowConfigLoggedException",
"{",
"String",
"flowName",
"=",
"flowId",
".",
"getFlowName",
"(",
")",
";",
"String",
"flowGroup",
"... | Deleting {@link FlowConfig} should check if current node is active (master).
If current node is active, call {@link FlowConfigResourceLocalHandler#deleteFlowConfig(FlowId, Properties)} directly.
If current node is standby, forward {@link ServiceConfigKeys#HELIX_FLOWSPEC_REMOVE} to active. The remote active will
then ca... | [
"Deleting",
"{",
"@link",
"FlowConfig",
"}",
"should",
"check",
"if",
"current",
"node",
"is",
"active",
"(",
"master",
")",
".",
"If",
"current",
"node",
"is",
"active",
"call",
"{",
"@link",
"FlowConfigResourceLocalHandler#deleteFlowConfig",
"(",
"FlowId",
"Pr... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/restli/GobblinServiceFlowConfigResourceHandler.java#L183-L209 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/TarHeader.java | TarHeader.parseName | public static StringBuffer parseName(byte[] header, int offset, int length) throws InvalidHeaderException {
"""
Parse an entry name from a header buffer.
@param header
The header buffer from which to parse.
@param offset
The offset into the buffer from which to parse.
@param length
The number of header byt... | java | public static StringBuffer parseName(byte[] header, int offset, int length) throws InvalidHeaderException {
StringBuffer result = new StringBuffer(length);
int end = offset + length;
for (int i = offset; i < end; ++i) {
if (header[i] == 0) {
break;
... | [
"public",
"static",
"StringBuffer",
"parseName",
"(",
"byte",
"[",
"]",
"header",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"InvalidHeaderException",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"length",
")",
";",
"int",
... | Parse an entry name from a header buffer.
@param header
The header buffer from which to parse.
@param offset
The offset into the buffer from which to parse.
@param length
The number of header bytes to parse.
@return The header's entry name. | [
"Parse",
"an",
"entry",
"name",
"from",
"a",
"header",
"buffer",
"."
] | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/TarHeader.java#L331-L343 |
reinert/requestor | requestor/core/requestor-api/src/main/java/io/reinert/requestor/SerdesManagerImpl.java | SerdesManagerImpl.getDeserializer | @SuppressWarnings("unchecked")
public <T> Deserializer<T> getDeserializer(Class<T> type, String mediaType) throws SerializationException {
"""
Retrieve Deserializer from manager.
@param type The type class of the deserializer.
@param <T> The type of the deserializer.
@return The deserializer of the specif... | java | @SuppressWarnings("unchecked")
public <T> Deserializer<T> getDeserializer(Class<T> type, String mediaType) throws SerializationException {
checkNotNull(type, "Type (Class<T>) cannot be null.");
checkNotNull(mediaType, "Media-Type cannot be null.");
final String typeName = getClassName(type)... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"Deserializer",
"<",
"T",
">",
"getDeserializer",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"mediaType",
")",
"throws",
"SerializationException",
"{",
"checkNotNull",
"(",
... | Retrieve Deserializer from manager.
@param type The type class of the deserializer.
@param <T> The type of the deserializer.
@return The deserializer of the specified type.
@throws SerializationException if no deserializer was registered for the class. | [
"Retrieve",
"Deserializer",
"from",
"manager",
"."
] | train | https://github.com/reinert/requestor/blob/40163a75cd17815d5089935d0dd97b8d652ad6d4/requestor/core/requestor-api/src/main/java/io/reinert/requestor/SerdesManagerImpl.java#L151-L179 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuParamSetv | @Deprecated
public static int cuParamSetv(CUfunction hfunc, int offset, Pointer ptr, int numbytes) {
"""
Adds arbitrary data to the function's argument list.
<pre>
CUresult cuParamSetv (
CUfunction hfunc,
int offset,
void* ptr,
unsigned int numbytes )
</pre>
<div>
<p>Adds arbitrary data to the fu... | java | @Deprecated
public static int cuParamSetv(CUfunction hfunc, int offset, Pointer ptr, int numbytes)
{
return checkResult(cuParamSetvNative(hfunc, offset, ptr, numbytes));
} | [
"@",
"Deprecated",
"public",
"static",
"int",
"cuParamSetv",
"(",
"CUfunction",
"hfunc",
",",
"int",
"offset",
",",
"Pointer",
"ptr",
",",
"int",
"numbytes",
")",
"{",
"return",
"checkResult",
"(",
"cuParamSetvNative",
"(",
"hfunc",
",",
"offset",
",",
"ptr"... | Adds arbitrary data to the function's argument list.
<pre>
CUresult cuParamSetv (
CUfunction hfunc,
int offset,
void* ptr,
unsigned int numbytes )
</pre>
<div>
<p>Adds arbitrary data to the function's
argument list.
Deprecated Copies an arbitrary amount of
data (specified in <tt>numbytes</tt>) from <tt>ptr</tt> into... | [
"Adds",
"arbitrary",
"data",
"to",
"the",
"function",
"s",
"argument",
"list",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L11899-L11903 |
apereo/cas | core/cas-server-core-services-registry/src/main/java/org/apereo/cas/services/resource/DefaultRegisteredServiceResourceNamingStrategy.java | DefaultRegisteredServiceResourceNamingStrategy.build | @Override
public String build(final RegisteredService service, final String extension) {
"""
Method creates a filename to store the service.
@param service - Service to be stored.
@param extension - extension to use for the file.
@return - String representing file name.
"""
return StringUtil... | java | @Override
public String build(final RegisteredService service, final String extension) {
return StringUtils.remove(service.getName(), ' ') + '-' + service.getId() + '.' + extension;
} | [
"@",
"Override",
"public",
"String",
"build",
"(",
"final",
"RegisteredService",
"service",
",",
"final",
"String",
"extension",
")",
"{",
"return",
"StringUtils",
".",
"remove",
"(",
"service",
".",
"getName",
"(",
")",
",",
"'",
"'",
")",
"+",
"'",
"'"... | Method creates a filename to store the service.
@param service - Service to be stored.
@param extension - extension to use for the file.
@return - String representing file name. | [
"Method",
"creates",
"a",
"filename",
"to",
"store",
"the",
"service",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-services-registry/src/main/java/org/apereo/cas/services/resource/DefaultRegisteredServiceResourceNamingStrategy.java#L23-L26 |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/datatype/xsd/DurationDatatype.java | DurationDatatype.daysPlusSeconds | private static BigDecimal daysPlusSeconds(BigInteger days, BigDecimal seconds) {
"""
Returns the total number of seconds from a specified number of days and seconds.
"""
return seconds.add(new BigDecimal(days.multiply(BigInteger.valueOf(24*60*60))));
} | java | private static BigDecimal daysPlusSeconds(BigInteger days, BigDecimal seconds) {
return seconds.add(new BigDecimal(days.multiply(BigInteger.valueOf(24*60*60))));
} | [
"private",
"static",
"BigDecimal",
"daysPlusSeconds",
"(",
"BigInteger",
"days",
",",
"BigDecimal",
"seconds",
")",
"{",
"return",
"seconds",
".",
"add",
"(",
"new",
"BigDecimal",
"(",
"days",
".",
"multiply",
"(",
"BigInteger",
".",
"valueOf",
"(",
"24",
"*... | Returns the total number of seconds from a specified number of days and seconds. | [
"Returns",
"the",
"total",
"number",
"of",
"seconds",
"from",
"a",
"specified",
"number",
"of",
"days",
"and",
"seconds",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/datatype/xsd/DurationDatatype.java#L221-L223 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/MatrixFeatures_ZDRM.java | MatrixFeatures_ZDRM.isNegative | public static boolean isNegative(ZMatrixD1 a, ZMatrixD1 b, double tol) {
"""
<p>
Checks to see if the two matrices are the negative of each other:<br>
<br>
a<sub>ij</sub> = -b<sub>ij</sub>
</p>
@param a First matrix. Not modified.
@param b Second matrix. Not modified.
@param tol Numerical tolerance.
@r... | java | public static boolean isNegative(ZMatrixD1 a, ZMatrixD1 b, double tol) {
if( a.numRows != b.numRows || a.numCols != b.numCols )
throw new IllegalArgumentException("Matrix dimensions must match");
int length = a.getNumElements()*2;
for( int i = 0; i < length; i++ ) {
if(... | [
"public",
"static",
"boolean",
"isNegative",
"(",
"ZMatrixD1",
"a",
",",
"ZMatrixD1",
"b",
",",
"double",
"tol",
")",
"{",
"if",
"(",
"a",
".",
"numRows",
"!=",
"b",
".",
"numRows",
"||",
"a",
".",
"numCols",
"!=",
"b",
".",
"numCols",
")",
"throw",
... | <p>
Checks to see if the two matrices are the negative of each other:<br>
<br>
a<sub>ij</sub> = -b<sub>ij</sub>
</p>
@param a First matrix. Not modified.
@param b Second matrix. Not modified.
@param tol Numerical tolerance.
@return True if they are the negative of each other within tolerance. | [
"<p",
">",
"Checks",
"to",
"see",
"if",
"the",
"two",
"matrices",
"are",
"the",
"negative",
"of",
"each",
"other",
":",
"<br",
">",
"<br",
">",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"-",
"b<sub",
">",
"ij<",
"/",
"sub",
">",
"<",
"/",
"p",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/MatrixFeatures_ZDRM.java#L58-L70 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/ActionsConfig.java | ActionsConfig.getRefs | private static List<ActionRef> getRefs(Xml node) {
"""
Get all actions and their references.
@param node The current node to check (must not be <code>null</code>).
@return The actions found.
"""
final Collection<Xml> children = node.getChildren(NODE_ACTION);
final List<ActionRef> actions ... | java | private static List<ActionRef> getRefs(Xml node)
{
final Collection<Xml> children = node.getChildren(NODE_ACTION);
final List<ActionRef> actions = new ArrayList<>(children.size());
for (final Xml action : children)
{
final String path = action.readString(ATT_PATH)... | [
"private",
"static",
"List",
"<",
"ActionRef",
">",
"getRefs",
"(",
"Xml",
"node",
")",
"{",
"final",
"Collection",
"<",
"Xml",
">",
"children",
"=",
"node",
".",
"getChildren",
"(",
"NODE_ACTION",
")",
";",
"final",
"List",
"<",
"ActionRef",
">",
"actio... | Get all actions and their references.
@param node The current node to check (must not be <code>null</code>).
@return The actions found. | [
"Get",
"all",
"actions",
"and",
"their",
"references",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/ActionsConfig.java#L117-L130 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.addLatLngsToMap | public static MultiMarker addLatLngsToMap(GoogleMap map, MultiLatLng latLngs) {
"""
Add a list of LatLngs to the map
@param map google map
@param latLngs lat lngs
@return multi marker
"""
MultiMarker multiMarker = new MultiMarker();
for (LatLng latLng : latLngs.getLatLngs()) {
... | java | public static MultiMarker addLatLngsToMap(GoogleMap map, MultiLatLng latLngs) {
MultiMarker multiMarker = new MultiMarker();
for (LatLng latLng : latLngs.getLatLngs()) {
MarkerOptions markerOptions = new MarkerOptions();
if (latLngs.getMarkerOptions() != null) {
m... | [
"public",
"static",
"MultiMarker",
"addLatLngsToMap",
"(",
"GoogleMap",
"map",
",",
"MultiLatLng",
"latLngs",
")",
"{",
"MultiMarker",
"multiMarker",
"=",
"new",
"MultiMarker",
"(",
")",
";",
"for",
"(",
"LatLng",
"latLng",
":",
"latLngs",
".",
"getLatLngs",
"... | Add a list of LatLngs to the map
@param map google map
@param latLngs lat lngs
@return multi marker | [
"Add",
"a",
"list",
"of",
"LatLngs",
"to",
"the",
"map"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1593-L1610 |
rampatra/jbot | jbot/src/main/java/me/ramswaroop/jbot/core/slack/SlackService.java | SlackService.getImChannels | private void getImChannels(String slackToken, int limit, String nextCursor) {
"""
Fetch all im channels to determine direct message to the bot.
@param slackToken slack token which you get from slack for the integration you create
@param limit number of channels to fetch in one call
@param nextCursor cursor fo... | java | private void getImChannels(String slackToken, int limit, String nextCursor) {
try {
Event event = restTemplate.getForEntity(slackApiEndpoints.getImListApi(), Event.class,
slackToken, limit, nextCursor).getBody();
imChannelIds.addAll(Arrays.stream(event.getIms()).map(C... | [
"private",
"void",
"getImChannels",
"(",
"String",
"slackToken",
",",
"int",
"limit",
",",
"String",
"nextCursor",
")",
"{",
"try",
"{",
"Event",
"event",
"=",
"restTemplate",
".",
"getForEntity",
"(",
"slackApiEndpoints",
".",
"getImListApi",
"(",
")",
",",
... | Fetch all im channels to determine direct message to the bot.
@param slackToken slack token which you get from slack for the integration you create
@param limit number of channels to fetch in one call
@param nextCursor cursor for the next call | [
"Fetch",
"all",
"im",
"channels",
"to",
"determine",
"direct",
"message",
"to",
"the",
"bot",
"."
] | train | https://github.com/rampatra/jbot/blob/0f42e1a6ec4dcbc5d1257e1307704903e771f7b5/jbot/src/main/java/me/ramswaroop/jbot/core/slack/SlackService.java#L62-L75 |
apache/incubator-gobblin | gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/utils/PartitionUtils.java | PartitionUtils.getPartitionSpecString | public static String getPartitionSpecString(Map<String, String> spec) {
"""
This method returns the partition spec string of the partition.
Example : datepartition='2016-01-01-00', size='12345'
"""
StringBuilder sb = new StringBuilder();
for (Map.Entry<String, String> entry : spec.entrySet()) {
... | java | public static String getPartitionSpecString(Map<String, String> spec) {
StringBuilder sb = new StringBuilder();
for (Map.Entry<String, String> entry : spec.entrySet()) {
if (!sb.toString().isEmpty()) {
sb.append(",");
}
sb.append(entry.getKey());
sb.append("=");
sb.append(g... | [
"public",
"static",
"String",
"getPartitionSpecString",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"spec",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">"... | This method returns the partition spec string of the partition.
Example : datepartition='2016-01-01-00', size='12345' | [
"This",
"method",
"returns",
"the",
"partition",
"spec",
"string",
"of",
"the",
"partition",
".",
"Example",
":",
"datepartition",
"=",
"2016",
"-",
"01",
"-",
"01",
"-",
"00",
"size",
"=",
"12345"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/utils/PartitionUtils.java#L55-L66 |
NessComputing/syslog4j | src/main/java/com/nesscomputing/syslog4j/Syslog.java | Syslog.destroyInstance | public synchronized static void destroyInstance(SyslogIF syslog) throws SyslogRuntimeException {
"""
destroyInstance() gracefully shuts down the specified Syslog instance and
removes it from Syslog4j.
@param syslog - the Syslog instance to destroy
@throws SyslogRuntimeException
"""
if (syslog == ... | java | public synchronized static void destroyInstance(SyslogIF syslog) throws SyslogRuntimeException {
if (syslog == null) {
return;
}
String protocol = syslog.getProtocol().toLowerCase();
if (instances.containsKey(protocol)) {
try {
syslog.sh... | [
"public",
"synchronized",
"static",
"void",
"destroyInstance",
"(",
"SyslogIF",
"syslog",
")",
"throws",
"SyslogRuntimeException",
"{",
"if",
"(",
"syslog",
"==",
"null",
")",
"{",
"return",
";",
"}",
"String",
"protocol",
"=",
"syslog",
".",
"getProtocol",
"(... | destroyInstance() gracefully shuts down the specified Syslog instance and
removes it from Syslog4j.
@param syslog - the Syslog instance to destroy
@throws SyslogRuntimeException | [
"destroyInstance",
"()",
"gracefully",
"shuts",
"down",
"the",
"specified",
"Syslog",
"instance",
"and",
"removes",
"it",
"from",
"Syslog4j",
"."
] | train | https://github.com/NessComputing/syslog4j/blob/698fe4ce926cfc46524329d089052507cdb8cba4/src/main/java/com/nesscomputing/syslog4j/Syslog.java#L269-L287 |
apache/reef | lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/util/batch/TokenBatchCredentialProvider.java | TokenBatchCredentialProvider.getCredentials | @Override
public BatchCredentials getCredentials() {
"""
Returns credentials for Azure Batch account.
@return an implementation of {@link BatchCredentials} which is based on the token provided by Azure Batch.
"""
final TokenCredentials tokenCredentials = new TokenCredentials(null, System.getenv(AZ_BATC... | java | @Override
public BatchCredentials getCredentials() {
final TokenCredentials tokenCredentials = new TokenCredentials(null, System.getenv(AZ_BATCH_AUTH_TOKEN_ENV));
return new BatchCredentials() {
@Override
public String baseUrl() {
return azureBatchAccountUri;
}
@Override
... | [
"@",
"Override",
"public",
"BatchCredentials",
"getCredentials",
"(",
")",
"{",
"final",
"TokenCredentials",
"tokenCredentials",
"=",
"new",
"TokenCredentials",
"(",
"null",
",",
"System",
".",
"getenv",
"(",
"AZ_BATCH_AUTH_TOKEN_ENV",
")",
")",
";",
"return",
"ne... | Returns credentials for Azure Batch account.
@return an implementation of {@link BatchCredentials} which is based on the token provided by Azure Batch. | [
"Returns",
"credentials",
"for",
"Azure",
"Batch",
"account",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/util/batch/TokenBatchCredentialProvider.java#L52-L68 |
kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.buildCall | public Call buildCall(String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
"""
Build HTTP ca... | java | public Call buildCall(String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Request reques... | [
"public",
"Call",
"buildCall",
"(",
"String",
"path",
",",
"String",
"method",
",",
"List",
"<",
"Pair",
">",
"queryParams",
",",
"List",
"<",
"Pair",
">",
"collectionQueryParams",
",",
"Object",
"body",
",",
"Map",
"<",
"String",
",",
"String",
">",
"he... | Build HTTP call with the given options.
@param path The sub-path of the HTTP URL
@param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
@param queryParams The query parameters
@param collectionQueryParams The collection query parameters
@param body The request body objec... | [
"Build",
"HTTP",
"call",
"with",
"the",
"given",
"options",
"."
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L905-L909 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Attributes.java | Attributes.asList | public List<Attribute> asList() {
"""
Get the attributes as a List, for iteration.
@return an view of the attributes as an unmodifialbe List.
"""
ArrayList<Attribute> list = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
Attribute attr = vals[i] == null ?
n... | java | public List<Attribute> asList() {
ArrayList<Attribute> list = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
Attribute attr = vals[i] == null ?
new BooleanAttribute(keys[i]) : // deprecated class, but maybe someone still wants it
new Attribute(keys[i]... | [
"public",
"List",
"<",
"Attribute",
">",
"asList",
"(",
")",
"{",
"ArrayList",
"<",
"Attribute",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
"size",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{... | Get the attributes as a List, for iteration.
@return an view of the attributes as an unmodifialbe List. | [
"Get",
"the",
"attributes",
"as",
"a",
"List",
"for",
"iteration",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Attributes.java#L276-L285 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java | ClusterJoinManager.shouldMergeTo | private boolean shouldMergeTo(Address thisAddress, Address targetAddress) {
"""
Determines whether this address should merge to target address and called when two sides are equal on all aspects.
This is a pure function that must produce always the same output when called with the same parameters.
This logic shou... | java | private boolean shouldMergeTo(Address thisAddress, Address targetAddress) {
String thisAddressStr = "[" + thisAddress.getHost() + "]:" + thisAddress.getPort();
String targetAddressStr = "[" + targetAddress.getHost() + "]:" + targetAddress.getPort();
if (thisAddressStr.equals(targetAddressStr)) ... | [
"private",
"boolean",
"shouldMergeTo",
"(",
"Address",
"thisAddress",
",",
"Address",
"targetAddress",
")",
"{",
"String",
"thisAddressStr",
"=",
"\"[\"",
"+",
"thisAddress",
".",
"getHost",
"(",
")",
"+",
"\"]:\"",
"+",
"thisAddress",
".",
"getPort",
"(",
")"... | Determines whether this address should merge to target address and called when two sides are equal on all aspects.
This is a pure function that must produce always the same output when called with the same parameters.
This logic should not be changed, otherwise compatibility will be broken.
@param thisAddress this add... | [
"Determines",
"whether",
"this",
"address",
"should",
"merge",
"to",
"target",
"address",
"and",
"called",
"when",
"two",
"sides",
"are",
"equal",
"on",
"all",
"aspects",
".",
"This",
"is",
"a",
"pure",
"function",
"that",
"must",
"produce",
"always",
"the",... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java#L910-L922 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsDateTimeUtil.java | CmsDateTimeUtil.getDateTime | public static String getDateTime(Date date, Format format) {
"""
Returns a formated date and time String from a Date value,
the formatting based on the provided options.<p>
@param date the Date object to format as String
@param format the format to use, see {@link Format} for possible values
@return the form... | java | public static String getDateTime(Date date, Format format) {
StringBuffer buf = new StringBuffer();
buf.append(getDate(date, format));
buf.append(" ");
buf.append(getTime(date, format));
return buf.toString();
} | [
"public",
"static",
"String",
"getDateTime",
"(",
"Date",
"date",
",",
"Format",
"format",
")",
"{",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"buf",
".",
"append",
"(",
"getDate",
"(",
"date",
",",
"format",
")",
")",
";",
"buf... | Returns a formated date and time String from a Date value,
the formatting based on the provided options.<p>
@param date the Date object to format as String
@param format the format to use, see {@link Format} for possible values
@return the formatted date | [
"Returns",
"a",
"formated",
"date",
"and",
"time",
"String",
"from",
"a",
"Date",
"value",
"the",
"formatting",
"based",
"on",
"the",
"provided",
"options",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsDateTimeUtil.java#L124-L131 |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/common/lib/utils/Media.java | Media.writeBytesToStream | @VisibleForTesting
static void writeBytesToStream(byte[] bytes, final OutputStream outputStream)
throws IOException {
"""
Writes the given {@code byte[]} to a stream.
@throws IOException if the steam cannot be written to
"""
new ByteSink() {
@Override
public OutputStream openStream()... | java | @VisibleForTesting
static void writeBytesToStream(byte[] bytes, final OutputStream outputStream)
throws IOException {
new ByteSink() {
@Override
public OutputStream openStream() {
return outputStream;
}
}.write(bytes);
} | [
"@",
"VisibleForTesting",
"static",
"void",
"writeBytesToStream",
"(",
"byte",
"[",
"]",
"bytes",
",",
"final",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
"{",
"new",
"ByteSink",
"(",
")",
"{",
"@",
"Override",
"public",
"OutputStream",
"openS... | Writes the given {@code byte[]} to a stream.
@throws IOException if the steam cannot be written to | [
"Writes",
"the",
"given",
"{",
"@code",
"byte",
"[]",
"}",
"to",
"a",
"stream",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/utils/Media.java#L139-L148 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Quaternion.java | Quaternion.setAxisAngle | public final void setAxisAngle(Vector3D axis, double angle) {
"""
Sets the value of this quaternion to the equivalent rotation
of the Axis-Angle arguments.
@param axis is the axis of rotation.
@param angle is the rotation around the axis.
"""
setAxisAngle(axis.getX(), axis.getY(), axis.getZ(), angle);
} | java | public final void setAxisAngle(Vector3D axis, double angle) {
setAxisAngle(axis.getX(), axis.getY(), axis.getZ(), angle);
} | [
"public",
"final",
"void",
"setAxisAngle",
"(",
"Vector3D",
"axis",
",",
"double",
"angle",
")",
"{",
"setAxisAngle",
"(",
"axis",
".",
"getX",
"(",
")",
",",
"axis",
".",
"getY",
"(",
")",
",",
"axis",
".",
"getZ",
"(",
")",
",",
"angle",
")",
";"... | Sets the value of this quaternion to the equivalent rotation
of the Axis-Angle arguments.
@param axis is the axis of rotation.
@param angle is the rotation around the axis. | [
"Sets",
"the",
"value",
"of",
"this",
"quaternion",
"to",
"the",
"equivalent",
"rotation",
"of",
"the",
"Axis",
"-",
"Angle",
"arguments",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Quaternion.java#L636-L638 |
protostuff/protostuff | protostuff-xml/src/main/java/io/protostuff/XmlIOUtil.java | XmlIOUtil.parseListFrom | public static <T> List<T> parseListFrom(InputStream in, Schema<T> schema)
throws IOException {
"""
Parses the {@code messages} from the {@link InputStream} using the given {@code schema}.
"""
return parseListFrom(in, schema, DEFAULT_INPUT_FACTORY);
} | java | public static <T> List<T> parseListFrom(InputStream in, Schema<T> schema)
throws IOException
{
return parseListFrom(in, schema, DEFAULT_INPUT_FACTORY);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"parseListFrom",
"(",
"InputStream",
"in",
",",
"Schema",
"<",
"T",
">",
"schema",
")",
"throws",
"IOException",
"{",
"return",
"parseListFrom",
"(",
"in",
",",
"schema",
",",
"DEFAULT_INPUT_FACTORY... | Parses the {@code messages} from the {@link InputStream} using the given {@code schema}. | [
"Parses",
"the",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-xml/src/main/java/io/protostuff/XmlIOUtil.java#L530-L534 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDFactoryDaoImpl.java | GeneratedDFactoryDaoImpl.queryByCreatedDate | public Iterable<DFactory> queryByCreatedDate(java.util.Date createdDate) {
"""
query-by method for field createdDate
@param createdDate the specified attribute
@return an Iterable of DFactorys for the specified createdDate
"""
return queryByField(null, DFactoryMapper.Field.CREATEDDATE.getFieldName(), cre... | java | public Iterable<DFactory> queryByCreatedDate(java.util.Date createdDate) {
return queryByField(null, DFactoryMapper.Field.CREATEDDATE.getFieldName(), createdDate);
} | [
"public",
"Iterable",
"<",
"DFactory",
">",
"queryByCreatedDate",
"(",
"java",
".",
"util",
".",
"Date",
"createdDate",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DFactoryMapper",
".",
"Field",
".",
"CREATEDDATE",
".",
"getFieldName",
"(",
")",
"... | query-by method for field createdDate
@param createdDate the specified attribute
@return an Iterable of DFactorys for the specified createdDate | [
"query",
"-",
"by",
"method",
"for",
"field",
"createdDate"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDFactoryDaoImpl.java#L106-L108 |
pressgang-ccms/PressGangCCMSBuilder | src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanDocBookBuilder.java | PublicanDocBookBuilder.applyPublicanCfgOverrides | private String applyPublicanCfgOverrides(final BuildData buildData, final String publicanCfg) {
"""
Applies custom user overrides to the publican.cfg file.
@param publicanCfg
@return
"""
final Map<String, String> publicanCfgOverrides = buildData.getBuildOptions().getPublicanCfgOverrides();
... | java | private String applyPublicanCfgOverrides(final BuildData buildData, final String publicanCfg) {
final Map<String, String> publicanCfgOverrides = buildData.getBuildOptions().getPublicanCfgOverrides();
String retValue = publicanCfg;
// Loop over each override and remove any entries that may exist... | [
"private",
"String",
"applyPublicanCfgOverrides",
"(",
"final",
"BuildData",
"buildData",
",",
"final",
"String",
"publicanCfg",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"publicanCfgOverrides",
"=",
"buildData",
".",
"getBuildOptions",
"(",
")"... | Applies custom user overrides to the publican.cfg file.
@param publicanCfg
@return | [
"Applies",
"custom",
"user",
"overrides",
"to",
"the",
"publican",
".",
"cfg",
"file",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanDocBookBuilder.java#L269-L280 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/graph/GraphGenerator.java | GraphGenerator.onIfSharedByPK | private Object onIfSharedByPK(Relation relation, Object childObject, EntityMetadata childMetadata, Object entityId) {
"""
Check and set if relation is set via primary key.
@param relation
relation
@param childObject
target entity
@param childMetadata
target entity metadata
@param entityId
entity id
@ret... | java | private Object onIfSharedByPK(Relation relation, Object childObject, EntityMetadata childMetadata, Object entityId)
{
if (relation.isJoinedByPrimaryKey())
{
PropertyAccessorHelper.setId(childObject, childMetadata, entityId);
}
return childObject;
} | [
"private",
"Object",
"onIfSharedByPK",
"(",
"Relation",
"relation",
",",
"Object",
"childObject",
",",
"EntityMetadata",
"childMetadata",
",",
"Object",
"entityId",
")",
"{",
"if",
"(",
"relation",
".",
"isJoinedByPrimaryKey",
"(",
")",
")",
"{",
"PropertyAccessor... | Check and set if relation is set via primary key.
@param relation
relation
@param childObject
target entity
@param childMetadata
target entity metadata
@param entityId
entity id
@return target entity. | [
"Check",
"and",
"set",
"if",
"relation",
"is",
"set",
"via",
"primary",
"key",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/graph/GraphGenerator.java#L192-L200 |
ReactiveX/RxJavaFX | src/main/java/io/reactivex/rxjavafx/transformers/FxFlowableTransformers.java | FxFlowableTransformers.doOnCompleteCount | public static <T> FlowableTransformer<T,T> doOnCompleteCount(Consumer<Integer> onComplete) {
"""
Performs an action on onComplete with the provided emission count
@param onComplete
@param <T>
"""
return obs -> obs.lift(new FlowableEmissionCounter<>(new CountObserver(null,onComplete,null)));
} | java | public static <T> FlowableTransformer<T,T> doOnCompleteCount(Consumer<Integer> onComplete) {
return obs -> obs.lift(new FlowableEmissionCounter<>(new CountObserver(null,onComplete,null)));
} | [
"public",
"static",
"<",
"T",
">",
"FlowableTransformer",
"<",
"T",
",",
"T",
">",
"doOnCompleteCount",
"(",
"Consumer",
"<",
"Integer",
">",
"onComplete",
")",
"{",
"return",
"obs",
"->",
"obs",
".",
"lift",
"(",
"new",
"FlowableEmissionCounter",
"<>",
"(... | Performs an action on onComplete with the provided emission count
@param onComplete
@param <T> | [
"Performs",
"an",
"action",
"on",
"onComplete",
"with",
"the",
"provided",
"emission",
"count"
] | train | https://github.com/ReactiveX/RxJavaFX/blob/8f44d4cc1caba9a8919f01cb1897aaea5514c7e5/src/main/java/io/reactivex/rxjavafx/transformers/FxFlowableTransformers.java#L123-L125 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonFactory.java | JsonFactory.toByteStream | private ByteArrayOutputStream toByteStream(Object item, boolean pretty) throws IOException {
"""
Returns a UTF-8 byte array output stream of the serialized JSON representation for the given
item using {@link JsonGenerator#serialize(Object)}.
@param item data key/value pairs
@param pretty whether to return a p... | java | private ByteArrayOutputStream toByteStream(Object item, boolean pretty) throws IOException {
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
JsonGenerator generator = createJsonGenerator(byteStream, Charsets.UTF_8);
if (pretty) {
generator.enablePrettyPrint();
}
generator.seria... | [
"private",
"ByteArrayOutputStream",
"toByteStream",
"(",
"Object",
"item",
",",
"boolean",
"pretty",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"byteStream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"JsonGenerator",
"generator",
"=",
"creat... | Returns a UTF-8 byte array output stream of the serialized JSON representation for the given
item using {@link JsonGenerator#serialize(Object)}.
@param item data key/value pairs
@param pretty whether to return a pretty representation
@return serialized JSON string representation | [
"Returns",
"a",
"UTF",
"-",
"8",
"byte",
"array",
"output",
"stream",
"of",
"the",
"serialized",
"JSON",
"representation",
"for",
"the",
"given",
"item",
"using",
"{",
"@link",
"JsonGenerator#serialize",
"(",
"Object",
")",
"}",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonFactory.java#L160-L169 |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java | Postcard.withFloatArray | public Postcard withFloatArray(@Nullable String key, @Nullable float[] value) {
"""
Inserts a float array value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a float array object, or null
@return ... | java | public Postcard withFloatArray(@Nullable String key, @Nullable float[] value) {
mBundle.putFloatArray(key, value);
return this;
} | [
"public",
"Postcard",
"withFloatArray",
"(",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"float",
"[",
"]",
"value",
")",
"{",
"mBundle",
".",
"putFloatArray",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a float array value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a float array object, or null
@return current | [
"Inserts",
"a",
"float",
"array",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java#L520-L523 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/closure/support/Algorithms.java | Algorithms.findFirst | public Object findFirst(Iterator it, Constraint constraint) {
"""
Find the first element in the collection matching the specified
constraint.
@param it the iterator
@param constraint the predicate
@return The first object match, or null if no match
"""
return new IteratorTemplate(it).findFirst(constrai... | java | public Object findFirst(Iterator it, Constraint constraint) {
return new IteratorTemplate(it).findFirst(constraint);
} | [
"public",
"Object",
"findFirst",
"(",
"Iterator",
"it",
",",
"Constraint",
"constraint",
")",
"{",
"return",
"new",
"IteratorTemplate",
"(",
"it",
")",
".",
"findFirst",
"(",
"constraint",
")",
";",
"}"
] | Find the first element in the collection matching the specified
constraint.
@param it the iterator
@param constraint the predicate
@return The first object match, or null if no match | [
"Find",
"the",
"first",
"element",
"in",
"the",
"collection",
"matching",
"the",
"specified",
"constraint",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/closure/support/Algorithms.java#L123-L125 |
mpetazzoni/ttorrent | ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java | CommunicationManager.addTorrent | public TorrentManager addTorrent(TorrentMetadataProvider metadataProvider,
PieceStorage pieceStorage,
List<TorrentListener> listeners) throws IOException {
"""
Adds torrent to storage with any storage, metadata source and specified listeners
... | java | public TorrentManager addTorrent(TorrentMetadataProvider metadataProvider,
PieceStorage pieceStorage,
List<TorrentListener> listeners) throws IOException {
TorrentMetadata torrentMetadata = metadataProvider.getTorrentMetadata();
EventDispatch... | [
"public",
"TorrentManager",
"addTorrent",
"(",
"TorrentMetadataProvider",
"metadataProvider",
",",
"PieceStorage",
"pieceStorage",
",",
"List",
"<",
"TorrentListener",
">",
"listeners",
")",
"throws",
"IOException",
"{",
"TorrentMetadata",
"torrentMetadata",
"=",
"metadat... | Adds torrent to storage with any storage, metadata source and specified listeners
@param metadataProvider specified metadata source
@param pieceStorage specified storage of pieces
@param listeners specified listeners
@return {@link TorrentManager} instance for monitoring torrent state
@throws IOException if... | [
"Adds",
"torrent",
"to",
"storage",
"with",
"any",
"storage",
"metadata",
"source",
"and",
"specified",
"listeners"
] | train | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java#L204-L231 |
elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/VectorUtil.java | VectorUtil.dotDense | public static double dotDense(NumberVector v1, NumberVector v2) {
"""
Compute the dot product of two dense vectors.
@param v1 first vector
@param v2 second vector
@return dot product
"""
final int dim1 = v1.getDimensionality(), dim2 = v2.getDimensionality();
final int mindim = (dim1 <= dim2) ? dim... | java | public static double dotDense(NumberVector v1, NumberVector v2) {
final int dim1 = v1.getDimensionality(), dim2 = v2.getDimensionality();
final int mindim = (dim1 <= dim2) ? dim1 : dim2;
double dot = 0;
for(int k = 0; k < mindim; k++) {
dot += v1.doubleValue(k) * v2.doubleValue(k);
}
retur... | [
"public",
"static",
"double",
"dotDense",
"(",
"NumberVector",
"v1",
",",
"NumberVector",
"v2",
")",
"{",
"final",
"int",
"dim1",
"=",
"v1",
".",
"getDimensionality",
"(",
")",
",",
"dim2",
"=",
"v2",
".",
"getDimensionality",
"(",
")",
";",
"final",
"in... | Compute the dot product of two dense vectors.
@param v1 first vector
@param v2 second vector
@return dot product | [
"Compute",
"the",
"dot",
"product",
"of",
"two",
"dense",
"vectors",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/VectorUtil.java#L348-L356 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.