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 |
|---|---|---|---|---|---|---|---|---|---|---|
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/interceptor/request/RequestInterceptor.java | RequestInterceptor.preInvoke | public void preInvoke( InterceptorContext context, InterceptorChain chain ) throws InterceptorException {
"""
Callback invoked before the request is processed. {@link #preRequest} may be used instead.
"""
preRequest( ( RequestInterceptorContext ) context, chain );
} | java | public void preInvoke( InterceptorContext context, InterceptorChain chain ) throws InterceptorException
{
preRequest( ( RequestInterceptorContext ) context, chain );
} | [
"public",
"void",
"preInvoke",
"(",
"InterceptorContext",
"context",
",",
"InterceptorChain",
"chain",
")",
"throws",
"InterceptorException",
"{",
"preRequest",
"(",
"(",
"RequestInterceptorContext",
")",
"context",
",",
"chain",
")",
";",
"}"
] | Callback invoked before the request is processed. {@link #preRequest} may be used instead. | [
"Callback",
"invoked",
"before",
"the",
"request",
"is",
"processed",
".",
"{"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/interceptor/request/RequestInterceptor.java#L49-L52 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.readXMLFragment | public static DocumentFragment readXMLFragment(File file) throws IOException, SAXException, ParserConfigurationException {
"""
Read an XML fragment from an XML file.
The XML file is well-formed. It means that the fragment will contains a single element: the root element
within the input file.
@param file is t... | java | public static DocumentFragment readXMLFragment(File file) throws IOException, SAXException, ParserConfigurationException {
return readXMLFragment(file, false);
} | [
"public",
"static",
"DocumentFragment",
"readXMLFragment",
"(",
"File",
"file",
")",
"throws",
"IOException",
",",
"SAXException",
",",
"ParserConfigurationException",
"{",
"return",
"readXMLFragment",
"(",
"file",
",",
"false",
")",
";",
"}"
] | Read an XML fragment from an XML file.
The XML file is well-formed. It means that the fragment will contains a single element: the root element
within the input file.
@param file is the file to read
@return the fragment from the {@code file}.
@throws IOException if the stream cannot be read.
@throws SAXException if th... | [
"Read",
"an",
"XML",
"fragment",
"from",
"an",
"XML",
"file",
".",
"The",
"XML",
"file",
"is",
"well",
"-",
"formed",
".",
"It",
"means",
"that",
"the",
"fragment",
"will",
"contains",
"a",
"single",
"element",
":",
"the",
"root",
"element",
"within",
... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L1944-L1946 |
camunda/camunda-engine-dmn | engine/src/main/java/org/camunda/bpm/dmn/engine/impl/el/VariableContextScriptBindings.java | VariableContextScriptBindings.put | public Object put(String name, Object value) {
"""
Dedicated implementation which does not fall back on the {@link #calculateBindingMap()} for performance reasons
"""
// only write to the wrapped bindings
return wrappedBindings.put(name, value);
} | java | public Object put(String name, Object value) {
// only write to the wrapped bindings
return wrappedBindings.put(name, value);
} | [
"public",
"Object",
"put",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"// only write to the wrapped bindings",
"return",
"wrappedBindings",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Dedicated implementation which does not fall back on the {@link #calculateBindingMap()} for performance reasons | [
"Dedicated",
"implementation",
"which",
"does",
"not",
"fall",
"back",
"on",
"the",
"{"
] | train | https://github.com/camunda/camunda-engine-dmn/blob/6335ea29f66ac3c1b8c9404e15d89e0bb8b0a27c/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/el/VariableContextScriptBindings.java#L87-L90 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/utils/NLS.java | NLS.objectsToString | String objectsToString(String key, Object objects) {
"""
Create a simple default formatted string.
@param key which would look up the message in a resource bundle.
@param objects which would be inserted into the message.
@return String the formatted String.
"""
java.io.StringWriter stringWriter = ... | java | String objectsToString(String key, Object objects) {
java.io.StringWriter stringWriter = new java.io.StringWriter();
stringWriter.write(key);
stringWriter.write(":");
if (objects == null) {
stringWriter.write("\n");
} else if (objects instanceof Object[]) {
... | [
"String",
"objectsToString",
"(",
"String",
"key",
",",
"Object",
"objects",
")",
"{",
"java",
".",
"io",
".",
"StringWriter",
"stringWriter",
"=",
"new",
"java",
".",
"io",
".",
"StringWriter",
"(",
")",
";",
"stringWriter",
".",
"write",
"(",
"key",
")... | Create a simple default formatted string.
@param key which would look up the message in a resource bundle.
@param objects which would be inserted into the message.
@return String the formatted String. | [
"Create",
"a",
"simple",
"default",
"formatted",
"string",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/utils/NLS.java#L84-L109 |
dmak/jaxb-xew-plugin | src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java | XmlElementWrapperPlugin.moveClassLevelUp | private void moveClassLevelUp(Outline outline, JDefinedClass clazz) {
"""
Move the given class to his grandparent (either class or package). The given {@code clazz} should be inner class.
"""
// Modify the container so it now refers the class. Container can be a class or package.
JDefinedClass parent = (JD... | java | private void moveClassLevelUp(Outline outline, JDefinedClass clazz) {
// Modify the container so it now refers the class. Container can be a class or package.
JDefinedClass parent = (JDefinedClass) clazz.parentContainer();
JClassContainer grandParent = parent.parentContainer();
Map<String, JDefinedClass> classe... | [
"private",
"void",
"moveClassLevelUp",
"(",
"Outline",
"outline",
",",
"JDefinedClass",
"clazz",
")",
"{",
"// Modify the container so it now refers the class. Container can be a class or package.",
"JDefinedClass",
"parent",
"=",
"(",
"JDefinedClass",
")",
"clazz",
".",
"par... | Move the given class to his grandparent (either class or package). The given {@code clazz} should be inner class. | [
"Move",
"the",
"given",
"class",
"to",
"his",
"grandparent",
"(",
"either",
"class",
"or",
"package",
")",
".",
"The",
"given",
"{"
] | train | https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java#L875-L923 |
toddfast/typeconverter | src/main/java/com/toddfast/util/convert/TypeConverter.java | TypeConverter.asBoolean | public static boolean asBoolean(Object value, boolean nullValue) {
"""
Return the value converted to a boolean
or the specified alternate value if the original value is null. Note,
this method still throws {@link IllegalArgumentException} if the value
is not null and could not be converted.
@param value
The... | java | public static boolean asBoolean(Object value, boolean nullValue) {
value=convert(Boolean.class,value);
return (value!=null)
? ((Boolean)value).booleanValue()
: nullValue;
} | [
"public",
"static",
"boolean",
"asBoolean",
"(",
"Object",
"value",
",",
"boolean",
"nullValue",
")",
"{",
"value",
"=",
"convert",
"(",
"Boolean",
".",
"class",
",",
"value",
")",
";",
"return",
"(",
"value",
"!=",
"null",
")",
"?",
"(",
"(",
"Boolean... | Return the value converted to a boolean
or the specified alternate value if the original value is null. Note,
this method still throws {@link IllegalArgumentException} if the value
is not null and could not be converted.
@param value
The value to be converted
@param nullValue
The value to be returned if {@link value} ... | [
"Return",
"the",
"value",
"converted",
"to",
"a",
"boolean",
"or",
"the",
"specified",
"alternate",
"value",
"if",
"the",
"original",
"value",
"is",
"null",
".",
"Note",
"this",
"method",
"still",
"throws",
"{",
"@link",
"IllegalArgumentException",
"}",
"if",
... | train | https://github.com/toddfast/typeconverter/blob/44efa352254faa49edaba5c5935389705aa12b90/src/main/java/com/toddfast/util/convert/TypeConverter.java#L701-L706 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/Utils.java | Utils.appendBuildInfo | public static BuildInfo appendBuildInfo(CpsScript cpsScript, Map<String, Object> stepVariables) {
"""
Add the buildInfo to step variables if missing and set its cps script.
@param cpsScript the cps script
@param stepVariables step variables map
@return the build info
"""
BuildInfo buildInfo = ... | java | public static BuildInfo appendBuildInfo(CpsScript cpsScript, Map<String, Object> stepVariables) {
BuildInfo buildInfo = (BuildInfo) stepVariables.get(BUILD_INFO);
if (buildInfo == null) {
buildInfo = (BuildInfo) cpsScript.invokeMethod("newBuildInfo", Maps.newLinkedHashMap());
ste... | [
"public",
"static",
"BuildInfo",
"appendBuildInfo",
"(",
"CpsScript",
"cpsScript",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"stepVariables",
")",
"{",
"BuildInfo",
"buildInfo",
"=",
"(",
"BuildInfo",
")",
"stepVariables",
".",
"get",
"(",
"BUILD_INFO",
"... | Add the buildInfo to step variables if missing and set its cps script.
@param cpsScript the cps script
@param stepVariables step variables map
@return the build info | [
"Add",
"the",
"buildInfo",
"to",
"step",
"variables",
"if",
"missing",
"and",
"set",
"its",
"cps",
"script",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/Utils.java#L346-L354 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/PageServiceImpl.java | PageServiceImpl.afterDataFlush | @InService(PageServiceSync.class)
public void afterDataFlush(Page newPage, int sequenceFlush) {
"""
After the checkpoint is written to mmap/file, the stub is valid
for reloading.
"""
Page page = _pages.get(newPage.getId());
if (page == newPage) {
page.afterDataFlush(this, sequenceFlush);
... | java | @InService(PageServiceSync.class)
public void afterDataFlush(Page newPage, int sequenceFlush)
{
Page page = _pages.get(newPage.getId());
if (page == newPage) {
page.afterDataFlush(this, sequenceFlush);
}
else {
System.out.println("AfterDataFlush mismatch: " + page + " " + newPage);
... | [
"@",
"InService",
"(",
"PageServiceSync",
".",
"class",
")",
"public",
"void",
"afterDataFlush",
"(",
"Page",
"newPage",
",",
"int",
"sequenceFlush",
")",
"{",
"Page",
"page",
"=",
"_pages",
".",
"get",
"(",
"newPage",
".",
"getId",
"(",
")",
")",
";",
... | After the checkpoint is written to mmap/file, the stub is valid
for reloading. | [
"After",
"the",
"checkpoint",
"is",
"written",
"to",
"mmap",
"/",
"file",
"the",
"stub",
"is",
"valid",
"for",
"reloading",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/PageServiceImpl.java#L939-L950 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java | RedisInner.listKeysAsync | public Observable<RedisAccessKeysInner> listKeysAsync(String resourceGroupName, String name) {
"""
Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@throws Ill... | java | public Observable<RedisAccessKeysInner> listKeysAsync(String resourceGroupName, String name) {
return listKeysWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<RedisAccessKeysInner>, RedisAccessKeysInner>() {
@Override
public RedisAccessKeysInner call(Servic... | [
"public",
"Observable",
"<",
"RedisAccessKeysInner",
">",
"listKeysAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"listKeysWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"map",
"(",
"new",
"Func1",... | Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RedisAccessKeys... | [
"Retrieve",
"a",
"Redis",
"cache",
"s",
"access",
"keys",
".",
"This",
"operation",
"requires",
"write",
"permission",
"to",
"the",
"cache",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java#L1087-L1094 |
groupby/api-java | src/main/java/com/groupbyinc/api/Query.java | Query.addRangeRefinement | public Query addRangeRefinement(String navigationName, String low, String high) {
"""
<code>
Add a range refinement. Takes a refinement name, a lower and upper bounds.
</code>
@param navigationName
The name of the refinement
@param low
The low value
@param high
The high value
"""
return addRange... | java | public Query addRangeRefinement(String navigationName, String low, String high) {
return addRangeRefinement(navigationName, low, high, false);
} | [
"public",
"Query",
"addRangeRefinement",
"(",
"String",
"navigationName",
",",
"String",
"low",
",",
"String",
"high",
")",
"{",
"return",
"addRangeRefinement",
"(",
"navigationName",
",",
"low",
",",
"high",
",",
"false",
")",
";",
"}"
] | <code>
Add a range refinement. Takes a refinement name, a lower and upper bounds.
</code>
@param navigationName
The name of the refinement
@param low
The low value
@param high
The high value | [
"<code",
">",
"Add",
"a",
"range",
"refinement",
".",
"Takes",
"a",
"refinement",
"name",
"a",
"lower",
"and",
"upper",
"bounds",
".",
"<",
"/",
"code",
">"
] | train | https://github.com/groupby/api-java/blob/257c4ed0777221e5e4ade3b29b9921300fac4e2e/src/main/java/com/groupbyinc/api/Query.java#L738-L740 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/mysql/AbstractMySQLQuery.java | AbstractMySQLQuery.intoOutfile | @WithBridgeMethods(value = MySQLQuery.class, castRequired = true)
public C intoOutfile(File file) {
"""
SELECT ... INTO OUTFILE writes the selected rows to a file. Column and line terminators c
an be specified to produce a specific output format.
@param file file to write to
@return the current object
... | java | @WithBridgeMethods(value = MySQLQuery.class, castRequired = true)
public C intoOutfile(File file) {
return addFlag(Position.END, "\ninto outfile '" + file.getPath() + "'");
} | [
"@",
"WithBridgeMethods",
"(",
"value",
"=",
"MySQLQuery",
".",
"class",
",",
"castRequired",
"=",
"true",
")",
"public",
"C",
"intoOutfile",
"(",
"File",
"file",
")",
"{",
"return",
"addFlag",
"(",
"Position",
".",
"END",
",",
"\"\\ninto outfile '\"",
"+",
... | SELECT ... INTO OUTFILE writes the selected rows to a file. Column and line terminators c
an be specified to produce a specific output format.
@param file file to write to
@return the current object | [
"SELECT",
"...",
"INTO",
"OUTFILE",
"writes",
"the",
"selected",
"rows",
"to",
"a",
"file",
".",
"Column",
"and",
"line",
"terminators",
"c",
"an",
"be",
"specified",
"to",
"produce",
"a",
"specific",
"output",
"format",
"."
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/mysql/AbstractMySQLQuery.java#L156-L159 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java | ListManagementImagesImpl.deleteImageAsync | public Observable<String> deleteImageAsync(String listId, String imageId) {
"""
Deletes an image from the list with list Id and image Id passed.
@param listId List Id of the image list.
@param imageId Id of the image.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the obser... | java | public Observable<String> deleteImageAsync(String listId, String imageId) {
return deleteImageWithServiceResponseAsync(listId, imageId).map(new Func1<ServiceResponse<String>, String>() {
@Override
public String call(ServiceResponse<String> response) {
return response.body... | [
"public",
"Observable",
"<",
"String",
">",
"deleteImageAsync",
"(",
"String",
"listId",
",",
"String",
"imageId",
")",
"{",
"return",
"deleteImageWithServiceResponseAsync",
"(",
"listId",
",",
"imageId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceRespon... | Deletes an image from the list with list Id and image Id passed.
@param listId List Id of the image list.
@param imageId Id of the image.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the String object | [
"Deletes",
"an",
"image",
"from",
"the",
"list",
"with",
"list",
"Id",
"and",
"image",
"Id",
"passed",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java#L443-L450 |
Jasig/portlet-utils | portlet-security-util/src/main/java/org/jasig/web/filter/SimpleCorsFilter.java | SimpleCorsFilter.doFilter | @Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
"""
Sets the headers to support CORS
@see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
"""
Http... | java | @Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
HttpServletResponse response = (HttpServletResponse) res;
response.setHeader("Access-Control-Allow-Origin", allowOrigin);
response.setHeader("Access-Control-Allow... | [
"@",
"Override",
"public",
"void",
"doFilter",
"(",
"ServletRequest",
"req",
",",
"ServletResponse",
"res",
",",
"FilterChain",
"chain",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"HttpServletResponse",
"response",
"=",
"(",
"HttpServletResponse",
"... | Sets the headers to support CORS
@see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) | [
"Sets",
"the",
"headers",
"to",
"support",
"CORS"
] | train | https://github.com/Jasig/portlet-utils/blob/bb54047a90b92bdfecd0ca51cc4371929c941ff5/portlet-security-util/src/main/java/org/jasig/web/filter/SimpleCorsFilter.java#L115-L123 |
softindex/datakernel | core-eventloop/src/main/java/io/datakernel/jmx/ValueStats.java | ValueStats.binarySearch | private static int binarySearch(int[] arr, int value) {
"""
return index of smallest element that is greater than "value"
"""
int found = 0;
int left = 0;
int right = arr.length - 1;
while (left < right) {
if (right - left == 1) {
found = value < arr[left] ? left : right;
break;
}
int... | java | private static int binarySearch(int[] arr, int value) {
int found = 0;
int left = 0;
int right = arr.length - 1;
while (left < right) {
if (right - left == 1) {
found = value < arr[left] ? left : right;
break;
}
int middle = left + (right - left) / 2;
if (value < arr[middle]) {
right = ... | [
"private",
"static",
"int",
"binarySearch",
"(",
"int",
"[",
"]",
"arr",
",",
"int",
"value",
")",
"{",
"int",
"found",
"=",
"0",
";",
"int",
"left",
"=",
"0",
";",
"int",
"right",
"=",
"arr",
".",
"length",
"-",
"1",
";",
"while",
"(",
"left",
... | return index of smallest element that is greater than "value" | [
"return",
"index",
"of",
"smallest",
"element",
"that",
"is",
"greater",
"than",
"value"
] | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-eventloop/src/main/java/io/datakernel/jmx/ValueStats.java#L344-L362 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java | HintRule.addGivenVersion | public void addGivenVersion(String source, String name, String value, boolean regex, Confidence confidence) {
"""
Adds a given version to the list of evidence to match.
@param source the source of the evidence
@param name the name of the evidence
@param value the value of the evidence
@param regex whether va... | java | public void addGivenVersion(String source, String name, String value, boolean regex, Confidence confidence) {
givenVersion.add(new EvidenceMatcher(source, name, value, regex, confidence));
} | [
"public",
"void",
"addGivenVersion",
"(",
"String",
"source",
",",
"String",
"name",
",",
"String",
"value",
",",
"boolean",
"regex",
",",
"Confidence",
"confidence",
")",
"{",
"givenVersion",
".",
"add",
"(",
"new",
"EvidenceMatcher",
"(",
"source",
",",
"n... | Adds a given version to the list of evidence to match.
@param source the source of the evidence
@param name the name of the evidence
@param value the value of the evidence
@param regex whether value is a regex
@param confidence the confidence of the evidence | [
"Adds",
"a",
"given",
"version",
"to",
"the",
"list",
"of",
"evidence",
"to",
"match",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java#L273-L275 |
azkaban/azkaban | az-core/src/main/java/azkaban/utils/Utils.java | Utils.runProcess | public static ArrayList<String> runProcess(String... commands)
throws InterruptedException, IOException {
"""
Run a sequence of commands
@param commands sequence of commands
@return list of output result
"""
final java.lang.ProcessBuilder processBuilder = new java.lang.ProcessBuilder(commands);
... | java | public static ArrayList<String> runProcess(String... commands)
throws InterruptedException, IOException {
final java.lang.ProcessBuilder processBuilder = new java.lang.ProcessBuilder(commands);
final ArrayList<String> output = new ArrayList<>();
final Process process = processBuilder.start();
proc... | [
"public",
"static",
"ArrayList",
"<",
"String",
">",
"runProcess",
"(",
"String",
"...",
"commands",
")",
"throws",
"InterruptedException",
",",
"IOException",
"{",
"final",
"java",
".",
"lang",
".",
"ProcessBuilder",
"processBuilder",
"=",
"new",
"java",
".",
... | Run a sequence of commands
@param commands sequence of commands
@return list of output result | [
"Run",
"a",
"sequence",
"of",
"commands"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Utils.java#L422-L440 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.similarUpdate | public JSONObject similarUpdate(byte[] image, HashMap<String, String> options) {
"""
相似图检索—更新接口
**更新图库中图片的摘要和分类信息(具体变量为brief、tags)**
@param image - 二进制图像数据
@param options - 可选参数对象,key: value都为string类型
options - options列表:
brief 更新的摘要信息,最长256B。样例:{"name":"周杰伦", "id":"666"}
tags 1 - 65535范围内的整数,tag间以逗号分隔,最多2... | java | public JSONObject similarUpdate(byte[] image, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
String base64Content = Base64Util.encode(image);
request.addBody("image", base64Content);
if (options != null) {
req... | [
"public",
"JSONObject",
"similarUpdate",
"(",
"byte",
"[",
"]",
"image",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"... | 相似图检索—更新接口
**更新图库中图片的摘要和分类信息(具体变量为brief、tags)**
@param image - 二进制图像数据
@param options - 可选参数对象,key: value都为string类型
options - options列表:
brief 更新的摘要信息,最长256B。样例:{"name":"周杰伦", "id":"666"}
tags 1 - 65535范围内的整数,tag间以逗号分隔,最多2个tag。样例:"100,11" ;检索时可圈定分类维度进行检索
@return JSONObject | [
"相似图检索—更新接口",
"**",
"更新图库中图片的摘要和分类信息(具体变量为brief、tags)",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L515-L527 |
tomasbjerre/git-changelog-lib | src/main/java/se/bjurr/gitchangelog/api/GitChangelogApi.java | GitChangelogApi.getChangelog | public Changelog getChangelog(final boolean useIntegrationIfConfigured)
throws GitChangelogRepositoryException {
"""
Get the changelog as data object.
@param useIntegrationIfConfigured true if title/link/labels/issueType should be fetched from
integrations (GitHub, GitLab, Jira) if that is configured.
@... | java | public Changelog getChangelog(final boolean useIntegrationIfConfigured)
throws GitChangelogRepositoryException {
try (GitRepo gitRepo = new GitRepo(new File(this.settings.getFromRepo()))) {
return getChangelog(gitRepo, useIntegrationIfConfigured);
} catch (final IOException e) {
throw new GitC... | [
"public",
"Changelog",
"getChangelog",
"(",
"final",
"boolean",
"useIntegrationIfConfigured",
")",
"throws",
"GitChangelogRepositoryException",
"{",
"try",
"(",
"GitRepo",
"gitRepo",
"=",
"new",
"GitRepo",
"(",
"new",
"File",
"(",
"this",
".",
"settings",
".",
"ge... | Get the changelog as data object.
@param useIntegrationIfConfigured true if title/link/labels/issueType should be fetched from
integrations (GitHub, GitLab, Jira) if that is configured.
@throws GitChangelogRepositoryException | [
"Get",
"the",
"changelog",
"as",
"data",
"object",
"."
] | train | https://github.com/tomasbjerre/git-changelog-lib/blob/e6b26d29592a57bd53fe98fbe4a56d8c2267a192/src/main/java/se/bjurr/gitchangelog/api/GitChangelogApi.java#L74-L81 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/hc/HCHelper.java | HCHelper.iterateTree | public static void iterateTree (@Nonnull final IHCNode aNode, @Nonnull final IHCIteratorCallback aCallback) {
"""
Recursively iterate the node and all child nodes of the passed node. The
difference to {@link #iterateChildren(IHCNode, IHCIteratorCallback)} is, that
the callback is also invoked on the passed node.... | java | public static void iterateTree (@Nonnull final IHCNode aNode, @Nonnull final IHCIteratorCallback aCallback)
{
ValueEnforcer.notNull (aNode, "node");
ValueEnforcer.notNull (aCallback, "callback");
// call callback on start node
if (aCallback.call (null, aNode).isContinue ())
_recursiveIterateTre... | [
"public",
"static",
"void",
"iterateTree",
"(",
"@",
"Nonnull",
"final",
"IHCNode",
"aNode",
",",
"@",
"Nonnull",
"final",
"IHCIteratorCallback",
"aCallback",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aNode",
",",
"\"node\"",
")",
";",
"ValueEnforcer",
... | Recursively iterate the node and all child nodes of the passed node. The
difference to {@link #iterateChildren(IHCNode, IHCIteratorCallback)} is, that
the callback is also invoked on the passed node.
@param aNode
The node to be iterated.
@param aCallback
The callback to be invoked on every child | [
"Recursively",
"iterate",
"the",
"node",
"and",
"all",
"child",
"nodes",
"of",
"the",
"passed",
"node",
".",
"The",
"difference",
"to",
"{",
"@link",
"#iterateChildren",
"(",
"IHCNode",
"IHCIteratorCallback",
")",
"}",
"is",
"that",
"the",
"callback",
"is",
... | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/HCHelper.java#L100-L108 |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/common/lib/conf/ConfigurationModule.java | ConfigurationModule.configureConfigurations | protected void configureConfigurations(
Class<? extends AdsApiConfiguration> apiConfigurationClass,
@Nullable List<URL> apiPropertyUrls, @Nullable List<String> apiPropertyFilePaths,
Class<? extends AdsLibConfiguration> adsLibConfigurationClass,
@Nullable List<URL> libPropertyUrls, @Nullable List... | java | protected void configureConfigurations(
Class<? extends AdsApiConfiguration> apiConfigurationClass,
@Nullable List<URL> apiPropertyUrls, @Nullable List<String> apiPropertyFilePaths,
Class<? extends AdsLibConfiguration> adsLibConfigurationClass,
@Nullable List<URL> libPropertyUrls, @Nullable List... | [
"protected",
"void",
"configureConfigurations",
"(",
"Class",
"<",
"?",
"extends",
"AdsApiConfiguration",
">",
"apiConfigurationClass",
",",
"@",
"Nullable",
"List",
"<",
"URL",
">",
"apiPropertyUrls",
",",
"@",
"Nullable",
"List",
"<",
"String",
">",
"apiProperty... | Configures configurations.
@param apiConfigurationClass the API configuration class
@param apiPropertyUrls the API properties file URLs
@param apiPropertyFilePaths the API properties file paths or names
@param adsLibConfigurationClass the lib configuration class
@param libPropertyUrls the lib properties files
@param l... | [
"Configures",
"configurations",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/conf/ConfigurationModule.java#L47-L68 |
square/spoon | spoon-runner/src/main/java/com/squareup/spoon/SpoonUtils.java | SpoonUtils.initAdb | public static AndroidDebugBridge initAdb(File sdk, Duration timeOut) {
"""
Get an {@link com.android.ddmlib.AndroidDebugBridge} instance given an SDK path.
"""
AndroidDebugBridge.initIfNeeded(false);
File adbPath = FileUtils.getFile(sdk, "platform-tools", "adb");
AndroidDebugBridge adb = AndroidDeb... | java | public static AndroidDebugBridge initAdb(File sdk, Duration timeOut) {
AndroidDebugBridge.initIfNeeded(false);
File adbPath = FileUtils.getFile(sdk, "platform-tools", "adb");
AndroidDebugBridge adb = AndroidDebugBridge.createBridge(adbPath.getAbsolutePath(), false);
waitForAdb(adb, timeOut);
return ... | [
"public",
"static",
"AndroidDebugBridge",
"initAdb",
"(",
"File",
"sdk",
",",
"Duration",
"timeOut",
")",
"{",
"AndroidDebugBridge",
".",
"initIfNeeded",
"(",
"false",
")",
";",
"File",
"adbPath",
"=",
"FileUtils",
".",
"getFile",
"(",
"sdk",
",",
"\"platform-... | Get an {@link com.android.ddmlib.AndroidDebugBridge} instance given an SDK path. | [
"Get",
"an",
"{"
] | train | https://github.com/square/spoon/blob/ebd51fbc1498f6bdcb61aa1281bbac2af99117b3/spoon-runner/src/main/java/com/squareup/spoon/SpoonUtils.java#L119-L125 |
lucee/Lucee | core/src/main/java/lucee/runtime/converter/WDDXConverter.java | WDDXConverter._serializeMap | private String _serializeMap(Map map, Set<Object> done) throws ConverterException {
"""
serialize a Map (as Struct)
@param map Map to serialize
@param done
@return serialized map
@throws ConverterException
"""
StringBuilder sb = new StringBuilder(goIn() + "<struct>");
Iterator it = map.keySet().iterat... | java | private String _serializeMap(Map map, Set<Object> done) throws ConverterException {
StringBuilder sb = new StringBuilder(goIn() + "<struct>");
Iterator it = map.keySet().iterator();
deep++;
while (it.hasNext()) {
Object key = it.next();
sb.append(goIn() + "<var name=" + del + XMLUtil.escapeXMLString(key... | [
"private",
"String",
"_serializeMap",
"(",
"Map",
"map",
",",
"Set",
"<",
"Object",
">",
"done",
")",
"throws",
"ConverterException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"goIn",
"(",
")",
"+",
"\"<struct>\"",
")",
";",
"Iterator",
... | serialize a Map (as Struct)
@param map Map to serialize
@param done
@return serialized map
@throws ConverterException | [
"serialize",
"a",
"Map",
"(",
"as",
"Struct",
")"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/WDDXConverter.java#L297-L313 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AlignedBox3d.java | AlignedBox3d.setY | @Override
public void setY(double min, double max) {
"""
Set the y bounds of the box.
@param min the min value for the y axis.
@param max the max value for the y axis.
"""
if (min <= max) {
this.minyProperty.set(min);
this.maxyProperty.set(max);
} else {
this.minyProperty.set(max);
this.ma... | java | @Override
public void setY(double min, double max) {
if (min <= max) {
this.minyProperty.set(min);
this.maxyProperty.set(max);
} else {
this.minyProperty.set(max);
this.maxyProperty.set(min);
}
} | [
"@",
"Override",
"public",
"void",
"setY",
"(",
"double",
"min",
",",
"double",
"max",
")",
"{",
"if",
"(",
"min",
"<=",
"max",
")",
"{",
"this",
".",
"minyProperty",
".",
"set",
"(",
"min",
")",
";",
"this",
".",
"maxyProperty",
".",
"set",
"(",
... | Set the y bounds of the box.
@param min the min value for the y axis.
@param max the max value for the y axis. | [
"Set",
"the",
"y",
"bounds",
"of",
"the",
"box",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AlignedBox3d.java#L688-L697 |
jenkinsci/jenkins | core/src/main/java/jenkins/model/PeepholePermalink.java | PeepholePermalink.updateCache | protected void updateCache(@Nonnull Job<?,?> job, @Nullable Run<?,?> b) {
"""
Remembers the value 'n' in the cache for future {@link #resolve(Job)}.
"""
final int n = b==null ? RESOLVES_TO_NONE : b.getNumber();
File cache = getPermalinkFile(job);
cache.getParentFile().mkdirs();
... | java | protected void updateCache(@Nonnull Job<?,?> job, @Nullable Run<?,?> b) {
final int n = b==null ? RESOLVES_TO_NONE : b.getNumber();
File cache = getPermalinkFile(job);
cache.getParentFile().mkdirs();
try {
String target = String.valueOf(n);
if (b != null && !new... | [
"protected",
"void",
"updateCache",
"(",
"@",
"Nonnull",
"Job",
"<",
"?",
",",
"?",
">",
"job",
",",
"@",
"Nullable",
"Run",
"<",
"?",
",",
"?",
">",
"b",
")",
"{",
"final",
"int",
"n",
"=",
"b",
"==",
"null",
"?",
"RESOLVES_TO_NONE",
":",
"b",
... | Remembers the value 'n' in the cache for future {@link #resolve(Job)}. | [
"Remembers",
"the",
"value",
"n",
"in",
"the",
"cache",
"for",
"future",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/PeepholePermalink.java#L138-L155 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/util/DateTimeUtils.java | DateTimeUtils.parseTimestampWithoutTimeZone | @Deprecated
public static long parseTimestampWithoutTimeZone(TimeZoneKey timeZoneKey, String value) {
"""
Parse a string (optionally containing a zone) as a value of TIMESTAMP type.
If the string doesn't specify a zone, it is interpreted in {@code timeZoneKey} zone.
@return stack representation of legacy T... | java | @Deprecated
public static long parseTimestampWithoutTimeZone(TimeZoneKey timeZoneKey, String value)
{
return TIMESTAMP_WITH_OR_WITHOUT_TIME_ZONE_FORMATTER.withChronology(getChronology(timeZoneKey)).parseMillis(value);
} | [
"@",
"Deprecated",
"public",
"static",
"long",
"parseTimestampWithoutTimeZone",
"(",
"TimeZoneKey",
"timeZoneKey",
",",
"String",
"value",
")",
"{",
"return",
"TIMESTAMP_WITH_OR_WITHOUT_TIME_ZONE_FORMATTER",
".",
"withChronology",
"(",
"getChronology",
"(",
"timeZoneKey",
... | Parse a string (optionally containing a zone) as a value of TIMESTAMP type.
If the string doesn't specify a zone, it is interpreted in {@code timeZoneKey} zone.
@return stack representation of legacy TIMESTAMP type | [
"Parse",
"a",
"string",
"(",
"optionally",
"containing",
"a",
"zone",
")",
"as",
"a",
"value",
"of",
"TIMESTAMP",
"type",
".",
"If",
"the",
"string",
"doesn",
"t",
"specify",
"a",
"zone",
"it",
"is",
"interpreted",
"in",
"{",
"@code",
"timeZoneKey",
"}",... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/util/DateTimeUtils.java#L226-L230 |
sitoolkit/sit-wt-all | sit-wt-runtime/src/main/java/io/sitoolkit/wt/app/compareevidence/ScreenshotComparator.java | ScreenshotComparator.compareOneScreenshot | public boolean compareOneScreenshot(File baseImg, File targetImg, int rows, int columns) {
"""
スクリーンショットが一致する場合にtrueを返します。 一致しない場合には差分スクリーンショットを生成します。
@param baseImg
基準スクリーンショット
@param targetImg
比較対象スクリーンショット
@param rows
分割行数
@param columns
分割列数
@return スクリーンショットが一致する場合にtrue
"""
boolean m... | java | public boolean compareOneScreenshot(File baseImg, File targetImg, int rows, int columns) {
boolean match = true;
BufferedImage[][] baseBfImg = splitImage(baseImg, rows, columns);
BufferedImage[][] targetBfImg = splitImage(targetImg, rows, columns);
BufferedImage[][] diffImg = new... | [
"public",
"boolean",
"compareOneScreenshot",
"(",
"File",
"baseImg",
",",
"File",
"targetImg",
",",
"int",
"rows",
",",
"int",
"columns",
")",
"{",
"boolean",
"match",
"=",
"true",
";",
"BufferedImage",
"[",
"]",
"[",
"]",
"baseBfImg",
"=",
"splitImage",
"... | スクリーンショットが一致する場合にtrueを返します。 一致しない場合には差分スクリーンショットを生成します。
@param baseImg
基準スクリーンショット
@param targetImg
比較対象スクリーンショット
@param rows
分割行数
@param columns
分割列数
@return スクリーンショットが一致する場合にtrue | [
"スクリーンショットが一致する場合にtrueを返します。",
"一致しない場合には差分スクリーンショットを生成します。"
] | train | https://github.com/sitoolkit/sit-wt-all/blob/efabde27aa731a5602d2041e137721a22f4fd27a/sit-wt-runtime/src/main/java/io/sitoolkit/wt/app/compareevidence/ScreenshotComparator.java#L99-L129 |
recommenders/rival | rival-core/src/main/java/net/recommenders/rival/core/DataModelUtils.java | DataModelUtils.saveDataModel | public static <U, I> void saveDataModel(final TemporalDataModelIF<U, I> dm, final String outfile, final boolean overwrite, String delimiter)
throws FileNotFoundException, UnsupportedEncodingException {
"""
Method that saves a temporal data model to a file.
@param dm the data model
@param outfile fi... | java | public static <U, I> void saveDataModel(final TemporalDataModelIF<U, I> dm, final String outfile, final boolean overwrite, String delimiter)
throws FileNotFoundException, UnsupportedEncodingException {
if (new File(outfile).exists() && !overwrite) {
System.out.println("Ignoring " + outfi... | [
"public",
"static",
"<",
"U",
",",
"I",
">",
"void",
"saveDataModel",
"(",
"final",
"TemporalDataModelIF",
"<",
"U",
",",
"I",
">",
"dm",
",",
"final",
"String",
"outfile",
",",
"final",
"boolean",
"overwrite",
",",
"String",
"delimiter",
")",
"throws",
... | Method that saves a temporal data model to a file.
@param dm the data model
@param outfile file where the model will be saved
@param overwrite flag that indicates if the file should be overwritten
@param delimiter field delimiter
@param <U> type of users
@param <I> type of items
@throws FileNotFoundException when outf... | [
"Method",
"that",
"saves",
"a",
"temporal",
"data",
"model",
"to",
"a",
"file",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-core/src/main/java/net/recommenders/rival/core/DataModelUtils.java#L78-L99 |
dropwizard/dropwizard | dropwizard-json-logging/src/main/java/io/dropwizard/logging/json/layout/JsonFormatter.java | JsonFormatter.toJson | @Nullable
public String toJson(@Nullable Map<String, Object> map) {
"""
Converts the provided map as a JSON object according to the configured JSON mapper.
@param map the provided map
@return the JSON as a string
"""
if (map == null || map.isEmpty()) {
return null;
}
... | java | @Nullable
public String toJson(@Nullable Map<String, Object> map) {
if (map == null || map.isEmpty()) {
return null;
}
try (StringWriter writer = new StringWriter(bufferSize)) {
objectMapper.writeValue(writer, map);
if (doesAppendLineSeparator) {
... | [
"@",
"Nullable",
"public",
"String",
"toJson",
"(",
"@",
"Nullable",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"if",
"(",
"map",
"==",
"null",
"||",
"map",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"try",
"(... | Converts the provided map as a JSON object according to the configured JSON mapper.
@param map the provided map
@return the JSON as a string | [
"Converts",
"the",
"provided",
"map",
"as",
"a",
"JSON",
"object",
"according",
"to",
"the",
"configured",
"JSON",
"mapper",
"."
] | train | https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-json-logging/src/main/java/io/dropwizard/logging/json/layout/JsonFormatter.java#L40-L55 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/sql/planner/EqualityInference.java | EqualityInference.getScopedCanonical | @VisibleForTesting
Expression getScopedCanonical(Expression expression, Predicate<Symbol> symbolScope) {
"""
Returns a canonical expression that is fully contained by the symbolScope and that is equivalent
to the specified expression. Returns null if unable to to find a canonical.
"""
Expression c... | java | @VisibleForTesting
Expression getScopedCanonical(Expression expression, Predicate<Symbol> symbolScope)
{
Expression canonicalIndex = canonicalMap.get(expression);
if (canonicalIndex == null) {
return null;
}
return getCanonical(filter(equalitySets.get(canonicalIndex),... | [
"@",
"VisibleForTesting",
"Expression",
"getScopedCanonical",
"(",
"Expression",
"expression",
",",
"Predicate",
"<",
"Symbol",
">",
"symbolScope",
")",
"{",
"Expression",
"canonicalIndex",
"=",
"canonicalMap",
".",
"get",
"(",
"expression",
")",
";",
"if",
"(",
... | Returns a canonical expression that is fully contained by the symbolScope and that is equivalent
to the specified expression. Returns null if unable to to find a canonical. | [
"Returns",
"a",
"canonical",
"expression",
"that",
"is",
"fully",
"contained",
"by",
"the",
"symbolScope",
"and",
"that",
"is",
"equivalent",
"to",
"the",
"specified",
"expression",
".",
"Returns",
"null",
"if",
"unable",
"to",
"to",
"find",
"a",
"canonical",
... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/sql/planner/EqualityInference.java#L240-L248 |
ReactiveX/RxJavaComputationExpressions | src/main/java/rx/Statement.java | Statement.whileDo | public static <T> Observable<T> whileDo(Observable<? extends T> source, Func0<Boolean> preCondition) {
"""
Return an Observable that replays the emissions from the source
Observable so long as a condtion is true.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/whileDo.... | java | public static <T> Observable<T> whileDo(Observable<? extends T> source, Func0<Boolean> preCondition) {
return Observable.create(new OperatorWhileDoWhile<T>(source, preCondition, preCondition));
} | [
"public",
"static",
"<",
"T",
">",
"Observable",
"<",
"T",
">",
"whileDo",
"(",
"Observable",
"<",
"?",
"extends",
"T",
">",
"source",
",",
"Func0",
"<",
"Boolean",
">",
"preCondition",
")",
"{",
"return",
"Observable",
".",
"create",
"(",
"new",
"Oper... | Return an Observable that replays the emissions from the source
Observable so long as a condtion is true.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/whileDo.png" alt="">
@param preCondition
the condition to evaluate before subscribing to or
replaying the source Observabl... | [
"Return",
"an",
"Observable",
"that",
"replays",
"the",
"emissions",
"from",
"the",
"source",
"Observable",
"so",
"long",
"as",
"a",
"condtion",
"is",
"true",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"git... | train | https://github.com/ReactiveX/RxJavaComputationExpressions/blob/f9d04ab762223b36fad47402ac36ce7969320d69/src/main/java/rx/Statement.java#L137-L139 |
datacleaner/DataCleaner | engine/core/src/main/java/org/datacleaner/util/CompareUtils.java | CompareUtils.compareUnbound | public static int compareUnbound(final Comparable<?> obj1, final Object obj2) throws ClassCastException {
"""
Compares two objects with an unbound (and thus unsafe) {@link Comparable}
. Use {@link #compare(Comparable, Object)} if possible.
@param obj1
@param obj2
@return a negative integer, zero, or a positi... | java | public static int compareUnbound(final Comparable<?> obj1, final Object obj2) throws ClassCastException {
if (obj1 == obj2) {
return 0;
}
if (obj1 == null) {
return -1;
}
if (obj2 == null) {
return 1;
}
@SuppressWarnings("unche... | [
"public",
"static",
"int",
"compareUnbound",
"(",
"final",
"Comparable",
"<",
"?",
">",
"obj1",
",",
"final",
"Object",
"obj2",
")",
"throws",
"ClassCastException",
"{",
"if",
"(",
"obj1",
"==",
"obj2",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"ob... | Compares two objects with an unbound (and thus unsafe) {@link Comparable}
. Use {@link #compare(Comparable, Object)} if possible.
@param obj1
@param obj2
@return a negative integer, zero, or a positive integer as the first
argument is less than, equal to, or greater than the second.
@throws ClassCastException
if obj1... | [
"Compares",
"two",
"objects",
"with",
"an",
"unbound",
"(",
"and",
"thus",
"unsafe",
")",
"{",
"@link",
"Comparable",
"}",
".",
"Use",
"{",
"@link",
"#compare",
"(",
"Comparable",
"Object",
")",
"}",
"if",
"possible",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/core/src/main/java/org/datacleaner/util/CompareUtils.java#L41-L54 |
wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java | SuffixParser.getPages | public @NotNull List<Page> getPages(@NotNull Predicate<Page> filter) {
"""
Get the pages selected in the suffix of the URL with page paths relative
to the current page path.
@param filter optional filter to select only specific pages
@return a list containing the Pages
"""
return getPages(filter, (Page)... | java | public @NotNull List<Page> getPages(@NotNull Predicate<Page> filter) {
return getPages(filter, (Page)null);
} | [
"public",
"@",
"NotNull",
"List",
"<",
"Page",
">",
"getPages",
"(",
"@",
"NotNull",
"Predicate",
"<",
"Page",
">",
"filter",
")",
"{",
"return",
"getPages",
"(",
"filter",
",",
"(",
"Page",
")",
"null",
")",
";",
"}"
] | Get the pages selected in the suffix of the URL with page paths relative
to the current page path.
@param filter optional filter to select only specific pages
@return a list containing the Pages | [
"Get",
"the",
"pages",
"selected",
"in",
"the",
"suffix",
"of",
"the",
"URL",
"with",
"page",
"paths",
"relative",
"to",
"the",
"current",
"page",
"path",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java#L337-L339 |
teatrove/teatrove | teaservlet/src/main/java/org/teatrove/teaservlet/stats/TeaServletRequestStats.java | TeaServletRequestStats.getStats | public TemplateStats getStats(String fullTemplateName) {
"""
Returns the template stats for a given template name.
@param fullTemplateName the full name of the template with '.'s as
delimeters.
@return the template stats
"""
TemplateStats stats = (TemplateStats) mStatsMap.get(fullTemplateName);
... | java | public TemplateStats getStats(String fullTemplateName) {
TemplateStats stats = (TemplateStats) mStatsMap.get(fullTemplateName);
if (stats == null) {
stats = new TemplateStats(fullTemplateName, mRawWindowSize, mAggregateWindowSize);
mStatsMap.put(fullTemplateName, stats);
... | [
"public",
"TemplateStats",
"getStats",
"(",
"String",
"fullTemplateName",
")",
"{",
"TemplateStats",
"stats",
"=",
"(",
"TemplateStats",
")",
"mStatsMap",
".",
"get",
"(",
"fullTemplateName",
")",
";",
"if",
"(",
"stats",
"==",
"null",
")",
"{",
"stats",
"="... | Returns the template stats for a given template name.
@param fullTemplateName the full name of the template with '.'s as
delimeters.
@return the template stats | [
"Returns",
"the",
"template",
"stats",
"for",
"a",
"given",
"template",
"name",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teaservlet/stats/TeaServletRequestStats.java#L79-L86 |
davidmoten/rxjava-extras | src/main/java/com/github/davidmoten/rx/Transformers.java | Transformers.orderedMergeWith | public static final <T> Transformer<T, T> orderedMergeWith(final Observable<T> other,
final Comparator<? super T> comparator) {
"""
<p>
Returns the source {@link Observable} merged with the <code>other</code>
observable using the given {@link Comparator} for order. A precondition
is that the source ... | java | public static final <T> Transformer<T, T> orderedMergeWith(final Observable<T> other,
final Comparator<? super T> comparator) {
@SuppressWarnings("unchecked")
Collection<Observable<T>> collection = Arrays.asList(other);
return orderedMergeWith(collection, comparator);
} | [
"public",
"static",
"final",
"<",
"T",
">",
"Transformer",
"<",
"T",
",",
"T",
">",
"orderedMergeWith",
"(",
"final",
"Observable",
"<",
"T",
">",
"other",
",",
"final",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comparator",
")",
"{",
"@",
"SuppressW... | <p>
Returns the source {@link Observable} merged with the <code>other</code>
observable using the given {@link Comparator} for order. A precondition
is that the source and other are already ordered. This transformer
supports backpressure and its inputs must also support backpressure.
<p>
<img src=
"https://github.com/... | [
"<p",
">",
"Returns",
"the",
"source",
"{",
"@link",
"Observable",
"}",
"merged",
"with",
"the",
"<code",
">",
"other<",
"/",
"code",
">",
"observable",
"using",
"the",
"given",
"{",
"@link",
"Comparator",
"}",
"for",
"order",
".",
"A",
"precondition",
"... | train | https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Transformers.java#L334-L339 |
moparisthebest/beehive | beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/ReflectionFragment.java | ReflectionFragment.getParameterValue | private Object getParameterValue(ControlBeanContext context, Method method, Object[] args) {
"""
Get the value from the method param.
@param method
@param args
@return Value of reflected method param.
"""
Object value;
try {
value = context.getParameterValue(method, _nameQualifie... | java | private Object getParameterValue(ControlBeanContext context, Method method, Object[] args) {
Object value;
try {
value = context.getParameterValue(method, _nameQualifiers[0], args);
} catch (IllegalArgumentException iae) {
throw new ControlException("Invalid argument name... | [
"private",
"Object",
"getParameterValue",
"(",
"ControlBeanContext",
"context",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"Object",
"value",
";",
"try",
"{",
"value",
"=",
"context",
".",
"getParameterValue",
"(",
"method",
",",
"_n... | Get the value from the method param.
@param method
@param args
@return Value of reflected method param. | [
"Get",
"the",
"value",
"from",
"the",
"method",
"param",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/ReflectionFragment.java#L177-L190 |
selendroid/selendroid | selendroid-common/src/main/java/io/selendroid/common/SelendroidCapabilities.java | SelendroidCapabilities.getDefaultApp | public String getDefaultApp(Set<String> supportedApps) {
"""
Returns the application under test in the format of "appName:appVersion", or "appName" if the supported application
does not have any version associated with it, or returns null if the requested app is not in the apps store. If the
launch activity is a... | java | public String getDefaultApp(Set<String> supportedApps) {
String defaultApp = getAut();
// if the launch activity is specified, just return.
if (getLaunchActivity() != null) {
return defaultApp;
}
// App version is not specified. Get the latest version from the apps store.
if (!defaultApp.c... | [
"public",
"String",
"getDefaultApp",
"(",
"Set",
"<",
"String",
">",
"supportedApps",
")",
"{",
"String",
"defaultApp",
"=",
"getAut",
"(",
")",
";",
"// if the launch activity is specified, just return.",
"if",
"(",
"getLaunchActivity",
"(",
")",
"!=",
"null",
")... | Returns the application under test in the format of "appName:appVersion", or "appName" if the supported application
does not have any version associated with it, or returns null if the requested app is not in the apps store. If the
launch activity is also specified with requested application then just return the reques... | [
"Returns",
"the",
"application",
"under",
"test",
"in",
"the",
"format",
"of",
"appName",
":",
"appVersion",
"or",
"appName",
"if",
"the",
"supported",
"application",
"does",
"not",
"have",
"any",
"version",
"associated",
"with",
"it",
"or",
"returns",
"null",... | train | https://github.com/selendroid/selendroid/blob/a32c1a96c973b80c14a588b1075f084201f7fe94/selendroid-common/src/main/java/io/selendroid/common/SelendroidCapabilities.java#L460-L471 |
io7m/jcanephora | com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLProjectionMatrices.java | JCGLProjectionMatrices.perspectiveProjectionRHP | public static <A, B> PMatrix4x4D<A, B> perspectiveProjectionRHP(
final double z_near,
final double z_far,
final double aspect,
final double horizontal_fov) {
"""
<p>Calculate a matrix that will produce a perspective projection based on
the given view frustum parameters, the aspect ratio of the vie... | java | public static <A, B> PMatrix4x4D<A, B> perspectiveProjectionRHP(
final double z_near,
final double z_far,
final double aspect,
final double horizontal_fov)
{
final double x_max = z_near * StrictMath.tan(horizontal_fov / 2.0);
final double x_min = -x_max;
final double y_max = x_max / aspect... | [
"public",
"static",
"<",
"A",
",",
"B",
">",
"PMatrix4x4D",
"<",
"A",
",",
"B",
">",
"perspectiveProjectionRHP",
"(",
"final",
"double",
"z_near",
",",
"final",
"double",
"z_far",
",",
"final",
"double",
"aspect",
",",
"final",
"double",
"horizontal_fov",
... | <p>Calculate a matrix that will produce a perspective projection based on
the given view frustum parameters, the aspect ratio of the viewport and a
given horizontal field of view in radians. Note that {@code fov_radians}
represents the full horizontal field of view: the angle at the base of the
triangle formed by the f... | [
"<p",
">",
"Calculate",
"a",
"matrix",
"that",
"will",
"produce",
"a",
"perspective",
"projection",
"based",
"on",
"the",
"given",
"view",
"frustum",
"parameters",
"the",
"aspect",
"ratio",
"of",
"the",
"viewport",
"and",
"a",
"given",
"horizontal",
"field",
... | train | https://github.com/io7m/jcanephora/blob/0004c1744b7f0969841d04cd4fa693f402b10980/com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLProjectionMatrices.java#L334-L345 |
albfernandez/javadbf | src/main/java/com/linuxense/javadbf/Utils.java | Utils.textPadding | @Deprecated
public static byte[] textPadding(String text, String characterSetName, int length, DBFAlignment alignment, byte paddingByte)
throws UnsupportedEncodingException {
"""
Obtais the data to store in file for a text field.
Text is truncated if exceed field capacity
@param text the text to write
@para... | java | @Deprecated
public static byte[] textPadding(String text, String characterSetName, int length, DBFAlignment alignment, byte paddingByte)
throws UnsupportedEncodingException {
return textPadding(text, Charset.forName(characterSetName), length, alignment, paddingByte);
} | [
"@",
"Deprecated",
"public",
"static",
"byte",
"[",
"]",
"textPadding",
"(",
"String",
"text",
",",
"String",
"characterSetName",
",",
"int",
"length",
",",
"DBFAlignment",
"alignment",
",",
"byte",
"paddingByte",
")",
"throws",
"UnsupportedEncodingException",
"{"... | Obtais the data to store in file for a text field.
Text is truncated if exceed field capacity
@param text the text to write
@param characterSetName The charset to use
@param length field length
@param alignment where to align the data
@param paddingByte the byte to use for padding
@return byte[] to store in the file
@t... | [
"Obtais",
"the",
"data",
"to",
"store",
"in",
"file",
"for",
"a",
"text",
"field",
".",
"Text",
"is",
"truncated",
"if",
"exceed",
"field",
"capacity"
] | train | https://github.com/albfernandez/javadbf/blob/ac9867b46786cb055bce9323e2cf074365207693/src/main/java/com/linuxense/javadbf/Utils.java#L323-L327 |
Daytron/SimpleDialogFX | src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java | Dialog.setHeaderFont | public void setHeaderFont(String font_family, int font_size) {
"""
Sets both header label's font family and size.
@param font_family Font family in <code>Strings</code>
@param font_size Font size in <code>integer</code> (pixels)
"""
this.headerLabel
.setStyle("-fx-font-family: \"" +... | java | public void setHeaderFont(String font_family, int font_size) {
this.headerLabel
.setStyle("-fx-font-family: \"" + font_family + "\";"
+ "-fx-font-size:" + Integer.toString(font_size) + "px;");
} | [
"public",
"void",
"setHeaderFont",
"(",
"String",
"font_family",
",",
"int",
"font_size",
")",
"{",
"this",
".",
"headerLabel",
".",
"setStyle",
"(",
"\"-fx-font-family: \\\"\"",
"+",
"font_family",
"+",
"\"\\\";\"",
"+",
"\"-fx-font-size:\"",
"+",
"Integer",
".",... | Sets both header label's font family and size.
@param font_family Font family in <code>Strings</code>
@param font_size Font size in <code>integer</code> (pixels) | [
"Sets",
"both",
"header",
"label",
"s",
"font",
"family",
"and",
"size",
"."
] | train | https://github.com/Daytron/SimpleDialogFX/blob/54e813dbb0ebabad8e0a81b6b5f05e518747611e/src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java#L858-L862 |
UrielCh/ovh-java-sdk | ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java | ApiOvhMsServices.serviceName_account_userPrincipalName_mfa_GET | public OvhMfaInformation serviceName_account_userPrincipalName_mfa_GET(String serviceName, String userPrincipalName) throws IOException {
"""
Get this object properties
REST: GET /msServices/{serviceName}/account/{userPrincipalName}/mfa
@param serviceName [required] The internal name of your Active Directory o... | java | public OvhMfaInformation serviceName_account_userPrincipalName_mfa_GET(String serviceName, String userPrincipalName) throws IOException {
String qPath = "/msServices/{serviceName}/account/{userPrincipalName}/mfa";
StringBuilder sb = path(qPath, serviceName, userPrincipalName);
String resp = exec(qPath, "GET", sb.... | [
"public",
"OvhMfaInformation",
"serviceName_account_userPrincipalName_mfa_GET",
"(",
"String",
"serviceName",
",",
"String",
"userPrincipalName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/msServices/{serviceName}/account/{userPrincipalName}/mfa\"",
";",
"Stri... | Get this object properties
REST: GET /msServices/{serviceName}/account/{userPrincipalName}/mfa
@param serviceName [required] The internal name of your Active Directory organization
@param userPrincipalName [required] User Principal Name
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java#L239-L244 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/OpenCensusUtils.java | OpenCensusUtils.propagateTracingContext | public static void propagateTracingContext(Span span, HttpHeaders headers) {
"""
Propagate information of current tracing context. This information will be injected into HTTP
header.
@param span the span to be propagated.
@param headers the headers used in propagation.
"""
Preconditions.checkArgument(... | java | public static void propagateTracingContext(Span span, HttpHeaders headers) {
Preconditions.checkArgument(span != null, "span should not be null.");
Preconditions.checkArgument(headers != null, "headers should not be null.");
if (propagationTextFormat != null && propagationTextFormatSetter != null) {
i... | [
"public",
"static",
"void",
"propagateTracingContext",
"(",
"Span",
"span",
",",
"HttpHeaders",
"headers",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"span",
"!=",
"null",
",",
"\"span should not be null.\"",
")",
";",
"Preconditions",
".",
"checkArgument... | Propagate information of current tracing context. This information will be injected into HTTP
header.
@param span the span to be propagated.
@param headers the headers used in propagation. | [
"Propagate",
"information",
"of",
"current",
"tracing",
"context",
".",
"This",
"information",
"will",
"be",
"injected",
"into",
"HTTP",
"header",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/OpenCensusUtils.java#L132-L140 |
h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/utils/GenmodelBitSet.java | GenmodelBitSet.fill3_1 | public void fill3_1(byte[] bits, ByteBufferWrapper ab) {
"""
/* SET IN STONE FOR MOJO VERSION "1.10" AND OLDER - DO NOT CHANGE
"""
int bitoff = ab.get2();
int nbytes = ab.get2();
fill_1(bits, ab.position(), nbytes<<3, bitoff);
ab.skip(nbytes); // Skip inline bitset
} | java | public void fill3_1(byte[] bits, ByteBufferWrapper ab) {
int bitoff = ab.get2();
int nbytes = ab.get2();
fill_1(bits, ab.position(), nbytes<<3, bitoff);
ab.skip(nbytes); // Skip inline bitset
} | [
"public",
"void",
"fill3_1",
"(",
"byte",
"[",
"]",
"bits",
",",
"ByteBufferWrapper",
"ab",
")",
"{",
"int",
"bitoff",
"=",
"ab",
".",
"get2",
"(",
")",
";",
"int",
"nbytes",
"=",
"ab",
".",
"get2",
"(",
")",
";",
"fill_1",
"(",
"bits",
",",
"ab"... | /* SET IN STONE FOR MOJO VERSION "1.10" AND OLDER - DO NOT CHANGE | [
"/",
"*",
"SET",
"IN",
"STONE",
"FOR",
"MOJO",
"VERSION",
"1",
".",
"10",
"AND",
"OLDER",
"-",
"DO",
"NOT",
"CHANGE"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/utils/GenmodelBitSet.java#L78-L83 |
facebook/fresco | fbcore/src/main/java/com/facebook/common/util/UriUtil.java | UriUtil.getRealPathFromUri | @Nullable
public static String getRealPathFromUri(ContentResolver contentResolver, final Uri srcUri) {
"""
Get the path of a file from the Uri.
@param contentResolver the content resolver which will query for the source file
@param srcUri The source uri
@return The Path for the file or null if doesn't exist... | java | @Nullable
public static String getRealPathFromUri(ContentResolver contentResolver, final Uri srcUri) {
String result = null;
if (isLocalContentUri(srcUri)) {
Cursor cursor = null;
try {
cursor = contentResolver.query(srcUri, null, null, null, null);
if (cursor != null && cursor.mov... | [
"@",
"Nullable",
"public",
"static",
"String",
"getRealPathFromUri",
"(",
"ContentResolver",
"contentResolver",
",",
"final",
"Uri",
"srcUri",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"isLocalContentUri",
"(",
"srcUri",
")",
")",
"{",
"Cursor... | Get the path of a file from the Uri.
@param contentResolver the content resolver which will query for the source file
@param srcUri The source uri
@return The Path for the file or null if doesn't exists | [
"Get",
"the",
"path",
"of",
"a",
"file",
"from",
"the",
"Uri",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/fbcore/src/main/java/com/facebook/common/util/UriUtil.java#L205-L227 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/reflection/EntityClassReader.java | EntityClassReader.getPropertyType | public Class getPropertyType(String propertyPath) {
"""
Retrieves the type of the given property path.
@param propertyPath The dot-separated path of the property type to retrieve. E.g. directly property: "name",
sub property: "streetAddress.number"
@return the type of the property with the given name or null ... | java | public Class getPropertyType(String propertyPath) {
if (propertyPath == null) {
throw new IllegalArgumentException("Propertyname may not be null");
}
StringTokenizer tokenizer = new StringTokenizer(propertyPath, ".", false);
return getPropertyType(tokenizer);
} | [
"public",
"Class",
"getPropertyType",
"(",
"String",
"propertyPath",
")",
"{",
"if",
"(",
"propertyPath",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Propertyname may not be null\"",
")",
";",
"}",
"StringTokenizer",
"tokenizer",
"=",... | Retrieves the type of the given property path.
@param propertyPath The dot-separated path of the property type to retrieve. E.g. directly property: "name",
sub property: "streetAddress.number"
@return the type of the property with the given name or null if the propertyName is not a property of the class managed
by thi... | [
"Retrieves",
"the",
"type",
"of",
"the",
"given",
"property",
"path",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/reflection/EntityClassReader.java#L370-L378 |
jenkinsci/jenkins | core/src/main/java/hudson/os/solaris/ZFSInstaller.java | ZFSInstaller.createZfsFileSystem | private String createZfsFileSystem(final TaskListener listener, String rootUsername, String rootPassword) throws IOException, InterruptedException, ZFSException {
"""
Creates a ZFS file system to migrate the data to.
<p>
This has to be done while we still have an interactive access with the user, since it invo... | java | private String createZfsFileSystem(final TaskListener listener, String rootUsername, String rootPassword) throws IOException, InterruptedException, ZFSException {
// capture the UID that Hudson runs under
// so that we can allow this user to do everything on this new partition
final int uid = LI... | [
"private",
"String",
"createZfsFileSystem",
"(",
"final",
"TaskListener",
"listener",
",",
"String",
"rootUsername",
",",
"String",
"rootPassword",
")",
"throws",
"IOException",
",",
"InterruptedException",
",",
"ZFSException",
"{",
"// capture the UID that Hudson runs unde... | Creates a ZFS file system to migrate the data to.
<p>
This has to be done while we still have an interactive access with the user, since it involves the password.
<p>
An exception will be thrown if the operation fails. A normal completion means a success.
@return
The ZFS dataset name to migrate the data to. | [
"Creates",
"a",
"ZFS",
"file",
"system",
"to",
"migrate",
"the",
"data",
"to",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/os/solaris/ZFSInstaller.java#L158-L173 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/maxsat/encodings/Encoder.java | Encoder.updatePB | public void updatePB(final MiniSatStyleSolver s, int rhs) {
"""
Updates a pseudo-Boolean encoding.
@param s the solver
@param rhs the new right hand side
@throws IllegalStateException if the pseudo-Boolean encoding is unknown
"""
switch (this.pbEncoding) {
case SWC:
this.swc.update(s, rh... | java | public void updatePB(final MiniSatStyleSolver s, int rhs) {
switch (this.pbEncoding) {
case SWC:
this.swc.update(s, rhs);
break;
default:
throw new IllegalStateException("Unknown pseudo-Boolean encoding: " + this.pbEncoding);
}
} | [
"public",
"void",
"updatePB",
"(",
"final",
"MiniSatStyleSolver",
"s",
",",
"int",
"rhs",
")",
"{",
"switch",
"(",
"this",
".",
"pbEncoding",
")",
"{",
"case",
"SWC",
":",
"this",
".",
"swc",
".",
"update",
"(",
"s",
",",
"rhs",
")",
";",
"break",
... | Updates a pseudo-Boolean encoding.
@param s the solver
@param rhs the new right hand side
@throws IllegalStateException if the pseudo-Boolean encoding is unknown | [
"Updates",
"a",
"pseudo",
"-",
"Boolean",
"encoding",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/maxsat/encodings/Encoder.java#L268-L276 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Canberra | public static double Canberra(double x1, double y1, double x2, double y2) {
"""
Gets the Canberra distance between two points.
@param x1 X1 axis coordinate.
@param y1 Y1 axis coordinate.
@param x2 X2 axis coordinate.
@param y2 Y2 axis coordinate.
@return The Canberra distance between x and y.
"""
... | java | public static double Canberra(double x1, double y1, double x2, double y2) {
double distance;
distance = Math.abs(x1 - x2) / (Math.abs(x1) + Math.abs(x2));
distance += Math.abs(y1 - y2) / (Math.abs(y1) + Math.abs(y2));
return distance;
} | [
"public",
"static",
"double",
"Canberra",
"(",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"x2",
",",
"double",
"y2",
")",
"{",
"double",
"distance",
";",
"distance",
"=",
"Math",
".",
"abs",
"(",
"x1",
"-",
"x2",
")",
"/",
"(",
"Math",
"."... | Gets the Canberra distance between two points.
@param x1 X1 axis coordinate.
@param y1 Y1 axis coordinate.
@param x2 X2 axis coordinate.
@param y2 Y2 axis coordinate.
@return The Canberra distance between x and y. | [
"Gets",
"the",
"Canberra",
"distance",
"between",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L151-L158 |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/binding/BindingFactory.java | BindingFactory.bindAnnotatedWith | protected Binding bindAnnotatedWith(TypeReference bind, TypeReference annotatedWith, TypeReference to,
String functionName) {
"""
Bind an annotated element.
@param bind the type to bind.
@param annotatedWith the annotation to consider.
@param to the target type.
@param functionName the optional function n... | java | protected Binding bindAnnotatedWith(TypeReference bind, TypeReference annotatedWith, TypeReference to,
String functionName) {
final StringConcatenationClient client = new StringConcatenationClient() {
@Override
protected void appendTo(TargetStringConcatenation builder) {
builder.append("binder.bind("); /... | [
"protected",
"Binding",
"bindAnnotatedWith",
"(",
"TypeReference",
"bind",
",",
"TypeReference",
"annotatedWith",
",",
"TypeReference",
"to",
",",
"String",
"functionName",
")",
"{",
"final",
"StringConcatenationClient",
"client",
"=",
"new",
"StringConcatenationClient",
... | Bind an annotated element.
@param bind the type to bind.
@param annotatedWith the annotation to consider.
@param to the target type.
@param functionName the optional function name.
@return the binding element. | [
"Bind",
"an",
"annotated",
"element",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/binding/BindingFactory.java#L91-L112 |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ExtendedProperties.java | ExtendedProperties.store | public void store(final Writer writer, final String comments, final boolean sorted, final boolean process) throws IOException {
"""
Writes the properties to the specified writer, including defaults.
@param writer
The writer
@param comments
The header comment written to the writer
@param sorted
If {@code tr... | java | public void store(final Writer writer, final String comments, final boolean sorted, final boolean process) throws IOException {
BufferedWriter bw = writer instanceof BufferedWriter ? (BufferedWriter) writer : new BufferedWriter(writer);
if (comments != null) {
for (Scanner scanner = new Scanner(comments); s... | [
"public",
"void",
"store",
"(",
"final",
"Writer",
"writer",
",",
"final",
"String",
"comments",
",",
"final",
"boolean",
"sorted",
",",
"final",
"boolean",
"process",
")",
"throws",
"IOException",
"{",
"BufferedWriter",
"bw",
"=",
"writer",
"instanceof",
"Buf... | Writes the properties to the specified writer, including defaults.
@param writer
The writer
@param comments
The header comment written to the writer
@param sorted
If {@code true}, the properties are written sorted by key
@param process
If {@code true}, place holders are resolved | [
"Writes",
"the",
"properties",
"to",
"the",
"specified",
"writer",
"including",
"defaults",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ExtendedProperties.java#L643-L669 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/db/TaskSession.java | TaskSession.createRemoteReceiveQueue | public RemoteReceiveQueue createRemoteReceiveQueue(String strQueueName, String strQueueType) throws RemoteException {
"""
Create the remote receive queue.
@param strQueueName The queue name to service.
@param strQueueType The queue type.
@return The RemoteSendQueue.
"""
MessageManager messageManager... | java | public RemoteReceiveQueue createRemoteReceiveQueue(String strQueueName, String strQueueType) throws RemoteException
{
MessageManager messageManager = this.getEnvironment().getMessageManager(this.getApplication(), true);
BaseMessageReceiver receiver = (BaseMessageReceiver)messageManager.getMessageQue... | [
"public",
"RemoteReceiveQueue",
"createRemoteReceiveQueue",
"(",
"String",
"strQueueName",
",",
"String",
"strQueueType",
")",
"throws",
"RemoteException",
"{",
"MessageManager",
"messageManager",
"=",
"this",
".",
"getEnvironment",
"(",
")",
".",
"getMessageManager",
"... | Create the remote receive queue.
@param strQueueName The queue name to service.
@param strQueueType The queue type.
@return The RemoteSendQueue. | [
"Create",
"the",
"remote",
"receive",
"queue",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/db/TaskSession.java#L287-L293 |
rjstanford/protea-http | src/main/java/cc/protea/util/http/Request.java | Request.writeResource | private Response writeResource(final String method, final String body) throws IOException {
"""
A private method that handles issuing POST and PUT requests
@param method
POST or PUT
@param body
The body of the Message
@return the {@link Response} from the server
@throws IOException
"""
buildQueryStri... | java | private Response writeResource(final String method, final String body) throws IOException {
buildQueryString();
buildHeaders();
connection.setDoOutput(true);
connection.setRequestMethod(method);
writer = new OutputStreamWriter(connection.getOutputStream());
writer.write(body);
writer.close();
return ... | [
"private",
"Response",
"writeResource",
"(",
"final",
"String",
"method",
",",
"final",
"String",
"body",
")",
"throws",
"IOException",
"{",
"buildQueryString",
"(",
")",
";",
"buildHeaders",
"(",
")",
";",
"connection",
".",
"setDoOutput",
"(",
"true",
")",
... | A private method that handles issuing POST and PUT requests
@param method
POST or PUT
@param body
The body of the Message
@return the {@link Response} from the server
@throws IOException | [
"A",
"private",
"method",
"that",
"handles",
"issuing",
"POST",
"and",
"PUT",
"requests"
] | train | https://github.com/rjstanford/protea-http/blob/4d4a18805639181a738faff199e39d58337169ea/src/main/java/cc/protea/util/http/Request.java#L221-L233 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java | ClassUtil.getClassName | public static String getClassName(Object obj, boolean isSimple) {
"""
获取类名
@param obj 获取类名对象
@param isSimple 是否简单类名,如果为true,返回不带包名的类名
@return 类名
@since 3.0.7
"""
if (null == obj) {
return null;
}
final Class<?> clazz = obj.getClass();
return getClassName(clazz, isSimple);
} | java | public static String getClassName(Object obj, boolean isSimple) {
if (null == obj) {
return null;
}
final Class<?> clazz = obj.getClass();
return getClassName(clazz, isSimple);
} | [
"public",
"static",
"String",
"getClassName",
"(",
"Object",
"obj",
",",
"boolean",
"isSimple",
")",
"{",
"if",
"(",
"null",
"==",
"obj",
")",
"{",
"return",
"null",
";",
"}",
"final",
"Class",
"<",
"?",
">",
"clazz",
"=",
"obj",
".",
"getClass",
"("... | 获取类名
@param obj 获取类名对象
@param isSimple 是否简单类名,如果为true,返回不带包名的类名
@return 类名
@since 3.0.7 | [
"获取类名"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L81-L87 |
jhg023/SimpleNet | src/main/java/simplenet/packet/Packet.java | Packet.putString | public Packet putString(String s) {
"""
Writes a single {@link StandardCharsets#UTF_8}-encoded {@link String} with {@link ByteOrder#BIG_ENDIAN} order to
this {@link Packet}'s payload.
<br><br>
The {@link String} can have a maximum length of {@code 65,535}.
@param s The {@link String} to write.
@return The {... | java | public Packet putString(String s) {
return putString(s, StandardCharsets.UTF_8, ByteOrder.BIG_ENDIAN);
} | [
"public",
"Packet",
"putString",
"(",
"String",
"s",
")",
"{",
"return",
"putString",
"(",
"s",
",",
"StandardCharsets",
".",
"UTF_8",
",",
"ByteOrder",
".",
"BIG_ENDIAN",
")",
";",
"}"
] | Writes a single {@link StandardCharsets#UTF_8}-encoded {@link String} with {@link ByteOrder#BIG_ENDIAN} order to
this {@link Packet}'s payload.
<br><br>
The {@link String} can have a maximum length of {@code 65,535}.
@param s The {@link String} to write.
@return The {@link Packet} to allow for chained writes.
@see #pu... | [
"Writes",
"a",
"single",
"{",
"@link",
"StandardCharsets#UTF_8",
"}",
"-",
"encoded",
"{",
"@link",
"String",
"}",
"with",
"{",
"@link",
"ByteOrder#BIG_ENDIAN",
"}",
"order",
"to",
"this",
"{",
"@link",
"Packet",
"}",
"s",
"payload",
".",
"<br",
">",
"<br"... | train | https://github.com/jhg023/SimpleNet/blob/a5b55cbfe1768c6a28874f12adac3c748f2b509a/src/main/java/simplenet/packet/Packet.java#L310-L312 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PoseFromPairLinear6.java | PoseFromPairLinear6.processHomogenous | public boolean processHomogenous( List<AssociatedPair> observations , List<Point4D_F64> locations ) {
"""
Computes the transformation between two camera frames using a linear equation. Both the
observed feature locations in each camera image and the depth (z-coordinate) of each feature
must be known. Feature l... | java | public boolean processHomogenous( List<AssociatedPair> observations , List<Point4D_F64> locations ) {
if( observations.size() != locations.size() )
throw new IllegalArgumentException("Number of observations and locations must match.");
if( observations.size() < 6 )
throw new IllegalArgumentException("At leas... | [
"public",
"boolean",
"processHomogenous",
"(",
"List",
"<",
"AssociatedPair",
">",
"observations",
",",
"List",
"<",
"Point4D_F64",
">",
"locations",
")",
"{",
"if",
"(",
"observations",
".",
"size",
"(",
")",
"!=",
"locations",
".",
"size",
"(",
")",
")",... | Computes the transformation between two camera frames using a linear equation. Both the
observed feature locations in each camera image and the depth (z-coordinate) of each feature
must be known. Feature locations are in calibrated image coordinates.
@param observations List of observations on the image plane in cal... | [
"Computes",
"the",
"transformation",
"between",
"two",
"camera",
"frames",
"using",
"a",
"linear",
"equation",
".",
"Both",
"the",
"observed",
"feature",
"locations",
"in",
"each",
"camera",
"image",
"and",
"the",
"depth",
"(",
"z",
"-",
"coordinate",
")",
"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PoseFromPairLinear6.java#L105-L121 |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/parser/JSONParserReader.java | JSONParserReader.parse | public Object parse(Reader in) throws ParseException {
"""
use to return Primitive Type, or String, Or JsonObject or JsonArray
generated by a ContainerFactory
"""
return parse(in, JSONValue.defaultReader.DEFAULT);
} | java | public Object parse(Reader in) throws ParseException {
return parse(in, JSONValue.defaultReader.DEFAULT);
} | [
"public",
"Object",
"parse",
"(",
"Reader",
"in",
")",
"throws",
"ParseException",
"{",
"return",
"parse",
"(",
"in",
",",
"JSONValue",
".",
"defaultReader",
".",
"DEFAULT",
")",
";",
"}"
] | use to return Primitive Type, or String, Or JsonObject or JsonArray
generated by a ContainerFactory | [
"use",
"to",
"return",
"Primitive",
"Type",
"or",
"String",
"Or",
"JsonObject",
"or",
"JsonArray",
"generated",
"by",
"a",
"ContainerFactory"
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/parser/JSONParserReader.java#L43-L45 |
sksamuel/scrimage | scrimage-core/src/main/java/com/sksamuel/scrimage/PixelTools.java | PixelTools.approx | public static boolean approx(Color color, int tolerance, Pixel[] pixels) {
"""
Returns true if the colors of all pixels in the array are within the given tolerance
compared to the referenced color
"""
RGBColor refColor = color.toRGB();
RGBColor minColor = new RGBColor(
Math.m... | java | public static boolean approx(Color color, int tolerance, Pixel[] pixels) {
RGBColor refColor = color.toRGB();
RGBColor minColor = new RGBColor(
Math.max(refColor.red() - tolerance, 0),
Math.max(refColor.green() - tolerance, 0),
Math.max(refColor.blue() -... | [
"public",
"static",
"boolean",
"approx",
"(",
"Color",
"color",
",",
"int",
"tolerance",
",",
"Pixel",
"[",
"]",
"pixels",
")",
"{",
"RGBColor",
"refColor",
"=",
"color",
".",
"toRGB",
"(",
")",
";",
"RGBColor",
"minColor",
"=",
"new",
"RGBColor",
"(",
... | Returns true if the colors of all pixels in the array are within the given tolerance
compared to the referenced color | [
"Returns",
"true",
"if",
"the",
"colors",
"of",
"all",
"pixels",
"in",
"the",
"array",
"are",
"within",
"the",
"given",
"tolerance",
"compared",
"to",
"the",
"referenced",
"color"
] | train | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-core/src/main/java/com/sksamuel/scrimage/PixelTools.java#L93-L112 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java | BugInstance.addCalledMethod | @Nonnull
public BugInstance addCalledMethod(ConstantPoolGen cpg, InvokeInstruction inv) {
"""
Add a method annotation for the method which is called by given
instruction.
@param cpg
the constant pool for the method containing the call
@param inv
the InvokeInstruction
@return this object
"""
... | java | @Nonnull
public BugInstance addCalledMethod(ConstantPoolGen cpg, InvokeInstruction inv) {
String className = inv.getClassName(cpg);
String methodName = inv.getMethodName(cpg);
String methodSig = inv.getSignature(cpg);
addMethod(className, methodName, methodSig, inv.getOpcode() == Con... | [
"@",
"Nonnull",
"public",
"BugInstance",
"addCalledMethod",
"(",
"ConstantPoolGen",
"cpg",
",",
"InvokeInstruction",
"inv",
")",
"{",
"String",
"className",
"=",
"inv",
".",
"getClassName",
"(",
"cpg",
")",
";",
"String",
"methodName",
"=",
"inv",
".",
"getMet... | Add a method annotation for the method which is called by given
instruction.
@param cpg
the constant pool for the method containing the call
@param inv
the InvokeInstruction
@return this object | [
"Add",
"a",
"method",
"annotation",
"for",
"the",
"method",
"which",
"is",
"called",
"by",
"given",
"instruction",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1452-L1460 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.transposeTimes | public static double transposeTimes(final double[] v1, final double[] v2) {
"""
Vector scalar product (dot product),
v1<sup>T</sup> v2 = v1·v2 = <v1,v2>.
@param v1 vector
@param v2 other vector
@return scalar result of matrix product, v1<sup>T</sup> * v2
"""
assert v2.length == v1.length : ERR_... | java | public static double transposeTimes(final double[] v1, final double[] v2) {
assert v2.length == v1.length : ERR_VEC_DIMENSIONS;
double s = 0;
for(int k = 0; k < v1.length; k++) {
s += v1[k] * v2[k];
}
return s;
} | [
"public",
"static",
"double",
"transposeTimes",
"(",
"final",
"double",
"[",
"]",
"v1",
",",
"final",
"double",
"[",
"]",
"v2",
")",
"{",
"assert",
"v2",
".",
"length",
"==",
"v1",
".",
"length",
":",
"ERR_VEC_DIMENSIONS",
";",
"double",
"s",
"=",
"0",... | Vector scalar product (dot product),
v1<sup>T</sup> v2 = v1·v2 = <v1,v2>.
@param v1 vector
@param v2 other vector
@return scalar result of matrix product, v1<sup>T</sup> * v2 | [
"Vector",
"scalar",
"product",
"(",
"dot",
"product",
")",
"v1<sup",
">",
"T<",
"/",
"sup",
">",
"v2",
"=",
"v1·v2",
"=",
"<",
";",
"v1",
"v2>",
";",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L565-L572 |
OpenHFT/Chronicle-Map | src/main/java/net/openhft/chronicle/hash/impl/BigSegmentHeader.java | BigSegmentHeader.tryWriteLockMillis | private static boolean tryWriteLockMillis(
long address, long timeInMillis, boolean interruptible) throws InterruptedException {
"""
Use a timer which is more insensitive to jumps in time like GCs and context switches.
"""
long lastTime = System.currentTimeMillis();
registerWait(add... | java | private static boolean tryWriteLockMillis(
long address, long timeInMillis, boolean interruptible) throws InterruptedException {
long lastTime = System.currentTimeMillis();
registerWait(address);
try {
do {
if (LOCK.tryWriteLockAndDeregisterWait(A, null, a... | [
"private",
"static",
"boolean",
"tryWriteLockMillis",
"(",
"long",
"address",
",",
"long",
"timeInMillis",
",",
"boolean",
"interruptible",
")",
"throws",
"InterruptedException",
"{",
"long",
"lastTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"reg... | Use a timer which is more insensitive to jumps in time like GCs and context switches. | [
"Use",
"a",
"timer",
"which",
"is",
"more",
"insensitive",
"to",
"jumps",
"in",
"time",
"like",
"GCs",
"and",
"context",
"switches",
"."
] | train | https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/hash/impl/BigSegmentHeader.java#L239-L260 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java | RemoteWebDriverBuilder.addMetadata | public RemoteWebDriverBuilder addMetadata(String key, Object value) {
"""
Adds metadata to the outgoing new session request, which can be used by intermediary of end
nodes for any purpose they choose (commonly, this is used to request additional features from
cloud providers, such as video recordings or to set t... | java | public RemoteWebDriverBuilder addMetadata(String key, Object value) {
if (ILLEGAL_METADATA_KEYS.contains(key)) {
throw new IllegalArgumentException(key + " is a reserved key");
}
metadata.put(Objects.requireNonNull(key), Objects.requireNonNull(value));
return this;
} | [
"public",
"RemoteWebDriverBuilder",
"addMetadata",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"ILLEGAL_METADATA_KEYS",
".",
"contains",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"key",
"+",
"\" is a reser... | Adds metadata to the outgoing new session request, which can be used by intermediary of end
nodes for any purpose they choose (commonly, this is used to request additional features from
cloud providers, such as video recordings or to set the timezone or screen size). Neither
parameter can be {@code null}. | [
"Adds",
"metadata",
"to",
"the",
"outgoing",
"new",
"session",
"request",
"which",
"can",
"be",
"used",
"by",
"intermediary",
"of",
"end",
"nodes",
"for",
"any",
"purpose",
"they",
"choose",
"(",
"commonly",
"this",
"is",
"used",
"to",
"request",
"additional... | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java#L132-L138 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/DateUtils.java | DateUtils.subSeconds | public static long subSeconds(final Date date1, final Date date2) {
"""
Get how many seconds between two date.
@param date1 date to be tested.
@param date2 date to be tested.
@return how many seconds between two date.
"""
return subTime(date1, date2, DatePeriod.SECOND);
} | java | public static long subSeconds(final Date date1, final Date date2) {
return subTime(date1, date2, DatePeriod.SECOND);
} | [
"public",
"static",
"long",
"subSeconds",
"(",
"final",
"Date",
"date1",
",",
"final",
"Date",
"date2",
")",
"{",
"return",
"subTime",
"(",
"date1",
",",
"date2",
",",
"DatePeriod",
".",
"SECOND",
")",
";",
"}"
] | Get how many seconds between two date.
@param date1 date to be tested.
@param date2 date to be tested.
@return how many seconds between two date. | [
"Get",
"how",
"many",
"seconds",
"between",
"two",
"date",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/DateUtils.java#L411-L414 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.unlockResource | public void unlockResource(CmsDbContext dbc, CmsResource resource, boolean force, boolean removeSystemLock)
throws CmsException {
"""
Unlocks a resource.<p>
@param dbc the current database context
@param resource the resource to unlock
@param force <code>true</code>, if a resource is forced to get unlocke... | java | public void unlockResource(CmsDbContext dbc, CmsResource resource, boolean force, boolean removeSystemLock)
throws CmsException {
// update the resource cache
m_monitor.clearResourceCache();
// now update lock status
m_lockManager.removeResource(dbc, resource, force, removeSystemLo... | [
"public",
"void",
"unlockResource",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
",",
"boolean",
"force",
",",
"boolean",
"removeSystemLock",
")",
"throws",
"CmsException",
"{",
"// update the resource cache",
"m_monitor",
".",
"clearResourceCache",
"(",
... | Unlocks a resource.<p>
@param dbc the current database context
@param resource the resource to unlock
@param force <code>true</code>, if a resource is forced to get unlocked, no matter by which user and in which project the resource is currently locked
@param removeSystemLock <code>true</code>, if you also want to rem... | [
"Unlocks",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9220-L9237 |
Azure/azure-sdk-for-java | cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java | DatabaseAccountsInner.onlineRegionAsync | public Observable<Void> onlineRegionAsync(String resourceGroupName, String accountName, String region) {
"""
Online the specified region for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param regi... | java | public Observable<Void> onlineRegionAsync(String resourceGroupName, String accountName, String region) {
return onlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> res... | [
"public",
"Observable",
"<",
"Void",
">",
"onlineRegionAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"region",
")",
"{",
"return",
"onlineRegionWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"re... | Online the specified region for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param region Cosmos DB region, with spaces between words and each word capitalized.
@throws IllegalArgumentException thrown if p... | [
"Online",
"the",
"specified",
"region",
"for",
"the",
"specified",
"Azure",
"Cosmos",
"DB",
"database",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java#L1483-L1490 |
vst/commons-math-extensions | src/main/java/com/vsthost/rnd/commons/math/ext/linear/EMatrixUtils.java | EMatrixUtils.rbrMultiply | public static RealMatrix rbrMultiply(RealMatrix matrix, RealVector vector) {
"""
Multiplies the matrix' rows using the vector element-by-element.
@param matrix The input matrix.
@param vector The vector which will be used to multiply rows of the matrix element-by-element.
@return The new matrix of which rows ... | java | public static RealMatrix rbrMultiply(RealMatrix matrix, RealVector vector) {
// Define the return value:
RealMatrix retval = MatrixUtils.createRealMatrix(matrix.getRowDimension(), matrix.getColumnDimension());
// Iterate over rows:
for (int i = 0; i < retval.getRowDimension(); i++) {
... | [
"public",
"static",
"RealMatrix",
"rbrMultiply",
"(",
"RealMatrix",
"matrix",
",",
"RealVector",
"vector",
")",
"{",
"// Define the return value:",
"RealMatrix",
"retval",
"=",
"MatrixUtils",
".",
"createRealMatrix",
"(",
"matrix",
".",
"getRowDimension",
"(",
")",
... | Multiplies the matrix' rows using the vector element-by-element.
@param matrix The input matrix.
@param vector The vector which will be used to multiply rows of the matrix element-by-element.
@return The new matrix of which rows are multiplied with the vector element-by-element. | [
"Multiplies",
"the",
"matrix",
"rows",
"using",
"the",
"vector",
"element",
"-",
"by",
"-",
"element",
"."
] | train | https://github.com/vst/commons-math-extensions/blob/a11ee78ffe53ab7c016062be93c5af07aa8e1823/src/main/java/com/vsthost/rnd/commons/math/ext/linear/EMatrixUtils.java#L265-L276 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/support/PageFactory.java | PageFactory.initElements | public static <T> T initElements(WebDriver driver, Class<T> pageClassToProxy) {
"""
Instantiate an instance of the given class, and set a lazy proxy for each of the WebElement and
List<WebElement> fields that have been declared, assuming that the field
name is also the HTML element's "id" or "name". This m... | java | public static <T> T initElements(WebDriver driver, Class<T> pageClassToProxy) {
T page = instantiatePage(driver, pageClassToProxy);
initElements(driver, page);
return page;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"initElements",
"(",
"WebDriver",
"driver",
",",
"Class",
"<",
"T",
">",
"pageClassToProxy",
")",
"{",
"T",
"page",
"=",
"instantiatePage",
"(",
"driver",
",",
"pageClassToProxy",
")",
";",
"initElements",
"(",
"driv... | Instantiate an instance of the given class, and set a lazy proxy for each of the WebElement and
List<WebElement> fields that have been declared, assuming that the field
name is also the HTML element's "id" or "name". This means that for the class:
<code> public class Page { private WebElement submit; } </code>
... | [
"Instantiate",
"an",
"instance",
"of",
"the",
"given",
"class",
"and",
"set",
"a",
"lazy",
"proxy",
"for",
"each",
"of",
"the",
"WebElement",
"and",
"List<",
";",
"WebElement>",
";",
"fields",
"that",
"have",
"been",
"declared",
"assuming",
"that",
"the"... | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/PageFactory.java#L62-L66 |
wcm-io/wcm-io-wcm | commons/src/main/java/io/wcm/wcm/commons/util/Template.java | Template.is | public static boolean is(@NotNull Page page, @NotNull TemplatePathInfo @NotNull... templates) {
"""
Checks if the given page uses a specific template.
@param page AEM page
@param templates Template(s)
@return true if the page uses the template
"""
if (page == null || templates == null || templates.lengt... | java | public static boolean is(@NotNull Page page, @NotNull TemplatePathInfo @NotNull... templates) {
if (page == null || templates == null || templates.length == 0) {
return false;
}
String templatePath = page.getProperties().get(NameConstants.PN_TEMPLATE, String.class);
for (TemplatePathInfo template ... | [
"public",
"static",
"boolean",
"is",
"(",
"@",
"NotNull",
"Page",
"page",
",",
"@",
"NotNull",
"TemplatePathInfo",
"@",
"NotNull",
".",
".",
".",
"templates",
")",
"{",
"if",
"(",
"page",
"==",
"null",
"||",
"templates",
"==",
"null",
"||",
"templates",
... | Checks if the given page uses a specific template.
@param page AEM page
@param templates Template(s)
@return true if the page uses the template | [
"Checks",
"if",
"the",
"given",
"page",
"uses",
"a",
"specific",
"template",
"."
] | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/commons/src/main/java/io/wcm/wcm/commons/util/Template.java#L79-L90 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/types/Timebase.java | Timebase.resample | public long resample(final long samples, final Timebase oldRate) {
"""
Convert a sample count from one timebase to another<br />
Note that this may result in data loss due to rounding.
@param samples
@param oldRate
@return
"""
try
{
return resample(samples, oldRate, false);
}
catch (Resampli... | java | public long resample(final long samples, final Timebase oldRate)
{
try
{
return resample(samples, oldRate, false);
}
catch (ResamplingException e)
{
// should never happen
throw new RuntimeException(e);
}
} | [
"public",
"long",
"resample",
"(",
"final",
"long",
"samples",
",",
"final",
"Timebase",
"oldRate",
")",
"{",
"try",
"{",
"return",
"resample",
"(",
"samples",
",",
"oldRate",
",",
"false",
")",
";",
"}",
"catch",
"(",
"ResamplingException",
"e",
")",
"{... | Convert a sample count from one timebase to another<br />
Note that this may result in data loss due to rounding.
@param samples
@param oldRate
@return | [
"Convert",
"a",
"sample",
"count",
"from",
"one",
"timebase",
"to",
"another<br",
"/",
">",
"Note",
"that",
"this",
"may",
"result",
"in",
"data",
"loss",
"due",
"to",
"rounding",
"."
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/Timebase.java#L158-L169 |
jayantk/jklol | src/com/jayantkrish/jklol/util/IntBiMap.java | IntBiMap.get | public int get(int key, int defaultValue) {
"""
If this map does not contain {@code key}, {@code defaultValue} is returned.
@param key
@return
"""
int index = getKeyIndex(key);
if (index >= 0) {
return values[index];
} else {
return defaultValue;
}
} | java | public int get(int key, int defaultValue) {
int index = getKeyIndex(key);
if (index >= 0) {
return values[index];
} else {
return defaultValue;
}
} | [
"public",
"int",
"get",
"(",
"int",
"key",
",",
"int",
"defaultValue",
")",
"{",
"int",
"index",
"=",
"getKeyIndex",
"(",
"key",
")",
";",
"if",
"(",
"index",
">=",
"0",
")",
"{",
"return",
"values",
"[",
"index",
"]",
";",
"}",
"else",
"{",
"ret... | If this map does not contain {@code key}, {@code defaultValue} is returned.
@param key
@return | [
"If",
"this",
"map",
"does",
"not",
"contain",
"{",
"@code",
"key",
"}",
"{",
"@code",
"defaultValue",
"}",
"is",
"returned",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/IntBiMap.java#L97-L104 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.listFromComputeNodeWithServiceResponseAsync | public Observable<ServiceResponseWithHeaders<Page<NodeFile>, FileListFromComputeNodeHeaders>> listFromComputeNodeWithServiceResponseAsync(final String poolId, final String nodeId) {
"""
Lists all of the files in task directories on the specified compute node.
@param poolId The ID of the pool that contains the c... | java | public Observable<ServiceResponseWithHeaders<Page<NodeFile>, FileListFromComputeNodeHeaders>> listFromComputeNodeWithServiceResponseAsync(final String poolId, final String nodeId) {
return listFromComputeNodeSinglePageAsync(poolId, nodeId)
.concatMap(new Func1<ServiceResponseWithHeaders<Page<Nod... | [
"public",
"Observable",
"<",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"NodeFile",
">",
",",
"FileListFromComputeNodeHeaders",
">",
">",
"listFromComputeNodeWithServiceResponseAsync",
"(",
"final",
"String",
"poolId",
",",
"final",
"String",
"nodeId",
")",
"{",
... | Lists all of the files in task directories on the specified compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node whose files you want to list.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Paged... | [
"Lists",
"all",
"of",
"the",
"files",
"in",
"task",
"directories",
"on",
"the",
"specified",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L1975-L1987 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deleteClosedList | public OperationStatus deleteClosedList(UUID appId, String versionId, UUID clEntityId) {
"""
Deletes a closed list model from the application.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list model ID.
@throws IllegalArgumentException thrown if parameters fa... | java | public OperationStatus deleteClosedList(UUID appId, String versionId, UUID clEntityId) {
return deleteClosedListWithServiceResponseAsync(appId, versionId, clEntityId).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"deleteClosedList",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"clEntityId",
")",
"{",
"return",
"deleteClosedListWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"clEntityId",
")",
".",
"toBlocking",
"... | Deletes a closed list model from the application.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list model ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws Ru... | [
"Deletes",
"a",
"closed",
"list",
"model",
"from",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L4598-L4600 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.updateDetail | private void updateDetail(TrackMetadataUpdate update, WaveformDetail detail) {
"""
We have obtained waveform detail for a device, so store it and alert any listeners.
@param update the update which caused us to retrieve this waveform detail
@param detail the waveform detail which we retrieved
"""
d... | java | private void updateDetail(TrackMetadataUpdate update, WaveformDetail detail) {
detailHotCache.put(DeckReference.getDeckReference(update.player, 0), detail); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueList.Ent... | [
"private",
"void",
"updateDetail",
"(",
"TrackMetadataUpdate",
"update",
",",
"WaveformDetail",
"detail",
")",
"{",
"detailHotCache",
".",
"put",
"(",
"DeckReference",
".",
"getDeckReference",
"(",
"update",
".",
"player",
",",
"0",
")",
",",
"detail",
")",
";... | We have obtained waveform detail for a device, so store it and alert any listeners.
@param update the update which caused us to retrieve this waveform detail
@param detail the waveform detail which we retrieved | [
"We",
"have",
"obtained",
"waveform",
"detail",
"for",
"a",
"device",
"so",
"store",
"it",
"and",
"alert",
"any",
"listeners",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L301-L311 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java | BigtableInstanceAdminClient.getAppProfile | @SuppressWarnings("WeakerAccess")
public AppProfile getAppProfile(String instanceId, String appProfileId) {
"""
Get the app profile by id.
<p>Sample code:
<pre>{@code
AppProfile appProfile = client.getAppProfile("my-instance", "my-app-profile");
}</pre>
@see AppProfile
"""
return ApiExceptions... | java | @SuppressWarnings("WeakerAccess")
public AppProfile getAppProfile(String instanceId, String appProfileId) {
return ApiExceptions.callAndTranslateApiException(getAppProfileAsync(instanceId, appProfileId));
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"AppProfile",
"getAppProfile",
"(",
"String",
"instanceId",
",",
"String",
"appProfileId",
")",
"{",
"return",
"ApiExceptions",
".",
"callAndTranslateApiException",
"(",
"getAppProfileAsync",
"(",
"instanc... | Get the app profile by id.
<p>Sample code:
<pre>{@code
AppProfile appProfile = client.getAppProfile("my-instance", "my-app-profile");
}</pre>
@see AppProfile | [
"Get",
"the",
"app",
"profile",
"by",
"id",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java#L847-L850 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginResetAsync | public Observable<VirtualNetworkGatewayInner> beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName) {
"""
Resets the primary of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name o... | java | public Observable<VirtualNetworkGatewayInner> beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName) {
return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1<ServiceResponse<VirtualNetworkGatewayInner>, VirtualNetworkGatewayInner>() {
... | [
"public",
"Observable",
"<",
"VirtualNetworkGatewayInner",
">",
"beginResetAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
")",
"{",
"return",
"beginResetWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayName... | Resets the primary of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the V... | [
"Resets",
"the",
"primary",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L1322-L1329 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GradientReduceToSingle.java | GradientReduceToSingle.maxf | public static void maxf(Planar<GrayF32> inX , Planar<GrayF32> inY , GrayF32 outX , GrayF32 outY ) {
"""
Reduces the number of bands by selecting the band with the largest Frobenius norm and using
its gradient to be the output gradient on a pixel-by-pixel basis
@param inX Input gradient X
@param inY Input grad... | java | public static void maxf(Planar<GrayF32> inX , Planar<GrayF32> inY , GrayF32 outX , GrayF32 outY )
{
// input and output should be the same shape
InputSanityCheck.checkSameShape(inX,inY);
InputSanityCheck.reshapeOneIn(inX,outX,outY);
// make sure that the pixel index is the same
InputSanityCheck.checkIndexin... | [
"public",
"static",
"void",
"maxf",
"(",
"Planar",
"<",
"GrayF32",
">",
"inX",
",",
"Planar",
"<",
"GrayF32",
">",
"inY",
",",
"GrayF32",
"outX",
",",
"GrayF32",
"outY",
")",
"{",
"// input and output should be the same shape",
"InputSanityCheck",
".",
"checkSam... | Reduces the number of bands by selecting the band with the largest Frobenius norm and using
its gradient to be the output gradient on a pixel-by-pixel basis
@param inX Input gradient X
@param inY Input gradient Y
@param outX Output gradient X
@param outY Output gradient Y | [
"Reduces",
"the",
"number",
"of",
"bands",
"by",
"selecting",
"the",
"band",
"with",
"the",
"largest",
"Frobenius",
"norm",
"and",
"using",
"its",
"gradient",
"to",
"be",
"the",
"output",
"gradient",
"on",
"a",
"pixel",
"-",
"by",
"-",
"pixel",
"basis"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GradientReduceToSingle.java#L42-L77 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionOperationId.java | RegionOperationId.of | public static RegionOperationId of(String project, String region, String operation) {
"""
Returns a region operation identity given project, region and operation names.
"""
return new RegionOperationId(project, region, operation);
} | java | public static RegionOperationId of(String project, String region, String operation) {
return new RegionOperationId(project, region, operation);
} | [
"public",
"static",
"RegionOperationId",
"of",
"(",
"String",
"project",
",",
"String",
"region",
",",
"String",
"operation",
")",
"{",
"return",
"new",
"RegionOperationId",
"(",
"project",
",",
"region",
",",
"operation",
")",
";",
"}"
] | Returns a region operation identity given project, region and operation names. | [
"Returns",
"a",
"region",
"operation",
"identity",
"given",
"project",
"region",
"and",
"operation",
"names",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionOperationId.java#L101-L103 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Primitives.java | Primitives.unbox | public static char[] unbox(final Character[] a, final char valueForNull) {
"""
<p>
Converts an array of object Character to primitives handling {@code null}
.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code Character} array, may be {@code null}
@param v... | java | public static char[] unbox(final Character[] a, final char valueForNull) {
if (a == null) {
return null;
}
return unbox(a, 0, a.length, valueForNull);
} | [
"public",
"static",
"char",
"[",
"]",
"unbox",
"(",
"final",
"Character",
"[",
"]",
"a",
",",
"final",
"char",
"valueForNull",
")",
"{",
"if",
"(",
"a",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"unbox",
"(",
"a",
",",
"0",
",... | <p>
Converts an array of object Character to primitives handling {@code null}
.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code Character} array, may be {@code null}
@param valueForNull
the value to insert if {@code null} found
@return a {@code char} array, {@code null... | [
"<p",
">",
"Converts",
"an",
"array",
"of",
"object",
"Character",
"to",
"primitives",
"handling",
"{",
"@code",
"null",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Primitives.java#L842-L848 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/ApplicationDialog.java | ApplicationDialog.addActionKeyBinding | protected void addActionKeyBinding(KeyStroke key, String actionKey, Action action) {
"""
Add an action key binding to this dialog.
@param key the {@link KeyStroke} that triggers the command/action.
@param actionKey id of the action.
@param action {@link Action} that will be triggered by the {@link KeyStroke}.... | java | protected void addActionKeyBinding(KeyStroke key, String actionKey, Action action) {
getInputMap().put(key, actionKey);
getActionMap().put(actionKey, action);
} | [
"protected",
"void",
"addActionKeyBinding",
"(",
"KeyStroke",
"key",
",",
"String",
"actionKey",
",",
"Action",
"action",
")",
"{",
"getInputMap",
"(",
")",
".",
"put",
"(",
"key",
",",
"actionKey",
")",
";",
"getActionMap",
"(",
")",
".",
"put",
"(",
"a... | Add an action key binding to this dialog.
@param key the {@link KeyStroke} that triggers the command/action.
@param actionKey id of the action.
@param action {@link Action} that will be triggered by the {@link KeyStroke}.
@see #getActionMap()
@see #getInputMap()
@see ActionMap#put(Object, Action)
@see InputMap#put(Ke... | [
"Add",
"an",
"action",
"key",
"binding",
"to",
"this",
"dialog",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/ApplicationDialog.java#L679-L682 |
icode/ameba | src/main/java/ameba/message/internal/StreamingWriterInterceptor.java | StreamingWriterInterceptor.applyStreaming | protected void applyStreaming(ContainerRequestContext requestContext, WriterInterceptorContext context)
throws IOException {
"""
<p>applyStreaming.</p>
@param requestContext a {@link javax.ws.rs.container.ContainerRequestContext} object.
@param context a {@link javax.ws.rs.ext.WriterInterceptorCont... | java | protected void applyStreaming(ContainerRequestContext requestContext, WriterInterceptorContext context)
throws IOException {
Object entity = context.getEntity();
StreamingProcess<Object> process = MessageHelper.getStreamingProcess(context.getEntity(), manager);
if (process != null)... | [
"protected",
"void",
"applyStreaming",
"(",
"ContainerRequestContext",
"requestContext",
",",
"WriterInterceptorContext",
"context",
")",
"throws",
"IOException",
"{",
"Object",
"entity",
"=",
"context",
".",
"getEntity",
"(",
")",
";",
"StreamingProcess",
"<",
"Objec... | <p>applyStreaming.</p>
@param requestContext a {@link javax.ws.rs.container.ContainerRequestContext} object.
@param context a {@link javax.ws.rs.ext.WriterInterceptorContext} object.
@throws java.io.IOException if any. | [
"<p",
">",
"applyStreaming",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/internal/StreamingWriterInterceptor.java#L98-L119 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.rotateLocal | public Matrix4d rotateLocal(double ang, double x, double y, double z) {
"""
Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified <code>(x, y, z)</code> axis.
<p>
The axis described by the three components needs to be a unit vector.
<p>
When used with a right-hande... | java | public Matrix4d rotateLocal(double ang, double x, double y, double z) {
return rotateLocal(ang, x, y, z, this);
} | [
"public",
"Matrix4d",
"rotateLocal",
"(",
"double",
"ang",
",",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"return",
"rotateLocal",
"(",
"ang",
",",
"x",
",",
"y",
",",
"z",
",",
"this",
")",
";",
"}"
] | Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified <code>(x, y, z)</code> axis.
<p>
The axis described by the three components needs to be a unit vector.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise arou... | [
"Pre",
"-",
"multiply",
"a",
"rotation",
"to",
"this",
"matrix",
"by",
"rotating",
"the",
"given",
"amount",
"of",
"radians",
"about",
"the",
"specified",
"<code",
">",
"(",
"x",
"y",
"z",
")",
"<",
"/",
"code",
">",
"axis",
".",
"<p",
">",
"The",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L5282-L5284 |
nominanuda/zen-project | zen-core/src/main/java/com/nominanuda/zen/xml/DOMBuilder.java | DOMBuilder.processingInstruction | public void processingInstruction(String target, String data)
throws SAXException {
"""
Receive notification of a processing instruction.
<p>
The Parser will invoke this method once for each processing instruction
found: note that processing instructions may occur before or after the
main document element... | java | public void processingInstruction(String target, String data)
throws SAXException {
append(m_doc.createProcessingInstruction(target, data));
} | [
"public",
"void",
"processingInstruction",
"(",
"String",
"target",
",",
"String",
"data",
")",
"throws",
"SAXException",
"{",
"append",
"(",
"m_doc",
".",
"createProcessingInstruction",
"(",
"target",
",",
"data",
")",
")",
";",
"}"
] | Receive notification of a processing instruction.
<p>
The Parser will invoke this method once for each processing instruction
found: note that processing instructions may occur before or after the
main document element.
</p>
<p>
A SAX parser should never report an XML declaration (XML 1.0, section
2.8) or a text decl... | [
"Receive",
"notification",
"of",
"a",
"processing",
"instruction",
"."
] | train | https://github.com/nominanuda/zen-project/blob/fe48ae8da198eb7066c2b56bf2ffafe4cdfc451d/zen-core/src/main/java/com/nominanuda/zen/xml/DOMBuilder.java#L605-L608 |
LearnLib/automatalib | commons/smartcollections/src/main/java/net/automatalib/commons/smartcollections/AbstractLinkedList.java | AbstractLinkedList.insertAfterEntry | protected void insertAfterEntry(T e, T insertPos) {
"""
Inserts a new entry <i>after</i> a given one.
@param e
the entry to add.
@param insertPos
the entry before which to add the new one.
"""
T oldNext = insertPos.getNext();
e.setNext(oldNext);
e.setPrev(insertPos);
inser... | java | protected void insertAfterEntry(T e, T insertPos) {
T oldNext = insertPos.getNext();
e.setNext(oldNext);
e.setPrev(insertPos);
insertPos.setNext(e);
if (oldNext != null) {
oldNext.setPrev(e);
} else {
last = e;
}
size++;
} | [
"protected",
"void",
"insertAfterEntry",
"(",
"T",
"e",
",",
"T",
"insertPos",
")",
"{",
"T",
"oldNext",
"=",
"insertPos",
".",
"getNext",
"(",
")",
";",
"e",
".",
"setNext",
"(",
"oldNext",
")",
";",
"e",
".",
"setPrev",
"(",
"insertPos",
")",
";",
... | Inserts a new entry <i>after</i> a given one.
@param e
the entry to add.
@param insertPos
the entry before which to add the new one. | [
"Inserts",
"a",
"new",
"entry",
"<i",
">",
"after<",
"/",
"i",
">",
"a",
"given",
"one",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/smartcollections/src/main/java/net/automatalib/commons/smartcollections/AbstractLinkedList.java#L462-L473 |
virgo47/javasimon | core/src/main/java/org/javasimon/AbstractSimon.java | AbstractSimon.setAttribute | @Override
public void setAttribute(String name, Object value) {
"""
Stores an attribute in this Simon. Attributes can be used to store any custom objects.
@param name a String specifying the name of the attribute
@param value the Object to be stored
@since 2.3
"""
attributesSupport.setAttribute(name, v... | java | @Override
public void setAttribute(String name, Object value) {
attributesSupport.setAttribute(name, value);
} | [
"@",
"Override",
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"attributesSupport",
".",
"setAttribute",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Stores an attribute in this Simon. Attributes can be used to store any custom objects.
@param name a String specifying the name of the attribute
@param value the Object to be stored
@since 2.3 | [
"Stores",
"an",
"attribute",
"in",
"this",
"Simon",
".",
"Attributes",
"can",
"be",
"used",
"to",
"store",
"any",
"custom",
"objects",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/AbstractSimon.java#L194-L197 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomWriter.java | AtomWriter.writeStartFeed | public void writeStartFeed(String requestContextURL, Map<String, Object> meta) throws ODataRenderException {
"""
Write start feed to the XML stream.
@param requestContextURL The 'Context URL' to write for the feed. It can not {@code null}.
@param meta Additional metadata to write.
@throws ODataRe... | java | public void writeStartFeed(String requestContextURL, Map<String, Object> meta) throws ODataRenderException {
this.contextURL = checkNotNull(requestContextURL);
try {
startFeed(false);
if (ODataUriUtil.hasCountOption(oDataUri) &&
meta != null && meta.containsK... | [
"public",
"void",
"writeStartFeed",
"(",
"String",
"requestContextURL",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"meta",
")",
"throws",
"ODataRenderException",
"{",
"this",
".",
"contextURL",
"=",
"checkNotNull",
"(",
"requestContextURL",
")",
";",
"try",
... | Write start feed to the XML stream.
@param requestContextURL The 'Context URL' to write for the feed. It can not {@code null}.
@param meta Additional metadata to write.
@throws ODataRenderException In case it is not possible to write to the XML stream. | [
"Write",
"start",
"feed",
"to",
"the",
"XML",
"stream",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomWriter.java#L223-L241 |
di2e/Argo | clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java | CLIContext.getBoolean | public boolean getBoolean(String key, boolean defaultValue) {
"""
Get the boolean value, or the defaultValue if not found.
@param key The key to search for.
@param defaultValue the default value
@return The value, or defaultValue if not found.
"""
Object o = getObject(key);
if (o == null) {
return... | java | public boolean getBoolean(String key, boolean defaultValue) {
Object o = getObject(key);
if (o == null) {
return defaultValue;
}
boolean b = defaultValue;
try {
b = Boolean.parseBoolean(o.toString());
}
catch (Exception e) {
throw new IllegalArgumentException("Object ["+o+"] associated ... | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"Object",
"o",
"=",
"getObject",
"(",
"key",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"boolean",
"b",
"=",
... | Get the boolean value, or the defaultValue if not found.
@param key The key to search for.
@param defaultValue the default value
@return The value, or defaultValue if not found. | [
"Get",
"the",
"boolean",
"value",
"or",
"the",
"defaultValue",
"if",
"not",
"found",
"."
] | train | https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java#L182-L195 |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/RecoveryDirectorImpl.java | RecoveryDirectorImpl.serialRecoveryComplete | @Override
public void serialRecoveryComplete(RecoveryAgent recoveryAgent, FailureScope failureScope) throws InvalidFailureScopeException {
"""
<p>
Invoked by a client service to indicate that a unit of recovery, identified by
FailureScope has been completed. The client service supplies its RecoveryAgent
ref... | java | @Override
public void serialRecoveryComplete(RecoveryAgent recoveryAgent, FailureScope failureScope) throws InvalidFailureScopeException {
if (tc.isEntryEnabled())
Tr.entry(tc, "serialRecoveryComplete", new Object[] { recoveryAgent, failureScope, this });
final boolean removed = removeI... | [
"@",
"Override",
"public",
"void",
"serialRecoveryComplete",
"(",
"RecoveryAgent",
"recoveryAgent",
",",
"FailureScope",
"failureScope",
")",
"throws",
"InvalidFailureScopeException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
... | <p>
Invoked by a client service to indicate that a unit of recovery, identified by
FailureScope has been completed. The client service supplies its RecoveryAgent
reference to identify itself.
</p>
<p>
When recovery events occur, each client services RecoveryAgent callback object
has its initiateRecovery() method invok... | [
"<p",
">",
"Invoked",
"by",
"a",
"client",
"service",
"to",
"indicate",
"that",
"a",
"unit",
"of",
"recovery",
"identified",
"by",
"FailureScope",
"has",
"been",
"completed",
".",
"The",
"client",
"service",
"supplies",
"its",
"RecoveryAgent",
"reference",
"to... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/RecoveryDirectorImpl.java#L507-L526 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.createButton | public final AbstractButton createButton(String faceDescriptorId, ButtonFactory buttonFactory) {
"""
Create a button using the default buttonConfigurer.
@see #createButton(String, ButtonFactory, CommandButtonConfigurer)
"""
return createButton(faceDescriptorId, buttonFactory, getDefaultButtonConfigurer())... | java | public final AbstractButton createButton(String faceDescriptorId, ButtonFactory buttonFactory) {
return createButton(faceDescriptorId, buttonFactory, getDefaultButtonConfigurer());
} | [
"public",
"final",
"AbstractButton",
"createButton",
"(",
"String",
"faceDescriptorId",
",",
"ButtonFactory",
"buttonFactory",
")",
"{",
"return",
"createButton",
"(",
"faceDescriptorId",
",",
"buttonFactory",
",",
"getDefaultButtonConfigurer",
"(",
")",
")",
";",
"}"... | Create a button using the default buttonConfigurer.
@see #createButton(String, ButtonFactory, CommandButtonConfigurer) | [
"Create",
"a",
"button",
"using",
"the",
"default",
"buttonConfigurer",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L757-L759 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/ZealotKhala.java | ZealotKhala.orBetween | public ZealotKhala orBetween(String field, Object startValue, Object endValue) {
"""
生成带" OR "前缀的between区间查询的SQL片段(当某一个值为null时,会是大于等于或小于等于的情形).
@param field 数据库字段
@param startValue 开始值
@param endValue 结束值
@return ZealotKhala实例
"""
return this.doBetween(ZealotConst.OR_PREFIX, field, startValue, endV... | java | public ZealotKhala orBetween(String field, Object startValue, Object endValue) {
return this.doBetween(ZealotConst.OR_PREFIX, field, startValue, endValue, true);
} | [
"public",
"ZealotKhala",
"orBetween",
"(",
"String",
"field",
",",
"Object",
"startValue",
",",
"Object",
"endValue",
")",
"{",
"return",
"this",
".",
"doBetween",
"(",
"ZealotConst",
".",
"OR_PREFIX",
",",
"field",
",",
"startValue",
",",
"endValue",
",",
"... | 生成带" OR "前缀的between区间查询的SQL片段(当某一个值为null时,会是大于等于或小于等于的情形).
@param field 数据库字段
@param startValue 开始值
@param endValue 结束值
@return ZealotKhala实例 | [
"生成带",
"OR",
"前缀的between区间查询的SQL片段",
"(",
"当某一个值为null时,会是大于等于或小于等于的情形",
")",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L1241-L1243 |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/Table.java | Table.clickLinkInCell | public void clickLinkInCell(int row, int column) {
"""
Goes to the cell addressed by row and column indices and clicks link in that cell. Performs wait until page would
be loaded
@param row
int number of row for cell
@param column
int number of column for cell
"""
String xPath = getXPathBase() +... | java | public void clickLinkInCell(int row, int column) {
String xPath = getXPathBase() + "tr[" + row + "]/td[" + column + "]/a";
new Link(xPath).click();
} | [
"public",
"void",
"clickLinkInCell",
"(",
"int",
"row",
",",
"int",
"column",
")",
"{",
"String",
"xPath",
"=",
"getXPathBase",
"(",
")",
"+",
"\"tr[\"",
"+",
"row",
"+",
"\"]/td[\"",
"+",
"column",
"+",
"\"]/a\"",
";",
"new",
"Link",
"(",
"xPath",
")"... | Goes to the cell addressed by row and column indices and clicks link in that cell. Performs wait until page would
be loaded
@param row
int number of row for cell
@param column
int number of column for cell | [
"Goes",
"to",
"the",
"cell",
"addressed",
"by",
"row",
"and",
"column",
"indices",
"and",
"clicks",
"link",
"in",
"that",
"cell",
".",
"Performs",
"wait",
"until",
"page",
"would",
"be",
"loaded"
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/Table.java#L240-L243 |
cdk/cdk | storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java | InChINumbersTools.auxInfo | static String auxInfo(IAtomContainer container, INCHI_OPTION... options) throws CDKException {
"""
Obtain the InChI auxiliary info for the provided structure using
using the specified InChI options.
@param container the structure to obtain the numbers of
@return auxiliary info
@throws CDKException the inchi... | java | static String auxInfo(IAtomContainer container, INCHI_OPTION... options) throws CDKException {
InChIGeneratorFactory factory = InChIGeneratorFactory.getInstance();
boolean org = factory.getIgnoreAromaticBonds();
factory.setIgnoreAromaticBonds(true);
InChIGenerator gen = factory.getInChIG... | [
"static",
"String",
"auxInfo",
"(",
"IAtomContainer",
"container",
",",
"INCHI_OPTION",
"...",
"options",
")",
"throws",
"CDKException",
"{",
"InChIGeneratorFactory",
"factory",
"=",
"InChIGeneratorFactory",
".",
"getInstance",
"(",
")",
";",
"boolean",
"org",
"=",
... | Obtain the InChI auxiliary info for the provided structure using
using the specified InChI options.
@param container the structure to obtain the numbers of
@return auxiliary info
@throws CDKException the inchi could not be generated | [
"Obtain",
"the",
"InChI",
"auxiliary",
"info",
"for",
"the",
"provided",
"structure",
"using",
"using",
"the",
"specified",
"InChI",
"options",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java#L232-L241 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java | SunCalc.getAltitude | private static double getAltitude(double H, double phi, double d) {
"""
Sun altitude above the horizon in radians.
e.g. 0 at the horizon and PI/2 at the zenith
@param H
@param phi
@param d
@return
"""
return Math.asin(Math.sin(phi) * Math.sin(d) + Math.cos(phi)
* Math.cos(d) * Math... | java | private static double getAltitude(double H, double phi, double d) {
return Math.asin(Math.sin(phi) * Math.sin(d) + Math.cos(phi)
* Math.cos(d) * Math.cos(H));
} | [
"private",
"static",
"double",
"getAltitude",
"(",
"double",
"H",
",",
"double",
"phi",
",",
"double",
"d",
")",
"{",
"return",
"Math",
".",
"asin",
"(",
"Math",
".",
"sin",
"(",
"phi",
")",
"*",
"Math",
".",
"sin",
"(",
"d",
")",
"+",
"Math",
".... | Sun altitude above the horizon in radians.
e.g. 0 at the horizon and PI/2 at the zenith
@param H
@param phi
@param d
@return | [
"Sun",
"altitude",
"above",
"the",
"horizon",
"in",
"radians",
".",
"e",
".",
"g",
".",
"0",
"at",
"the",
"horizon",
"and",
"PI",
"/",
"2",
"at",
"the",
"zenith"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java#L136-L139 |
Azure/azure-sdk-for-java | mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java | SpatialAnchorsAccountsInner.updateAsync | public Observable<SpatialAnchorsAccountInner> updateAsync(String resourceGroupName, String spatialAnchorsAccountName, SpatialAnchorsAccountInner spatialAnchorsAccount) {
"""
Updating a Spatial Anchors Account.
@param resourceGroupName Name of an Azure resource group.
@param spatialAnchorsAccountName Name of an... | java | public Observable<SpatialAnchorsAccountInner> updateAsync(String resourceGroupName, String spatialAnchorsAccountName, SpatialAnchorsAccountInner spatialAnchorsAccount) {
return updateWithServiceResponseAsync(resourceGroupName, spatialAnchorsAccountName, spatialAnchorsAccount).map(new Func1<ServiceResponse<Spati... | [
"public",
"Observable",
"<",
"SpatialAnchorsAccountInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"spatialAnchorsAccountName",
",",
"SpatialAnchorsAccountInner",
"spatialAnchorsAccount",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
... | Updating a Spatial Anchors Account.
@param resourceGroupName Name of an Azure resource group.
@param spatialAnchorsAccountName Name of an Mixed Reality Spatial Anchors Account.
@param spatialAnchorsAccount Spatial Anchors Account parameter.
@throws IllegalArgumentException thrown if parameters fail the validation
@ret... | [
"Updating",
"a",
"Spatial",
"Anchors",
"Account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java#L544-L551 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/factory/ConfigurableFactory.java | ConfigurableFactory.createNewInstance | public Object createNewInstance(Class[] types, Object[] args) {
"""
factory method for creating new instances
the Class to be instantiated is defined by getClassToServe().
@return Object the created instance
"""
try
{
Object result;
// create an instance of the tar... | java | public Object createNewInstance(Class[] types, Object[] args)
{
try
{
Object result;
// create an instance of the target class
if (types != null)
{
result = ClassHelper.newInstance(getClassToServe(), types, args, true);
... | [
"public",
"Object",
"createNewInstance",
"(",
"Class",
"[",
"]",
"types",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"Object",
"result",
";",
"// create an instance of the target class\r",
"if",
"(",
"types",
"!=",
"null",
")",
"{",
"result",
"="... | factory method for creating new instances
the Class to be instantiated is defined by getClassToServe().
@return Object the created instance | [
"factory",
"method",
"for",
"creating",
"new",
"instances",
"the",
"Class",
"to",
"be",
"instantiated",
"is",
"defined",
"by",
"getClassToServe",
"()",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/factory/ConfigurableFactory.java#L93-L130 |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java | ModeledUser.setRestrictedAttributes | private void setRestrictedAttributes(Map<String, String> attributes) {
"""
Stores all restricted (privileged) attributes within the underlying user
model, pulling the values of those attributes from the given Map.
@param attributes
The Map to pull all restricted attributes from.
"""
// Translate ... | java | private void setRestrictedAttributes(Map<String, String> attributes) {
// Translate disabled attribute
getModel().setDisabled("true".equals(attributes.get(DISABLED_ATTRIBUTE_NAME)));
// Translate password expired attribute
getModel().setExpired("true".equals(attributes.get(EXPIRED_ATTR... | [
"private",
"void",
"setRestrictedAttributes",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"// Translate disabled attribute",
"getModel",
"(",
")",
".",
"setDisabled",
"(",
"\"true\"",
".",
"equals",
"(",
"attributes",
".",
"get",
"(",
... | Stores all restricted (privileged) attributes within the underlying user
model, pulling the values of those attributes from the given Map.
@param attributes
The Map to pull all restricted attributes from. | [
"Stores",
"all",
"restricted",
"(",
"privileged",
")",
"attributes",
"within",
"the",
"underlying",
"user",
"model",
"pulling",
"the",
"values",
"of",
"those",
"attributes",
"from",
"the",
"given",
"Map",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java#L419-L458 |
FitLayout/tools | src/main/java/org/fit/layout/process/ScriptableProcessor.java | ScriptableProcessor.drawToImageWithAreas | public void drawToImageWithAreas(String path, String areaNames) {
"""
Draws the page to an image file and marks selected areas in the image.
@param path The path to the destination image file.
@param areaNames A substring of the names of areas that should be marked in the image. When set to {@code null}, all the... | java | public void drawToImageWithAreas(String path, String areaNames)
{
try
{
ImageOutputDisplay disp = new ImageOutputDisplay(getPage().getWidth(), getPage().getHeight());
disp.drawPage(getPage());
showAreas(disp, getAreaTree().getRoot(), areaNames);
disp.s... | [
"public",
"void",
"drawToImageWithAreas",
"(",
"String",
"path",
",",
"String",
"areaNames",
")",
"{",
"try",
"{",
"ImageOutputDisplay",
"disp",
"=",
"new",
"ImageOutputDisplay",
"(",
"getPage",
"(",
")",
".",
"getWidth",
"(",
")",
",",
"getPage",
"(",
")",
... | Draws the page to an image file and marks selected areas in the image.
@param path The path to the destination image file.
@param areaNames A substring of the names of areas that should be marked in the image. When set to {@code null}, all the areas are marked. | [
"Draws",
"the",
"page",
"to",
"an",
"image",
"file",
"and",
"marks",
"selected",
"areas",
"in",
"the",
"image",
"."
] | train | https://github.com/FitLayout/tools/blob/43a8e3f4ddf21a031d3ab7247b8d37310bda4856/src/main/java/org/fit/layout/process/ScriptableProcessor.java#L204-L215 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParseUtil.java | BpmnParseUtil.findCamundaExtensionElement | public static Element findCamundaExtensionElement(Element element, String extensionElementName) {
"""
Returns the camunda extension element in the camunda namespace
and the given name.
@param element the parent element of the extension element
@param extensionElementName the name of the extension element to f... | java | public static Element findCamundaExtensionElement(Element element, String extensionElementName) {
Element extensionElements = element.element("extensionElements");
if(extensionElements != null) {
return extensionElements.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, extensionElementName);
} else {
... | [
"public",
"static",
"Element",
"findCamundaExtensionElement",
"(",
"Element",
"element",
",",
"String",
"extensionElementName",
")",
"{",
"Element",
"extensionElements",
"=",
"element",
".",
"element",
"(",
"\"extensionElements\"",
")",
";",
"if",
"(",
"extensionEleme... | Returns the camunda extension element in the camunda namespace
and the given name.
@param element the parent element of the extension element
@param extensionElementName the name of the extension element to find
@return the extension element or null if not found | [
"Returns",
"the",
"camunda",
"extension",
"element",
"in",
"the",
"camunda",
"namespace",
"and",
"the",
"given",
"name",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParseUtil.java#L53-L60 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/utils/ReflectionUtils.java | ReflectionUtils.invokeStaticMethod | public static Object invokeStaticMethod(final Class<?> cls, final String methodName, final Class<?> argType,
final Object param, final boolean throwException) throws IllegalArgumentException {
"""
Invoke the named static method. If an exception is thrown while trying to call the method, and throwExcept... | java | public static Object invokeStaticMethod(final Class<?> cls, final String methodName, final Class<?> argType,
final Object param, final boolean throwException) throws IllegalArgumentException {
if (cls == null || methodName == null) {
if (throwException) {
throw new NullPo... | [
"public",
"static",
"Object",
"invokeStaticMethod",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"String",
"methodName",
",",
"final",
"Class",
"<",
"?",
">",
"argType",
",",
"final",
"Object",
"param",
",",
"final",
"boolean",
"throwException"... | Invoke the named static method. If an exception is thrown while trying to call the method, and throwException
is true, then IllegalArgumentException is thrown wrapping the cause, otherwise this will return null. If
passed a null class reference, returns null unless throwException is true, then throws
IllegalArgumentExc... | [
"Invoke",
"the",
"named",
"static",
"method",
".",
"If",
"an",
"exception",
"is",
"thrown",
"while",
"trying",
"to",
"call",
"the",
"method",
"and",
"throwException",
"is",
"true",
"then",
"IllegalArgumentException",
"is",
"thrown",
"wrapping",
"the",
"cause",
... | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/ReflectionUtils.java#L384-L394 |
linkhub-sdk/popbill.sdk.java | src/main/java/com/popbill/api/statement/StatementServiceImp.java | StatementServiceImp.deleteFile | @Override
public Response deleteFile(String CorpNum, int ItemCode, String MgtKey,
String FileID, String UserID) throws PopbillException {
"""
/* (non-Javadoc)
@see com.popbill.api.StatementService#deleteFile(java.lang.String, java.number.Integer, java.lang.String, java.lang.String, java.lang.String)
"""... | java | @Override
public Response deleteFile(String CorpNum, int ItemCode, String MgtKey,
String FileID, String UserID) throws PopbillException {
if (MgtKey == null || MgtKey.isEmpty())
throw new PopbillException(-99999999, "관리번호가 입력되지 않았습니다.");
if (FileID == null || FileID.isEmpty())
throw new PopbillExcep... | [
"@",
"Override",
"public",
"Response",
"deleteFile",
"(",
"String",
"CorpNum",
",",
"int",
"ItemCode",
",",
"String",
"MgtKey",
",",
"String",
"FileID",
",",
"String",
"UserID",
")",
"throws",
"PopbillException",
"{",
"if",
"(",
"MgtKey",
"==",
"null",
"||",... | /* (non-Javadoc)
@see com.popbill.api.StatementService#deleteFile(java.lang.String, java.number.Integer, java.lang.String, java.lang.String, java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/linkhub-sdk/popbill.sdk.java/blob/63a341fefe96d60a368776638f3d4c81888238b7/src/main/java/com/popbill/api/statement/StatementServiceImp.java#L589-L600 |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java | HTMLUtilities.inlineCssImports | private static String inlineCssImports(final String css, final String basePath) {
"""
Finds any reference to an external CSS scripts that themselves have been
referenced in a CSS script using an import statement and replaces the
node with inline CSS data.
@param doc The document that holds the XHTML
@pa... | java | private static String inlineCssImports(final String css, final String basePath) {
String retValue = css;
int start;
while ((start = retValue.indexOf(CSS_IMPORT_START)) != -1) {
int end = retValue.indexOf(CSS_IMPORT_END, start);
if (end != -1) {
final Strin... | [
"private",
"static",
"String",
"inlineCssImports",
"(",
"final",
"String",
"css",
",",
"final",
"String",
"basePath",
")",
"{",
"String",
"retValue",
"=",
"css",
";",
"int",
"start",
";",
"while",
"(",
"(",
"start",
"=",
"retValue",
".",
"indexOf",
"(",
... | Finds any reference to an external CSS scripts that themselves have been
referenced in a CSS script using an import statement and replaces the
node with inline CSS data.
@param doc The document that holds the XHTML
@param basePath The base path where the CSS scripts can be found | [
"Finds",
"any",
"reference",
"to",
"an",
"external",
"CSS",
"scripts",
"that",
"themselves",
"have",
"been",
"referenced",
"in",
"a",
"CSS",
"script",
"using",
"an",
"import",
"statement",
"and",
"replaces",
"the",
"node",
"with",
"inline",
"CSS",
"data",
".... | train | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java#L183-L196 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/ClassListParameter.java | ClassListParameter.instantiateClasses | public List<C> instantiateClasses(Parameterization config) {
"""
Returns a list of new instances for the value (i.e., the class name) of
this class list parameter. The instances have the type of the restriction
class of this class list parameter.
<p>
If the Class for the class names is not found, the instantia... | java | public List<C> instantiateClasses(Parameterization config) {
config = config.descend(this);
List<C> instances = new ArrayList<>();
if(getValue() == null) {
config.reportError(new UnspecifiedParameterException(this));
return instances; // empty list.
}
for(Class<? extends C> cls : getVal... | [
"public",
"List",
"<",
"C",
">",
"instantiateClasses",
"(",
"Parameterization",
"config",
")",
"{",
"config",
"=",
"config",
".",
"descend",
"(",
"this",
")",
";",
"List",
"<",
"C",
">",
"instances",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
... | Returns a list of new instances for the value (i.e., the class name) of
this class list parameter. The instances have the type of the restriction
class of this class list parameter.
<p>
If the Class for the class names is not found, the instantiation is tried
using the package of the restriction class as package of the... | [
"Returns",
"a",
"list",
"of",
"new",
"instances",
"for",
"the",
"value",
"(",
"i",
".",
"e",
".",
"the",
"class",
"name",
")",
"of",
"this",
"class",
"list",
"parameter",
".",
"The",
"instances",
"have",
"the",
"type",
"of",
"the",
"restriction",
"clas... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/ClassListParameter.java#L208-L227 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/Validator.java | Validator.switchValue8 | private static long switchValue8(long currentHexValue, int digitCount) {
"""
The digits were stored as a hex value, thix switches them to an octal value.
@param currentHexValue
@param digitCount
@return
"""
long result = 0x7 & currentHexValue;
int shift = 0;
while(--digitCount > 0) {
shift += 3;
... | java | private static long switchValue8(long currentHexValue, int digitCount) {
long result = 0x7 & currentHexValue;
int shift = 0;
while(--digitCount > 0) {
shift += 3;
currentHexValue >>>= 4;
result |= (0x7 & currentHexValue) << shift;
}
return result;
} | [
"private",
"static",
"long",
"switchValue8",
"(",
"long",
"currentHexValue",
",",
"int",
"digitCount",
")",
"{",
"long",
"result",
"=",
"0x7",
"&",
"currentHexValue",
";",
"int",
"shift",
"=",
"0",
";",
"while",
"(",
"--",
"digitCount",
">",
"0",
")",
"{... | The digits were stored as a hex value, thix switches them to an octal value.
@param currentHexValue
@param digitCount
@return | [
"The",
"digits",
"were",
"stored",
"as",
"a",
"hex",
"value",
"thix",
"switches",
"them",
"to",
"an",
"octal",
"value",
"."
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/Validator.java#L2312-L2321 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.