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 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenTSDB/opentsdb | src/utils/PluginLoader.java | PluginLoader.searchForJars | private static void searchForJars(final File file, List<File> jars) {
"""
Recursive method to search for JAR files starting at a given level
@param file The directory to search in
@param jars A list of file objects that will be loaded with discovered
jar files
@throws SecurityException if a security manager ex... | java | private static void searchForJars(final File file, List<File> jars) {
if (file.isFile()) {
if (file.getAbsolutePath().toLowerCase().endsWith(".jar")) {
jars.add(file);
LOG.debug("Found a jar: " + file.getAbsolutePath());
}
} else if (file.isDirectory()) {
File[] files = file.li... | [
"private",
"static",
"void",
"searchForJars",
"(",
"final",
"File",
"file",
",",
"List",
"<",
"File",
">",
"jars",
")",
"{",
"if",
"(",
"file",
".",
"isFile",
"(",
")",
")",
"{",
"if",
"(",
"file",
".",
"getAbsolutePath",
"(",
")",
".",
"toLowerCase"... | Recursive method to search for JAR files starting at a given level
@param file The directory to search in
@param jars A list of file objects that will be loaded with discovered
jar files
@throws SecurityException if a security manager exists and prevents reading | [
"Recursive",
"method",
"to",
"search",
"for",
"JAR",
"files",
"starting",
"at",
"a",
"given",
"level"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/utils/PluginLoader.java#L227-L244 |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/SequenceEntryUtils.java | SequenceEntryUtils.deleteDeletedValueQualifiers | public static boolean deleteDeletedValueQualifiers(Feature feature, ArrayList<Qualifier> deleteQualifierList) {
"""
deletes the qualifiers which have 'DELETED' value
@param feature
"""
boolean deleted = false;
for (Qualifier qual : deleteQualifierList)
{
feature.removeQualifier(qual);
deleted = ... | java | public static boolean deleteDeletedValueQualifiers(Feature feature, ArrayList<Qualifier> deleteQualifierList)
{
boolean deleted = false;
for (Qualifier qual : deleteQualifierList)
{
feature.removeQualifier(qual);
deleted = true;
}
return deleted;
} | [
"public",
"static",
"boolean",
"deleteDeletedValueQualifiers",
"(",
"Feature",
"feature",
",",
"ArrayList",
"<",
"Qualifier",
">",
"deleteQualifierList",
")",
"{",
"boolean",
"deleted",
"=",
"false",
";",
"for",
"(",
"Qualifier",
"qual",
":",
"deleteQualifierList",
... | deletes the qualifiers which have 'DELETED' value
@param feature | [
"deletes",
"the",
"qualifiers",
"which",
"have",
"DELETED",
"value"
] | train | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/SequenceEntryUtils.java#L617-L627 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/stereo/ExampleStereoTwoViewsOneCamera.java | ExampleStereoTwoViewsOneCamera.rectifyImages | public static <T extends ImageBase<T>>
void rectifyImages(T distortedLeft,
T distortedRight,
Se3_F64 leftToRight,
CameraPinholeBrown intrinsicLeft,
CameraPinholeBrown intrinsicRight,
T rectifiedLeft,
T rectifiedRight,
GrayU8 rectifiedMask,
DMatrixRMaj rec... | java | public static <T extends ImageBase<T>>
void rectifyImages(T distortedLeft,
T distortedRight,
Se3_F64 leftToRight,
CameraPinholeBrown intrinsicLeft,
CameraPinholeBrown intrinsicRight,
T rectifiedLeft,
T rectifiedRight,
GrayU8 rectifiedMask,
DMatrixRMaj rec... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"void",
"rectifyImages",
"(",
"T",
"distortedLeft",
",",
"T",
"distortedRight",
",",
"Se3_F64",
"leftToRight",
",",
"CameraPinholeBrown",
"intrinsicLeft",
",",
"CameraPinholeBrown",
"intrins... | Remove lens distortion and rectify stereo images
@param distortedLeft Input distorted image from left camera.
@param distortedRight Input distorted image from right camera.
@param leftToRight Camera motion from left to right
@param intrinsicLeft Intrinsic camera parameters
@param rectifiedLeft Output rectified i... | [
"Remove",
"lens",
"distortion",
"and",
"rectify",
"stereo",
"images"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleStereoTwoViewsOneCamera.java#L205-L250 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.plus | public static Number plus(Character left, Number right) {
"""
Add a Character and a Number. The ordinal value of the Character
is used in the addition (the ordinal value is the unicode
value which for simple character sets is the ASCII value).
This operation will always create a new object for the result,
whil... | java | public static Number plus(Character left, Number right) {
return NumberNumberPlus.plus(Integer.valueOf(left), right);
} | [
"public",
"static",
"Number",
"plus",
"(",
"Character",
"left",
",",
"Number",
"right",
")",
"{",
"return",
"NumberNumberPlus",
".",
"plus",
"(",
"Integer",
".",
"valueOf",
"(",
"left",
")",
",",
"right",
")",
";",
"}"
] | Add a Character and a Number. The ordinal value of the Character
is used in the addition (the ordinal value is the unicode
value which for simple character sets is the ASCII value).
This operation will always create a new object for the result,
while the operands remain unchanged.
@see java.lang.Integer#valueOf(int)
@... | [
"Add",
"a",
"Character",
"and",
"a",
"Number",
".",
"The",
"ordinal",
"value",
"of",
"the",
"Character",
"is",
"used",
"in",
"the",
"addition",
"(",
"the",
"ordinal",
"value",
"is",
"the",
"unicode",
"value",
"which",
"for",
"simple",
"character",
"sets",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L15011-L15013 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/QueryStatisticsInner.java | QueryStatisticsInner.listByQuery | public List<QueryStatisticInner> listByQuery(String resourceGroupName, String serverName, String databaseName, String queryId) {
"""
Lists a query's statistics.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or th... | java | public List<QueryStatisticInner> listByQuery(String resourceGroupName, String serverName, String databaseName, String queryId) {
return listByQueryWithServiceResponseAsync(resourceGroupName, serverName, databaseName, queryId).toBlocking().single().body();
} | [
"public",
"List",
"<",
"QueryStatisticInner",
">",
"listByQuery",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"queryId",
")",
"{",
"return",
"listByQueryWithServiceResponseAsync",
"(",
"resourceGroupName... | Lists a query's statistics.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@param queryId The id of the query
@throws... | [
"Lists",
"a",
"query",
"s",
"statistics",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/QueryStatisticsInner.java#L73-L75 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/io/DOMHandle.java | DOMHandle.evaluateXPath | public <T> T evaluateXPath(String xpathExpression, Node context, Class<T> as)
throws XPathExpressionException {
"""
Evaluate a string XPath expression relative to a node such as a node
returned by a previous XPath expression.
An XPath expression can return a Node or subinterface such as
Element or Text, a N... | java | public <T> T evaluateXPath(String xpathExpression, Node context, Class<T> as)
throws XPathExpressionException {
checkContext(context);
return castAs(
getXPathProcessor().evaluate(xpathExpression, context, returnXPathConstant(as)),
as
);
} | [
"public",
"<",
"T",
">",
"T",
"evaluateXPath",
"(",
"String",
"xpathExpression",
",",
"Node",
"context",
",",
"Class",
"<",
"T",
">",
"as",
")",
"throws",
"XPathExpressionException",
"{",
"checkContext",
"(",
"context",
")",
";",
"return",
"castAs",
"(",
"... | Evaluate a string XPath expression relative to a node such as a node
returned by a previous XPath expression.
An XPath expression can return a Node or subinterface such as
Element or Text, a NodeList, or a Boolean, Number, or String value.
@param xpathExpression the XPath expression as a string
@param context the node ... | [
"Evaluate",
"a",
"string",
"XPath",
"expression",
"relative",
"to",
"a",
"node",
"such",
"as",
"a",
"node",
"returned",
"by",
"a",
"previous",
"XPath",
"expression",
".",
"An",
"XPath",
"expression",
"can",
"return",
"a",
"Node",
"or",
"subinterface",
"such"... | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/io/DOMHandle.java#L288-L295 |
jenkinsci/jenkins | core/src/main/java/hudson/util/spring/BeanBuilder.java | BeanBuilder.methodMissing | public Object methodMissing(String name, Object arg) {
"""
This method is invoked by Groovy when a method that's not defined in Java is invoked.
We use that as a syntax for bean definition.
"""
Object[] args = (Object[])arg;
if(args.length == 0)
throw new MissingMethodException(name,getCla... | java | public Object methodMissing(String name, Object arg) {
Object[] args = (Object[])arg;
if(args.length == 0)
throw new MissingMethodException(name,getClass(),args);
if(args[0] instanceof Closure) {
// abstract bean definition
return invokeBeanDefiningMethod(name, args);
}
... | [
"public",
"Object",
"methodMissing",
"(",
"String",
"name",
",",
"Object",
"arg",
")",
"{",
"Object",
"[",
"]",
"args",
"=",
"(",
"Object",
"[",
"]",
")",
"arg",
";",
"if",
"(",
"args",
".",
"length",
"==",
"0",
")",
"throw",
"new",
"MissingMethodExc... | This method is invoked by Groovy when a method that's not defined in Java is invoked.
We use that as a syntax for bean definition. | [
"This",
"method",
"is",
"invoked",
"by",
"Groovy",
"when",
"a",
"method",
"that",
"s",
"not",
"defined",
"in",
"Java",
"is",
"invoked",
".",
"We",
"use",
"that",
"as",
"a",
"syntax",
"for",
"bean",
"definition",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/spring/BeanBuilder.java#L365-L387 |
codelibs/jcifs | src/main/java/jcifs/smb1/smb1/NtlmPasswordAuthentication.java | NtlmPasswordAuthentication.getUnicodeHash | public byte[] getUnicodeHash( byte[] challenge ) {
"""
Computes the 24 byte Unicode password hash given the 8 byte server challenge.
"""
if( hashesExternal ) {
return unicodeHash;
}
switch (LM_COMPATIBILITY) {
case 0:
case 1:
case 2:
retur... | java | public byte[] getUnicodeHash( byte[] challenge ) {
if( hashesExternal ) {
return unicodeHash;
}
switch (LM_COMPATIBILITY) {
case 0:
case 1:
case 2:
return getNTLMResponse( password, challenge );
case 3:
case 4:
case 5:
... | [
"public",
"byte",
"[",
"]",
"getUnicodeHash",
"(",
"byte",
"[",
"]",
"challenge",
")",
"{",
"if",
"(",
"hashesExternal",
")",
"{",
"return",
"unicodeHash",
";",
"}",
"switch",
"(",
"LM_COMPATIBILITY",
")",
"{",
"case",
"0",
":",
"case",
"1",
":",
"case... | Computes the 24 byte Unicode password hash given the 8 byte server challenge. | [
"Computes",
"the",
"24",
"byte",
"Unicode",
"password",
"hash",
"given",
"the",
"8",
"byte",
"server",
"challenge",
"."
] | train | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/smb1/NtlmPasswordAuthentication.java#L440-L464 |
facebook/fresco | samples/comparison/src/main/java/com/facebook/samples/comparison/urlsfetcher/ImageUrlsRequestBuilder.java | ImageUrlsRequestBuilder.addImageFormat | public ImageUrlsRequestBuilder addImageFormat(ImageFormat imageFormat, ImageSize imageSize) {
"""
Adds imageFormat to the set of image formats you want to download. imageSize specify
server-side resize options.
"""
mRequestedImageFormats.put(imageFormat, imageSize);
return this;
} | java | public ImageUrlsRequestBuilder addImageFormat(ImageFormat imageFormat, ImageSize imageSize) {
mRequestedImageFormats.put(imageFormat, imageSize);
return this;
} | [
"public",
"ImageUrlsRequestBuilder",
"addImageFormat",
"(",
"ImageFormat",
"imageFormat",
",",
"ImageSize",
"imageSize",
")",
"{",
"mRequestedImageFormats",
".",
"put",
"(",
"imageFormat",
",",
"imageSize",
")",
";",
"return",
"this",
";",
"}"
] | Adds imageFormat to the set of image formats you want to download. imageSize specify
server-side resize options. | [
"Adds",
"imageFormat",
"to",
"the",
"set",
"of",
"image",
"formats",
"you",
"want",
"to",
"download",
".",
"imageSize",
"specify",
"server",
"-",
"side",
"resize",
"options",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/samples/comparison/src/main/java/com/facebook/samples/comparison/urlsfetcher/ImageUrlsRequestBuilder.java#L37-L40 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedConnection.java | MemcachedConnection.insertOperation | public void insertOperation(final MemcachedNode node, final Operation o) {
"""
Insert an operation on the given node to the beginning of the queue.
@param node the node where to insert the {@link Operation}.
@param o the operation to insert.
"""
o.setHandlingNode(node);
o.initialize();
node.ins... | java | public void insertOperation(final MemcachedNode node, final Operation o) {
o.setHandlingNode(node);
o.initialize();
node.insertOp(o);
addedQueue.offer(node);
metrics.markMeter(OVERALL_REQUEST_METRIC);
Selector s = selector.wakeup();
assert s == selector : "Wakeup returned the wrong selector... | [
"public",
"void",
"insertOperation",
"(",
"final",
"MemcachedNode",
"node",
",",
"final",
"Operation",
"o",
")",
"{",
"o",
".",
"setHandlingNode",
"(",
"node",
")",
";",
"o",
".",
"initialize",
"(",
")",
";",
"node",
".",
"insertOp",
"(",
"o",
")",
";"... | Insert an operation on the given node to the beginning of the queue.
@param node the node where to insert the {@link Operation}.
@param o the operation to insert. | [
"Insert",
"an",
"operation",
"on",
"the",
"given",
"node",
"to",
"the",
"beginning",
"of",
"the",
"queue",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedConnection.java#L1256-L1266 |
gs2io/gs2-java-sdk-core | src/main/java/io/gs2/AbstractGs2Client.java | AbstractGs2Client.createHttpGet | protected HttpGet createHttpGet(String url, IGs2Credential credential, String service, String module, String function) {
"""
GETリクエストを生成
@param url アクセス先URL
@param credential 認証情報
@param service アクセス先サービス
@param module アクセス先モジュール
@param function アクセス先ファンクション
@return リクエストオブジェクト
"""
Long timestamp = S... | java | protected HttpGet createHttpGet(String url, IGs2Credential credential, String service, String module, String function) {
Long timestamp = System.currentTimeMillis()/1000;
url = StringUtils.replace(url, "{service}", service);
url = StringUtils.replace(url, "{region}", region.getName());
HttpGet get = new HttpGet... | [
"protected",
"HttpGet",
"createHttpGet",
"(",
"String",
"url",
",",
"IGs2Credential",
"credential",
",",
"String",
"service",
",",
"String",
"module",
",",
"String",
"function",
")",
"{",
"Long",
"timestamp",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
... | GETリクエストを生成
@param url アクセス先URL
@param credential 認証情報
@param service アクセス先サービス
@param module アクセス先モジュール
@param function アクセス先ファンクション
@return リクエストオブジェクト | [
"GETリクエストを生成"
] | train | https://github.com/gs2io/gs2-java-sdk-core/blob/fe66ee4e374664b101b07c41221a3b32c844127d/src/main/java/io/gs2/AbstractGs2Client.java#L158-L166 |
apache/incubator-gobblin | gobblin-modules/gobblin-parquet/src/main/java/org/apache/gobblin/writer/ParquetDataWriterBuilder.java | ParquetDataWriterBuilder.getWriter | public ParquetWriter<Group> getWriter(int blockSize, Path stagingFile)
throws IOException {
"""
Build a {@link ParquetWriter<Group>} for given file path with a block size.
@param blockSize
@param stagingFile
@return
@throws IOException
"""
State state = this.destination.getProperties();
int p... | java | public ParquetWriter<Group> getWriter(int blockSize, Path stagingFile)
throws IOException {
State state = this.destination.getProperties();
int pageSize = state.getPropAsInt(getProperty(WRITER_PARQUET_PAGE_SIZE), DEFAULT_PAGE_SIZE);
int dictPageSize = state.getPropAsInt(getProperty(WRITER_PARQUET_DICT... | [
"public",
"ParquetWriter",
"<",
"Group",
">",
"getWriter",
"(",
"int",
"blockSize",
",",
"Path",
"stagingFile",
")",
"throws",
"IOException",
"{",
"State",
"state",
"=",
"this",
".",
"destination",
".",
"getProperties",
"(",
")",
";",
"int",
"pageSize",
"=",... | Build a {@link ParquetWriter<Group>} for given file path with a block size.
@param blockSize
@param stagingFile
@return
@throws IOException | [
"Build",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-parquet/src/main/java/org/apache/gobblin/writer/ParquetDataWriterBuilder.java#L78-L95 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/shared/core/types/Color.java | Color.toBrowserRGBA | public static final String toBrowserRGBA(final int r, final int g, final int b, final double a) {
"""
Converts RGBA values to a browser-compliance rgba format.
@param r int between 0 and 255
@param g int between 0 and 255
@param b int between 0 and 255
@param b double between 0 and 1
@return String e.g. "rg... | java | public static final String toBrowserRGBA(final int r, final int g, final int b, final double a)
{
return "rgba(" + fixRGB(r) + "," + fixRGB(g) + "," + fixRGB(g) + "," + fixAlpha(a) + ")";
} | [
"public",
"static",
"final",
"String",
"toBrowserRGBA",
"(",
"final",
"int",
"r",
",",
"final",
"int",
"g",
",",
"final",
"int",
"b",
",",
"final",
"double",
"a",
")",
"{",
"return",
"\"rgba(\"",
"+",
"fixRGB",
"(",
"r",
")",
"+",
"\",\"",
"+",
"fixR... | Converts RGBA values to a browser-compliance rgba format.
@param r int between 0 and 255
@param g int between 0 and 255
@param b int between 0 and 255
@param b double between 0 and 1
@return String e.g. "rgba(12,34,255,0.5)" | [
"Converts",
"RGBA",
"values",
"to",
"a",
"browser",
"-",
"compliance",
"rgba",
"format",
"."
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/shared/core/types/Color.java#L206-L209 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/search/bingnewssearch/src/main/java/com/microsoft/azure/cognitiveservices/search/newssearch/implementation/BingNewsImpl.java | BingNewsImpl.categoryAsync | public ServiceFuture<NewsModel> categoryAsync(CategoryOptionalParameter categoryOptionalParameter, final ServiceCallback<NewsModel> serviceCallback) {
"""
The News Category API lets lets you search on Bing and get back a list of top news articles by category. This section provides technical details about the query... | java | public ServiceFuture<NewsModel> categoryAsync(CategoryOptionalParameter categoryOptionalParameter, final ServiceCallback<NewsModel> serviceCallback) {
return ServiceFuture.fromResponse(categoryWithServiceResponseAsync(categoryOptionalParameter), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"NewsModel",
">",
"categoryAsync",
"(",
"CategoryOptionalParameter",
"categoryOptionalParameter",
",",
"final",
"ServiceCallback",
"<",
"NewsModel",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"fromResponse",
"(",
"c... | The News Category API lets lets you search on Bing and get back a list of top news articles by category. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searchi... | [
"The",
"News",
"Category",
"API",
"lets",
"lets",
"you",
"search",
"on",
"Bing",
"and",
"get",
"back",
"a",
"list",
"of",
"top",
"news",
"articles",
"by",
"category",
".",
"This",
"section",
"provides",
"technical",
"details",
"about",
"the",
"query",
"par... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/search/bingnewssearch/src/main/java/com/microsoft/azure/cognitiveservices/search/newssearch/implementation/BingNewsImpl.java#L378-L380 |
inkstand-io/scribble | scribble-inject/src/main/java/io/inkstand/scribble/inject/TypeUtil.java | TypeUtil.toPrimitive | private static Object toPrimitive(final String value, final Class<?> type) {
"""
Converts the given value to it's given primitive type.
@param value
the value to be converted
@param type
a primitive type class (i.e. {@code int.class}) .
@return the converted value (will be a wrapper type)
"""
... | java | private static Object toPrimitive(final String value, final Class<?> type) {
final Class<?> objectType = objectTypeFor(type);
final Object objectValue = valueOf(value, objectType);
final Object primitiveValue;
final String toValueMethodName = type.getSimpleName() + "Value";
try... | [
"private",
"static",
"Object",
"toPrimitive",
"(",
"final",
"String",
"value",
",",
"final",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"objectType",
"=",
"objectTypeFor",
"(",
"type",
")",
";",
"final",
"Object",
"objectV... | Converts the given value to it's given primitive type.
@param value
the value to be converted
@param type
a primitive type class (i.e. {@code int.class}) .
@return the converted value (will be a wrapper type) | [
"Converts",
"the",
"given",
"value",
"to",
"it",
"s",
"given",
"primitive",
"type",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-inject/src/main/java/io/inkstand/scribble/inject/TypeUtil.java#L123-L139 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java | AmazonS3Client.populateSSE_C | private static void populateSSE_C(Request<?> request, SSECustomerKey sseKey) {
"""
<p>
Populates the specified request with the numerous attributes available in
<code>SSEWithCustomerKeyRequest</code>.
</p>
@param request
The request to populate with headers to represent all the
options expressed in the
<c... | java | private static void populateSSE_C(Request<?> request, SSECustomerKey sseKey) {
if (sseKey == null) return;
addHeaderIfNotNull(request, Headers.SERVER_SIDE_ENCRYPTION_CUSTOMER_ALGORITHM,
sseKey.getAlgorithm());
addHeaderIfNotNull(request, Headers.SERVER_SIDE_ENCRYPTION_CUSTOMER_K... | [
"private",
"static",
"void",
"populateSSE_C",
"(",
"Request",
"<",
"?",
">",
"request",
",",
"SSECustomerKey",
"sseKey",
")",
"{",
"if",
"(",
"sseKey",
"==",
"null",
")",
"return",
";",
"addHeaderIfNotNull",
"(",
"request",
",",
"Headers",
".",
"SERVER_SIDE_... | <p>
Populates the specified request with the numerous attributes available in
<code>SSEWithCustomerKeyRequest</code>.
</p>
@param request
The request to populate with headers to represent all the
options expressed in the
<code>ServerSideEncryptionWithCustomerKeyRequest</code>
object.
@param sseKey
The request object f... | [
"<p",
">",
"Populates",
"the",
"specified",
"request",
"with",
"the",
"numerous",
"attributes",
"available",
"in",
"<code",
">",
"SSEWithCustomerKeyRequest<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4359-L4377 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/EntrySerializer.java | EntrySerializer.readHeader | Header readHeader(@NonNull ArrayView input) throws SerializationException {
"""
Reads the Entry's Header from the given {@link ArrayView}.
@param input The {@link ArrayView} to read from.
@return The Entry Header.
@throws SerializationException If an invalid header was detected.
"""
byte version =... | java | Header readHeader(@NonNull ArrayView input) throws SerializationException {
byte version = input.get(VERSION_POSITION);
int keyLength = BitConverter.readInt(input, KEY_POSITION);
int valueLength = BitConverter.readInt(input, VALUE_POSITION);
long entryVersion = BitConverter.readLong(inpu... | [
"Header",
"readHeader",
"(",
"@",
"NonNull",
"ArrayView",
"input",
")",
"throws",
"SerializationException",
"{",
"byte",
"version",
"=",
"input",
".",
"get",
"(",
"VERSION_POSITION",
")",
";",
"int",
"keyLength",
"=",
"BitConverter",
".",
"readInt",
"(",
"inpu... | Reads the Entry's Header from the given {@link ArrayView}.
@param input The {@link ArrayView} to read from.
@return The Entry Header.
@throws SerializationException If an invalid header was detected. | [
"Reads",
"the",
"Entry",
"s",
"Header",
"from",
"the",
"given",
"{",
"@link",
"ArrayView",
"}",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/EntrySerializer.java#L181-L188 |
bazaarvoice/jersey-hmac-auth | common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractCachingAuthenticator.java | AbstractCachingAuthenticator.cachePrincipal | protected void cachePrincipal(String apiKey, Principal principal) {
"""
Put this principal directly into cache. This can avoid lookup on
user request and "prepay" the lookup cost.
@param apiKey the api key
@param principal the principal
"""
cache.put(apiKey, Optional.fromNullable(princip... | java | protected void cachePrincipal(String apiKey, Principal principal) {
cache.put(apiKey, Optional.fromNullable(principal));
} | [
"protected",
"void",
"cachePrincipal",
"(",
"String",
"apiKey",
",",
"Principal",
"principal",
")",
"{",
"cache",
".",
"put",
"(",
"apiKey",
",",
"Optional",
".",
"fromNullable",
"(",
"principal",
")",
")",
";",
"}"
] | Put this principal directly into cache. This can avoid lookup on
user request and "prepay" the lookup cost.
@param apiKey the api key
@param principal the principal | [
"Put",
"this",
"principal",
"directly",
"into",
"cache",
".",
"This",
"can",
"avoid",
"lookup",
"on",
"user",
"request",
"and",
"prepay",
"the",
"lookup",
"cost",
"."
] | train | https://github.com/bazaarvoice/jersey-hmac-auth/blob/17e2a40a4b7b783de4d77ad97f8a623af6baf688/common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractCachingAuthenticator.java#L67-L69 |
VoltDB/voltdb | third_party/java/src/org/HdrHistogram_voltpatches/AbstractHistogram.java | AbstractHistogram.shiftValuesRight | public void shiftValuesRight(final int numberOfBinaryOrdersOfMagnitude) {
"""
Shift recorded values to the right (the equivalent of a >> shift operation on all recorded values). The
configured integer value range limits and value precision setting will remain unchanged.
<p>
Shift right operations that do ... | java | public void shiftValuesRight(final int numberOfBinaryOrdersOfMagnitude) {
if (numberOfBinaryOrdersOfMagnitude < 0) {
throw new IllegalArgumentException("Cannot shift by a negative number of magnitudes");
}
if (numberOfBinaryOrdersOfMagnitude == 0) {
return;
}
... | [
"public",
"void",
"shiftValuesRight",
"(",
"final",
"int",
"numberOfBinaryOrdersOfMagnitude",
")",
"{",
"if",
"(",
"numberOfBinaryOrdersOfMagnitude",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot shift by a negative number of magnitudes\"",
... | Shift recorded values to the right (the equivalent of a >> shift operation on all recorded values). The
configured integer value range limits and value precision setting will remain unchanged.
<p>
Shift right operations that do not underflow are reversible with a shift left operation with no loss of
information. ... | [
"Shift",
"recorded",
"values",
"to",
"the",
"right",
"(",
"the",
"equivalent",
"of",
"a",
">",
";",
">",
";",
"shift",
"operation",
"on",
"all",
"recorded",
"values",
")",
".",
"The",
"configured",
"integer",
"value",
"range",
"limits",
"and",
"value",... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/AbstractHistogram.java#L837-L875 |
resourcepool/ssdp-client | src/main/java/io/resourcepool/ssdp/client/parser/ResponseParser.java | ResponseParser.parseCacheHeader | private static long parseCacheHeader(Map<String, String> headers) {
"""
Parse both Cache-Control and Expires headers to determine if there is any caching strategy requested by service.
@param headers the headers.
@return 0 if no strategy, or the timestamp matching the future expiration in milliseconds otherwis... | java | private static long parseCacheHeader(Map<String, String> headers) {
if (headers.get("CACHE-CONTROL") != null) {
String cacheControlHeader = headers.get("CACHE-CONTROL");
Matcher m = CACHE_CONTROL_PATTERN.matcher(cacheControlHeader);
if (m.matches()) {
return new Date().getTime() + Long.par... | [
"private",
"static",
"long",
"parseCacheHeader",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"if",
"(",
"headers",
".",
"get",
"(",
"\"CACHE-CONTROL\"",
")",
"!=",
"null",
")",
"{",
"String",
"cacheControlHeader",
"=",
"headers",
".... | Parse both Cache-Control and Expires headers to determine if there is any caching strategy requested by service.
@param headers the headers.
@return 0 if no strategy, or the timestamp matching the future expiration in milliseconds otherwise. | [
"Parse",
"both",
"Cache",
"-",
"Control",
"and",
"Expires",
"headers",
"to",
"determine",
"if",
"there",
"is",
"any",
"caching",
"strategy",
"requested",
"by",
"service",
"."
] | train | https://github.com/resourcepool/ssdp-client/blob/5c44131c159189e53dfed712bc10b8b3444776b6/src/main/java/io/resourcepool/ssdp/client/parser/ResponseParser.java#L92-L108 |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportVersion7.java | CmsImportVersion7.addAccountsUserRules | protected void addAccountsUserRules(Digester digester, String xpath) {
"""
Adds the XML digester rules for users.<p>
@param digester the digester to add the rules to
@param xpath the base xpath for the rules
"""
String xp_user = xpath + N_USERS + "/" + N_USER + "/";
digester.addCallMethod(... | java | protected void addAccountsUserRules(Digester digester, String xpath) {
String xp_user = xpath + N_USERS + "/" + N_USER + "/";
digester.addCallMethod(xp_user + N_NAME, "setUserName", 0);
digester.addCallMethod(xp_user + N_PASSWORD, "setUserPassword", 0);
digester.addCallMethod(xp_user + ... | [
"protected",
"void",
"addAccountsUserRules",
"(",
"Digester",
"digester",
",",
"String",
"xpath",
")",
"{",
"String",
"xp_user",
"=",
"xpath",
"+",
"N_USERS",
"+",
"\"/\"",
"+",
"N_USER",
"+",
"\"/\"",
";",
"digester",
".",
"addCallMethod",
"(",
"xp_user",
"... | Adds the XML digester rules for users.<p>
@param digester the digester to add the rules to
@param xpath the base xpath for the rules | [
"Adds",
"the",
"XML",
"digester",
"rules",
"for",
"users",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportVersion7.java#L3008-L3028 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/lang/Strings.java | Strings.indexOf | private static int indexOf(CharSequence cs, int searchChar, int start) {
"""
<p>
Finds the first index in the {@code CharSequence} that matches the specified character.
</p>
@param cs the {@code CharSequence} to be processed, not null
@param searchChar the char to be searched for
@param start the start inde... | java | private static int indexOf(CharSequence cs, int searchChar, int start) {
if (cs instanceof String) {
return ((String) cs).indexOf(searchChar, start);
} else {
int sz = cs.length();
if (start < 0) {
start = 0;
}
for (int i = start; i < sz; i++) {
if (cs.charAt(i) == ... | [
"private",
"static",
"int",
"indexOf",
"(",
"CharSequence",
"cs",
",",
"int",
"searchChar",
",",
"int",
"start",
")",
"{",
"if",
"(",
"cs",
"instanceof",
"String",
")",
"{",
"return",
"(",
"(",
"String",
")",
"cs",
")",
".",
"indexOf",
"(",
"searchChar... | <p>
Finds the first index in the {@code CharSequence} that matches the specified character.
</p>
@param cs the {@code CharSequence} to be processed, not null
@param searchChar the char to be searched for
@param start the start index, negative starts at the string start
@return the index where the search char was found... | [
"<p",
">",
"Finds",
"the",
"first",
"index",
"in",
"the",
"{",
"@code",
"CharSequence",
"}",
"that",
"matches",
"the",
"specified",
"character",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/lang/Strings.java#L216-L229 |
denisneuling/apitrary.jar | apitrary-orm/apitrary-orm-core/src/main/java/com/apitrary/orm/core/ApitraryDaoSupport.java | ApitraryDaoSupport.findById | @SuppressWarnings("unchecked")
public <T> T findById(String id, Class<T> entity) {
"""
<p>
findById.
</p>
@param id
a {@link java.lang.String} object.
@param entity
a {@link java.lang.Class} object.
@param <T>
a T object.
@return a T object.
"""
if (entity == null) {
throw new ApitraryOrmExcep... | java | @SuppressWarnings("unchecked")
public <T> T findById(String id, Class<T> entity) {
if (entity == null) {
throw new ApitraryOrmException("Cannot access null entity");
}
if (id == null || id.isEmpty()) {
return null;
}
log.debug("Searching " + entity.getName() + " " + id);
GetRequest request = new Ge... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"findById",
"(",
"String",
"id",
",",
"Class",
"<",
"T",
">",
"entity",
")",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"throw",
"new",
"ApitraryOrmException",
"("... | <p>
findById.
</p>
@param id
a {@link java.lang.String} object.
@param entity
a {@link java.lang.Class} object.
@param <T>
a T object.
@return a T object. | [
"<p",
">",
"findById",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/denisneuling/apitrary.jar/blob/b7f639a1e735c60ba2b1b62851926757f5de8628/apitrary-orm/apitrary-orm-core/src/main/java/com/apitrary/orm/core/ApitraryDaoSupport.java#L225-L252 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java | Uris.getRawPath | public static String getRawPath(final URI uri, final boolean strict) {
"""
Returns the raw (and normalized) path of the given URI - prefixed with a "/". This means that an empty path
becomes a single slash.
@param uri the URI to extract the path from
@param strict whether or not to do strict escaping
@retur... | java | public static String getRawPath(final URI uri, final boolean strict) {
return esc(strict).escapePath(prependSlash(Strings.nullToEmpty(uri.getRawPath())));
} | [
"public",
"static",
"String",
"getRawPath",
"(",
"final",
"URI",
"uri",
",",
"final",
"boolean",
"strict",
")",
"{",
"return",
"esc",
"(",
"strict",
")",
".",
"escapePath",
"(",
"prependSlash",
"(",
"Strings",
".",
"nullToEmpty",
"(",
"uri",
".",
"getRawPa... | Returns the raw (and normalized) path of the given URI - prefixed with a "/". This means that an empty path
becomes a single slash.
@param uri the URI to extract the path from
@param strict whether or not to do strict escaping
@return the extracted path | [
"Returns",
"the",
"raw",
"(",
"and",
"normalized",
")",
"path",
"of",
"the",
"given",
"URI",
"-",
"prefixed",
"with",
"a",
"/",
".",
"This",
"means",
"that",
"an",
"empty",
"path",
"becomes",
"a",
"single",
"slash",
"."
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java#L154-L156 |
dmerkushov/os-helper | src/main/java/ru/dmerkushov/oshelper/OSHelper.java | OSHelper.procWait | public static int procWait (Process process) throws OSHelperException {
"""
Waits for a specified process to terminate
@param process
@throws OSHelperException
@deprecated Use ProcessReturn procWaitWithProcessReturn () instead
"""
try {
return process.waitFor ();
} catch (InterruptedException ex) {... | java | public static int procWait (Process process) throws OSHelperException {
try {
return process.waitFor ();
} catch (InterruptedException ex) {
throw new OSHelperException ("Received an InterruptedException when waiting for an external process to terminate.", ex);
}
} | [
"public",
"static",
"int",
"procWait",
"(",
"Process",
"process",
")",
"throws",
"OSHelperException",
"{",
"try",
"{",
"return",
"process",
".",
"waitFor",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"ex",
")",
"{",
"throw",
"new",
"OSHelperExc... | Waits for a specified process to terminate
@param process
@throws OSHelperException
@deprecated Use ProcessReturn procWaitWithProcessReturn () instead | [
"Waits",
"for",
"a",
"specified",
"process",
"to",
"terminate"
] | train | https://github.com/dmerkushov/os-helper/blob/a7c2b72d289d9bc23ae106d1c5e11769cf3463d6/src/main/java/ru/dmerkushov/oshelper/OSHelper.java#L159-L165 |
elastic/elasticsearch-hadoop | mr/src/main/java/org/elasticsearch/hadoop/rest/commonshttp/auth/spnego/SpnegoAuthScheme.java | SpnegoAuthScheme.initializeNegotiator | private void initializeNegotiator(URI requestURI, SpnegoCredentials spnegoCredentials) throws UnknownHostException, AuthenticationException, GSSException {
"""
Creates the negotiator if it is not yet created, or does nothing if the negotiator is already initialized.
@param requestURI request being authenticated
... | java | private void initializeNegotiator(URI requestURI, SpnegoCredentials spnegoCredentials) throws UnknownHostException, AuthenticationException, GSSException {
// Initialize negotiator
if (spnegoNegotiator == null) {
// Determine host principal
String servicePrincipal = spnegoCredent... | [
"private",
"void",
"initializeNegotiator",
"(",
"URI",
"requestURI",
",",
"SpnegoCredentials",
"spnegoCredentials",
")",
"throws",
"UnknownHostException",
",",
"AuthenticationException",
",",
"GSSException",
"{",
"// Initialize negotiator",
"if",
"(",
"spnegoNegotiator",
"=... | Creates the negotiator if it is not yet created, or does nothing if the negotiator is already initialized.
@param requestURI request being authenticated
@param spnegoCredentials The user and service principals
@throws UnknownHostException If the service principal is host based, and if the request URI cannot be resolved... | [
"Creates",
"the",
"negotiator",
"if",
"it",
"is",
"not",
"yet",
"created",
"or",
"does",
"nothing",
"if",
"the",
"negotiator",
"is",
"already",
"initialized",
"."
] | train | https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/commonshttp/auth/spnego/SpnegoAuthScheme.java#L101-L122 |
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.addDelegateStaticMethod | public static MethodNode addDelegateStaticMethod(ClassNode classNode, MethodNode delegateMethod) {
"""
Adds a static method call to given class node that delegates to the given method
@param classNode The class node
@param delegateMethod The delegate method
@return The added method node or null if it couldn't... | java | public static MethodNode addDelegateStaticMethod(ClassNode classNode, MethodNode delegateMethod) {
ClassExpression classExpression = new ClassExpression(delegateMethod.getDeclaringClass());
return addDelegateStaticMethod(classExpression, classNode, delegateMethod);
} | [
"public",
"static",
"MethodNode",
"addDelegateStaticMethod",
"(",
"ClassNode",
"classNode",
",",
"MethodNode",
"delegateMethod",
")",
"{",
"ClassExpression",
"classExpression",
"=",
"new",
"ClassExpression",
"(",
"delegateMethod",
".",
"getDeclaringClass",
"(",
")",
")"... | Adds a static method call to given class node that delegates to the given method
@param classNode The class node
@param delegateMethod The delegate method
@return The added method node or null if it couldn't be added | [
"Adds",
"a",
"static",
"method",
"call",
"to",
"given",
"class",
"node",
"that",
"delegates",
"to",
"the",
"given",
"method"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L369-L372 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlInterface.java | AptControlInterface.initSuperClass | private AptControlInterface initSuperClass() {
"""
Initializes the super interface that this ControlInterface extends (or sets it to null
if a base interface)
"""
//
// Look for a super interface that is either a control interface or extension.
// If found, return it.
//
... | java | private AptControlInterface initSuperClass()
{
//
// Look for a super interface that is either a control interface or extension.
// If found, return it.
//
InterfaceType superType = getSuperType();
if (superType == null)
{
// At this point, we're p... | [
"private",
"AptControlInterface",
"initSuperClass",
"(",
")",
"{",
"//",
"// Look for a super interface that is either a control interface or extension.",
"// If found, return it.",
"//",
"InterfaceType",
"superType",
"=",
"getSuperType",
"(",
")",
";",
"if",
"(",
"superType",
... | Initializes the super interface that this ControlInterface extends (or sets it to null
if a base interface) | [
"Initializes",
"the",
"super",
"interface",
"that",
"this",
"ControlInterface",
"extends",
"(",
"or",
"sets",
"it",
"to",
"null",
"if",
"a",
"base",
"interface",
")"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlInterface.java#L159-L197 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertHeaderPresent | public static void assertHeaderPresent(String msg, SipMessage sipMessage, String header) {
"""
Asserts that the given SIP message contains at least one occurrence of the specified header.
Assertion failure output includes the given message text.
@param msg message text to output if the assertion fails.
@param... | java | public static void assertHeaderPresent(String msg, SipMessage sipMessage, String header) {
assertNotNull("Null assert object passed in", sipMessage);
assertTrue(msg, sipMessage.getHeaders(header).hasNext());
} | [
"public",
"static",
"void",
"assertHeaderPresent",
"(",
"String",
"msg",
",",
"SipMessage",
"sipMessage",
",",
"String",
"header",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"sipMessage",
")",
";",
"assertTrue",
"(",
"msg",
",",
"sipM... | Asserts that the given SIP message contains at least one occurrence of the specified header.
Assertion failure output includes the given message text.
@param msg message text to output if the assertion fails.
@param sipMessage the SIP message.
@param header the string identifying the header as specified in RFC-3261. | [
"Asserts",
"that",
"the",
"given",
"SIP",
"message",
"contains",
"at",
"least",
"one",
"occurrence",
"of",
"the",
"specified",
"header",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L123-L126 |
looly/hutool | hutool-cron/src/main/java/cn/hutool/cron/pattern/CronPattern.java | CronPattern.isMatchDayOfMonth | private static boolean isMatchDayOfMonth(ValueMatcher matcher, int dayOfMonth, int month, boolean isLeapYear) {
"""
是否匹配日(指定月份的第几天)
@param matcher {@link ValueMatcher}
@param dayOfMonth 日
@param month 月
@param isLeapYear 是否闰年
@return 是否匹配
"""
return ((matcher instanceof DayOfMonthValueMatcher) //
... | java | private static boolean isMatchDayOfMonth(ValueMatcher matcher, int dayOfMonth, int month, boolean isLeapYear) {
return ((matcher instanceof DayOfMonthValueMatcher) //
? ((DayOfMonthValueMatcher) matcher).match(dayOfMonth, month, isLeapYear) //
: matcher.match(dayOfMonth));
} | [
"private",
"static",
"boolean",
"isMatchDayOfMonth",
"(",
"ValueMatcher",
"matcher",
",",
"int",
"dayOfMonth",
",",
"int",
"month",
",",
"boolean",
"isLeapYear",
")",
"{",
"return",
"(",
"(",
"matcher",
"instanceof",
"DayOfMonthValueMatcher",
")",
"//\r",
"?",
"... | 是否匹配日(指定月份的第几天)
@param matcher {@link ValueMatcher}
@param dayOfMonth 日
@param month 月
@param isLeapYear 是否闰年
@return 是否匹配 | [
"是否匹配日(指定月份的第几天)"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/pattern/CronPattern.java#L198-L202 |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnBatchNormalizationForwardInference | public static int cudnnBatchNormalizationForwardInference(
cudnnHandle handle,
int mode,
Pointer alpha, /** alpha[0] = result blend factor */
Pointer beta, /** beta[0] = dest layer blend factor */
cudnnTensorDescriptor xDesc,
Pointer x, /** NxCxHxW */
cudnnTens... | java | public static int cudnnBatchNormalizationForwardInference(
cudnnHandle handle,
int mode,
Pointer alpha, /** alpha[0] = result blend factor */
Pointer beta, /** beta[0] = dest layer blend factor */
cudnnTensorDescriptor xDesc,
Pointer x, /** NxCxHxW */
cudnnTens... | [
"public",
"static",
"int",
"cudnnBatchNormalizationForwardInference",
"(",
"cudnnHandle",
"handle",
",",
"int",
"mode",
",",
"Pointer",
"alpha",
",",
"/** alpha[0] = result blend factor */",
"Pointer",
"beta",
",",
"/** beta[0] = dest layer blend factor */",
"cudnnTensorDescrip... | <pre>
Performs Batch Normalization during Inference:
y[i] = bnScale[k]*(x[i]-estimatedMean[k])/sqrt(epsilon+estimatedVariance[k]) + bnBias[k]
with bnScale, bnBias, runningMean, runningInvVariance tensors indexed
according to spatial or per-activation mode. Refer to cudnnBatchNormalizationForwardTraining
above for notes... | [
"<pre",
">",
"Performs",
"Batch",
"Normalization",
"during",
"Inference",
":",
"y",
"[",
"i",
"]",
"=",
"bnScale",
"[",
"k",
"]",
"*",
"(",
"x",
"[",
"i",
"]",
"-",
"estimatedMean",
"[",
"k",
"]",
")",
"/",
"sqrt",
"(",
"epsilon",
"+",
"estimatedVa... | train | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L2450-L2467 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.createNotification | public CreateNotificationResponse createNotification(String name, String endpoint) {
"""
Create a doc notification in the doc stream service.
@param name The name of notification.
@param endpoint The address to receive notification message.
"""
CreateNotificationRequest request = new CreateNotific... | java | public CreateNotificationResponse createNotification(String name, String endpoint) {
CreateNotificationRequest request = new CreateNotificationRequest();
request.withName(name).withEndpoint(endpoint);
return createNotification(request);
} | [
"public",
"CreateNotificationResponse",
"createNotification",
"(",
"String",
"name",
",",
"String",
"endpoint",
")",
"{",
"CreateNotificationRequest",
"request",
"=",
"new",
"CreateNotificationRequest",
"(",
")",
";",
"request",
".",
"withName",
"(",
"name",
")",
".... | Create a doc notification in the doc stream service.
@param name The name of notification.
@param endpoint The address to receive notification message. | [
"Create",
"a",
"doc",
"notification",
"in",
"the",
"doc",
"stream",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L1000-L1004 |
alkacon/opencms-core | src/org/opencms/ade/detailpage/CmsDetailPageInfo.java | CmsDetailPageInfo.copyAsInherited | public CmsDetailPageInfo copyAsInherited() {
"""
Creates a copy of this entry, but sets the 'inherited' flag to true in the copy.<p>
@return the copy of this entry
"""
CmsDetailPageInfo result = new CmsDetailPageInfo(m_id, m_uri, m_type, m_iconClasses);
result.m_inherited = true;
re... | java | public CmsDetailPageInfo copyAsInherited() {
CmsDetailPageInfo result = new CmsDetailPageInfo(m_id, m_uri, m_type, m_iconClasses);
result.m_inherited = true;
return result;
} | [
"public",
"CmsDetailPageInfo",
"copyAsInherited",
"(",
")",
"{",
"CmsDetailPageInfo",
"result",
"=",
"new",
"CmsDetailPageInfo",
"(",
"m_id",
",",
"m_uri",
",",
"m_type",
",",
"m_iconClasses",
")",
";",
"result",
".",
"m_inherited",
"=",
"true",
";",
"return",
... | Creates a copy of this entry, but sets the 'inherited' flag to true in the copy.<p>
@return the copy of this entry | [
"Creates",
"a",
"copy",
"of",
"this",
"entry",
"but",
"sets",
"the",
"inherited",
"flag",
"to",
"true",
"in",
"the",
"copy",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/detailpage/CmsDetailPageInfo.java#L104-L109 |
icode/ameba | src/main/java/ameba/mvc/template/internal/ResolvingViewableContext.java | ResolvingViewableContext.resolveViewable | public ResolvedViewable resolveViewable(final Viewable viewable, final MediaType mediaType,
final Class<?> resourceClass, final TemplateProcessor templateProcessor) {
"""
{@inheritDoc}
Resolve given {@link Viewable viewable} using {@link MediaType media type}, {@code ... | java | public ResolvedViewable resolveViewable(final Viewable viewable, final MediaType mediaType,
final Class<?> resourceClass, final TemplateProcessor templateProcessor) {
if (viewable.isTemplateNameAbsolute()) {
return resolveAbsoluteViewable(viewable, resourc... | [
"public",
"ResolvedViewable",
"resolveViewable",
"(",
"final",
"Viewable",
"viewable",
",",
"final",
"MediaType",
"mediaType",
",",
"final",
"Class",
"<",
"?",
">",
"resourceClass",
",",
"final",
"TemplateProcessor",
"templateProcessor",
")",
"{",
"if",
"(",
"view... | {@inheritDoc}
Resolve given {@link Viewable viewable} using {@link MediaType media type}, {@code resolving class} and
{@link TemplateProcessor template processor}. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/mvc/template/internal/ResolvingViewableContext.java#L39-L50 |
dmfs/xmlobjects | src/org/dmfs/xmlobjects/pull/XmlObjectPull.java | XmlObjectPull.moveToNextSibling | public <T> boolean moveToNextSibling(ElementDescriptor<T> type, XmlPath path) throws XmlPullParserException, XmlObjectPullParserException, IOException {
"""
Moves forward to the start of the next element that matches the given type and path without leaving the current sub-tree. If there is no other element of
tha... | java | public <T> boolean moveToNextSibling(ElementDescriptor<T> type, XmlPath path) throws XmlPullParserException, XmlObjectPullParserException, IOException
{
return pullInternal(type, null, path, true, true) != null || mParser.getDepth() == path.length() + 1;
} | [
"public",
"<",
"T",
">",
"boolean",
"moveToNextSibling",
"(",
"ElementDescriptor",
"<",
"T",
">",
"type",
",",
"XmlPath",
"path",
")",
"throws",
"XmlPullParserException",
",",
"XmlObjectPullParserException",
",",
"IOException",
"{",
"return",
"pullInternal",
"(",
... | Moves forward to the start of the next element that matches the given type and path without leaving the current sub-tree. If there is no other element of
that type in the current sub-tree, this mehtod will stop at the closing tab current sub-tree. Calling this methods with the same parameters won't get you
any further.... | [
"Moves",
"forward",
"to",
"the",
"start",
"of",
"the",
"next",
"element",
"that",
"matches",
"the",
"given",
"type",
"and",
"path",
"without",
"leaving",
"the",
"current",
"sub",
"-",
"tree",
".",
"If",
"there",
"is",
"no",
"other",
"element",
"of",
"tha... | train | https://github.com/dmfs/xmlobjects/blob/b68ddd0ce994d804fc2ec6da1096bf0d883b37f9/src/org/dmfs/xmlobjects/pull/XmlObjectPull.java#L99-L102 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeTransformation.java | TypeTransformation.joinRecordTypes | private JSType joinRecordTypes(ImmutableList<ObjectType> recTypes) {
"""
Merges a list of record types.
Example
{r:{s:string, n:number}} and {a:boolean}
is transformed into {r:{s:string, n:number}, a:boolean}
"""
Map<String, JSType> props = new LinkedHashMap<>();
for (ObjectType recType : recTypes) ... | java | private JSType joinRecordTypes(ImmutableList<ObjectType> recTypes) {
Map<String, JSType> props = new LinkedHashMap<>();
for (ObjectType recType : recTypes) {
for (String newPropName : recType.getOwnPropertyNames()) {
JSType newPropValue = recType.getPropertyType(newPropName);
// Put the ne... | [
"private",
"JSType",
"joinRecordTypes",
"(",
"ImmutableList",
"<",
"ObjectType",
">",
"recTypes",
")",
"{",
"Map",
"<",
"String",
",",
"JSType",
">",
"props",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"for",
"(",
"ObjectType",
"recType",
":",
"recT... | Merges a list of record types.
Example
{r:{s:string, n:number}} and {a:boolean}
is transformed into {r:{s:string, n:number}, a:boolean} | [
"Merges",
"a",
"list",
"of",
"record",
"types",
".",
"Example",
"{",
"r",
":",
"{",
"s",
":",
"string",
"n",
":",
"number",
"}}",
"and",
"{",
"a",
":",
"boolean",
"}",
"is",
"transformed",
"into",
"{",
"r",
":",
"{",
"s",
":",
"string",
"n",
":... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeTransformation.java#L675-L685 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/nio/ClassLoaderUtil.java | ClassLoaderUtil.implementsInterfaceWithSameName | public static boolean implementsInterfaceWithSameName(Class<?> clazz, Class<?> iface) {
"""
Check whether given class implements an interface with the same name.
It returns true even when the implemented interface is loaded by a different
classloader and hence the class is not assignable into it.
An interface... | java | public static boolean implementsInterfaceWithSameName(Class<?> clazz, Class<?> iface) {
Class<?>[] interfaces = getAllInterfaces(clazz);
for (Class implementedInterface : interfaces) {
if (implementedInterface.getName().equals(iface.getName())) {
return true;
}
... | [
"public",
"static",
"boolean",
"implementsInterfaceWithSameName",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Class",
"<",
"?",
">",
"iface",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"interfaces",
"=",
"getAllInterfaces",
"(",
"clazz",
")",
";",
"for"... | Check whether given class implements an interface with the same name.
It returns true even when the implemented interface is loaded by a different
classloader and hence the class is not assignable into it.
An interface is considered as implemented when either:
<ul>
<li>The class directly implements the interface</li>
... | [
"Check",
"whether",
"given",
"class",
"implements",
"an",
"interface",
"with",
"the",
"same",
"name",
".",
"It",
"returns",
"true",
"even",
"when",
"the",
"implemented",
"interface",
"is",
"loaded",
"by",
"a",
"different",
"classloader",
"and",
"hence",
"the",... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/nio/ClassLoaderUtil.java#L356-L364 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java | CqlNativeStorage.setCollectionTupleValues | private void setCollectionTupleValues(Tuple tuple, int position, Object value, AbstractType<?> validator) throws ExecException {
"""
set the values of set/list at and after the position of the tuple
"""
if (validator instanceof MapType)
{
setMapTupleValues(tuple, position, value, va... | java | private void setCollectionTupleValues(Tuple tuple, int position, Object value, AbstractType<?> validator) throws ExecException
{
if (validator instanceof MapType)
{
setMapTupleValues(tuple, position, value, validator);
return;
}
AbstractType elementValidator;
... | [
"private",
"void",
"setCollectionTupleValues",
"(",
"Tuple",
"tuple",
",",
"int",
"position",
",",
"Object",
"value",
",",
"AbstractType",
"<",
"?",
">",
"validator",
")",
"throws",
"ExecException",
"{",
"if",
"(",
"validator",
"instanceof",
"MapType",
")",
"{... | set the values of set/list at and after the position of the tuple | [
"set",
"the",
"values",
"of",
"set",
"/",
"list",
"at",
"and",
"after",
"the",
"position",
"of",
"the",
"tuple"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java#L172-L195 |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java | Postcard.withSerializable | public Postcard withSerializable(@Nullable String key, @Nullable Serializable value) {
"""
Inserts a Serializable 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 Serializable object, or null
... | java | public Postcard withSerializable(@Nullable String key, @Nullable Serializable value) {
mBundle.putSerializable(key, value);
return this;
} | [
"public",
"Postcard",
"withSerializable",
"(",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"Serializable",
"value",
")",
"{",
"mBundle",
".",
"putSerializable",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a Serializable 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 Serializable object, or null
@return current | [
"Inserts",
"a",
"Serializable",
"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#L468-L471 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/SkewGeneralizedNormalDistribution.java | SkewGeneralizedNormalDistribution.logpdf | public static double logpdf(double x, double mu, double sigma, double skew) {
"""
Probability density function of the skewed normal distribution.
@param x The value.
@param mu The mean.
@param sigma The standard deviation.
@return log PDF of the given normal distribution at x.
"""
if(x != x) {
... | java | public static double logpdf(double x, double mu, double sigma, double skew) {
if(x != x) {
return Double.NaN;
}
x = (x - mu) / sigma;
if(skew == 0.) {
return MathUtil.LOG_ONE_BY_SQRTTWOPI - FastMath.log(sigma) - .5 * x * x;
}
double y = -FastMath.log(1. - skew * x) / skew;
if(y !... | [
"public",
"static",
"double",
"logpdf",
"(",
"double",
"x",
",",
"double",
"mu",
",",
"double",
"sigma",
",",
"double",
"skew",
")",
"{",
"if",
"(",
"x",
"!=",
"x",
")",
"{",
"return",
"Double",
".",
"NaN",
";",
"}",
"x",
"=",
"(",
"x",
"-",
"m... | Probability density function of the skewed normal distribution.
@param x The value.
@param mu The mean.
@param sigma The standard deviation.
@return log PDF of the given normal distribution at x. | [
"Probability",
"density",
"function",
"of",
"the",
"skewed",
"normal",
"distribution",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/SkewGeneralizedNormalDistribution.java#L206-L219 |
Bedework/bw-util | bw-util-xml/src/main/java/org/bedework/util/xml/XmlUtil.java | XmlUtil.getOneNodeVal | public static String getOneNodeVal(final Node el, final String name)
throws SAXException {
"""
Get the value of an element. We expect 0 or 1 child nodes.
For no child node we return null, for more than one we raise an
exception.
@param el Node whose value we want
@param name String name... | java | public static String getOneNodeVal(final Node el, final String name)
throws SAXException {
/* We expect one child of type text */
if (!el.hasChildNodes()) {
return null;
}
NodeList children = el.getChildNodes();
if (children.getLength() > 1){
throw new SAXException("Multiple prop... | [
"public",
"static",
"String",
"getOneNodeVal",
"(",
"final",
"Node",
"el",
",",
"final",
"String",
"name",
")",
"throws",
"SAXException",
"{",
"/* We expect one child of type text */",
"if",
"(",
"!",
"el",
".",
"hasChildNodes",
"(",
")",
")",
"{",
"return",
"... | Get the value of an element. We expect 0 or 1 child nodes.
For no child node we return null, for more than one we raise an
exception.
@param el Node whose value we want
@param name String name to make exception messages more readable
@return String node value or null
@throws SAXException | [
"Get",
"the",
"value",
"of",
"an",
"element",
".",
"We",
"expect",
"0",
"or",
"1",
"child",
"nodes",
".",
"For",
"no",
"child",
"node",
"we",
"return",
"null",
"for",
"more",
"than",
"one",
"we",
"raise",
"an",
"exception",
"."
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlUtil.java#L152-L167 |
zaproxy/zaproxy | src/org/parosproxy/paros/view/FindDialog.java | FindDialog.getDialog | public static FindDialog getDialog(Window parent, boolean modal) {
"""
Get the FindDialog for the parent if there is one or creates and returns a new one.
@param parent the parent Window (or Frame) for this FindDialog
@param modal a boolean indicating whether the FindDialog should ({@code true}),
or shouldn't... | java | public static FindDialog getDialog(Window parent, boolean modal) {
if (parent == null) {
throw new IllegalArgumentException("The parent must not be null.");
}
FindDialog activeDialog = getParentsMap().get(parent);
if (activeDialog != null) {
activeDialog.getTxtFind().requestFocus();
return act... | [
"public",
"static",
"FindDialog",
"getDialog",
"(",
"Window",
"parent",
",",
"boolean",
"modal",
")",
"{",
"if",
"(",
"parent",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The parent must not be null.\"",
")",
";",
"}",
"FindDialo... | Get the FindDialog for the parent if there is one or creates and returns a new one.
@param parent the parent Window (or Frame) for this FindDialog
@param modal a boolean indicating whether the FindDialog should ({@code true}),
or shouldn't ({@code false}) be modal.
@return The existing FindDialog for the parent (if th... | [
"Get",
"the",
"FindDialog",
"for",
"the",
"parent",
"if",
"there",
"is",
"one",
"or",
"creates",
"and",
"returns",
"a",
"new",
"one",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/FindDialog.java#L148-L167 |
JetBrains/xodus | openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java | EnvironmentConfig.setSetting | @Override
public EnvironmentConfig setSetting(@NotNull final String key, @NotNull final Object value) {
"""
Sets the value of the setting with the specified key.
@param key name of the setting
@param value the setting value
@return this {@code EnvironmentConfig} instance
"""
return (Environm... | java | @Override
public EnvironmentConfig setSetting(@NotNull final String key, @NotNull final Object value) {
return (EnvironmentConfig) super.setSetting(key, value);
} | [
"@",
"Override",
"public",
"EnvironmentConfig",
"setSetting",
"(",
"@",
"NotNull",
"final",
"String",
"key",
",",
"@",
"NotNull",
"final",
"Object",
"value",
")",
"{",
"return",
"(",
"EnvironmentConfig",
")",
"super",
".",
"setSetting",
"(",
"key",
",",
"val... | Sets the value of the setting with the specified key.
@param key name of the setting
@param value the setting value
@return this {@code EnvironmentConfig} instance | [
"Sets",
"the",
"value",
"of",
"the",
"setting",
"with",
"the",
"specified",
"key",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java#L674-L677 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Element.java | Element.getElementsByAttributeValueMatching | public Elements getElementsByAttributeValueMatching(String key, String regex) {
"""
Find elements that have attributes whose values match the supplied regular expression.
@param key name of the attribute
@param regex regular expression to match against attribute values. You can use <a href="http://java.sun.com/d... | java | public Elements getElementsByAttributeValueMatching(String key, String regex) {
Pattern pattern;
try {
pattern = Pattern.compile(regex);
} catch (PatternSyntaxException e) {
throw new IllegalArgumentException("Pattern syntax error: " + regex, e);
}
return ... | [
"public",
"Elements",
"getElementsByAttributeValueMatching",
"(",
"String",
"key",
",",
"String",
"regex",
")",
"{",
"Pattern",
"pattern",
";",
"try",
"{",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"regex",
")",
";",
"}",
"catch",
"(",
"PatternSyntaxExce... | Find elements that have attributes whose values match the supplied regular expression.
@param key name of the attribute
@param regex regular expression to match against attribute values. You can use <a href="http://java.sun.com/docs/books/tutorial/essential/regex/pattern.html#embedded">embedded flags</a> (such as (?i) ... | [
"Find",
"elements",
"that",
"have",
"attributes",
"whose",
"values",
"match",
"the",
"supplied",
"regular",
"expression",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Element.java#L928-L936 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java | SqlDateTimeUtils.fromUnixtime | public static String fromUnixtime(long unixtime, String format, TimeZone tz) {
"""
Convert unix timestamp (seconds since '1970-01-01 00:00:00' UTC) to datetime string
in the given format.
"""
SimpleDateFormat formatter = FORMATTER_CACHE.get(format);
formatter.setTimeZone(tz);
Date date = new Date(unixti... | java | public static String fromUnixtime(long unixtime, String format, TimeZone tz) {
SimpleDateFormat formatter = FORMATTER_CACHE.get(format);
formatter.setTimeZone(tz);
Date date = new Date(unixtime * 1000);
try {
return formatter.format(date);
} catch (Exception e) {
LOG.error("Exception when formatting.", ... | [
"public",
"static",
"String",
"fromUnixtime",
"(",
"long",
"unixtime",
",",
"String",
"format",
",",
"TimeZone",
"tz",
")",
"{",
"SimpleDateFormat",
"formatter",
"=",
"FORMATTER_CACHE",
".",
"get",
"(",
"format",
")",
";",
"formatter",
".",
"setTimeZone",
"(",... | Convert unix timestamp (seconds since '1970-01-01 00:00:00' UTC) to datetime string
in the given format. | [
"Convert",
"unix",
"timestamp",
"(",
"seconds",
"since",
"1970",
"-",
"01",
"-",
"01",
"00",
":",
"00",
":",
"00",
"UTC",
")",
"to",
"datetime",
"string",
"in",
"the",
"given",
"format",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L849-L859 |
wildfly-swarm-archive/ARCHIVE-wildfly-swarm | logging/api/src/main/java/org/wildfly/swarm/logging/LoggingFraction.java | LoggingFraction.rootLogger | public LoggingFraction rootLogger(Level level, String... handlers) {
"""
Add a root logger to this fraction
@param level the log level
@param handlers a list of handlers
@return this fraction
"""
rootLogger(new RootLogger().level(level)
.handlers(handlers));
return this;... | java | public LoggingFraction rootLogger(Level level, String... handlers) {
rootLogger(new RootLogger().level(level)
.handlers(handlers));
return this;
} | [
"public",
"LoggingFraction",
"rootLogger",
"(",
"Level",
"level",
",",
"String",
"...",
"handlers",
")",
"{",
"rootLogger",
"(",
"new",
"RootLogger",
"(",
")",
".",
"level",
"(",
"level",
")",
".",
"handlers",
"(",
"handlers",
")",
")",
";",
"return",
"t... | Add a root logger to this fraction
@param level the log level
@param handlers a list of handlers
@return this fraction | [
"Add",
"a",
"root",
"logger",
"to",
"this",
"fraction"
] | train | https://github.com/wildfly-swarm-archive/ARCHIVE-wildfly-swarm/blob/28ef71bcfa743a7267666e0ed2919c37b356c09b/logging/api/src/main/java/org/wildfly/swarm/logging/LoggingFraction.java#L303-L307 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java | AbstractRadial.setUserLedPosition | @Override
public void setUserLedPosition(final double X, final double Y) {
"""
Sets the position of the gauge user led to the given values
@param X
@param Y
"""
userLedPosition.setLocation(X, Y);
repaint(getInnerBounds());
} | java | @Override
public void setUserLedPosition(final double X, final double Y) {
userLedPosition.setLocation(X, Y);
repaint(getInnerBounds());
} | [
"@",
"Override",
"public",
"void",
"setUserLedPosition",
"(",
"final",
"double",
"X",
",",
"final",
"double",
"Y",
")",
"{",
"userLedPosition",
".",
"setLocation",
"(",
"X",
",",
"Y",
")",
";",
"repaint",
"(",
"getInnerBounds",
"(",
")",
")",
";",
"}"
] | Sets the position of the gauge user led to the given values
@param X
@param Y | [
"Sets",
"the",
"position",
"of",
"the",
"gauge",
"user",
"led",
"to",
"the",
"given",
"values"
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java#L461-L465 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.getFieldValues | public static List<Object> getFieldValues(Iterable<?> collection, final String fieldName) {
"""
获取给定Bean列表中指定字段名对应字段值的列表<br>
列表元素支持Bean与Map
@param collection Bean集合或Map集合
@param fieldName 字段名或map的键
@return 字段值列表
@since 3.1.0
"""
return getFieldValues(collection, fieldName, false);
} | java | public static List<Object> getFieldValues(Iterable<?> collection, final String fieldName) {
return getFieldValues(collection, fieldName, false);
} | [
"public",
"static",
"List",
"<",
"Object",
">",
"getFieldValues",
"(",
"Iterable",
"<",
"?",
">",
"collection",
",",
"final",
"String",
"fieldName",
")",
"{",
"return",
"getFieldValues",
"(",
"collection",
",",
"fieldName",
",",
"false",
")",
";",
"}"
] | 获取给定Bean列表中指定字段名对应字段值的列表<br>
列表元素支持Bean与Map
@param collection Bean集合或Map集合
@param fieldName 字段名或map的键
@return 字段值列表
@since 3.1.0 | [
"获取给定Bean列表中指定字段名对应字段值的列表<br",
">",
"列表元素支持Bean与Map"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1159-L1161 |
OpenLiberty/open-liberty | dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/ThreadPool.java | ThreadPool.workerDone | @Deprecated
protected synchronized void workerDone(Worker w, boolean taskDied) {
"""
Cleanup method called upon termination of worker thread.
@deprecated This will become private in a future release.
"""
threads_.remove(w);
if (taskDied) {
--activeThreads;
--poo... | java | @Deprecated
protected synchronized void workerDone(Worker w, boolean taskDied) {
threads_.remove(w);
if (taskDied) {
--activeThreads;
--poolSize_;
}
if (poolSize_ == 0 && shutdown_) {
maximumPoolSize_ = minimumPoolSize_ = 0; // disable new threa... | [
"@",
"Deprecated",
"protected",
"synchronized",
"void",
"workerDone",
"(",
"Worker",
"w",
",",
"boolean",
"taskDied",
")",
"{",
"threads_",
".",
"remove",
"(",
"w",
")",
";",
"if",
"(",
"taskDied",
")",
"{",
"--",
"activeThreads",
";",
"--",
"poolSize_",
... | Cleanup method called upon termination of worker thread.
@deprecated This will become private in a future release. | [
"Cleanup",
"method",
"called",
"upon",
"termination",
"of",
"worker",
"thread",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/ThreadPool.java#L837-L853 |
banq/jdonframework | src/main/java/com/jdon/util/UtilDateTime.java | UtilDateTime.toSqlTime | public static java.sql.Time toSqlTime(String hourStr, String minuteStr, String secondStr) {
"""
Makes a java.sql.Time from separate Strings for hour, minute, and second.
@param hourStr
The hour String
@param minuteStr
The minute String
@param secondStr
The second String
@return A java.sql.Time made from s... | java | public static java.sql.Time toSqlTime(String hourStr, String minuteStr, String secondStr) {
java.util.Date newDate = toDate("0", "0", "0", hourStr, minuteStr, secondStr);
if (newDate != null)
return new java.sql.Time(newDate.getTime());
else
return null;
} | [
"public",
"static",
"java",
".",
"sql",
".",
"Time",
"toSqlTime",
"(",
"String",
"hourStr",
",",
"String",
"minuteStr",
",",
"String",
"secondStr",
")",
"{",
"java",
".",
"util",
".",
"Date",
"newDate",
"=",
"toDate",
"(",
"\"0\"",
",",
"\"0\"",
",",
"... | Makes a java.sql.Time from separate Strings for hour, minute, and second.
@param hourStr
The hour String
@param minuteStr
The minute String
@param secondStr
The second String
@return A java.sql.Time made from separate Strings for hour, minute, and
second. | [
"Makes",
"a",
"java",
".",
"sql",
".",
"Time",
"from",
"separate",
"Strings",
"for",
"hour",
"minute",
"and",
"second",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/UtilDateTime.java#L174-L181 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/icon/Icon.java | Icon.from | public static Icon from(Item item, int metadata) {
"""
Gets a {@link Icon} for the texture used for the {@link Item}
@param item the item
@return the malisis icon
"""
Pair<Item, Integer> p = Pair.of(item, metadata);
if (vanillaIcons.get(p) != null)
return vanillaIcons.get(p);
VanillaIcon icon = n... | java | public static Icon from(Item item, int metadata)
{
Pair<Item, Integer> p = Pair.of(item, metadata);
if (vanillaIcons.get(p) != null)
return vanillaIcons.get(p);
VanillaIcon icon = new VanillaIcon(item, metadata);
vanillaIcons.put(p, icon);
return icon;
} | [
"public",
"static",
"Icon",
"from",
"(",
"Item",
"item",
",",
"int",
"metadata",
")",
"{",
"Pair",
"<",
"Item",
",",
"Integer",
">",
"p",
"=",
"Pair",
".",
"of",
"(",
"item",
",",
"metadata",
")",
";",
"if",
"(",
"vanillaIcons",
".",
"get",
"(",
... | Gets a {@link Icon} for the texture used for the {@link Item}
@param item the item
@return the malisis icon | [
"Gets",
"a",
"{",
"@link",
"Icon",
"}",
"for",
"the",
"texture",
"used",
"for",
"the",
"{",
"@link",
"Item",
"}"
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/icon/Icon.java#L512-L521 |
OpenLiberty/open-liberty | dev/com.ibm.ws.concurrent.mp.1.0/src/com/ibm/ws/concurrent/mp/MPConfigAccessorImpl.java | MPConfigAccessorImpl.get | @Override
@SuppressWarnings("unchecked")
public <T> T get(Object config, String name, T defaultValue) {
"""
Reads a String[] or Integer property value from MicroProfile Config.
@param config instance of org.eclipse.microprofile.config.Config.
@param name config property name.
@param defaultValue value... | java | @Override
@SuppressWarnings("unchecked")
public <T> T get(Object config, String name, T defaultValue) {
Class<?> cl = defaultValue == null || defaultValue instanceof Set ? String[].class : defaultValue.getClass();
Optional<T> configuredValue = (Optional<T>) ((Config) config).getOptionalValue(nam... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"get",
"(",
"Object",
"config",
",",
"String",
"name",
",",
"T",
"defaultValue",
")",
"{",
"Class",
"<",
"?",
">",
"cl",
"=",
"defaultValue",
"==",
"null... | Reads a String[] or Integer property value from MicroProfile Config.
@param config instance of org.eclipse.microprofile.config.Config.
@param name config property name.
@param defaultValue value to use if a config property with the specified name is not found.
@return value from MicroProfile Config. Otherwise the defa... | [
"Reads",
"a",
"String",
"[]",
"or",
"Integer",
"property",
"value",
"from",
"MicroProfile",
"Config",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent.mp.1.0/src/com/ibm/ws/concurrent/mp/MPConfigAccessorImpl.java#L42-L67 |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/iter/Util.java | Util.countInPeriod | static int countInPeriod(Weekday dow, Weekday dow0, int nDays) {
"""
the number of occurences of dow in a period nDays long where the first day
of the period has day of week dow0.
"""
// Two cases
// (1a) dow >= dow0: count === (nDays - (dow - dow0)) / 7
// (1b) dow < dow0: coun... | java | static int countInPeriod(Weekday dow, Weekday dow0, int nDays) {
// Two cases
// (1a) dow >= dow0: count === (nDays - (dow - dow0)) / 7
// (1b) dow < dow0: count === (nDays - (7 - dow0 - dow)) / 7
if (dow.javaDayNum >= dow0.javaDayNum) {
return 1 + ((nDays - (dow.javaD... | [
"static",
"int",
"countInPeriod",
"(",
"Weekday",
"dow",
",",
"Weekday",
"dow0",
",",
"int",
"nDays",
")",
"{",
"// Two cases",
"// (1a) dow >= dow0: count === (nDays - (dow - dow0)) / 7",
"// (1b) dow < dow0: count === (nDays - (7 - dow0 - dow)) / 7",
"if",
"(",
"dow",
... | the number of occurences of dow in a period nDays long where the first day
of the period has day of week dow0. | [
"the",
"number",
"of",
"occurences",
"of",
"dow",
"in",
"a",
"period",
"nDays",
"long",
"where",
"the",
"first",
"day",
"of",
"the",
"period",
"has",
"day",
"of",
"week",
"dow0",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/iter/Util.java#L135-L144 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.localGoto | public void localGoto(String name, float llx, float lly, float urx, float ury) {
"""
Implements a link to other part of the document. The jump will
be made to a local destination with the same name, that must exist.
@param name the name for this link
@param llx the lower left x corner of the activation area
@p... | java | public void localGoto(String name, float llx, float lly, float urx, float ury) {
pdf.localGoto(name, llx, lly, urx, ury);
} | [
"public",
"void",
"localGoto",
"(",
"String",
"name",
",",
"float",
"llx",
",",
"float",
"lly",
",",
"float",
"urx",
",",
"float",
"ury",
")",
"{",
"pdf",
".",
"localGoto",
"(",
"name",
",",
"llx",
",",
"lly",
",",
"urx",
",",
"ury",
")",
";",
"}... | Implements a link to other part of the document. The jump will
be made to a local destination with the same name, that must exist.
@param name the name for this link
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of... | [
"Implements",
"a",
"link",
"to",
"other",
"part",
"of",
"the",
"document",
".",
"The",
"jump",
"will",
"be",
"made",
"to",
"a",
"local",
"destination",
"with",
"the",
"same",
"name",
"that",
"must",
"exist",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L2525-L2527 |
Harium/keel | src/main/java/com/harium/keel/effect/helper/Curve.java | Curve.Spline | public static float Spline(float x, int numKnots, int[] xknots, int[] yknots) {
"""
compute a Catmull-Rom spline, but with variable knot spacing.
@param x the input parameter
@param numKnots the number of knots in the spline
@param xknots the array of knot x values
@param yknots the array of knot ... | java | public static float Spline(float x, int numKnots, int[] xknots, int[] yknots) {
int span;
int numSpans = numKnots - 3;
float k0, k1, k2, k3;
float c0, c1, c2, c3;
if (numSpans < 1)
throw new IllegalArgumentException("Too few knots in spline");
for (span = 0;... | [
"public",
"static",
"float",
"Spline",
"(",
"float",
"x",
",",
"int",
"numKnots",
",",
"int",
"[",
"]",
"xknots",
",",
"int",
"[",
"]",
"yknots",
")",
"{",
"int",
"span",
";",
"int",
"numSpans",
"=",
"numKnots",
"-",
"3",
";",
"float",
"k0",
",",
... | compute a Catmull-Rom spline, but with variable knot spacing.
@param x the input parameter
@param numKnots the number of knots in the spline
@param xknots the array of knot x values
@param yknots the array of knot y values
@return the spline value | [
"compute",
"a",
"Catmull",
"-",
"Rom",
"spline",
"but",
"with",
"variable",
"knot",
"spacing",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/helper/Curve.java#L278-L310 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasActivationUtils.java | KerasActivationUtils.getActivationFromConfig | public static Activation getActivationFromConfig(Map<String, Object> layerConfig, KerasLayerConfiguration conf)
throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
"""
Get activation enum value from Keras layer configuration.
@param layerConfig dictionary containing K... | java | public static Activation getActivationFromConfig(Map<String, Object> layerConfig, KerasLayerConfiguration conf)
throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
... | [
"public",
"static",
"Activation",
"getActivationFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
",",
"KerasLayerConfiguration",
"conf",
")",
"throws",
"InvalidKerasConfigurationException",
",",
"UnsupportedKerasConfigurationException",
"{",
"Map",... | Get activation enum value from Keras layer configuration.
@param layerConfig dictionary containing Keras layer configuration
@return DL4J activation enum value
@throws InvalidKerasConfigurationException Invalid Keras config
@throws UnsupportedKerasConfigurationException Unsupported Keras config | [
"Get",
"activation",
"enum",
"value",
"from",
"Keras",
"layer",
"configuration",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasActivationUtils.java#L108-L115 |
alkacon/opencms-core | src/org/opencms/jsp/decorator/CmsHtmlDecorator.java | CmsHtmlDecorator.mustDecode | private boolean mustDecode(String word, List<String> wordList, int count) {
"""
Checks if a word must be decoded.<p>
The given word is compared to a negative list of words which must not be decoded.<p>
@param word the word to test
@param wordList the list of words which must not be decoded
@param count the... | java | private boolean mustDecode(String word, List<String> wordList, int count) {
boolean decode = true;
String nextWord = null;
if (count < (wordList.size() - 1)) {
nextWord = wordList.get(count + 1);
}
// test if the current word contains a "&" and the following with a ... | [
"private",
"boolean",
"mustDecode",
"(",
"String",
"word",
",",
"List",
"<",
"String",
">",
"wordList",
",",
"int",
"count",
")",
"{",
"boolean",
"decode",
"=",
"true",
";",
"String",
"nextWord",
"=",
"null",
";",
"if",
"(",
"count",
"<",
"(",
"wordLis... | Checks if a word must be decoded.<p>
The given word is compared to a negative list of words which must not be decoded.<p>
@param word the word to test
@param wordList the list of words which must not be decoded
@param count the count in the list
@return true if the word must be decoded, false otherweise | [
"Checks",
"if",
"a",
"word",
"must",
"be",
"decoded",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/decorator/CmsHtmlDecorator.java#L483-L505 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/util/pathfinding/AStarPathFinder.java | AStarPathFinder.getMovementCost | public float getMovementCost(Mover mover, int sx, int sy, int tx, int ty) {
"""
Get the cost to move through a given location
@param mover The entity that is being moved
@param sx The x coordinate of the tile whose cost is being determined
@param sy The y coordiante of the tile whose cost is being determined
... | java | public float getMovementCost(Mover mover, int sx, int sy, int tx, int ty) {
this.mover = mover;
this.sourceX = sx;
this.sourceY = sy;
return map.getCost(this, tx, ty);
} | [
"public",
"float",
"getMovementCost",
"(",
"Mover",
"mover",
",",
"int",
"sx",
",",
"int",
"sy",
",",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"this",
".",
"mover",
"=",
"mover",
";",
"this",
".",
"sourceX",
"=",
"sx",
";",
"this",
".",
"sourceY",
... | Get the cost to move through a given location
@param mover The entity that is being moved
@param sx The x coordinate of the tile whose cost is being determined
@param sy The y coordiante of the tile whose cost is being determined
@param tx The x coordinate of the target location
@param ty The y coordinate of the targe... | [
"Get",
"the",
"cost",
"to",
"move",
"through",
"a",
"given",
"location"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/util/pathfinding/AStarPathFinder.java#L340-L346 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCClob.java | JDBCClob.getCharacterStream | public Reader getCharacterStream(long pos,
long length) throws SQLException {
"""
Returns a <code>Reader</code> object that contains a partial <code>Clob</code> value, starting
with the character specified by pos, which is length characters in length.
@param pos the offset ... | java | public Reader getCharacterStream(long pos,
long length) throws SQLException {
if (length > Integer.MAX_VALUE) {
throw Util.outOfRangeArgument("length: " + length);
}
return new StringReader(getSubString(pos, (int) length));
} | [
"public",
"Reader",
"getCharacterStream",
"(",
"long",
"pos",
",",
"long",
"length",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"length",
">",
"Integer",
".",
"MAX_VALUE",
")",
"{",
"throw",
"Util",
".",
"outOfRangeArgument",
"(",
"\"length: \"",
"+",
"l... | Returns a <code>Reader</code> object that contains a partial <code>Clob</code> value, starting
with the character specified by pos, which is length characters in length.
@param pos the offset to the first character of the partial value to
be retrieved. The first character in the Clob is at position 1.
@param length t... | [
"Returns",
"a",
"<code",
">",
"Reader<",
"/",
"code",
">",
"object",
"that",
"contains",
"a",
"partial",
"<code",
">",
"Clob<",
"/",
"code",
">",
"value",
"starting",
"with",
"the",
"character",
"specified",
"by",
"pos",
"which",
"is",
"length",
"character... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCClob.java#L863-L871 |
intuit/QuickBooks-V3-Java-SDK | oauth2-platform-api/src/main/java/com/intuit/oauth2/client/DiscoveryAPIClient.java | DiscoveryAPIClient.callDiscoveryAPI | public DiscoveryAPIResponse callDiscoveryAPI(Environment environment) throws ConnectionException {
"""
Calls the Discovery Document API based on the the Environment provided and
returns an object with url’s for all the endpoints
@param environment
@return
@throws ConnectionException
"""
logger.debug("... | java | public DiscoveryAPIResponse callDiscoveryAPI(Environment environment) throws ConnectionException {
logger.debug("Enter DiscoveryAPIClient::callDiscoveryAPI");
try {
HttpRequestClient client = new HttpRequestClient(proxyConfig);
Request request = new Request.RequestBuilder(MethodType.GET, getDiscoveryAPIH... | [
"public",
"DiscoveryAPIResponse",
"callDiscoveryAPI",
"(",
"Environment",
"environment",
")",
"throws",
"ConnectionException",
"{",
"logger",
".",
"debug",
"(",
"\"Enter DiscoveryAPIClient::callDiscoveryAPI\"",
")",
";",
"try",
"{",
"HttpRequestClient",
"client",
"=",
"ne... | Calls the Discovery Document API based on the the Environment provided and
returns an object with url’s for all the endpoints
@param environment
@return
@throws ConnectionException | [
"Calls",
"the",
"Discovery",
"Document",
"API",
"based",
"on",
"the",
"the",
"Environment",
"provided",
"and",
"returns",
"an",
"object",
"with",
"url’s",
"for",
"all",
"the",
"endpoints"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/oauth2-platform-api/src/main/java/com/intuit/oauth2/client/DiscoveryAPIClient.java#L66-L92 |
google/error-prone | check_api/src/main/java/com/google/errorprone/util/FindIdentifiers.java | FindIdentifiers.findIdent | @Nullable
public static Symbol findIdent(String name, VisitorState state, KindSelector kind) {
"""
Finds a declaration with the given name and type that is in scope at the current location.
"""
ClassType enclosingClass = ASTHelpers.getType(state.findEnclosing(ClassTree.class));
if (enclosingClass == ... | java | @Nullable
public static Symbol findIdent(String name, VisitorState state, KindSelector kind) {
ClassType enclosingClass = ASTHelpers.getType(state.findEnclosing(ClassTree.class));
if (enclosingClass == null || enclosingClass.tsym == null) {
return null;
}
Env<AttrContext> env = Enter.instance(st... | [
"@",
"Nullable",
"public",
"static",
"Symbol",
"findIdent",
"(",
"String",
"name",
",",
"VisitorState",
"state",
",",
"KindSelector",
"kind",
")",
"{",
"ClassType",
"enclosingClass",
"=",
"ASTHelpers",
".",
"getType",
"(",
"state",
".",
"findEnclosing",
"(",
"... | Finds a declaration with the given name and type that is in scope at the current location. | [
"Finds",
"a",
"declaration",
"with",
"the",
"given",
"name",
"and",
"type",
"that",
"is",
"in",
"scope",
"at",
"the",
"current",
"location",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/FindIdentifiers.java#L85-L106 |
molgenis/molgenis | molgenis-data/src/main/java/org/molgenis/data/populate/IdGeneratorImpl.java | IdGeneratorImpl.generateRandomBytes | private byte[] generateRandomBytes(int nBytes, Random random) {
"""
Generates a number of random bytes.
<p>The chance of collisions of k IDs taken from a population of N possibilities is <code>
1 - Math.exp(-0.5 * k * (k - 1) / N)</code>
<p>A couple collision chances for 5 bytes <code>N = 256^5</code>:
<... | java | private byte[] generateRandomBytes(int nBytes, Random random) {
byte[] randomBytes = new byte[nBytes];
random.nextBytes(randomBytes);
return randomBytes;
} | [
"private",
"byte",
"[",
"]",
"generateRandomBytes",
"(",
"int",
"nBytes",
",",
"Random",
"random",
")",
"{",
"byte",
"[",
"]",
"randomBytes",
"=",
"new",
"byte",
"[",
"nBytes",
"]",
";",
"random",
".",
"nextBytes",
"(",
"randomBytes",
")",
";",
"return",... | Generates a number of random bytes.
<p>The chance of collisions of k IDs taken from a population of N possibilities is <code>
1 - Math.exp(-0.5 * k * (k - 1) / N)</code>
<p>A couple collision chances for 5 bytes <code>N = 256^5</code>:
<table>
<tr><td> 1 </td><td> 0.0 </td></tr>
<tr><td> 10 </td><td> 4.0927261579781... | [
"Generates",
"a",
"number",
"of",
"random",
"bytes",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data/src/main/java/org/molgenis/data/populate/IdGeneratorImpl.java#L70-L74 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/expressions/Expressions.java | Expressions.isGreaterThan | public static IsGreaterThan isGreaterThan(ComparableExpression<Number> left, ComparableExpression<Number> right) {
"""
Creates an IsGreaterThan expression from the given expressions.
@param left The left expression.
@param right The right expression.
@return A new IsGreaterThan binary expression.
"""
... | java | public static IsGreaterThan isGreaterThan(ComparableExpression<Number> left, ComparableExpression<Number> right) {
return new IsGreaterThan(left, right);
} | [
"public",
"static",
"IsGreaterThan",
"isGreaterThan",
"(",
"ComparableExpression",
"<",
"Number",
">",
"left",
",",
"ComparableExpression",
"<",
"Number",
">",
"right",
")",
"{",
"return",
"new",
"IsGreaterThan",
"(",
"left",
",",
"right",
")",
";",
"}"
] | Creates an IsGreaterThan expression from the given expressions.
@param left The left expression.
@param right The right expression.
@return A new IsGreaterThan binary expression. | [
"Creates",
"an",
"IsGreaterThan",
"expression",
"from",
"the",
"given",
"expressions",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/expressions/Expressions.java#L241-L243 |
derari/cthul | matchers/src/main/java/org/cthul/proc/ProcBase.java | ProcBase.assertArgCount | protected void assertArgCount(Object[] args, int count) {
"""
Throws a ProcError exception if {@code args.length != count}
@param args
@param count
"""
if (args.length != count) {
throw illegalArgumentException(String.format(
"Wrong number of arguments, expected %d ... | java | protected void assertArgCount(Object[] args, int count) {
if (args.length != count) {
throw illegalArgumentException(String.format(
"Wrong number of arguments, expected %d got %d",
count, args.length));
}
} | [
"protected",
"void",
"assertArgCount",
"(",
"Object",
"[",
"]",
"args",
",",
"int",
"count",
")",
"{",
"if",
"(",
"args",
".",
"length",
"!=",
"count",
")",
"{",
"throw",
"illegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Wrong number of argum... | Throws a ProcError exception if {@code args.length != count}
@param args
@param count | [
"Throws",
"a",
"ProcError",
"exception",
"if",
"{"
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/proc/ProcBase.java#L87-L93 |
coursera/courier | generator-api/src/main/java/org/coursera/courier/api/FileFormatDataSchemaParser.java | FileFormatDataSchemaParser.validateSchemaWithFilePath | private void validateSchemaWithFilePath(File schemaSourceFile, DataSchema schema) {
"""
Checks that the schema name and namespace match the file name and path. These must match for FileDataSchemaResolver to find a schema pdscs by fully qualified name.
"""
if (schemaSourceFile != null && schemaSourceFile.i... | java | private void validateSchemaWithFilePath(File schemaSourceFile, DataSchema schema)
{
if (schemaSourceFile != null && schemaSourceFile.isFile() && schema instanceof NamedDataSchema)
{
final NamedDataSchema namedDataSchema = (NamedDataSchema) schema;
final String namespace = namedDataSchema.getNamesp... | [
"private",
"void",
"validateSchemaWithFilePath",
"(",
"File",
"schemaSourceFile",
",",
"DataSchema",
"schema",
")",
"{",
"if",
"(",
"schemaSourceFile",
"!=",
"null",
"&&",
"schemaSourceFile",
".",
"isFile",
"(",
")",
"&&",
"schema",
"instanceof",
"NamedDataSchema",
... | Checks that the schema name and namespace match the file name and path. These must match for FileDataSchemaResolver to find a schema pdscs by fully qualified name. | [
"Checks",
"that",
"the",
"schema",
"name",
"and",
"namespace",
"match",
"the",
"file",
"name",
"and",
"path",
".",
"These",
"must",
"match",
"for",
"FileDataSchemaResolver",
"to",
"find",
"a",
"schema",
"pdscs",
"by",
"fully",
"qualified",
"name",
"."
] | train | https://github.com/coursera/courier/blob/749674fa7ee33804ad11b6c8ecb560f455cb4c22/generator-api/src/main/java/org/coursera/courier/api/FileFormatDataSchemaParser.java#L195-L215 |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShell.java | PowerShell.executeCommand | public PowerShellResponse executeCommand(String command) {
"""
Execute a PowerShell command.
<p>
This method launch a thread which will be executed in the already created
PowerShell console context
@param command the command to call. Ex: dir
@return PowerShellResponse the information returned by powerShell
... | java | public PowerShellResponse executeCommand(String command) {
String commandOutput = "";
boolean isError = false;
boolean timeout = false;
checkState();
PowerShellCommandProcessor commandProcessor = new PowerShellCommandProcessor("standard", p.getInputStream(),
thi... | [
"public",
"PowerShellResponse",
"executeCommand",
"(",
"String",
"command",
")",
"{",
"String",
"commandOutput",
"=",
"\"\"",
";",
"boolean",
"isError",
"=",
"false",
";",
"boolean",
"timeout",
"=",
"false",
";",
"checkState",
"(",
")",
";",
"PowerShellCommandPr... | Execute a PowerShell command.
<p>
This method launch a thread which will be executed in the already created
PowerShell console context
@param command the command to call. Ex: dir
@return PowerShellResponse the information returned by powerShell | [
"Execute",
"a",
"PowerShell",
"command",
".",
"<p",
">",
"This",
"method",
"launch",
"a",
"thread",
"which",
"will",
"be",
"executed",
"in",
"the",
"already",
"created",
"PowerShell",
"console",
"context"
] | train | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L186-L222 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java | NetworkInterfacesInner.getByResourceGroup | public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName) {
"""
Gets information about the specified network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interface.
@throws IllegalArgumentEx... | java | public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body();
} | [
"public",
"NetworkInterfaceInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkInterfaceName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkInterfaceName",
")",
".",
"toBlocking",
... | Gets information about the specified network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interface.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@t... | [
"Gets",
"information",
"about",
"the",
"specified",
"network",
"interface",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L326-L328 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/GV/SepaUtil.java | SepaUtil.insertIndex | public static String insertIndex(String key, Integer index) {
"""
Fuegt einen Index in den Property-Key ein. Wurde kein Index angegeben, wird der Key
unveraendert zurueckgeliefert.
@param key Key, der mit einem Index ergaenzt werden soll
@param index Index oder {@code null}, wenn kein Index gesetzt werden s... | java | public static String insertIndex(String key, Integer index) {
if (index == null)
return key;
int pos = key.indexOf('.');
if (pos >= 0) {
return key.substring(0, pos) + '[' + index + ']' + key.substring(pos);
} else {
return key + '[' + index + ']';
... | [
"public",
"static",
"String",
"insertIndex",
"(",
"String",
"key",
",",
"Integer",
"index",
")",
"{",
"if",
"(",
"index",
"==",
"null",
")",
"return",
"key",
";",
"int",
"pos",
"=",
"key",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"pos",
... | Fuegt einen Index in den Property-Key ein. Wurde kein Index angegeben, wird der Key
unveraendert zurueckgeliefert.
@param key Key, der mit einem Index ergaenzt werden soll
@param index Index oder {@code null}, wenn kein Index gesetzt werden soll
@return Key mit Index | [
"Fuegt",
"einen",
"Index",
"in",
"den",
"Property",
"-",
"Key",
"ein",
".",
"Wurde",
"kein",
"Index",
"angegeben",
"wird",
"der",
"Key",
"unveraendert",
"zurueckgeliefert",
"."
] | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/SepaUtil.java#L153-L163 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsLinkManager.java | CmsLinkManager.substituteLinkForRootPath | public String substituteLinkForRootPath(CmsObject cms, String rootPath) {
"""
Returns a link <i>from</i> the URI stored in the provided OpenCms user context
<i>to</i> the VFS resource indicated by the given root path, for use on web pages.<p>
The result will contain the configured context path and
servlet nam... | java | public String substituteLinkForRootPath(CmsObject cms, String rootPath) {
String siteRoot = OpenCms.getSiteManager().getSiteRoot(rootPath);
if (siteRoot == null) {
// use current site root in case no valid site root is available
// this will also be the case if a "/system" link ... | [
"public",
"String",
"substituteLinkForRootPath",
"(",
"CmsObject",
"cms",
",",
"String",
"rootPath",
")",
"{",
"String",
"siteRoot",
"=",
"OpenCms",
".",
"getSiteManager",
"(",
")",
".",
"getSiteRoot",
"(",
"rootPath",
")",
";",
"if",
"(",
"siteRoot",
"==",
... | Returns a link <i>from</i> the URI stored in the provided OpenCms user context
<i>to</i> the VFS resource indicated by the given root path, for use on web pages.<p>
The result will contain the configured context path and
servlet name, and in the case of the "online" project it will also be rewritten according to
to th... | [
"Returns",
"a",
"link",
"<i",
">",
"from<",
"/",
"i",
">",
"the",
"URI",
"stored",
"in",
"the",
"provided",
"OpenCms",
"user",
"context",
"<i",
">",
"to<",
"/",
"i",
">",
"the",
"VFS",
"resource",
"indicated",
"by",
"the",
"given",
"root",
"path",
"f... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsLinkManager.java#L830-L846 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/nikefs2/NikeFS2BlockProvider.java | NikeFS2BlockProvider.allocateBlock | public synchronized NikeFS2Block allocateBlock() {
"""
Allocates a new block from this block provider.
@return A newly allocated block from this provider.
May return <code>null</code>, if no free blocks are
currently available.
"""
// look for free block, i.e. first block whose index
// bit is set to ... | java | public synchronized NikeFS2Block allocateBlock() {
// look for free block, i.e. first block whose index
// bit is set to true in the allocation map.
int freeBlockIndex = blockAllocationMap.nextSetBit(0);
if(freeBlockIndex < 0) {
// no free blocks left in this provider.
return null;
} else {
// set in... | [
"public",
"synchronized",
"NikeFS2Block",
"allocateBlock",
"(",
")",
"{",
"// look for free block, i.e. first block whose index",
"// bit is set to true in the allocation map.",
"int",
"freeBlockIndex",
"=",
"blockAllocationMap",
".",
"nextSetBit",
"(",
"0",
")",
";",
"if",
"... | Allocates a new block from this block provider.
@return A newly allocated block from this provider.
May return <code>null</code>, if no free blocks are
currently available. | [
"Allocates",
"a",
"new",
"block",
"from",
"this",
"block",
"provider",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/nikefs2/NikeFS2BlockProvider.java#L189-L202 |
apache/incubator-druid | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java | SupervisorManager.possiblySuspendOrResumeSupervisorInternal | private boolean possiblySuspendOrResumeSupervisorInternal(String id, boolean suspend) {
"""
Suspend or resume a supervisor with a given id.
<p/>
Caller should have acquired [lock] before invoking this method to avoid contention with other threads that may be
starting, stopping, suspending and resuming superviso... | java | private boolean possiblySuspendOrResumeSupervisorInternal(String id, boolean suspend)
{
Pair<Supervisor, SupervisorSpec> pair = supervisors.get(id);
if (pair == null || pair.rhs.isSuspended() == suspend) {
return false;
}
SupervisorSpec nextState = suspend ? pair.rhs.createSuspendedSpec() : pai... | [
"private",
"boolean",
"possiblySuspendOrResumeSupervisorInternal",
"(",
"String",
"id",
",",
"boolean",
"suspend",
")",
"{",
"Pair",
"<",
"Supervisor",
",",
"SupervisorSpec",
">",
"pair",
"=",
"supervisors",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"pair",
... | Suspend or resume a supervisor with a given id.
<p/>
Caller should have acquired [lock] before invoking this method to avoid contention with other threads that may be
starting, stopping, suspending and resuming supervisors.
@return true if a supervisor was suspended or resumed, false if there was no supervisor with th... | [
"Suspend",
"or",
"resume",
"a",
"supervisor",
"with",
"a",
"given",
"id",
".",
"<p",
"/",
">",
"Caller",
"should",
"have",
"acquired",
"[",
"lock",
"]",
"before",
"invoking",
"this",
"method",
"to",
"avoid",
"contention",
"with",
"other",
"threads",
"that"... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java#L263-L273 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.containsKey | public static boolean containsKey(@Nullable Bundle bundle, @Nullable String key) {
"""
Checks if the bundle contains a specified key or not.
If bundle is null, this method will return false;
@param bundle a bundle.
@param key a key.
@return true if bundle is not null and the key exists in the bundle, false oth... | java | public static boolean containsKey(@Nullable Bundle bundle, @Nullable String key) {
return bundle != null && bundle.containsKey(key);
} | [
"public",
"static",
"boolean",
"containsKey",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
")",
"{",
"return",
"bundle",
"!=",
"null",
"&&",
"bundle",
".",
"containsKey",
"(",
"key",
")",
";",
"}"
] | Checks if the bundle contains a specified key or not.
If bundle is null, this method will return false;
@param bundle a bundle.
@param key a key.
@return true if bundle is not null and the key exists in the bundle, false otherwise.
@see android.os.Bundle#containsKey(String) | [
"Checks",
"if",
"the",
"bundle",
"contains",
"a",
"specified",
"key",
"or",
"not",
".",
"If",
"bundle",
"is",
"null",
"this",
"method",
"will",
"return",
"false",
";"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L1079-L1081 |
aws/aws-sdk-java | aws-java-sdk-amplify/src/main/java/com/amazonaws/services/amplify/model/Branch.java | Branch.withEnvironmentVariables | public Branch withEnvironmentVariables(java.util.Map<String, String> environmentVariables) {
"""
<p>
Environment Variables specific to a branch, part of an Amplify App.
</p>
@param environmentVariables
Environment Variables specific to a branch, part of an Amplify App.
@return Returns a reference to this ob... | java | public Branch withEnvironmentVariables(java.util.Map<String, String> environmentVariables) {
setEnvironmentVariables(environmentVariables);
return this;
} | [
"public",
"Branch",
"withEnvironmentVariables",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"environmentVariables",
")",
"{",
"setEnvironmentVariables",
"(",
"environmentVariables",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Environment Variables specific to a branch, part of an Amplify App.
</p>
@param environmentVariables
Environment Variables specific to a branch, part of an Amplify App.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Environment",
"Variables",
"specific",
"to",
"a",
"branch",
"part",
"of",
"an",
"Amplify",
"App",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-amplify/src/main/java/com/amazonaws/services/amplify/model/Branch.java#L599-L602 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.listSubscriptions | public PubsubFuture<SubscriptionList> listSubscriptions(final String project,
final String pageToken) {
"""
Get a page of Pub/Sub subscriptions in a project using a specified page token.
@param project The Google Cloud project.
@param pageToken A toke... | java | public PubsubFuture<SubscriptionList> listSubscriptions(final String project,
final String pageToken) {
final String query = (pageToken == null) ? "" : "?pageToken=" + pageToken;
final String path = "projects/" + project + "/subscriptions" + query;
r... | [
"public",
"PubsubFuture",
"<",
"SubscriptionList",
">",
"listSubscriptions",
"(",
"final",
"String",
"project",
",",
"final",
"String",
"pageToken",
")",
"{",
"final",
"String",
"query",
"=",
"(",
"pageToken",
"==",
"null",
")",
"?",
"\"\"",
":",
"\"?pageToken... | Get a page of Pub/Sub subscriptions in a project using a specified page token.
@param project The Google Cloud project.
@param pageToken A token for the page of subscriptions to get.
@return A future that is completed when this request is completed. | [
"Get",
"a",
"page",
"of",
"Pub",
"/",
"Sub",
"subscriptions",
"in",
"a",
"project",
"using",
"a",
"specified",
"page",
"token",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L381-L386 |
ktoso/janbanery | janbanery-core/src/main/java/pl/project13/janbanery/config/auth/Base64Coder.java | Base64Coder.decodeLines | public static byte[] decodeLines(String s) {
"""
Decodes a byte array from Base64 format and ignores line separators, tabs and blanks.
CR, LF, Tab and Space characters are ignored in the input data.
This method is compatible with <code>sun.misc.BASE64Decoder.decodeBuffer(String)</code>.
@param s A Base64 Stri... | java | public static byte[] decodeLines(String s) {
char[] buf = new char[s.length()];
int p = 0;
for (int ip = 0; ip < s.length(); ip++) {
char c = s.charAt(ip);
if (c != ' ' && c != '\r' && c != '\n' && c != '\t') {
buf[p++] = c;
}
}
return decode(buf, 0, p);
} | [
"public",
"static",
"byte",
"[",
"]",
"decodeLines",
"(",
"String",
"s",
")",
"{",
"char",
"[",
"]",
"buf",
"=",
"new",
"char",
"[",
"s",
".",
"length",
"(",
")",
"]",
";",
"int",
"p",
"=",
"0",
";",
"for",
"(",
"int",
"ip",
"=",
"0",
";",
... | Decodes a byte array from Base64 format and ignores line separators, tabs and blanks.
CR, LF, Tab and Space characters are ignored in the input data.
This method is compatible with <code>sun.misc.BASE64Decoder.decodeBuffer(String)</code>.
@param s A Base64 String to be decoded.
@return An array containing the decoded ... | [
"Decodes",
"a",
"byte",
"array",
"from",
"Base64",
"format",
"and",
"ignores",
"line",
"separators",
"tabs",
"and",
"blanks",
".",
"CR",
"LF",
"Tab",
"and",
"Space",
"characters",
"are",
"ignored",
"in",
"the",
"input",
"data",
".",
"This",
"method",
"is",... | train | https://github.com/ktoso/janbanery/blob/cd77b774814c7fbb2a0c9c55d4c3f7e76affa636/janbanery-core/src/main/java/pl/project13/janbanery/config/auth/Base64Coder.java#L193-L203 |
apereo/cas | support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/util/OAuth20Utils.java | OAuth20Utils.isAuthorizedGrantTypeForService | public static boolean isAuthorizedGrantTypeForService(final J2EContext context, final OAuthRegisteredService registeredService) {
"""
Is authorized grant type for service?
@param context the context
@param registeredService the registered service
@return true/false
"""
return isAuthorize... | java | public static boolean isAuthorizedGrantTypeForService(final J2EContext context, final OAuthRegisteredService registeredService) {
return isAuthorizedGrantTypeForService(
context.getRequestParameter(OAuth20Constants.GRANT_TYPE),
registeredService);
} | [
"public",
"static",
"boolean",
"isAuthorizedGrantTypeForService",
"(",
"final",
"J2EContext",
"context",
",",
"final",
"OAuthRegisteredService",
"registeredService",
")",
"{",
"return",
"isAuthorizedGrantTypeForService",
"(",
"context",
".",
"getRequestParameter",
"(",
"OAu... | Is authorized grant type for service?
@param context the context
@param registeredService the registered service
@return true/false | [
"Is",
"authorized",
"grant",
"type",
"for",
"service?"
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/util/OAuth20Utils.java#L312-L316 |
aws/aws-sdk-java | aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/CreateInputSecurityGroupRequest.java | CreateInputSecurityGroupRequest.withTags | public CreateInputSecurityGroupRequest withTags(java.util.Map<String, String> tags) {
"""
A collection of key-value pairs.
@param tags
A collection of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
... | java | public CreateInputSecurityGroupRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"CreateInputSecurityGroupRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | A collection of key-value pairs.
@param tags
A collection of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together. | [
"A",
"collection",
"of",
"key",
"-",
"value",
"pairs",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/CreateInputSecurityGroupRequest.java#L63-L66 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/CollectionLiteralsTypeComputer.java | CollectionLiteralsTypeComputer.createNormalizedPairType | protected LightweightTypeReference createNormalizedPairType(LightweightTypeReference pairType, LightweightTypeReference mapType, ITypeReferenceOwner owner) {
"""
The map type may be constructed from different pairs, e.g. the pair's type arguments don't need to be as strict
as the map suggests. The pair's expectat... | java | protected LightweightTypeReference createNormalizedPairType(LightweightTypeReference pairType, LightweightTypeReference mapType, ITypeReferenceOwner owner) {
ParameterizedTypeReference result = new ParameterizedTypeReference(owner, pairType.getType());
LightweightTypeReference keyType = mapType.getTypeArguments().g... | [
"protected",
"LightweightTypeReference",
"createNormalizedPairType",
"(",
"LightweightTypeReference",
"pairType",
",",
"LightweightTypeReference",
"mapType",
",",
"ITypeReferenceOwner",
"owner",
")",
"{",
"ParameterizedTypeReference",
"result",
"=",
"new",
"ParameterizedTypeRefer... | The map type may be constructed from different pairs, e.g. the pair's type arguments don't need to be as strict
as the map suggests. The pair's expectation is adjusted accordingly. | [
"The",
"map",
"type",
"may",
"be",
"constructed",
"from",
"different",
"pairs",
"e",
".",
"g",
".",
"the",
"pair",
"s",
"type",
"arguments",
"don",
"t",
"need",
"to",
"be",
"as",
"strict",
"as",
"the",
"map",
"suggests",
".",
"The",
"pair",
"s",
"exp... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/CollectionLiteralsTypeComputer.java#L219-L236 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/util/Environment.java | Environment.getEnvironment | public static Environment getEnvironment(Map<String,Object> properties) {
"""
Get/Create the one and only Environment.
Try NOT to call this method, as it requires the only static variable in the system.
@param args The initial args, such as local=prefix remote=prefix.
@return The system environment.
"""
... | java | public static Environment getEnvironment(Map<String,Object> properties)
{
if (gEnv == null) // TODO(don) Possible concurrency issue
gEnv = new Environment(properties); // Create the Environment (using defalt database(s))
//+else
//+ Utility.getLogger().warning("getEnvironmentCall... | [
"public",
"static",
"Environment",
"getEnvironment",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"gEnv",
"==",
"null",
")",
"// TODO(don) Possible concurrency issue",
"gEnv",
"=",
"new",
"Environment",
"(",
"properties",
")"... | Get/Create the one and only Environment.
Try NOT to call this method, as it requires the only static variable in the system.
@param args The initial args, such as local=prefix remote=prefix.
@return The system environment. | [
"Get",
"/",
"Create",
"the",
"one",
"and",
"only",
"Environment",
".",
"Try",
"NOT",
"to",
"call",
"this",
"method",
"as",
"it",
"requires",
"the",
"only",
"static",
"variable",
"in",
"the",
"system",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/util/Environment.java#L212-L219 |
kiegroup/drools | drools-core/src/main/java/org/drools/core/util/asm/MethodComparator.java | MethodComparator.equivalent | public boolean equivalent(final String method1,
final ClassReader class1,
final String method2,
final ClassReader class2) {
"""
This actually does the comparing.
Class1 and Class2 are class reader instances to the respective... | java | public boolean equivalent(final String method1,
final ClassReader class1,
final String method2,
final ClassReader class2) {
return getMethodBytecode( method1, class1 ).equals( getMethodBytecode( method2, class2 ) );
} | [
"public",
"boolean",
"equivalent",
"(",
"final",
"String",
"method1",
",",
"final",
"ClassReader",
"class1",
",",
"final",
"String",
"method2",
",",
"final",
"ClassReader",
"class2",
")",
"{",
"return",
"getMethodBytecode",
"(",
"method1",
",",
"class1",
")",
... | This actually does the comparing.
Class1 and Class2 are class reader instances to the respective classes. method1 and method2 are looked up on the
respective classes and their contents compared.
This is a convenience method. | [
"This",
"actually",
"does",
"the",
"comparing",
".",
"Class1",
"and",
"Class2",
"are",
"class",
"reader",
"instances",
"to",
"the",
"respective",
"classes",
".",
"method1",
"and",
"method2",
"are",
"looked",
"up",
"on",
"the",
"respective",
"classes",
"and",
... | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/util/asm/MethodComparator.java#L40-L45 |
rodionmoiseev/c10n | core/src/main/java/com/github/rodionmoiseev/c10n/share/utils/ReflectionUtils.java | ReflectionUtils.getC10NKey | public static String getC10NKey(String keyPrefix, Method method) {
"""
<p>Work out method's bundle key.
<h2>Bundle key resolution</h2>
<p>Bundle key is generated as follows:
<ul>
<li>If there are no {@link com.github.rodionmoiseev.c10n.C10NKey} annotations, key is the <code>Class FQDN '.' Method Name</code>.... | java | public static String getC10NKey(String keyPrefix, Method method) {
String key = getKeyAnnotationBasedKey(method);
if (null == key) {
//fallback to default key based on class FQDN and method name
key = ReflectionUtils.getDefaultKey(method);
}
if (keyPrefix.length()... | [
"public",
"static",
"String",
"getC10NKey",
"(",
"String",
"keyPrefix",
",",
"Method",
"method",
")",
"{",
"String",
"key",
"=",
"getKeyAnnotationBasedKey",
"(",
"method",
")",
";",
"if",
"(",
"null",
"==",
"key",
")",
"{",
"//fallback to default key based on cl... | <p>Work out method's bundle key.
<h2>Bundle key resolution</h2>
<p>Bundle key is generated as follows:
<ul>
<li>If there are no {@link com.github.rodionmoiseev.c10n.C10NKey} annotations, key is the <code>Class FQDN '.' Method Name</code>.
If method has arguments, method name is post-fixed with argument types delimited... | [
"<p",
">",
"Work",
"out",
"method",
"s",
"bundle",
"key",
"."
] | train | https://github.com/rodionmoiseev/c10n/blob/8f3ce95395b1775b536294ed34b1b5c1e4540b03/core/src/main/java/com/github/rodionmoiseev/c10n/share/utils/ReflectionUtils.java#L65-L75 |
paoding-code/paoding-rose | paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/expression/impl/ExqlCompiler.java | ExqlCompiler.findBrace | private String findBrace(char chLeft, char chRight) {
"""
从当前位置查找匹配的一对括号, 并返回内容。
如果有匹配的括号, 返回后的当前位置指向匹配的右括号后一个字符。
@param chLeft - 匹配的左括号
@param chRight - 匹配的右括号
@return 返回括号内容, 如果没有括号匹配, 返回 <code>null</code>.
"""
// 从当前位置查找查找匹配的 (...)
int left = findLeftBrace(chLeft, position);
... | java | private String findBrace(char chLeft, char chRight) {
// 从当前位置查找查找匹配的 (...)
int left = findLeftBrace(chLeft, position);
if (left >= position) {
int start = left + 1;
int end = findRightBrace(chLeft, chRight, start);
if (end >= start) {
// 当... | [
"private",
"String",
"findBrace",
"(",
"char",
"chLeft",
",",
"char",
"chRight",
")",
"{",
"// 从当前位置查找查找匹配的 (...)",
"int",
"left",
"=",
"findLeftBrace",
"(",
"chLeft",
",",
"position",
")",
";",
"if",
"(",
"left",
">=",
"position",
")",
"{",
"int",
"start... | 从当前位置查找匹配的一对括号, 并返回内容。
如果有匹配的括号, 返回后的当前位置指向匹配的右括号后一个字符。
@param chLeft - 匹配的左括号
@param chRight - 匹配的右括号
@return 返回括号内容, 如果没有括号匹配, 返回 <code>null</code>. | [
"从当前位置查找匹配的一对括号",
"并返回内容。"
] | train | https://github.com/paoding-code/paoding-rose/blob/8b512704174dd6cba95e544c7d6ab66105cb8ec4/paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/expression/impl/ExqlCompiler.java#L358-L377 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/UserResourcesImpl.java | UserResourcesImpl.addProfileImage | public User addProfileImage(long userId, String file, String fileType) throws SmartsheetException, FileNotFoundException {
"""
Uploads a profile image for the specified user.
@param userId id of the user
@param file path to the image file
@param fileType content type of the image file
@return user
@throws I... | java | public User addProfileImage(long userId, String file, String fileType) throws SmartsheetException, FileNotFoundException {
return attachProfileImage("users/" + userId + "/profileimage", file, fileType);
} | [
"public",
"User",
"addProfileImage",
"(",
"long",
"userId",
",",
"String",
"file",
",",
"String",
"fileType",
")",
"throws",
"SmartsheetException",
",",
"FileNotFoundException",
"{",
"return",
"attachProfileImage",
"(",
"\"users/\"",
"+",
"userId",
"+",
"\"/profilei... | Uploads a profile image for the specified user.
@param userId id of the user
@param file path to the image file
@param fileType content type of the image file
@return user
@throws IllegalArgumentException if any argument is null or empty string
@throws InvalidRequestException if there is any problem with the REST API ... | [
"Uploads",
"a",
"profile",
"image",
"for",
"the",
"specified",
"user",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/UserResourcesImpl.java#L383-L385 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_11_01/src/main/java/com/microsoft/azure/management/storage/v2018_11_01/implementation/ManagementPoliciesInner.java | ManagementPoliciesInner.createOrUpdateAsync | public ServiceFuture<ManagementPolicyInner> createOrUpdateAsync(String resourceGroupName, String accountName, ManagementPolicySchema policy, final ServiceCallback<ManagementPolicyInner> serviceCallback) {
"""
Sets the managementpolicy to the specified storage account.
@param resourceGroupName The name of the re... | java | public ServiceFuture<ManagementPolicyInner> createOrUpdateAsync(String resourceGroupName, String accountName, ManagementPolicySchema policy, final ServiceCallback<ManagementPolicyInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, po... | [
"public",
"ServiceFuture",
"<",
"ManagementPolicyInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"ManagementPolicySchema",
"policy",
",",
"final",
"ServiceCallback",
"<",
"ManagementPolicyInner",
">",
"serviceCallba... | Sets the managementpolicy to the specified storage account.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 charac... | [
"Sets",
"the",
"managementpolicy",
"to",
"the",
"specified",
"storage",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_11_01/src/main/java/com/microsoft/azure/management/storage/v2018_11_01/implementation/ManagementPoliciesInner.java#L186-L188 |
JavaMoney/jsr354-ri-bp | src/main/java/org/javamoney/moneta/spi/base/BaseMonetaryCurrenciesSingletonSpi.java | BaseMonetaryCurrenciesSingletonSpi.isCurrencyAvailable | public boolean isCurrencyAvailable(Locale locale, String... providers) {
"""
Allows to check if a {@link javax.money.CurrencyUnit} instance is
defined, i.e. accessible from {@link #getCurrency(String, String...)}.
@param locale the target {@link java.util.Locale}, not {@code null}.
@param providers the (op... | java | public boolean isCurrencyAvailable(Locale locale, String... providers) {
return !getCurrencies(CurrencyQueryBuilder.of().setCountries(locale).setProviderNames(providers).build()).isEmpty();
} | [
"public",
"boolean",
"isCurrencyAvailable",
"(",
"Locale",
"locale",
",",
"String",
"...",
"providers",
")",
"{",
"return",
"!",
"getCurrencies",
"(",
"CurrencyQueryBuilder",
".",
"of",
"(",
")",
".",
"setCountries",
"(",
"locale",
")",
".",
"setProviderNames",
... | Allows to check if a {@link javax.money.CurrencyUnit} instance is
defined, i.e. accessible from {@link #getCurrency(String, String...)}.
@param locale the target {@link java.util.Locale}, not {@code null}.
@param providers the (optional) specification of providers to consider. If not set (empty) the providers
as de... | [
"Allows",
"to",
"check",
"if",
"a",
"{",
"@link",
"javax",
".",
"money",
".",
"CurrencyUnit",
"}",
"instance",
"is",
"defined",
"i",
".",
"e",
".",
"accessible",
"from",
"{",
"@link",
"#getCurrency",
"(",
"String",
"String",
"...",
")",
"}",
"."
] | train | https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/spi/base/BaseMonetaryCurrenciesSingletonSpi.java#L122-L124 |
jayantk/jklol | src/com/jayantkrish/jklol/preprocessing/FeatureStandardizer.java | FeatureStandardizer.estimateFrom | public static FeatureStandardizer estimateFrom(Collection<DiscreteFactor> featureFactors,
int featureVariableNum, Assignment biasFeature, double rescalingFactor) {
"""
Estimates standardization parameters (empirical feature means and
variances) from {@code featureFactors}. Each element of {@code featureFac... | java | public static FeatureStandardizer estimateFrom(Collection<DiscreteFactor> featureFactors,
int featureVariableNum, Assignment biasFeature, double rescalingFactor) {
Preconditions.checkArgument(featureFactors.size() > 0);
DiscreteFactor means = getMeans(featureFactors, featureVariableNum);
Discret... | [
"public",
"static",
"FeatureStandardizer",
"estimateFrom",
"(",
"Collection",
"<",
"DiscreteFactor",
">",
"featureFactors",
",",
"int",
"featureVariableNum",
",",
"Assignment",
"biasFeature",
",",
"double",
"rescalingFactor",
")",
"{",
"Preconditions",
".",
"checkArgume... | Estimates standardization parameters (empirical feature means and
variances) from {@code featureFactors}. Each element of {@code featureFactors}
behaves like an independent set of feature vector observations; if these
factors contain variables other than the feature variable, then each
assignment to these variables def... | [
"Estimates",
"standardization",
"parameters",
"(",
"empirical",
"feature",
"means",
"and",
"variances",
")",
"from",
"{",
"@code",
"featureFactors",
"}",
".",
"Each",
"element",
"of",
"{",
"@code",
"featureFactors",
"}",
"behaves",
"like",
"an",
"independent",
"... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/preprocessing/FeatureStandardizer.java#L89-L107 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Conference.java | Conference.createConference | public static Conference createConference(final Map<String, Object> params) throws Exception {
"""
Factory method to create a conference given a set of params
@param params the params
@return the conference
@throws IOException unexpected error.
"""
return createConference(BandwidthClient.getInstance()... | java | public static Conference createConference(final Map<String, Object> params) throws Exception {
return createConference(BandwidthClient.getInstance(), params);
} | [
"public",
"static",
"Conference",
"createConference",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"throws",
"Exception",
"{",
"return",
"createConference",
"(",
"BandwidthClient",
".",
"getInstance",
"(",
")",
",",
"params",
")",
";"... | Factory method to create a conference given a set of params
@param params the params
@return the conference
@throws IOException unexpected error. | [
"Factory",
"method",
"to",
"create",
"a",
"conference",
"given",
"a",
"set",
"of",
"params"
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Conference.java#L58-L61 |
h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.notifyAboutCloudSize | public static void notifyAboutCloudSize(InetAddress ip, int port, InetAddress leaderIp, int leaderPort, int size) {
"""
Tell the embedding software that this H2O instance belongs to
a cloud of a certain size.
This may be non-blocking.
@param ip IP address this H2O can be reached at.
@param port Port this H2O... | java | public static void notifyAboutCloudSize(InetAddress ip, int port, InetAddress leaderIp, int leaderPort, int size) {
if (ARGS.notify_local != null && !ARGS.notify_local.trim().isEmpty()) {
final File notifyFile = new File(ARGS.notify_local);
final File parentDir = notifyFile.getParentFile();
if (pa... | [
"public",
"static",
"void",
"notifyAboutCloudSize",
"(",
"InetAddress",
"ip",
",",
"int",
"port",
",",
"InetAddress",
"leaderIp",
",",
"int",
"leaderPort",
",",
"int",
"size",
")",
"{",
"if",
"(",
"ARGS",
".",
"notify_local",
"!=",
"null",
"&&",
"!",
"ARGS... | Tell the embedding software that this H2O instance belongs to
a cloud of a certain size.
This may be non-blocking.
@param ip IP address this H2O can be reached at.
@param port Port this H2O can be reached at (for REST API and browser).
@param size Number of H2O instances in the cloud. | [
"Tell",
"the",
"embedding",
"software",
"that",
"this",
"H2O",
"instance",
"belongs",
"to",
"a",
"cloud",
"of",
"a",
"certain",
"size",
".",
"This",
"may",
"be",
"non",
"-",
"blocking",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L760-L781 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.listTopics | public PubsubFuture<TopicList> listTopics(final String project,
final String pageToken) {
"""
Get a page of Pub/Sub topics in a project using a specified page token.
@param project The Google Cloud project.
@param pageToken A token for the page of topics to get.
@... | java | public PubsubFuture<TopicList> listTopics(final String project,
final String pageToken) {
final String query = (pageToken == null) ? "" : "?pageToken=" + pageToken;
final String path = "projects/" + project + "/topics" + query;
return get("list topics", path, read... | [
"public",
"PubsubFuture",
"<",
"TopicList",
">",
"listTopics",
"(",
"final",
"String",
"project",
",",
"final",
"String",
"pageToken",
")",
"{",
"final",
"String",
"query",
"=",
"(",
"pageToken",
"==",
"null",
")",
"?",
"\"\"",
":",
"\"?pageToken=\"",
"+",
... | Get a page of Pub/Sub topics in a project using a specified page token.
@param project The Google Cloud project.
@param pageToken A token for the page of topics to get.
@return A future that is completed when this request is completed. | [
"Get",
"a",
"page",
"of",
"Pub",
"/",
"Sub",
"topics",
"in",
"a",
"project",
"using",
"a",
"specified",
"page",
"token",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L268-L273 |
apereo/cas | support/cas-server-support-couchdb-core/src/main/java/org/apereo/cas/couchdb/core/ProfileCouchDbRepository.java | ProfileCouchDbRepository.findByUsername | @View(name = "by_username", map = "function(doc) {
"""
Find profile by username.
@param username to be searched for
@return profile found
""" if(doc.username){ emit(doc.username, doc) } }")
public CouchDbProfileDocument findByUsername(final String username) {
return queryView("by_username", usern... | java | @View(name = "by_username", map = "function(doc) { if(doc.username){ emit(doc.username, doc) } }")
public CouchDbProfileDocument findByUsername(final String username) {
return queryView("by_username", username).stream().findFirst().orElse(null);
} | [
"@",
"View",
"(",
"name",
"=",
"\"by_username\"",
",",
"map",
"=",
"\"function(doc) { if(doc.username){ emit(doc.username, doc) } }\"",
")",
"public",
"CouchDbProfileDocument",
"findByUsername",
"(",
"final",
"String",
"username",
")",
"{",
"return",
"queryView",
"(",
"... | Find profile by username.
@param username to be searched for
@return profile found | [
"Find",
"profile",
"by",
"username",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-couchdb-core/src/main/java/org/apereo/cas/couchdb/core/ProfileCouchDbRepository.java#L23-L26 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspStatusBean.java | CmsJspStatusBean.getPageContent | public String getPageContent(String element) {
"""
Returns the processed output of the specified element of an OpenCms page.<p>
The page to get the content from is looked up in the property value "template-elements".
If no value is found, the page is read from the "contents/" subfolder of the handler folder.<p... | java | public String getPageContent(String element) {
// Determine the folder to read the contents from
String contentFolder = property(CmsPropertyDefinition.PROPERTY_TEMPLATE_ELEMENTS, "search", "");
if (CmsStringUtil.isEmpty(contentFolder)) {
contentFolder = VFS_FOLDER_HANDLER + "content... | [
"public",
"String",
"getPageContent",
"(",
"String",
"element",
")",
"{",
"// Determine the folder to read the contents from",
"String",
"contentFolder",
"=",
"property",
"(",
"CmsPropertyDefinition",
".",
"PROPERTY_TEMPLATE_ELEMENTS",
",",
"\"search\"",
",",
"\"\"",
")",
... | Returns the processed output of the specified element of an OpenCms page.<p>
The page to get the content from is looked up in the property value "template-elements".
If no value is found, the page is read from the "contents/" subfolder of the handler folder.<p>
For each status code, an individual page can be created ... | [
"Returns",
"the",
"processed",
"output",
"of",
"the",
"specified",
"element",
"of",
"an",
"OpenCms",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspStatusBean.java#L256-L273 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java | StandardGenerator.generateAnnotation | static TextOutline generateAnnotation(Point2d basePoint, String label, Vector2d direction, double distance,
double scale, Font font, AtomSymbol symbol) {
"""
Generate an annotation 'label' for an atom (located at 'basePoint'). The label is offset from
the basePoint by the provided 'distance' and 'dire... | java | static TextOutline generateAnnotation(Point2d basePoint, String label, Vector2d direction, double distance,
double scale, Font font, AtomSymbol symbol) {
boolean italicHint = label.startsWith(ITALIC_DISPLAY_PREFIX);
label = italicHint ? label.substring(ITALIC_DISPLAY_PREFIX.length()) : lab... | [
"static",
"TextOutline",
"generateAnnotation",
"(",
"Point2d",
"basePoint",
",",
"String",
"label",
",",
"Vector2d",
"direction",
",",
"double",
"distance",
",",
"double",
"scale",
",",
"Font",
"font",
",",
"AtomSymbol",
"symbol",
")",
"{",
"boolean",
"italicHin... | Generate an annotation 'label' for an atom (located at 'basePoint'). The label is offset from
the basePoint by the provided 'distance' and 'direction'.
@param basePoint the relative (0,0) reference
@param label the annotation text
@param direction the direction along which the label is laid out
@param distance th... | [
"Generate",
"an",
"annotation",
"label",
"for",
"an",
"atom",
"(",
"located",
"at",
"basePoint",
")",
".",
"The",
"label",
"is",
"offset",
"from",
"the",
"basePoint",
"by",
"the",
"provided",
"distance",
"and",
"direction",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java#L532-L560 |
alkacon/opencms-core | src/org/opencms/ugc/CmsUgcSession.java | CmsUgcSession.getValues | public Map<String, String> getValues() throws CmsException {
"""
Returns the content values.<p>
@return the content values
@throws CmsException if reading the content fails
"""
CmsFile file = m_cms.readFile(m_editResource);
CmsXmlContent content = unmarshalXmlContent(file);
Local... | java | public Map<String, String> getValues() throws CmsException {
CmsFile file = m_cms.readFile(m_editResource);
CmsXmlContent content = unmarshalXmlContent(file);
Locale locale = m_cms.getRequestContext().getLocale();
if (!content.hasLocale(locale)) {
content.addLocale(m_cms, lo... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getValues",
"(",
")",
"throws",
"CmsException",
"{",
"CmsFile",
"file",
"=",
"m_cms",
".",
"readFile",
"(",
"m_editResource",
")",
";",
"CmsXmlContent",
"content",
"=",
"unmarshalXmlContent",
"(",
"file",
... | Returns the content values.<p>
@return the content values
@throws CmsException if reading the content fails | [
"Returns",
"the",
"content",
"values",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ugc/CmsUgcSession.java#L424-L433 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.asType | @SuppressWarnings("unchecked")
public static <T> T asType(Number self, Class<T> c) {
"""
Transform this number to a the given type, using the 'as' operator. The
following types are supported in addition to the default
{@link #asType(java.lang.Object, java.lang.Class)}:
<ul>
<li>BigDecimal</li>
<li>BigInt... | java | @SuppressWarnings("unchecked")
public static <T> T asType(Number self, Class<T> c) {
if (c == BigDecimal.class) {
return (T) toBigDecimal(self);
} else if (c == BigInteger.class) {
return (T) toBigInteger(self);
} else if (c == Double.class) {
return (T) t... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"asType",
"(",
"Number",
"self",
",",
"Class",
"<",
"T",
">",
"c",
")",
"{",
"if",
"(",
"c",
"==",
"BigDecimal",
".",
"class",
")",
"{",
"return",
"(",
"T",... | Transform this number to a the given type, using the 'as' operator. The
following types are supported in addition to the default
{@link #asType(java.lang.Object, java.lang.Class)}:
<ul>
<li>BigDecimal</li>
<li>BigInteger</li>
<li>Double</li>
<li>Float</li>
</ul>
@param self this number
@param c the desired type of the... | [
"Transform",
"this",
"number",
"to",
"a",
"the",
"given",
"type",
"using",
"the",
"as",
"operator",
".",
"The",
"following",
"types",
"are",
"supported",
"in",
"addition",
"to",
"the",
"default",
"{"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L16550-L16562 |
qspin/qtaste | kernel/src/main/java/com/qspin/qtaste/toolbox/simulators/SimulatorImpl.java | SimulatorImpl.scheduleTaskAtFixedRate | public void scheduleTaskAtFixedRate(PyObject task, double delay, double period) {
"""
Schedules the specified task for repeated <i>fixed-rate execution</i>, beginning after the specified delay.
Subsequent executions take place at approximately regular intervals, separated by the specified period.
<p>
See {@link... | java | public void scheduleTaskAtFixedRate(PyObject task, double delay, double period) {
mTimer.scheduleAtFixedRate(new PythonCallTimerTask(task), Math.round(delay * 1000), Math.round(period * 1000));
} | [
"public",
"void",
"scheduleTaskAtFixedRate",
"(",
"PyObject",
"task",
",",
"double",
"delay",
",",
"double",
"period",
")",
"{",
"mTimer",
".",
"scheduleAtFixedRate",
"(",
"new",
"PythonCallTimerTask",
"(",
"task",
")",
",",
"Math",
".",
"round",
"(",
"delay",... | Schedules the specified task for repeated <i>fixed-rate execution</i>, beginning after the specified delay.
Subsequent executions take place at approximately regular intervals, separated by the specified period.
<p>
See {@link Timer} documentation for more information.
@param task Python object callable without argume... | [
"Schedules",
"the",
"specified",
"task",
"for",
"repeated",
"<i",
">",
"fixed",
"-",
"rate",
"execution<",
"/",
"i",
">",
"beginning",
"after",
"the",
"specified",
"delay",
".",
"Subsequent",
"executions",
"take",
"place",
"at",
"approximately",
"regular",
"in... | train | https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/kernel/src/main/java/com/qspin/qtaste/toolbox/simulators/SimulatorImpl.java#L144-L146 |
google/gwtmockito | gwtmockito/src/main/java/com/google/gwtmockito/fakes/FakeUiBinderProvider.java | FakeUiBinderProvider.getFake | @Override
public UiBinder<?, ?> getFake(final Class<?> type) {
"""
Returns a new instance of FakeUiBinder that implements the given interface.
This is accomplished by returning a dynamic proxy object that delegates
calls to a backing FakeUiBinder.
@param type interface to be implemented by the returned type... | java | @Override
public UiBinder<?, ?> getFake(final Class<?> type) {
return (UiBinder<?, ?>) Proxy.newProxyInstance(
FakeUiBinderProvider.class.getClassLoader(),
new Class<?>[] {type},
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Objec... | [
"@",
"Override",
"public",
"UiBinder",
"<",
"?",
",",
"?",
">",
"getFake",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"(",
"UiBinder",
"<",
"?",
",",
"?",
">",
")",
"Proxy",
".",
"newProxyInstance",
"(",
"FakeUiBinderProvider",
... | Returns a new instance of FakeUiBinder that implements the given interface.
This is accomplished by returning a dynamic proxy object that delegates
calls to a backing FakeUiBinder.
@param type interface to be implemented by the returned type. This must
represent an interface that directly extends {@link UiBinder}. | [
"Returns",
"a",
"new",
"instance",
"of",
"FakeUiBinder",
"that",
"implements",
"the",
"given",
"interface",
".",
"This",
"is",
"accomplished",
"by",
"returning",
"a",
"dynamic",
"proxy",
"object",
"that",
"delegates",
"calls",
"to",
"a",
"backing",
"FakeUiBinder... | train | https://github.com/google/gwtmockito/blob/e886a9b9d290169b5f83582dd89b7545c5f198a2/gwtmockito/src/main/java/com/google/gwtmockito/fakes/FakeUiBinderProvider.java#L51-L70 |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/AbstractDocumentationMojo.java | AbstractDocumentationMojo.toPackageName | protected static String toPackageName(String rootPackage, File packageName) {
"""
Convert a file to a package name.
@param rootPackage an additional root package.
@param packageName the file.
@return the package name.
"""
final StringBuilder name = new StringBuilder();
File tmp = packageName;
while... | java | protected static String toPackageName(String rootPackage, File packageName) {
final StringBuilder name = new StringBuilder();
File tmp = packageName;
while (tmp != null) {
final String elementName = tmp.getName();
if (!Strings.equal(FileSystem.CURRENT_DIRECTORY, elementName)
&& !Strings.equal(FileSyst... | [
"protected",
"static",
"String",
"toPackageName",
"(",
"String",
"rootPackage",
",",
"File",
"packageName",
")",
"{",
"final",
"StringBuilder",
"name",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"File",
"tmp",
"=",
"packageName",
";",
"while",
"(",
"tmp",
"... | Convert a file to a package name.
@param rootPackage an additional root package.
@param packageName the file.
@return the package name. | [
"Convert",
"a",
"file",
"to",
"a",
"package",
"name",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/AbstractDocumentationMojo.java#L491-L512 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/refer/References.java | References.getRequired | public List<Object> getRequired(Object locator) throws ReferenceException {
"""
Gets all component references that match specified locator. At least one
component reference must be present. If it doesn't the method throws an
error.
@param locator the locator to find references by.
@return a list with matchin... | java | public List<Object> getRequired(Object locator) throws ReferenceException {
return find(Object.class, locator, true);
} | [
"public",
"List",
"<",
"Object",
">",
"getRequired",
"(",
"Object",
"locator",
")",
"throws",
"ReferenceException",
"{",
"return",
"find",
"(",
"Object",
".",
"class",
",",
"locator",
",",
"true",
")",
";",
"}"
] | Gets all component references that match specified locator. At least one
component reference must be present. If it doesn't the method throws an
error.
@param locator the locator to find references by.
@return a list with matching component references.
@throws ReferenceException when no references found. | [
"Gets",
"all",
"component",
"references",
"that",
"match",
"specified",
"locator",
".",
"At",
"least",
"one",
"component",
"reference",
"must",
"be",
"present",
".",
"If",
"it",
"doesn",
"t",
"the",
"method",
"throws",
"an",
"error",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/refer/References.java#L261-L263 |
redkale/redkale | src/org/redkale/source/ColumnValue.java | ColumnValue.and | public static ColumnValue and(String column, Serializable value) {
"""
返回 {column} = {column} & {value} 操作
@param column 字段名
@param value 字段值
@return ColumnValue
"""
return new ColumnValue(column, AND, value);
} | java | public static ColumnValue and(String column, Serializable value) {
return new ColumnValue(column, AND, value);
} | [
"public",
"static",
"ColumnValue",
"and",
"(",
"String",
"column",
",",
"Serializable",
"value",
")",
"{",
"return",
"new",
"ColumnValue",
"(",
"column",
",",
"AND",
",",
"value",
")",
";",
"}"
] | 返回 {column} = {column} & {value} 操作
@param column 字段名
@param value 字段值
@return ColumnValue | [
"返回",
"{",
"column",
"}",
"=",
"{",
"column",
"}",
"&",
";",
"{",
"value",
"}",
"操作"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/source/ColumnValue.java#L97-L99 |
inferred/FreeBuilder | src/main/java/org/inferred/freebuilder/processor/source/Scope.java | Scope.putIfAbsent | public <V> V putIfAbsent(Key<V> key, V value) {
"""
If {@code key} is not already associated with a value, associates it with {@code value}.
@return the original value, or {@code null} if there was no value associated
"""
requireNonNull(key);
requireNonNull(value);
if (canStore(key)) {
@Su... | java | public <V> V putIfAbsent(Key<V> key, V value) {
requireNonNull(key);
requireNonNull(value);
if (canStore(key)) {
@SuppressWarnings("unchecked")
V existingValue = (V) entries.get(key);
if (value == RECURSION_SENTINEL) {
throw new ConcurrentModificationException(
"Cannot ... | [
"public",
"<",
"V",
">",
"V",
"putIfAbsent",
"(",
"Key",
"<",
"V",
">",
"key",
",",
"V",
"value",
")",
"{",
"requireNonNull",
"(",
"key",
")",
";",
"requireNonNull",
"(",
"value",
")",
";",
"if",
"(",
"canStore",
"(",
"key",
")",
")",
"{",
"@",
... | If {@code key} is not already associated with a value, associates it with {@code value}.
@return the original value, or {@code null} if there was no value associated | [
"If",
"{",
"@code",
"key",
"}",
"is",
"not",
"already",
"associated",
"with",
"a",
"value",
"associates",
"it",
"with",
"{",
"@code",
"value",
"}",
"."
] | train | https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/src/main/java/org/inferred/freebuilder/processor/source/Scope.java#L127-L146 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.