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 |
|---|---|---|---|---|---|---|---|---|---|---|
PureSolTechnologies/parsers | parsers/src/main/java/com/puresoltechnologies/parsers/parser/packrat/PackratParser.java | PackratParser.setupLR | private void setupLR(String production, final LR l) throws ParserException {
"""
After finding a recursion or a seed grow in process, this method puts all
information in place for seed grow. This might be the start information for
the growth or the current result in the growing, which means the current
result.
... | java | private void setupLR(String production, final LR l) throws ParserException {
/*
* If the lr object does not contain a head, we found a new recursion
* production. Otherwise we already know the production, but we found another
* production which is involved in the recursion.
*/
if (l.getHead() == null)
l.... | [
"private",
"void",
"setupLR",
"(",
"String",
"production",
",",
"final",
"LR",
"l",
")",
"throws",
"ParserException",
"{",
"/*\n\t * If the lr object does not contain a head, we found a new recursion\n\t * production. Otherwise we already know the production, but we found another\n\t * p... | After finding a recursion or a seed grow in process, this method puts all
information in place for seed grow. This might be the start information for
the growth or the current result in the growing, which means the current
result.
@param production
@param l
@throws ParserException | [
"After",
"finding",
"a",
"recursion",
"or",
"a",
"seed",
"grow",
"in",
"process",
"this",
"method",
"puts",
"all",
"information",
"in",
"place",
"for",
"seed",
"grow",
".",
"This",
"might",
"be",
"the",
"start",
"information",
"for",
"the",
"growth",
"or",... | train | https://github.com/PureSolTechnologies/parsers/blob/61077223b90d3768ff9445ae13036343c98b63cd/parsers/src/main/java/com/puresoltechnologies/parsers/parser/packrat/PackratParser.java#L343-L363 |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.findOrCreateNode | public Node findOrCreateNode( Session session,
String path,
String nodeType ) throws RepositoryException {
"""
Get or create a node at the specified path and node type.
@param session the JCR session. may not be null
@param path the path of th... | java | public Node findOrCreateNode( Session session,
String path,
String nodeType ) throws RepositoryException {
return findOrCreateNode(session, path, nodeType, nodeType);
} | [
"public",
"Node",
"findOrCreateNode",
"(",
"Session",
"session",
",",
"String",
"path",
",",
"String",
"nodeType",
")",
"throws",
"RepositoryException",
"{",
"return",
"findOrCreateNode",
"(",
"session",
",",
"path",
",",
"nodeType",
",",
"nodeType",
")",
";",
... | Get or create a node at the specified path and node type.
@param session the JCR session. may not be null
@param path the path of the desired node to be found or created. may not be null
@param nodeType the node type. may be null
@return the existing or newly created node
@throws RepositoryException
@throws IllegalArg... | [
"Get",
"or",
"create",
"a",
"node",
"at",
"the",
"specified",
"path",
"and",
"node",
"type",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L354-L358 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.replaceIgnoreCase | public static String replaceIgnoreCase(final String text, final String searchString, final String replacement, final int max) {
"""
<p>Case insensitively replaces a String with another String inside a larger String,
for the first {@code max} values of the search String.</p>
<p>A {@code null} reference passed t... | java | public static String replaceIgnoreCase(final String text, final String searchString, final String replacement, final int max) {
return replace(text, searchString, replacement, max, true);
} | [
"public",
"static",
"String",
"replaceIgnoreCase",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"searchString",
",",
"final",
"String",
"replacement",
",",
"final",
"int",
"max",
")",
"{",
"return",
"replace",
"(",
"text",
",",
"searchString",
",",
... | <p>Case insensitively replaces a String with another String inside a larger String,
for the first {@code max} values of the search String.</p>
<p>A {@code null} reference passed to this method is a no-op.</p>
<pre>
StringUtils.replaceIgnoreCase(null, *, *, *) = null
StringUtils.replaceIgnoreCase("", *, *, *) ... | [
"<p",
">",
"Case",
"insensitively",
"replaces",
"a",
"String",
"with",
"another",
"String",
"inside",
"a",
"larger",
"String",
"for",
"the",
"first",
"{",
"@code",
"max",
"}",
"values",
"of",
"the",
"search",
"String",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L5568-L5570 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/quota/PathPatternUtils.java | PathPatternUtils.extractCommonAncestor | public static String extractCommonAncestor(String pattern, String absPath) {
"""
Returns common ancestor for paths represented by absolute path and pattern.
"""
pattern = normalizePath(pattern);
absPath = normalizePath(absPath);
String[] patterEntries = pattern.split("/");
String[] pat... | java | public static String extractCommonAncestor(String pattern, String absPath)
{
pattern = normalizePath(pattern);
absPath = normalizePath(absPath);
String[] patterEntries = pattern.split("/");
String[] pathEntries = absPath.split("/");
StringBuilder ancestor = new StringBuilder();
... | [
"public",
"static",
"String",
"extractCommonAncestor",
"(",
"String",
"pattern",
",",
"String",
"absPath",
")",
"{",
"pattern",
"=",
"normalizePath",
"(",
"pattern",
")",
";",
"absPath",
"=",
"normalizePath",
"(",
"absPath",
")",
";",
"String",
"[",
"]",
"pa... | Returns common ancestor for paths represented by absolute path and pattern. | [
"Returns",
"common",
"ancestor",
"for",
"paths",
"represented",
"by",
"absolute",
"path",
"and",
"pattern",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/quota/PathPatternUtils.java#L98-L123 |
mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.isGetterOrSetter | protected boolean isGetterOrSetter(String name, int index, boolean setter) {
"""
Returns whether a property is a getter or a setter
@param name property name
@param index property index
@param setter true to check for a setter, false for a getter
@return whether the property is a getter or a setter
"""
... | java | protected boolean isGetterOrSetter(String name, int index, boolean setter) {
Slot slot = slotMap.query(name, index);
if (slot instanceof GetterSlot) {
if (setter && ((GetterSlot)slot).setter != null) return true;
if (!setter && ((GetterSlot)slot).getter != null) return true;
... | [
"protected",
"boolean",
"isGetterOrSetter",
"(",
"String",
"name",
",",
"int",
"index",
",",
"boolean",
"setter",
")",
"{",
"Slot",
"slot",
"=",
"slotMap",
".",
"query",
"(",
"name",
",",
"index",
")",
";",
"if",
"(",
"slot",
"instanceof",
"GetterSlot",
... | Returns whether a property is a getter or a setter
@param name property name
@param index property index
@param setter true to check for a setter, false for a getter
@return whether the property is a getter or a setter | [
"Returns",
"whether",
"a",
"property",
"is",
"a",
"getter",
"or",
"a",
"setter"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L886-L893 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java | GoogleCloudStorageImpl.copyInternal | private void copyInternal(
BatchHelper batchHelper,
final KeySetView<IOException, Boolean> innerExceptions,
final String srcBucketName, final String srcObjectName,
final String dstBucketName, final String dstObjectName)
throws IOException {
"""
Performs copy operation using GCS Copy r... | java | private void copyInternal(
BatchHelper batchHelper,
final KeySetView<IOException, Boolean> innerExceptions,
final String srcBucketName, final String srcObjectName,
final String dstBucketName, final String dstObjectName)
throws IOException {
Storage.Objects.Copy copyObject =
con... | [
"private",
"void",
"copyInternal",
"(",
"BatchHelper",
"batchHelper",
",",
"final",
"KeySetView",
"<",
"IOException",
",",
"Boolean",
">",
"innerExceptions",
",",
"final",
"String",
"srcBucketName",
",",
"final",
"String",
"srcObjectName",
",",
"final",
"String",
... | Performs copy operation using GCS Copy requests
@see GoogleCloudStorage#copy(String, List, String, List) | [
"Performs",
"copy",
"operation",
"using",
"GCS",
"Copy",
"requests"
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L976-L1002 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/runtime/JbcSrcRuntime.java | JbcSrcRuntime.compareNullableString | public static boolean compareNullableString(@Nullable String string, SoyValue other) {
"""
Determines if the operand's string form can be equality-compared with a string.
"""
// This is a parallel version of SharedRuntime.compareString except it can handle a null LHS.
// This follows similarly to the ... | java | public static boolean compareNullableString(@Nullable String string, SoyValue other) {
// This is a parallel version of SharedRuntime.compareString except it can handle a null LHS.
// This follows similarly to the Javascript specification, to ensure similar operation
// over Javascript and Java: http://www... | [
"public",
"static",
"boolean",
"compareNullableString",
"(",
"@",
"Nullable",
"String",
"string",
",",
"SoyValue",
"other",
")",
"{",
"// This is a parallel version of SharedRuntime.compareString except it can handle a null LHS.",
"// This follows similarly to the Javascript specificat... | Determines if the operand's string form can be equality-compared with a string. | [
"Determines",
"if",
"the",
"operand",
"s",
"string",
"form",
"can",
"be",
"equality",
"-",
"compared",
"with",
"a",
"string",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/runtime/JbcSrcRuntime.java#L634-L656 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_mailingList_name_subscriber_email_GET | public OvhSubscriber domain_mailingList_name_subscriber_email_GET(String domain, String name, String email) throws IOException {
"""
Get this object properties
REST: GET /email/domain/{domain}/mailingList/{name}/subscriber/{email}
@param domain [required] Name of your domain name
@param name [required] Name o... | java | public OvhSubscriber domain_mailingList_name_subscriber_email_GET(String domain, String name, String email) throws IOException {
String qPath = "/email/domain/{domain}/mailingList/{name}/subscriber/{email}";
StringBuilder sb = path(qPath, domain, name, email);
String resp = exec(qPath, "GET", sb.toString(), null)... | [
"public",
"OvhSubscriber",
"domain_mailingList_name_subscriber_email_GET",
"(",
"String",
"domain",
",",
"String",
"name",
",",
"String",
"email",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/mailingList/{name}/subscriber/{email}\"",
";... | Get this object properties
REST: GET /email/domain/{domain}/mailingList/{name}/subscriber/{email}
@param domain [required] Name of your domain name
@param name [required] Name of mailing list
@param email [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L1602-L1607 |
Stratio/bdt | src/main/java/com/stratio/qa/utils/ElasticSearchUtils.java | ElasticSearchUtils.deleteDocument | public void deleteDocument(String indexName, String mappingName, String id) {
"""
Deletes a document by its id.
@param indexName
@param mappingName
@param id
"""
client.prepareDelete(indexName, mappingName, id).get();
} | java | public void deleteDocument(String indexName, String mappingName, String id) {
client.prepareDelete(indexName, mappingName, id).get();
} | [
"public",
"void",
"deleteDocument",
"(",
"String",
"indexName",
",",
"String",
"mappingName",
",",
"String",
"id",
")",
"{",
"client",
".",
"prepareDelete",
"(",
"indexName",
",",
"mappingName",
",",
"id",
")",
".",
"get",
"(",
")",
";",
"}"
] | Deletes a document by its id.
@param indexName
@param mappingName
@param id | [
"Deletes",
"a",
"document",
"by",
"its",
"id",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/ElasticSearchUtils.java#L285-L287 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsProjectDriver.java | CmsProjectDriver.internalWriteHistory | protected void internalWriteHistory(
CmsDbContext dbc,
CmsResource resource,
CmsResourceState state,
List<CmsProperty> properties,
CmsUUID publishHistoryId,
int publishTag)
throws CmsDataAccessException {
"""
Writes the needed history entries.<p>
@param dbc th... | java | protected void internalWriteHistory(
CmsDbContext dbc,
CmsResource resource,
CmsResourceState state,
List<CmsProperty> properties,
CmsUUID publishHistoryId,
int publishTag)
throws CmsDataAccessException {
try {
if (OpenCms.getSystemInfo().isHistor... | [
"protected",
"void",
"internalWriteHistory",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
",",
"CmsResourceState",
"state",
",",
"List",
"<",
"CmsProperty",
">",
"properties",
",",
"CmsUUID",
"publishHistoryId",
",",
"int",
"publishTag",
")",
"throws"... | Writes the needed history entries.<p>
@param dbc the current database context
@param resource the offline resource
@param state the state to store in the publish history entry
@param properties the offline properties
@param publishHistoryId the current publish process id
@param publishTag the current publish process t... | [
"Writes",
"the",
"needed",
"history",
"entries",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsProjectDriver.java#L3234-L3267 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br/br_locallicense.java | br_locallicense.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
br_locallicense_responses result = (br_locallicense_responses) service.... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
br_locallicense_responses result = (br_locallicense_responses) service.get_payload_formatter().string_to_resource(br_locallicense_responses.class, response);
if(result.errorcode != 0)
{
if (result... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"br_locallicense_responses",
"result",
"=",
"(",
"br_locallicense_responses",
")",
"service",
".",
"get_payloa... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_locallicense.java#L136-L153 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/resourceresolver/DefaultResourceResolver.java | DefaultResourceResolver.getResolvedResource | @Nonnull
public static IReadableResource getResolvedResource (@Nullable final String sSystemId,
@Nullable final String sBaseURI) {
"""
Do the standard resource resolving of sSystemId relative to sBaseURI
@param sSystemId
The resource to search. May be <c... | java | @Nonnull
public static IReadableResource getResolvedResource (@Nullable final String sSystemId,
@Nullable final String sBaseURI)
{
return getResolvedResource (sSystemId, sBaseURI, (ClassLoader) null);
} | [
"@",
"Nonnull",
"public",
"static",
"IReadableResource",
"getResolvedResource",
"(",
"@",
"Nullable",
"final",
"String",
"sSystemId",
",",
"@",
"Nullable",
"final",
"String",
"sBaseURI",
")",
"{",
"return",
"getResolvedResource",
"(",
"sSystemId",
",",
"sBaseURI",
... | Do the standard resource resolving of sSystemId relative to sBaseURI
@param sSystemId
The resource to search. May be <code>null</code> if base URI is set.
@param sBaseURI
The base URI from where the search is initiated. May be
<code>null</code> if systemId is set.
@return The non-<code>null</code> resource. May be non... | [
"Do",
"the",
"standard",
"resource",
"resolving",
"of",
"sSystemId",
"relative",
"to",
"sBaseURI"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/resourceresolver/DefaultResourceResolver.java#L89-L94 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/HeadersImpl.java | HeadersImpl.addHeadLine | @Override
public void addHeadLine(final String type, final String aLine) {
"""
Records a "shared" line (of a specified type) for inclusion in the output.
@param type the type of line.
@param aLine the line to include.
"""
ArrayList<String> lines = headers.get(type);
if (lines == null) {
lines = ne... | java | @Override
public void addHeadLine(final String type, final String aLine) {
ArrayList<String> lines = headers.get(type);
if (lines == null) {
lines = new ArrayList<>();
headers.put(type, lines);
}
lines.add(aLine);
} | [
"@",
"Override",
"public",
"void",
"addHeadLine",
"(",
"final",
"String",
"type",
",",
"final",
"String",
"aLine",
")",
"{",
"ArrayList",
"<",
"String",
">",
"lines",
"=",
"headers",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"lines",
"==",
"null",
... | Records a "shared" line (of a specified type) for inclusion in the output.
@param type the type of line.
@param aLine the line to include. | [
"Records",
"a",
"shared",
"line",
"(",
"of",
"a",
"specified",
"type",
")",
"for",
"inclusion",
"in",
"the",
"output",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/HeadersImpl.java#L52-L62 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/utils/FileLock.java | FileLock.getFileLock | public static FileLock getFileLock(java.io.RandomAccessFile file, String fileName) throws java.io.IOException {
"""
Create a platform specific FileLock instance.
@param file to be locked. The file must be already open.
@param fileName of the file.
@return FileLock for the file.
@throws java.io.IOException
... | java | public static FileLock getFileLock(java.io.RandomAccessFile file, String fileName) throws java.io.IOException
{
return (FileLock) Utils.getImpl("com.ibm.ws.objectManager.utils.FileLockImpl",
new Class[] { java.io.RandomAccessFile.class, String.class },
... | [
"public",
"static",
"FileLock",
"getFileLock",
"(",
"java",
".",
"io",
".",
"RandomAccessFile",
"file",
",",
"String",
"fileName",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
"{",
"return",
"(",
"FileLock",
")",
"Utils",
".",
"getImpl",
"(",
"\"c... | Create a platform specific FileLock instance.
@param file to be locked. The file must be already open.
@param fileName of the file.
@return FileLock for the file.
@throws java.io.IOException | [
"Create",
"a",
"platform",
"specific",
"FileLock",
"instance",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/utils/FileLock.java#L33-L38 |
h2oai/h2o-3 | h2o-core/src/main/java/water/parser/ParserProvider.java | ParserProvider.guessInitSetup | public ParseSetup guessInitSetup(ByteVec v, byte[] bits, ParseSetup userSetup) {
"""
Constructs initial ParseSetup from a given user setup
Any exception thrown by this method will signal that this ParserProvider doesn't support
the input data.
Parsers of data formats that provide metadata (eg. a binary file... | java | public ParseSetup guessInitSetup(ByteVec v, byte[] bits, ParseSetup userSetup) {
return guessSetup(v, bits, userSetup._separator, userSetup._number_columns, userSetup._single_quotes,
userSetup._check_header, userSetup._column_names, userSetup._column_types, userSetup._domains, userSetup._na_strings);
... | [
"public",
"ParseSetup",
"guessInitSetup",
"(",
"ByteVec",
"v",
",",
"byte",
"[",
"]",
"bits",
",",
"ParseSetup",
"userSetup",
")",
"{",
"return",
"guessSetup",
"(",
"v",
",",
"bits",
",",
"userSetup",
".",
"_separator",
",",
"userSetup",
".",
"_number_column... | Constructs initial ParseSetup from a given user setup
Any exception thrown by this method will signal that this ParserProvider doesn't support
the input data.
Parsers of data formats that provide metadata (eg. a binary file formats like Parquet) should use the
file metadata to identify the parse type and possibly oth... | [
"Constructs",
"initial",
"ParseSetup",
"from",
"a",
"given",
"user",
"setup"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/parser/ParserProvider.java#L63-L66 |
joniles/mpxj | src/main/java/net/sf/mpxj/ResourceAssignment.java | ResourceAssignment.setEnterpriseCost | public void setEnterpriseCost(int index, Number value) {
"""
Set an enterprise cost value.
@param index cost index (1-30)
@param value cost value
"""
set(selectField(AssignmentFieldLists.ENTERPRISE_COST, index), value);
} | java | public void setEnterpriseCost(int index, Number value)
{
set(selectField(AssignmentFieldLists.ENTERPRISE_COST, index), value);
} | [
"public",
"void",
"setEnterpriseCost",
"(",
"int",
"index",
",",
"Number",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"AssignmentFieldLists",
".",
"ENTERPRISE_COST",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set an enterprise cost value.
@param index cost index (1-30)
@param value cost value | [
"Set",
"an",
"enterprise",
"cost",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1694-L1697 |
VoltDB/voltdb | src/frontend/org/voltcore/zk/CoreZK.java | CoreZK.removeRejoinNodeIndicatorForHost | public static boolean removeRejoinNodeIndicatorForHost(ZooKeeper zk, int hostId) {
"""
Removes the rejoin blocker if the current rejoin blocker contains the given host ID.
@return true if the blocker is removed successfully, false otherwise.
"""
try {
Stat stat = new Stat();
fi... | java | public static boolean removeRejoinNodeIndicatorForHost(ZooKeeper zk, int hostId)
{
try {
Stat stat = new Stat();
final int rejoiningHost = ByteBuffer.wrap(zk.getData(rejoin_node_blocker, false, stat)).getInt();
if (hostId == rejoiningHost) {
zk.delete(rejo... | [
"public",
"static",
"boolean",
"removeRejoinNodeIndicatorForHost",
"(",
"ZooKeeper",
"zk",
",",
"int",
"hostId",
")",
"{",
"try",
"{",
"Stat",
"stat",
"=",
"new",
"Stat",
"(",
")",
";",
"final",
"int",
"rejoiningHost",
"=",
"ByteBuffer",
".",
"wrap",
"(",
... | Removes the rejoin blocker if the current rejoin blocker contains the given host ID.
@return true if the blocker is removed successfully, false otherwise. | [
"Removes",
"the",
"rejoin",
"blocker",
"if",
"the",
"current",
"rejoin",
"blocker",
"contains",
"the",
"given",
"host",
"ID",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/zk/CoreZK.java#L143-L162 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br/br_locallicense.java | br_locallicense.configurelicense | public static br_locallicense configurelicense(nitro_service client, br_locallicense resource) throws Exception {
"""
<pre>
Use this operation to configure Local license server on Repeater Instances.
</pre>
"""
return ((br_locallicense[]) resource.perform_operation(client, "configurelicense"))[0];
} | java | public static br_locallicense configurelicense(nitro_service client, br_locallicense resource) throws Exception
{
return ((br_locallicense[]) resource.perform_operation(client, "configurelicense"))[0];
} | [
"public",
"static",
"br_locallicense",
"configurelicense",
"(",
"nitro_service",
"client",
",",
"br_locallicense",
"resource",
")",
"throws",
"Exception",
"{",
"return",
"(",
"(",
"br_locallicense",
"[",
"]",
")",
"resource",
".",
"perform_operation",
"(",
"client",... | <pre>
Use this operation to configure Local license server on Repeater Instances.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"configure",
"Local",
"license",
"server",
"on",
"Repeater",
"Instances",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_locallicense.java#L84-L87 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DerValue.java | DerValue.createTag | public static byte createTag(byte tagClass, boolean form, byte val) {
"""
Create the tag of the attribute.
@params class the tag class type, one of UNIVERSAL, CONTEXT,
APPLICATION or PRIVATE
@params form if true, the value is constructed, otherwise it
is primitive.
@params val the tag value
"""
... | java | public static byte createTag(byte tagClass, boolean form, byte val) {
byte tag = (byte)(tagClass | val);
if (form) {
tag |= (byte)0x20;
}
return (tag);
} | [
"public",
"static",
"byte",
"createTag",
"(",
"byte",
"tagClass",
",",
"boolean",
"form",
",",
"byte",
"val",
")",
"{",
"byte",
"tag",
"=",
"(",
"byte",
")",
"(",
"tagClass",
"|",
"val",
")",
";",
"if",
"(",
"form",
")",
"{",
"tag",
"|=",
"(",
"b... | Create the tag of the attribute.
@params class the tag class type, one of UNIVERSAL, CONTEXT,
APPLICATION or PRIVATE
@params form if true, the value is constructed, otherwise it
is primitive.
@params val the tag value | [
"Create",
"the",
"tag",
"of",
"the",
"attribute",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DerValue.java#L930-L936 |
Ekryd/sortpom | sorter/src/main/java/sortpom/parameter/IndentCharacters.java | IndentCharacters.getIndentCharacters | public String getIndentCharacters() {
"""
Gets the indent characters from parameter.
@return the indent characters
"""
if (nrOfIndentSpace == 0) {
return "";
}
if (nrOfIndentSpace == INDENT_TAB) {
return "\t";
}
if (nrOfIndentSpace < INDENT_TAB... | java | public String getIndentCharacters() {
if (nrOfIndentSpace == 0) {
return "";
}
if (nrOfIndentSpace == INDENT_TAB) {
return "\t";
}
if (nrOfIndentSpace < INDENT_TAB || nrOfIndentSpace > MAX_INDENT_SPACES) {
throw new FailureException("nrOfIndent... | [
"public",
"String",
"getIndentCharacters",
"(",
")",
"{",
"if",
"(",
"nrOfIndentSpace",
"==",
"0",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"nrOfIndentSpace",
"==",
"INDENT_TAB",
")",
"{",
"return",
"\"\\t\"",
";",
"}",
"if",
"(",
"nrOfIndentSpace"... | Gets the indent characters from parameter.
@return the indent characters | [
"Gets",
"the",
"indent",
"characters",
"from",
"parameter",
"."
] | train | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/parameter/IndentCharacters.java#L28-L41 |
CloudSlang/cs-actions | cs-tesseract/src/main/java/io/cloudslang/content/tesseract/actions/ExtractTextFromPDF.java | ExtractTextFromPDF.execute | @Action(name = "Extract text from PDF",
description = EXTRACT_TEXT_FROM_PDF_DESC,
outputs = {
"""
This operation converts a PDF file given as input and extracts the text using Tesseract's OCR library.
@param filePath The path of the file to be extracted. The file must be an image. Most... | java | @Action(name = "Extract text from PDF",
description = EXTRACT_TEXT_FROM_PDF_DESC,
outputs = {
@Output(value = RETURN_CODE, description = RETURN_CODE_DESC),
@Output(value = RETURN_RESULT, description = RETURN_RESULT_DESC),
@Output(value ... | [
"@",
"Action",
"(",
"name",
"=",
"\"Extract text from PDF\"",
",",
"description",
"=",
"EXTRACT_TEXT_FROM_PDF_DESC",
",",
"outputs",
"=",
"{",
"@",
"Output",
"(",
"value",
"=",
"RETURN_CODE",
",",
"description",
"=",
"RETURN_CODE_DESC",
")",
",",
"@",
"Output",
... | This operation converts a PDF file given as input and extracts the text using Tesseract's OCR library.
@param filePath The path of the file to be extracted. The file must be an image. Most of the common image formats
are supported.
Required
@param dataPath The path to the tessdata folder that contains the tesserac... | [
"This",
"operation",
"converts",
"a",
"PDF",
"file",
"given",
"as",
"input",
"and",
"extracts",
"the",
"text",
"using",
"Tesseract",
"s",
"OCR",
"library",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-tesseract/src/main/java/io/cloudslang/content/tesseract/actions/ExtractTextFromPDF.java#L93-L148 |
carewebframework/carewebframework-core | org.carewebframework.messaging-parent/org.carewebframework.messaging.jms-parent/org.carewebframework.messaging.jms.core/src/main/java/org/carewebframework/messaging/jms/JMSService.java | JMSService.decorateMessage | public Message decorateMessage(Message message, String sender, String recipients) throws JMSException {
"""
Given a message, supplement the message with additional properties/attributes.
@param message The message
@param sender Sender client ID.
@param recipients Comma-delimited list of recipient client IDs
... | java | public Message decorateMessage(Message message, String sender, String recipients) throws JMSException {
message.setStringProperty("sender", sender);
message.setStringProperty("recipients", StringUtils.isEmpty(recipients) ? null : "," + recipients + ",");
return message;
} | [
"public",
"Message",
"decorateMessage",
"(",
"Message",
"message",
",",
"String",
"sender",
",",
"String",
"recipients",
")",
"throws",
"JMSException",
"{",
"message",
".",
"setStringProperty",
"(",
"\"sender\"",
",",
"sender",
")",
";",
"message",
".",
"setStri... | Given a message, supplement the message with additional properties/attributes.
@param message The message
@param sender Sender client ID.
@param recipients Comma-delimited list of recipient client IDs
@return The decorated Message
@throws JMSException if error thrown setting properties | [
"Given",
"a",
"message",
"supplement",
"the",
"message",
"with",
"additional",
"properties",
"/",
"attributes",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.messaging-parent/org.carewebframework.messaging.jms-parent/org.carewebframework.messaging.jms.core/src/main/java/org/carewebframework/messaging/jms/JMSService.java#L223-L227 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java | SslContextBuilder.forServer | public static SslContextBuilder forServer(InputStream keyCertChainInputStream, InputStream keyInputStream) {
"""
Creates a builder for new server-side {@link SslContext}.
@param keyCertChainInputStream an input stream for an X.509 certificate chain in PEM format
@param keyInputStream an input stream for a PKCS... | java | public static SslContextBuilder forServer(InputStream keyCertChainInputStream, InputStream keyInputStream) {
return new SslContextBuilder(true).keyManager(keyCertChainInputStream, keyInputStream);
} | [
"public",
"static",
"SslContextBuilder",
"forServer",
"(",
"InputStream",
"keyCertChainInputStream",
",",
"InputStream",
"keyInputStream",
")",
"{",
"return",
"new",
"SslContextBuilder",
"(",
"true",
")",
".",
"keyManager",
"(",
"keyCertChainInputStream",
",",
"keyInput... | Creates a builder for new server-side {@link SslContext}.
@param keyCertChainInputStream an input stream for an X.509 certificate chain in PEM format
@param keyInputStream an input stream for a PKCS#8 private key in PEM format
@see #keyManager(InputStream, InputStream) | [
"Creates",
"a",
"builder",
"for",
"new",
"server",
"-",
"side",
"{",
"@link",
"SslContext",
"}",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java#L64-L66 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/executor/ExecutorServiceFactories.java | ExecutorServiceFactories.fixedThreadPool | public static ExecutorServiceFactory fixedThreadPool(String name, int nThreads) {
"""
Returns a {@link ExecutorServiceFactory} which creates threadpool executors with the given base
name and number of threads. Created threads will be daemonic.
@param name the base name for executor thread names
@param nThread... | java | public static ExecutorServiceFactory fixedThreadPool(String name, int nThreads) {
return () -> Executors.newFixedThreadPool(nThreads,
ThreadFactoryUtils.build(name + "-%d", true));
} | [
"public",
"static",
"ExecutorServiceFactory",
"fixedThreadPool",
"(",
"String",
"name",
",",
"int",
"nThreads",
")",
"{",
"return",
"(",
")",
"->",
"Executors",
".",
"newFixedThreadPool",
"(",
"nThreads",
",",
"ThreadFactoryUtils",
".",
"build",
"(",
"name",
"+"... | Returns a {@link ExecutorServiceFactory} which creates threadpool executors with the given base
name and number of threads. Created threads will be daemonic.
@param name the base name for executor thread names
@param nThreads the number of threads to create executors with
@return the {@link ExecutorServiceFactory} | [
"Returns",
"a",
"{",
"@link",
"ExecutorServiceFactory",
"}",
"which",
"creates",
"threadpool",
"executors",
"with",
"the",
"given",
"base",
"name",
"and",
"number",
"of",
"threads",
".",
"Created",
"threads",
"will",
"be",
"daemonic",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/executor/ExecutorServiceFactories.java#L42-L45 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPHandler.java | RTMPHandler.invokeCall | private boolean invokeCall(RTMPConnection conn, IServiceCall call, Object service) {
"""
Remoting call invocation handler.
@param conn
RTMP connection
@param call
Service call
@param service
Server-side service object
@return true if the call was performed, otherwise false
"""
final IScope sc... | java | private boolean invokeCall(RTMPConnection conn, IServiceCall call, Object service) {
final IScope scope = conn.getScope();
final IContext context = scope.getContext();
if (log.isTraceEnabled()) {
log.trace("Scope: {} context: {} service: {}", scope, context, service);
}
... | [
"private",
"boolean",
"invokeCall",
"(",
"RTMPConnection",
"conn",
",",
"IServiceCall",
"call",
",",
"Object",
"service",
")",
"{",
"final",
"IScope",
"scope",
"=",
"conn",
".",
"getScope",
"(",
")",
";",
"final",
"IContext",
"context",
"=",
"scope",
".",
... | Remoting call invocation handler.
@param conn
RTMP connection
@param call
Service call
@param service
Server-side service object
@return true if the call was performed, otherwise false | [
"Remoting",
"call",
"invocation",
"handler",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPHandler.java#L208-L215 |
larsga/Duke | duke-core/src/main/java/no/priv/garshol/duke/utils/StringUtils.java | StringUtils.replaceAnyOf | public static String replaceAnyOf(String value, String chars,
char replacement) {
"""
Replaces all characters in the second parameter found in the first
parameter with the final character.
@param value the string to replace characters in
@param chars the characters to replace... | java | public static String replaceAnyOf(String value, String chars,
char replacement) {
char[] tmp = new char[value.length()];
int pos = 0;
for (int ix = 0; ix < tmp.length; ix++) {
char ch = value.charAt(ix);
if (chars.indexOf(ch) != -1)
tmp[pos++] = replac... | [
"public",
"static",
"String",
"replaceAnyOf",
"(",
"String",
"value",
",",
"String",
"chars",
",",
"char",
"replacement",
")",
"{",
"char",
"[",
"]",
"tmp",
"=",
"new",
"char",
"[",
"value",
".",
"length",
"(",
")",
"]",
";",
"int",
"pos",
"=",
"0",
... | Replaces all characters in the second parameter found in the first
parameter with the final character.
@param value the string to replace characters in
@param chars the characters to replace
@param replacement the character to insert as replacement | [
"Replaces",
"all",
"characters",
"in",
"the",
"second",
"parameter",
"found",
"in",
"the",
"first",
"parameter",
"with",
"the",
"final",
"character",
"."
] | train | https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-core/src/main/java/no/priv/garshol/duke/utils/StringUtils.java#L13-L25 |
JodaOrg/joda-money | src/main/java/org/joda/money/BigMoney.java | BigMoney.multiplyRetainScale | public BigMoney multiplyRetainScale(BigDecimal valueToMultiplyBy, RoundingMode roundingMode) {
"""
Returns a copy of this monetary value multiplied by the specified value
using the specified rounding mode to adjust the scale of the result.
<p>
This multiplies this money by the specified value, retaining the sca... | java | public BigMoney multiplyRetainScale(BigDecimal valueToMultiplyBy, RoundingMode roundingMode) {
MoneyUtils.checkNotNull(valueToMultiplyBy, "Multiplier must not be null");
MoneyUtils.checkNotNull(roundingMode, "RoundingMode must not be null");
if (valueToMultiplyBy.compareTo(BigDecimal.ONE) == ... | [
"public",
"BigMoney",
"multiplyRetainScale",
"(",
"BigDecimal",
"valueToMultiplyBy",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"MoneyUtils",
".",
"checkNotNull",
"(",
"valueToMultiplyBy",
",",
"\"Multiplier must not be null\"",
")",
";",
"MoneyUtils",
".",
"checkNotN... | Returns a copy of this monetary value multiplied by the specified value
using the specified rounding mode to adjust the scale of the result.
<p>
This multiplies this money by the specified value, retaining the scale of this money.
This will frequently lose precision, hence the need for a rounding mode.
For example, 'US... | [
"Returns",
"a",
"copy",
"of",
"this",
"monetary",
"value",
"multiplied",
"by",
"the",
"specified",
"value",
"using",
"the",
"specified",
"rounding",
"mode",
"to",
"adjust",
"the",
"scale",
"of",
"the",
"result",
".",
"<p",
">",
"This",
"multiplies",
"this",
... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L1319-L1328 |
weld/core | impl/src/main/java/org/jboss/weld/resolution/BeanTypeAssignabilityRules.java | BeanTypeAssignabilityRules.matches | private boolean matches(ParameterizedType requiredType, ParameterizedType beanType) {
"""
A parameterized bean type is considered assignable to a parameterized required type if they have
identical raw type and for each parameter:
"""
if (!requiredType.getRawType().equals(beanType.getRawType())) {
... | java | private boolean matches(ParameterizedType requiredType, ParameterizedType beanType) {
if (!requiredType.getRawType().equals(beanType.getRawType())) {
return false;
}
if (requiredType.getActualTypeArguments().length != beanType.getActualTypeArguments().length) {
throw new ... | [
"private",
"boolean",
"matches",
"(",
"ParameterizedType",
"requiredType",
",",
"ParameterizedType",
"beanType",
")",
"{",
"if",
"(",
"!",
"requiredType",
".",
"getRawType",
"(",
")",
".",
"equals",
"(",
"beanType",
".",
"getRawType",
"(",
")",
")",
")",
"{"... | A parameterized bean type is considered assignable to a parameterized required type if they have
identical raw type and for each parameter: | [
"A",
"parameterized",
"bean",
"type",
"is",
"considered",
"assignable",
"to",
"a",
"parameterized",
"required",
"type",
"if",
"they",
"have",
"identical",
"raw",
"type",
"and",
"for",
"each",
"parameter",
":"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/BeanTypeAssignabilityRules.java#L100-L113 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/session/AbstractDocumentQuery.java | AbstractDocumentQuery._search | @Override
public void _search(String fieldName, String searchTerms, SearchOperator operator) {
"""
Perform a search for documents which fields that match the searchTerms.
If there is more than a single term, each of them will be checked independently.
@param fieldName Field name
@param searchTerms Search te... | java | @Override
public void _search(String fieldName, String searchTerms, SearchOperator operator) {
List<QueryToken> tokens = getCurrentWhereTokens();
appendOperatorIfNeeded(tokens);
fieldName = ensureValidFieldName(fieldName, false);
negateIfNeeded(tokens, fieldName);
WhereToke... | [
"@",
"Override",
"public",
"void",
"_search",
"(",
"String",
"fieldName",
",",
"String",
"searchTerms",
",",
"SearchOperator",
"operator",
")",
"{",
"List",
"<",
"QueryToken",
">",
"tokens",
"=",
"getCurrentWhereTokens",
"(",
")",
";",
"appendOperatorIfNeeded",
... | Perform a search for documents which fields that match the searchTerms.
If there is more than a single term, each of them will be checked independently.
@param fieldName Field name
@param searchTerms Search terms
@param operator Search operator | [
"Perform",
"a",
"search",
"for",
"documents",
"which",
"fields",
"that",
"match",
"the",
"searchTerms",
".",
"If",
"there",
"is",
"more",
"than",
"a",
"single",
"term",
"each",
"of",
"them",
"will",
"be",
"checked",
"independently",
"."
] | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/session/AbstractDocumentQuery.java#L1034-L1044 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java | FileUtils.writeUnixLines | public static void writeUnixLines(Iterable<? extends CharSequence> lines, CharSink sink)
throws IOException {
"""
Generally we want to avoid {@link CharSink#writeLines(Iterable)} because it uses the OS default
line separator, but our code always works with Unix line endings regardless of platform. This
is ... | java | public static void writeUnixLines(Iterable<? extends CharSequence> lines, CharSink sink)
throws IOException {
sink.writeLines(lines, "\n");
} | [
"public",
"static",
"void",
"writeUnixLines",
"(",
"Iterable",
"<",
"?",
"extends",
"CharSequence",
">",
"lines",
",",
"CharSink",
"sink",
")",
"throws",
"IOException",
"{",
"sink",
".",
"writeLines",
"(",
"lines",
",",
"\"\\n\"",
")",
";",
"}"
] | Generally we want to avoid {@link CharSink#writeLines(Iterable)} because it uses the OS default
line separator, but our code always works with Unix line endings regardless of platform. This
is just like {@link CharSink#writeLines(Iterable)}, but always uses Unix endings. | [
"Generally",
"we",
"want",
"to",
"avoid",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java#L1004-L1007 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/CalendarPanel.java | CalendarPanel.getMonthOrYearMenuLocation | private Point getMonthOrYearMenuLocation(JLabel sourceLabel, JPopupMenu filledPopupMenu) {
"""
getMonthOrYearMenuLocation, This calculates the position should be used to set the location
of the month or the year popup menus, relative to their source labels. These menus are used
to change the current month or cur... | java | private Point getMonthOrYearMenuLocation(JLabel sourceLabel, JPopupMenu filledPopupMenu) {
Rectangle labelBounds = sourceLabel.getBounds();
int menuHeight = filledPopupMenu.getPreferredSize().height;
int popupX = labelBounds.x + labelBounds.width + 1;
int popupY = labelBounds.y + (labelB... | [
"private",
"Point",
"getMonthOrYearMenuLocation",
"(",
"JLabel",
"sourceLabel",
",",
"JPopupMenu",
"filledPopupMenu",
")",
"{",
"Rectangle",
"labelBounds",
"=",
"sourceLabel",
".",
"getBounds",
"(",
")",
";",
"int",
"menuHeight",
"=",
"filledPopupMenu",
".",
"getPre... | getMonthOrYearMenuLocation, This calculates the position should be used to set the location
of the month or the year popup menus, relative to their source labels. These menus are used
to change the current month or current year from within the calendar panel. | [
"getMonthOrYearMenuLocation",
"This",
"calculates",
"the",
"position",
"should",
"be",
"used",
"to",
"set",
"the",
"location",
"of",
"the",
"month",
"or",
"the",
"year",
"popup",
"menus",
"relative",
"to",
"their",
"source",
"labels",
".",
"These",
"menus",
"a... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/CalendarPanel.java#L899-L905 |
softindex/datakernel | core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufQueue.java | ByteBufQueue.drainTo | public int drainTo(@NotNull ByteBuf dest, int maxSize) {
"""
Adds {@code maxSize} bytes from this queue to ByteBuf {@code dest} if
queue contains more than {@code maxSize} bytes. Otherwise adds all
bytes from queue to dest. In both cases increases queue's position to
number of drained bytes.
@param dest {... | java | public int drainTo(@NotNull ByteBuf dest, int maxSize) {
int actualSize = drainTo(dest.array(), dest.tail(), maxSize);
dest.moveTail(actualSize);
return actualSize;
} | [
"public",
"int",
"drainTo",
"(",
"@",
"NotNull",
"ByteBuf",
"dest",
",",
"int",
"maxSize",
")",
"{",
"int",
"actualSize",
"=",
"drainTo",
"(",
"dest",
".",
"array",
"(",
")",
",",
"dest",
".",
"tail",
"(",
")",
",",
"maxSize",
")",
";",
"dest",
"."... | Adds {@code maxSize} bytes from this queue to ByteBuf {@code dest} if
queue contains more than {@code maxSize} bytes. Otherwise adds all
bytes from queue to dest. In both cases increases queue's position to
number of drained bytes.
@param dest {@code ByteBuf} for draining
@param maxSize number of bytes for adding
@... | [
"Adds",
"{",
"@code",
"maxSize",
"}",
"bytes",
"from",
"this",
"queue",
"to",
"ByteBuf",
"{",
"@code",
"dest",
"}",
"if",
"queue",
"contains",
"more",
"than",
"{",
"@code",
"maxSize",
"}",
"bytes",
".",
"Otherwise",
"adds",
"all",
"bytes",
"from",
"queue... | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufQueue.java#L571-L575 |
haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/DiffusionDither.java | DiffusionDither.createCompatibleDestImage | public final BufferedImage createCompatibleDestImage(BufferedImage pSource, ColorModel pDestCM) {
"""
Creates a compatible {@code BufferedImage} to dither into.
Only {@code IndexColorModel} allowed.
@return a compatible {@code BufferedImage}
@throws ImageFilterException if {@code pDestCM} is not {@code null... | java | public final BufferedImage createCompatibleDestImage(BufferedImage pSource, ColorModel pDestCM) {
if (pDestCM == null) {
return new BufferedImage(pSource.getWidth(), pSource.getHeight(),
BufferedImage.TYPE_BYTE_INDEXED,
ge... | [
"public",
"final",
"BufferedImage",
"createCompatibleDestImage",
"(",
"BufferedImage",
"pSource",
",",
"ColorModel",
"pDestCM",
")",
"{",
"if",
"(",
"pDestCM",
"==",
"null",
")",
"{",
"return",
"new",
"BufferedImage",
"(",
"pSource",
".",
"getWidth",
"(",
")",
... | Creates a compatible {@code BufferedImage} to dither into.
Only {@code IndexColorModel} allowed.
@return a compatible {@code BufferedImage}
@throws ImageFilterException if {@code pDestCM} is not {@code null} or
an instance of {@code IndexColorModel}. | [
"Creates",
"a",
"compatible",
"{",
"@code",
"BufferedImage",
"}",
"to",
"dither",
"into",
".",
"Only",
"{",
"@code",
"IndexColorModel",
"}",
"allowed",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/DiffusionDither.java#L114-L128 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.biFunction | public static <T, U, R> BiFunction<T, U, R> biFunction(CheckedBiFunction<T, U, R> function) {
"""
Wrap a {@link org.jooq.lambda.fi.util.function.CheckedBiFunction} in a {@link BiFunction}.
<p>
Example:
<code><pre>
map.computeIfPresent("key", Unchecked.biFunction((k, v) -> {
if (k == null || v == null)
throw ... | java | public static <T, U, R> BiFunction<T, U, R> biFunction(CheckedBiFunction<T, U, R> function) {
return biFunction(function, THROWABLE_TO_RUNTIME_EXCEPTION);
} | [
"public",
"static",
"<",
"T",
",",
"U",
",",
"R",
">",
"BiFunction",
"<",
"T",
",",
"U",
",",
"R",
">",
"biFunction",
"(",
"CheckedBiFunction",
"<",
"T",
",",
"U",
",",
"R",
">",
"function",
")",
"{",
"return",
"biFunction",
"(",
"function",
",",
... | Wrap a {@link org.jooq.lambda.fi.util.function.CheckedBiFunction} in a {@link BiFunction}.
<p>
Example:
<code><pre>
map.computeIfPresent("key", Unchecked.biFunction((k, v) -> {
if (k == null || v == null)
throw new Exception("No nulls allowed in map");
return 42;
}));
</pre></code> | [
"Wrap",
"a",
"{",
"@link",
"org",
".",
"jooq",
".",
"lambda",
".",
"fi",
".",
"util",
".",
"function",
".",
"CheckedBiFunction",
"}",
"in",
"a",
"{",
"@link",
"BiFunction",
"}",
".",
"<p",
">",
"Example",
":",
"<code",
">",
"<pre",
">",
"map",
".",... | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L329-L331 |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportHelper.java | CmsImportHelper.getFileBytes | public byte[] getFileBytes(String filename) throws CmsImportExportException {
"""
Returns a byte array containing the content of the file.<p>
@param filename the name of the file to read, relative to the folder or zip file
@return a byte array containing the content of the file
@throws CmsImportExportExce... | java | public byte[] getFileBytes(String filename) throws CmsImportExportException {
try {
// is this a zip-file?
if (getZipFile() != null) {
ZipEntry entry = getZipEntry(filename);
InputStream stream = getZipFile().getInputStream(entry);
int si... | [
"public",
"byte",
"[",
"]",
"getFileBytes",
"(",
"String",
"filename",
")",
"throws",
"CmsImportExportException",
"{",
"try",
"{",
"// is this a zip-file?",
"if",
"(",
"getZipFile",
"(",
")",
"!=",
"null",
")",
"{",
"ZipEntry",
"entry",
"=",
"getZipEntry",
"("... | Returns a byte array containing the content of the file.<p>
@param filename the name of the file to read, relative to the folder or zip file
@return a byte array containing the content of the file
@throws CmsImportExportException if something goes wrong | [
"Returns",
"a",
"byte",
"array",
"containing",
"the",
"content",
"of",
"the",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportHelper.java#L139-L169 |
kmi/iserve | iserve-discovery-api/src/main/java/uk/ac/open/kmi/iserve/discovery/api/impl/AbstractMatcher.java | AbstractMatcher.listMatchesOfType | @Override
public Table<URI, URI, MatchResult> listMatchesOfType(Set<URI> origins, MatchType type) {
"""
Obtains all the matching resources that have a precise MatchType with the URIs of {@code origin}.
@param origins URIs to match
@param type the MatchType we want to obtain
@return a {@link com.google.... | java | @Override
public Table<URI, URI, MatchResult> listMatchesOfType(Set<URI> origins, MatchType type) {
return listMatchesWithinRange(origins, type, type);
} | [
"@",
"Override",
"public",
"Table",
"<",
"URI",
",",
"URI",
",",
"MatchResult",
">",
"listMatchesOfType",
"(",
"Set",
"<",
"URI",
">",
"origins",
",",
"MatchType",
"type",
")",
"{",
"return",
"listMatchesWithinRange",
"(",
"origins",
",",
"type",
",",
"typ... | Obtains all the matching resources that have a precise MatchType with the URIs of {@code origin}.
@param origins URIs to match
@param type the MatchType we want to obtain
@return a {@link com.google.common.collect.Table} with the result of the matching indexed by origin URI and then destination URI. | [
"Obtains",
"all",
"the",
"matching",
"resources",
"that",
"have",
"a",
"precise",
"MatchType",
"with",
"the",
"URIs",
"of",
"{",
"@code",
"origin",
"}",
"."
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-discovery-api/src/main/java/uk/ac/open/kmi/iserve/discovery/api/impl/AbstractMatcher.java#L169-L172 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/DetectorsExtensionHelper.java | DetectorsExtensionHelper.resolvePluginClassesDir | @CheckForNull
private static String resolvePluginClassesDir(String bundleName, File sourceDir) {
"""
Used for Eclipse instances running inside debugger. During development Eclipse plugins
are just directories. The code below tries to locate plugin's
"bin" directory. It doesn't work if the plugin build.proper... | java | @CheckForNull
private static String resolvePluginClassesDir(String bundleName, File sourceDir) {
if (sourceDir.listFiles() == null) {
FindbugsPlugin.getDefault().logException(new IllegalStateException("No files in the bundle!"),
"Failed to create temporary detector package f... | [
"@",
"CheckForNull",
"private",
"static",
"String",
"resolvePluginClassesDir",
"(",
"String",
"bundleName",
",",
"File",
"sourceDir",
")",
"{",
"if",
"(",
"sourceDir",
".",
"listFiles",
"(",
")",
"==",
"null",
")",
"{",
"FindbugsPlugin",
".",
"getDefault",
"("... | Used for Eclipse instances running inside debugger. During development Eclipse plugins
are just directories. The code below tries to locate plugin's
"bin" directory. It doesn't work if the plugin build.properties are not
existing or contain invalid content | [
"Used",
"for",
"Eclipse",
"instances",
"running",
"inside",
"debugger",
".",
"During",
"development",
"Eclipse",
"plugins",
"are",
"just",
"directories",
".",
"The",
"code",
"below",
"tries",
"to",
"locate",
"plugin",
"s",
"bin",
"directory",
".",
"It",
"doesn... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/DetectorsExtensionHelper.java#L154-L183 |
apptik/jus | android/jus-android/src/main/java/io/apptik/comm/jus/ui/ImageLoader.java | ImageLoader.getImageListener | public static ImageListener getImageListener(final ImageView view,
final int defaultImageResId, final int errorImageResId) {
"""
The default implementation of ImageListener which handles basic functionality
of showing a default image until the network response is r... | java | public static ImageListener getImageListener(final ImageView view,
final int defaultImageResId, final int errorImageResId) {
return new ImageListener() {
@Override
public void onError(JusError error) {
if (errorImageResId !... | [
"public",
"static",
"ImageListener",
"getImageListener",
"(",
"final",
"ImageView",
"view",
",",
"final",
"int",
"defaultImageResId",
",",
"final",
"int",
"errorImageResId",
")",
"{",
"return",
"new",
"ImageListener",
"(",
")",
"{",
"@",
"Override",
"public",
"v... | The default implementation of ImageListener which handles basic functionality
of showing a default image until the network response is received, at which point
it will switch to either the actual image or the error image.
@param view The imageView that the listener is associated with.
@param defaultImageResId Default i... | [
"The",
"default",
"implementation",
"of",
"ImageListener",
"which",
"handles",
"basic",
"functionality",
"of",
"showing",
"a",
"default",
"image",
"until",
"the",
"network",
"response",
"is",
"received",
"at",
"which",
"point",
"it",
"will",
"switch",
"to",
"eit... | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/android/jus-android/src/main/java/io/apptik/comm/jus/ui/ImageLoader.java#L153-L172 |
gosu-lang/gosu-lang | gosu-lab/src/main/java/editor/util/TaskQueue.java | TaskQueue.getInstance | public static TaskQueue getInstance( ILogger logger, String strQueueName ) {
"""
Fetch a TaskQueue by name. If the TaskQueue doesn't already exist,
creates the TaskQueue.
@param logger An optional logger.
@param strQueueName The unique name for the queue.
@return The TaskQueue associated with the sp... | java | public static TaskQueue getInstance( ILogger logger, String strQueueName )
{
if( strQueueName == null )
{
return null;
}
TaskQueue taskQueue = QUEUE_MAP.get( strQueueName );
if( taskQueue == null )
{
taskQueue = new TaskQueue( logger, strQueueName );
QUEUE_MAP.put( strQueueN... | [
"public",
"static",
"TaskQueue",
"getInstance",
"(",
"ILogger",
"logger",
",",
"String",
"strQueueName",
")",
"{",
"if",
"(",
"strQueueName",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"TaskQueue",
"taskQueue",
"=",
"QUEUE_MAP",
".",
"get",
"(",
"... | Fetch a TaskQueue by name. If the TaskQueue doesn't already exist,
creates the TaskQueue.
@param logger An optional logger.
@param strQueueName The unique name for the queue.
@return The TaskQueue associated with the specified name. | [
"Fetch",
"a",
"TaskQueue",
"by",
"name",
".",
"If",
"the",
"TaskQueue",
"doesn",
"t",
"already",
"exist",
"creates",
"the",
"TaskQueue",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-lab/src/main/java/editor/util/TaskQueue.java#L67-L82 |
f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.putParcelableArrayList | public Bundler putParcelableArrayList(String key, ArrayList<? extends Parcelable> value) {
"""
Inserts a List of Parcelable values into the mapping of the underlying Bundle, replacing any
existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value an ArrayList ... | java | public Bundler putParcelableArrayList(String key, ArrayList<? extends Parcelable> value) {
delegate.putParcelableArrayList(key, value);
return this;
} | [
"public",
"Bundler",
"putParcelableArrayList",
"(",
"String",
"key",
",",
"ArrayList",
"<",
"?",
"extends",
"Parcelable",
">",
"value",
")",
"{",
"delegate",
".",
"putParcelableArrayList",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a List of Parcelable values into the mapping of the underlying Bundle, replacing any
existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value an ArrayList of Parcelable objects, or null
@return this bundler instance to chain method calls | [
"Inserts",
"a",
"List",
"of",
"Parcelable",
"values",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L374-L377 |
Whiley/WhileyCompiler | src/main/java/wyil/util/AbstractTypedVisitor.java | AbstractTypedVisitor.selectArray | public Type.Array selectArray(Type target, Expr expr, Environment environment) {
"""
<p>
Given an arbitrary target type, filter out the target array types. For
example, consider the following method:
</p>
<pre>
method f(int x):
null|int[] xs = [x]
...
</pre>
<p>
When type checking the expression <cod... | java | public Type.Array selectArray(Type target, Expr expr, Environment environment) {
Type.Array type = asType(expr.getType(), Type.Array.class);
Type.Array[] records = TYPE_ARRAY_FILTER.apply(target);
return selectCandidate(records, type, environment);
} | [
"public",
"Type",
".",
"Array",
"selectArray",
"(",
"Type",
"target",
",",
"Expr",
"expr",
",",
"Environment",
"environment",
")",
"{",
"Type",
".",
"Array",
"type",
"=",
"asType",
"(",
"expr",
".",
"getType",
"(",
")",
",",
"Type",
".",
"Array",
".",
... | <p>
Given an arbitrary target type, filter out the target array types. For
example, consider the following method:
</p>
<pre>
method f(int x):
null|int[] xs = [x]
...
</pre>
<p>
When type checking the expression <code>[x]</code> the flow type checker will
attempt to determine an <i>expected</i> array type. In order t... | [
"<p",
">",
"Given",
"an",
"arbitrary",
"target",
"type",
"filter",
"out",
"the",
"target",
"array",
"types",
".",
"For",
"example",
"consider",
"the",
"following",
"method",
":",
"<",
"/",
"p",
">"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/util/AbstractTypedVisitor.java#L1107-L1111 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/core/convert/support/GenericConversionService.java | GenericConversionService.canBypassConvert | public boolean canBypassConvert(TypeDescriptor sourceType, TypeDescriptor targetType) {
"""
Returns true if conversion between the sourceType and targetType can be bypassed.
More precisely this method will return true if objects of sourceType can be
converted to the targetType by returning the source object unch... | java | public boolean canBypassConvert(TypeDescriptor sourceType, TypeDescriptor targetType) {
Assert.notNull(targetType, "The targetType to convert to cannot be null");
if (sourceType == null) {
return true;
}
GenericConverter converter = getConverter(sourceType, targetType);
return (converter == NO_OP_CONVERTER... | [
"public",
"boolean",
"canBypassConvert",
"(",
"TypeDescriptor",
"sourceType",
",",
"TypeDescriptor",
"targetType",
")",
"{",
"Assert",
".",
"notNull",
"(",
"targetType",
",",
"\"The targetType to convert to cannot be null\"",
")",
";",
"if",
"(",
"sourceType",
"==",
"... | Returns true if conversion between the sourceType and targetType can be bypassed.
More precisely this method will return true if objects of sourceType can be
converted to the targetType by returning the source object unchanged.
@param sourceType context about the source type to convert from (may be null if source is nu... | [
"Returns",
"true",
"if",
"conversion",
"between",
"the",
"sourceType",
"and",
"targetType",
"can",
"be",
"bypassed",
".",
"More",
"precisely",
"this",
"method",
"will",
"return",
"true",
"if",
"objects",
"of",
"sourceType",
"can",
"be",
"converted",
"to",
"the... | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/core/convert/support/GenericConversionService.java#L140-L147 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslKeyMaterialProvider.java | OpenSslKeyMaterialProvider.chooseKeyMaterial | OpenSslKeyMaterial chooseKeyMaterial(ByteBufAllocator allocator, String alias) throws Exception {
"""
Returns the {@link OpenSslKeyMaterial} or {@code null} (if none) that should be used during the handshake by
OpenSSL.
"""
X509Certificate[] certificates = keyManager.getCertificateChain(alias);
... | java | OpenSslKeyMaterial chooseKeyMaterial(ByteBufAllocator allocator, String alias) throws Exception {
X509Certificate[] certificates = keyManager.getCertificateChain(alias);
if (certificates == null || certificates.length == 0) {
return null;
}
PrivateKey key = keyManager.getPri... | [
"OpenSslKeyMaterial",
"chooseKeyMaterial",
"(",
"ByteBufAllocator",
"allocator",
",",
"String",
"alias",
")",
"throws",
"Exception",
"{",
"X509Certificate",
"[",
"]",
"certificates",
"=",
"keyManager",
".",
"getCertificateChain",
"(",
"alias",
")",
";",
"if",
"(",
... | Returns the {@link OpenSslKeyMaterial} or {@code null} (if none) that should be used during the handshake by
OpenSSL. | [
"Returns",
"the",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslKeyMaterialProvider.java#L105-L146 |
heroku/heroku.jar | heroku-api/src/main/java/com/heroku/api/HerokuAPI.java | HerokuAPI.updateConfig | public void updateConfig(String appName, Map<String, String> config) {
"""
Update environment variables to an app.
@param appName App name. See {@link #listApps} for a list of apps that can be used.
@param config Key/Value pairs of environment variables.
"""
connection.execute(new ConfigUpdate(appNam... | java | public void updateConfig(String appName, Map<String, String> config) {
connection.execute(new ConfigUpdate(appName, config), apiKey);
} | [
"public",
"void",
"updateConfig",
"(",
"String",
"appName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"config",
")",
"{",
"connection",
".",
"execute",
"(",
"new",
"ConfigUpdate",
"(",
"appName",
",",
"config",
")",
",",
"apiKey",
")",
";",
"}"
] | Update environment variables to an app.
@param appName App name. See {@link #listApps} for a list of apps that can be used.
@param config Key/Value pairs of environment variables. | [
"Update",
"environment",
"variables",
"to",
"an",
"app",
"."
] | train | https://github.com/heroku/heroku.jar/blob/d9e52991293159498c10c498c6f91fcdd637378e/heroku-api/src/main/java/com/heroku/api/HerokuAPI.java#L329-L331 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/declarative/utils/DeclarativePipelineUtils.java | DeclarativePipelineUtils.writeBuildDataFile | public static void writeBuildDataFile(FilePath ws, String buildNumber, BuildDataFile buildDataFile, Log logger) throws Exception {
"""
Create pipeline build data in @tmp/artifactory-pipeline-cache/build-number directory.
Used to transfer data between different steps in declarative pipelines.
@param ws ... | java | public static void writeBuildDataFile(FilePath ws, String buildNumber, BuildDataFile buildDataFile, Log logger) throws Exception {
createAndGetTempDir(ws).act(new CreateBuildDataFileCallable(buildNumber, buildDataFile, logger));
} | [
"public",
"static",
"void",
"writeBuildDataFile",
"(",
"FilePath",
"ws",
",",
"String",
"buildNumber",
",",
"BuildDataFile",
"buildDataFile",
",",
"Log",
"logger",
")",
"throws",
"Exception",
"{",
"createAndGetTempDir",
"(",
"ws",
")",
".",
"act",
"(",
"new",
... | Create pipeline build data in @tmp/artifactory-pipeline-cache/build-number directory.
Used to transfer data between different steps in declarative pipelines.
@param ws - The agent workspace.
@param buildNumber - The build number.
@param buildDataFile - The build data file to save.
@throws Exception - In c... | [
"Create",
"pipeline",
"build",
"data",
"in",
"@tmp",
"/",
"artifactory",
"-",
"pipeline",
"-",
"cache",
"/",
"build",
"-",
"number",
"directory",
".",
"Used",
"to",
"transfer",
"data",
"between",
"different",
"steps",
"in",
"declarative",
"pipelines",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/declarative/utils/DeclarativePipelineUtils.java#L40-L42 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.v2GetMessageList | public MessageListResult v2GetMessageList(int count, String begin_time, String end_time)
throws APIConnectionException, APIRequestException {
"""
Get message list from history, messages will store 60 days.
@param count Necessary parameter. The count of the message list.
@param begin_time Necessary pa... | java | public MessageListResult v2GetMessageList(int count, String begin_time, String end_time)
throws APIConnectionException, APIRequestException {
return _reportClient.v2GetMessageList(count, begin_time, end_time);
} | [
"public",
"MessageListResult",
"v2GetMessageList",
"(",
"int",
"count",
",",
"String",
"begin_time",
",",
"String",
"end_time",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_reportClient",
".",
"v2GetMessageList",
"(",
"count",
... | Get message list from history, messages will store 60 days.
@param count Necessary parameter. The count of the message list.
@param begin_time Necessary parameter. The format must follow by 'yyyy-MM-dd HH:mm:ss'
@param end_time Necessary parameter. The format must follow by 'yyyy-MM-dd HH:mm:ss'
@return MessageListResu... | [
"Get",
"message",
"list",
"from",
"history",
"messages",
"will",
"store",
"60",
"days",
"."
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L948-L951 |
ow2-chameleon/fuchsia | importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/protocol/ZWaveController.java | ZWaveController.handleIncomingResponseMessage | private void handleIncomingResponseMessage(SerialMessage incomingMessage) {
"""
Handles an incoming response message.
An incoming response message is a response, based one of our own requests.
@param incomingMessage the response message to process.
"""
logger.debug("Message type = RESPONSE");
switch (inc... | java | private void handleIncomingResponseMessage(SerialMessage incomingMessage) {
logger.debug("Message type = RESPONSE");
switch (incomingMessage.getMessageClass()) {
case GetVersion:
handleGetVersionResponse(incomingMessage);
if (incomingMessage.getMessageClass() == this.lastSentMessage.getExpectedReply() &&... | [
"private",
"void",
"handleIncomingResponseMessage",
"(",
"SerialMessage",
"incomingMessage",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Message type = RESPONSE\"",
")",
";",
"switch",
"(",
"incomingMessage",
".",
"getMessageClass",
"(",
")",
")",
"{",
"case",
"GetVer... | Handles an incoming response message.
An incoming response message is a response, based one of our own requests.
@param incomingMessage the response message to process. | [
"Handles",
"an",
"incoming",
"response",
"message",
".",
"An",
"incoming",
"response",
"message",
"is",
"a",
"response",
"based",
"one",
"of",
"our",
"own",
"requests",
"."
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/protocol/ZWaveController.java#L419-L474 |
percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/IntentUtils.java | IntentUtils.launchAppForPackage | public static boolean launchAppForPackage(final Context context, final String packageName) {
"""
Tries to launch the application for a given package name.
@return true if launch succeeded, otherwise false.
"""
try {
final PackageManager packageManager = context.getPackageManager();
... | java | public static boolean launchAppForPackage(final Context context, final String packageName) {
try {
final PackageManager packageManager = context.getPackageManager();
final Intent intent = packageManager.getLaunchIntentForPackage(packageName);
intent.addCategory(Intent.CATEGOR... | [
"public",
"static",
"boolean",
"launchAppForPackage",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"packageName",
")",
"{",
"try",
"{",
"final",
"PackageManager",
"packageManager",
"=",
"context",
".",
"getPackageManager",
"(",
")",
";",
"final",
... | Tries to launch the application for a given package name.
@return true if launch succeeded, otherwise false. | [
"Tries",
"to",
"launch",
"the",
"application",
"for",
"a",
"given",
"package",
"name",
"."
] | train | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/IntentUtils.java#L94-L105 |
michael-rapp/AndroidBottomSheet | library/src/main/java/de/mrapp/android/bottomsheet/BottomSheet.java | BottomSheet.addItem | public final void addItem(final int id, @NonNull final CharSequence title,
@Nullable final Drawable icon) {
"""
Adds a new item to the bottom sheet.
@param id
The id of the item, which should be added, as an {@link Integer} value. The id must
be at least 0
@param title
The titl... | java | public final void addItem(final int id, @NonNull final CharSequence title,
@Nullable final Drawable icon) {
Item item = new Item(id, title);
item.setIcon(icon);
adapter.add(item);
adaptGridViewHeight();
} | [
"public",
"final",
"void",
"addItem",
"(",
"final",
"int",
"id",
",",
"@",
"NonNull",
"final",
"CharSequence",
"title",
",",
"@",
"Nullable",
"final",
"Drawable",
"icon",
")",
"{",
"Item",
"item",
"=",
"new",
"Item",
"(",
"id",
",",
"title",
")",
";",
... | Adds a new item to the bottom sheet.
@param id
The id of the item, which should be added, as an {@link Integer} value. The id must
be at least 0
@param title
The title of the item, which should be added, as an instance of the type {@link
CharSequence}. The title may neither be null, nor empty
@param icon
The icon of t... | [
"Adds",
"a",
"new",
"item",
"to",
"the",
"bottom",
"sheet",
"."
] | train | https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/library/src/main/java/de/mrapp/android/bottomsheet/BottomSheet.java#L2001-L2007 |
Talend/tesb-rt-se | examples/tesb/locator-service/soap-service/war/src/main/java/demo/service/ContextListener.java | ContextListener.contextDestroyed | public void contextDestroyed(ServletContextEvent event) {
"""
/*
This method is invoked when the Web Application has been removed and is
no longer able to accept requests
"""
// Output a simple message to the server's console
System.out.println("The Simple Web App. Has Been Removed");
... | java | public void contextDestroyed(ServletContextEvent event) {
// Output a simple message to the server's console
System.out.println("The Simple Web App. Has Been Removed");
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
"/client.xml");
LocatorSer... | [
"public",
"void",
"contextDestroyed",
"(",
"ServletContextEvent",
"event",
")",
"{",
"// Output a simple message to the server's console",
"System",
".",
"out",
".",
"println",
"(",
"\"The Simple Web App. Has Been Removed\"",
")",
";",
"ClassPathXmlApplicationContext",
"context... | /*
This method is invoked when the Web Application has been removed and is
no longer able to accept requests | [
"/",
"*",
"This",
"method",
"is",
"invoked",
"when",
"the",
"Web",
"Application",
"has",
"been",
"removed",
"and",
"is",
"no",
"longer",
"able",
"to",
"accept",
"requests"
] | train | https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/examples/tesb/locator-service/soap-service/war/src/main/java/demo/service/ContextListener.java#L40-L58 |
lucee/Lucee | core/src/main/java/lucee/commons/lang/StringUtil.java | StringUtil.replaceMap | private static String replaceMap(String input, Map map, boolean ignoreCase, boolean doResolveInternals) throws PageException {
"""
this is the core of the replaceMap() method.
it is called once from the public entry point and then internally from resolveInternals()
when doResolveInternals is true -- this met... | java | private static String replaceMap(String input, Map map, boolean ignoreCase, boolean doResolveInternals) throws PageException {
if (doResolveInternals) map = resolveInternals(map, ignoreCase, 0);
String result = input;
Iterator<Map.Entry> it = map.entrySet().iterator();
Map.Entry e;
while (it.hasNext()) {
e =... | [
"private",
"static",
"String",
"replaceMap",
"(",
"String",
"input",
",",
"Map",
"map",
",",
"boolean",
"ignoreCase",
",",
"boolean",
"doResolveInternals",
")",
"throws",
"PageException",
"{",
"if",
"(",
"doResolveInternals",
")",
"map",
"=",
"resolveInternals",
... | this is the core of the replaceMap() method.
it is called once from the public entry point and then internally from resolveInternals()
when doResolveInternals is true -- this method calls resolveInternals. therefore, calls from
resolveInternals() must pass false to that param to avoid an infinite ping-pong loop
@par... | [
"this",
"is",
"the",
"core",
"of",
"the",
"replaceMap",
"()",
"method",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/StringUtil.java#L1345-L1356 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java | DataServiceVisitorJsBuilder.writeArgumentsComment | void writeArgumentsComment(Iterator<String> argumentsType, Iterator<String> argumentsName, Writer writer) throws IOException {
"""
write js documentation for arguments
@param argumentsType
@param argumentsName
@param writer
@throws IOException
"""
while(argumentsType.hasNext()) {
String type = argum... | java | void writeArgumentsComment(Iterator<String> argumentsType, Iterator<String> argumentsName, Writer writer) throws IOException {
while(argumentsType.hasNext()) {
String type = argumentsType.next();
String name = argumentsName.next();
writer.append(TAB2).append(" * @param ").append(OPENBRACE).append(type).a... | [
"void",
"writeArgumentsComment",
"(",
"Iterator",
"<",
"String",
">",
"argumentsType",
",",
"Iterator",
"<",
"String",
">",
"argumentsName",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"while",
"(",
"argumentsType",
".",
"hasNext",
"(",
")",
")... | write js documentation for arguments
@param argumentsType
@param argumentsName
@param writer
@throws IOException | [
"write",
"js",
"documentation",
"for",
"arguments"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java#L141-L147 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/UtilFile.java | UtilFile.getFilesByNameRecursive | private static void getFilesByNameRecursive(Collection<File> filesList, File path, String name) {
"""
Get all files existing in the path with the specified name.
@param filesList The files list.
@param path The path to check.
@param name The file name.
"""
Optional.ofNullable(path.listFiles()).ifP... | java | private static void getFilesByNameRecursive(Collection<File> filesList, File path, String name)
{
Optional.ofNullable(path.listFiles()).ifPresent(files -> Arrays.asList(files).forEach(content ->
{
if (content.isFile() && content.getName().equals(name))
{
files... | [
"private",
"static",
"void",
"getFilesByNameRecursive",
"(",
"Collection",
"<",
"File",
">",
"filesList",
",",
"File",
"path",
",",
"String",
"name",
")",
"{",
"Optional",
".",
"ofNullable",
"(",
"path",
".",
"listFiles",
"(",
")",
")",
".",
"ifPresent",
"... | Get all files existing in the path with the specified name.
@param filesList The files list.
@param path The path to check.
@param name The file name. | [
"Get",
"all",
"files",
"existing",
"in",
"the",
"path",
"with",
"the",
"specified",
"name",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/UtilFile.java#L274-L287 |
JodaOrg/joda-convert | src/main/java/org/joda/convert/MethodConstructorStringConverter.java | MethodConstructorStringConverter.convertFromString | @Override
public T convertFromString(Class<? extends T> cls, String str) {
"""
Converts the {@code String} to an object.
@param cls the class to convert to, not null
@param str the string to convert, not null
@return the converted object, may be null but generally not
"""
try {
... | java | @Override
public T convertFromString(Class<? extends T> cls, String str) {
try {
return fromString.newInstance(str);
} catch (IllegalAccessException ex) {
throw new IllegalStateException("Constructor is not accessible: " + fromString);
} catch (InstantiationExce... | [
"@",
"Override",
"public",
"T",
"convertFromString",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
"cls",
",",
"String",
"str",
")",
"{",
"try",
"{",
"return",
"fromString",
".",
"newInstance",
"(",
"str",
")",
";",
"}",
"catch",
"(",
"IllegalAccessExcept... | Converts the {@code String} to an object.
@param cls the class to convert to, not null
@param str the string to convert, not null
@return the converted object, may be null but generally not | [
"Converts",
"the",
"{"
] | train | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/MethodConstructorStringConverter.java#L65-L79 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/CouchURIHelper.java | CouchURIHelper.attachmentUri | public URI attachmentUri(String documentId, String attachmentId) {
"""
Returns URI for Attachment having {@code attachmentId} for {@code documentId}.
"""
String base_uri = String.format(
"%s/%s/%s",
this.rootUriString,
this.encodeId(documentId),
... | java | public URI attachmentUri(String documentId, String attachmentId) {
String base_uri = String.format(
"%s/%s/%s",
this.rootUriString,
this.encodeId(documentId),
this.encodeId(attachmentId)
);
return uriFor(base_uri);
} | [
"public",
"URI",
"attachmentUri",
"(",
"String",
"documentId",
",",
"String",
"attachmentId",
")",
"{",
"String",
"base_uri",
"=",
"String",
".",
"format",
"(",
"\"%s/%s/%s\"",
",",
"this",
".",
"rootUriString",
",",
"this",
".",
"encodeId",
"(",
"documentId",... | Returns URI for Attachment having {@code attachmentId} for {@code documentId}. | [
"Returns",
"URI",
"for",
"Attachment",
"having",
"{"
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/CouchURIHelper.java#L127-L135 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/compare/SimpleCompareFileExtensions.java | SimpleCompareFileExtensions.compareFilesByExtension | public static boolean compareFilesByExtension(final File sourceFile, final File fileToCompare) {
"""
Compare files by extension.
@param sourceFile
the source file
@param fileToCompare
the file to compare
@return true if the extension are equal, otherwise false.
"""
return CompareFileExtensions
.com... | java | public static boolean compareFilesByExtension(final File sourceFile, final File fileToCompare)
{
return CompareFileExtensions
.compareFiles(sourceFile, fileToCompare, true, false, true, true, true, true)
.getFileExtensionEquality();
} | [
"public",
"static",
"boolean",
"compareFilesByExtension",
"(",
"final",
"File",
"sourceFile",
",",
"final",
"File",
"fileToCompare",
")",
"{",
"return",
"CompareFileExtensions",
".",
"compareFiles",
"(",
"sourceFile",
",",
"fileToCompare",
",",
"true",
",",
"false",... | Compare files by extension.
@param sourceFile
the source file
@param fileToCompare
the file to compare
@return true if the extension are equal, otherwise false. | [
"Compare",
"files",
"by",
"extension",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/compare/SimpleCompareFileExtensions.java#L147-L152 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/ByteBufferConfiguration.java | ByteBufferConfiguration.updateBufferManager | private void updateBufferManager(Map<String, Object> properties) {
"""
This is used to provide the runtime configuration changes to an
existing pool manager, which is a small subset of the possible
creation properties.
@param properties
"""
if (properties.isEmpty()) {
return;
}... | java | private void updateBufferManager(Map<String, Object> properties) {
if (properties.isEmpty()) {
return;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(this, tc, "Ignoring runtime changes to WSBB config; " + properties);
}
// T... | [
"private",
"void",
"updateBufferManager",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"properties",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
... | This is used to provide the runtime configuration changes to an
existing pool manager, which is a small subset of the possible
creation properties.
@param properties | [
"This",
"is",
"used",
"to",
"provide",
"the",
"runtime",
"configuration",
"changes",
"to",
"an",
"existing",
"pool",
"manager",
"which",
"is",
"a",
"small",
"subset",
"of",
"the",
"possible",
"creation",
"properties",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/ByteBufferConfiguration.java#L175-L183 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/snmp_manager.java | snmp_manager.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
snmp_manager_responses result = (snmp_manager_responses) service.get_pa... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
snmp_manager_responses result = (snmp_manager_responses) service.get_payload_formatter().string_to_resource(snmp_manager_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcod... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"snmp_manager_responses",
"result",
"=",
"(",
"snmp_manager_responses",
")",
"service",
".",
"get_payload_form... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/snmp_manager.java#L326-L343 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/widget/LienzoPanel.java | LienzoPanel.setPixelSize | @Override
public void setPixelSize(final int wide, final int high) {
"""
Sets the size in pixels of the {@link LienzoPanel}
Sets the size in pixels of the {@link Viewport} contained and automatically added to the instance of the {@link LienzoPanel}
"""
super.setPixelSize(wide, high);
getV... | java | @Override
public void setPixelSize(final int wide, final int high)
{
super.setPixelSize(wide, high);
getViewport().setPixelSize(wide, high);
getViewport().draw();
} | [
"@",
"Override",
"public",
"void",
"setPixelSize",
"(",
"final",
"int",
"wide",
",",
"final",
"int",
"high",
")",
"{",
"super",
".",
"setPixelSize",
"(",
"wide",
",",
"high",
")",
";",
"getViewport",
"(",
")",
".",
"setPixelSize",
"(",
"wide",
",",
"hi... | Sets the size in pixels of the {@link LienzoPanel}
Sets the size in pixels of the {@link Viewport} contained and automatically added to the instance of the {@link LienzoPanel} | [
"Sets",
"the",
"size",
"in",
"pixels",
"of",
"the",
"{"
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/widget/LienzoPanel.java#L286-L294 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsWorkplaceEditorManager.java | CmsWorkplaceEditorManager.getEditorParameter | public String getEditorParameter(CmsObject cms, String editor, String param) {
"""
Gets the value of a global editor configuration parameter.
@param cms the CMS context
@param editor the editor name
@param param the name of the parameter
@return the editor parameter value
"""
String path = Ope... | java | public String getEditorParameter(CmsObject cms, String editor, String param) {
String path = OpenCms.getSystemInfo().getConfigFilePath(cms, "editors/" + editor + ".properties");
CmsVfsMemoryObjectCache cache = CmsVfsMemoryObjectCache.getVfsMemoryObjectCache();
CmsParameterConfiguration config =... | [
"public",
"String",
"getEditorParameter",
"(",
"CmsObject",
"cms",
",",
"String",
"editor",
",",
"String",
"param",
")",
"{",
"String",
"path",
"=",
"OpenCms",
".",
"getSystemInfo",
"(",
")",
".",
"getConfigFilePath",
"(",
"cms",
",",
"\"editors/\"",
"+",
"e... | Gets the value of a global editor configuration parameter.
@param cms the CMS context
@param editor the editor name
@param param the name of the parameter
@return the editor parameter value | [
"Gets",
"the",
"value",
"of",
"a",
"global",
"editor",
"configuration",
"parameter",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsWorkplaceEditorManager.java#L250-L270 |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaRef.java | JpaRef.filterUnwantedReferences | static void filterUnwantedReferences(List<JpaRef> result, Collection<BeanId> query) {
"""
Beans with different schemaName may have same instance id.
The IN search query is greedy, finding instances that
match any combination of instance id and schemaName. Hence,
the query may find references belonging to wron... | java | static void filterUnwantedReferences(List<JpaRef> result, Collection<BeanId> query) {
ListIterator<JpaRef> it = result.listIterator();
while (it.hasNext()) {
// remove reference from result that was not part of the query
BeanId found = it.next().getSource();
if (!quer... | [
"static",
"void",
"filterUnwantedReferences",
"(",
"List",
"<",
"JpaRef",
">",
"result",
",",
"Collection",
"<",
"BeanId",
">",
"query",
")",
"{",
"ListIterator",
"<",
"JpaRef",
">",
"it",
"=",
"result",
".",
"listIterator",
"(",
")",
";",
"while",
"(",
... | Beans with different schemaName may have same instance id.
The IN search query is greedy, finding instances that
match any combination of instance id and schemaName. Hence,
the query may find references belonging to wrong schema
so filter those out. | [
"Beans",
"with",
"different",
"schemaName",
"may",
"have",
"same",
"instance",
"id",
"."
] | train | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaRef.java#L148-L157 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Annotations.java | Annotations.inRange | public static boolean inRange(Range range, double val) {
"""
Check if a certain value is in range
@param range range info
@param val the value to check;
@return true if it is in range, false otherwise.
"""
return val >= range.min() && val <= range.max();
} | java | public static boolean inRange(Range range, double val) {
return val >= range.min() && val <= range.max();
} | [
"public",
"static",
"boolean",
"inRange",
"(",
"Range",
"range",
",",
"double",
"val",
")",
"{",
"return",
"val",
">=",
"range",
".",
"min",
"(",
")",
"&&",
"val",
"<=",
"range",
".",
"max",
"(",
")",
";",
"}"
] | Check if a certain value is in range
@param range range info
@param val the value to check;
@return true if it is in range, false otherwise. | [
"Check",
"if",
"a",
"certain",
"value",
"is",
"in",
"range"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Annotations.java#L87-L89 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/flow/DenseOpticalFlowBlockPyramid.java | DenseOpticalFlowBlockPyramid.checkNeighbors | protected void checkNeighbors( int cx , int cy , ImageFlow.D flow , ImageFlow image , float score ) {
"""
Examines every pixel inside the region centered at (cx,cy) to see if their optical flow has a worse
score the one specified in 'flow'
"""
for( int i = -regionRadius; i <= regionRadius; i++ ) {
int in... | java | protected void checkNeighbors( int cx , int cy , ImageFlow.D flow , ImageFlow image , float score ) {
for( int i = -regionRadius; i <= regionRadius; i++ ) {
int index = image.width*(cy+i) + (cx-regionRadius);
for( int j = -regionRadius; j <= regionRadius; j++ , index++ ) {
float s = scores[ index ];
Ima... | [
"protected",
"void",
"checkNeighbors",
"(",
"int",
"cx",
",",
"int",
"cy",
",",
"ImageFlow",
".",
"D",
"flow",
",",
"ImageFlow",
"image",
",",
"float",
"score",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"-",
"regionRadius",
";",
"i",
"<=",
"regionRadius",... | Examines every pixel inside the region centered at (cx,cy) to see if their optical flow has a worse
score the one specified in 'flow' | [
"Examines",
"every",
"pixel",
"inside",
"the",
"region",
"centered",
"at",
"(",
"cx",
"cy",
")",
"to",
"see",
"if",
"their",
"optical",
"flow",
"has",
"a",
"worse",
"score",
"the",
"one",
"specified",
"in",
"flow"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/DenseOpticalFlowBlockPyramid.java#L231-L251 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UsersInner.java | UsersInner.createOrUpdate | public UserInner createOrUpdate(String resourceGroupName, String labAccountName, String labName, String userName, UserInner user) {
"""
Create or replace an existing User.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the... | java | public UserInner createOrUpdate(String resourceGroupName, String labAccountName, String labName, String userName, UserInner user) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName, user).toBlocking().single().body();
} | [
"public",
"UserInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"userName",
",",
"UserInner",
"user",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroup... | Create or replace an existing User.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param userName The name of the user.
@param user The User registered to a lab
@throws IllegalArgumentException thrown if parameters fail t... | [
"Create",
"or",
"replace",
"an",
"existing",
"User",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UsersInner.java#L586-L588 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ColumnSRID.java | ColumnSRID.fetchConstraint | public static String fetchConstraint(Connection connection, String catalogName, String schemaName, String tableName) throws SQLException {
"""
Read table constraints from database metadata.
@param connection Active connection
@param catalogName Catalog name or empty string
@param schemaName Schema name or empty... | java | public static String fetchConstraint(Connection connection, String catalogName, String schemaName, String tableName) throws SQLException {
// Merge column constraint and table constraint
PreparedStatement pst = SFSUtilities.prepareInformationSchemaStatement(connection, catalogName, schemaName,
... | [
"public",
"static",
"String",
"fetchConstraint",
"(",
"Connection",
"connection",
",",
"String",
"catalogName",
",",
"String",
"schemaName",
",",
"String",
"tableName",
")",
"throws",
"SQLException",
"{",
"// Merge column constraint and table constraint",
"PreparedStatement... | Read table constraints from database metadata.
@param connection Active connection
@param catalogName Catalog name or empty string
@param schemaName Schema name or empty string
@param tableName table name
@return Found table constraints
@throws SQLException | [
"Read",
"table",
"constraints",
"from",
"database",
"metadata",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ColumnSRID.java#L82-L98 |
op4j/op4j | src/main/java/org/op4j/functions/Call.java | Call.bigDecimal | public static Function<Object,BigDecimal> bigDecimal(final String methodName, final Object... optionalParameters) {
"""
<p>
Abbreviation for {{@link #methodForBigDecimal(String, Object...)}.
</p>
@since 1.1
@param methodName the name of the method
@param optionalParameters the (optional) parameters of the... | java | public static Function<Object,BigDecimal> bigDecimal(final String methodName, final Object... optionalParameters) {
return methodForBigDecimal(methodName, optionalParameters);
} | [
"public",
"static",
"Function",
"<",
"Object",
",",
"BigDecimal",
">",
"bigDecimal",
"(",
"final",
"String",
"methodName",
",",
"final",
"Object",
"...",
"optionalParameters",
")",
"{",
"return",
"methodForBigDecimal",
"(",
"methodName",
",",
"optionalParameters",
... | <p>
Abbreviation for {{@link #methodForBigDecimal(String, Object...)}.
</p>
@since 1.1
@param methodName the name of the method
@param optionalParameters the (optional) parameters of the method.
@return the result of the method execution | [
"<p",
">",
"Abbreviation",
"for",
"{{",
"@link",
"#methodForBigDecimal",
"(",
"String",
"Object",
"...",
")",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/Call.java#L178-L180 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AtomCache.java | AtomCache.getStructureForDomain | public Structure getStructureForDomain(String scopId, ScopDatabase scopDatabase) throws IOException,
StructureException {
"""
Returns the representation of a {@link ScopDomain} as a BioJava {@link Structure} object.
@param scopId
a SCOP Id
@param scopDatabase
A {@link ScopDatabase} to use
@return a Struc... | java | public Structure getStructureForDomain(String scopId, ScopDatabase scopDatabase) throws IOException,
StructureException {
ScopDomain domain = scopDatabase.getDomainByScopID(scopId);
return getStructureForDomain(domain, scopDatabase);
} | [
"public",
"Structure",
"getStructureForDomain",
"(",
"String",
"scopId",
",",
"ScopDatabase",
"scopDatabase",
")",
"throws",
"IOException",
",",
"StructureException",
"{",
"ScopDomain",
"domain",
"=",
"scopDatabase",
".",
"getDomainByScopID",
"(",
"scopId",
")",
";",
... | Returns the representation of a {@link ScopDomain} as a BioJava {@link Structure} object.
@param scopId
a SCOP Id
@param scopDatabase
A {@link ScopDatabase} to use
@return a Structure object
@throws IOException
@throws StructureException | [
"Returns",
"the",
"representation",
"of",
"a",
"{",
"@link",
"ScopDomain",
"}",
"as",
"a",
"BioJava",
"{",
"@link",
"Structure",
"}",
"object",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AtomCache.java#L659-L663 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ras/SibTr.java | SibTr.formatBytes | public static String formatBytes (byte[] data) {
"""
Produce a formatted view of a byte array. Duplicate output lines are
suppressed to save space.
<p>
@param data the byte array to be formatted
@return the formatted byte array, or an empty StringBuffer if null was passed in.
"""
// If the data exists... | java | public static String formatBytes (byte[] data) {
// If the data exists, format it.
if (data != null) {
return formatBytes(data, 0, data.length, true);
}
// Otherwise, return an empty String as the overloaded method would have done.
else {
return "";
}
} | [
"public",
"static",
"String",
"formatBytes",
"(",
"byte",
"[",
"]",
"data",
")",
"{",
"// If the data exists, format it.",
"if",
"(",
"data",
"!=",
"null",
")",
"{",
"return",
"formatBytes",
"(",
"data",
",",
"0",
",",
"data",
".",
"length",
",",
"true",
... | Produce a formatted view of a byte array. Duplicate output lines are
suppressed to save space.
<p>
@param data the byte array to be formatted
@return the formatted byte array, or an empty StringBuffer if null was passed in. | [
"Produce",
"a",
"formatted",
"view",
"of",
"a",
"byte",
"array",
".",
"Duplicate",
"output",
"lines",
"are",
"suppressed",
"to",
"save",
"space",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ras/SibTr.java#L1417-L1426 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vrack/src/main/java/net/minidev/ovh/api/ApiOvhVrack.java | ApiOvhVrack.serviceName_ip_ip_availableZone_GET | public ArrayList<OvhVrackZoneEnum> serviceName_ip_ip_availableZone_GET(String serviceName, String ip) throws IOException {
"""
Zone available to announce your block
REST: GET /vrack/{serviceName}/ip/{ip}/availableZone
@param serviceName [required] The internal name of your vrack
@param ip [required] Your IP b... | java | public ArrayList<OvhVrackZoneEnum> serviceName_ip_ip_availableZone_GET(String serviceName, String ip) throws IOException {
String qPath = "/vrack/{serviceName}/ip/{ip}/availableZone";
StringBuilder sb = path(qPath, serviceName, ip);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t... | [
"public",
"ArrayList",
"<",
"OvhVrackZoneEnum",
">",
"serviceName_ip_ip_availableZone_GET",
"(",
"String",
"serviceName",
",",
"String",
"ip",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/vrack/{serviceName}/ip/{ip}/availableZone\"",
";",
"StringBuilder",
... | Zone available to announce your block
REST: GET /vrack/{serviceName}/ip/{ip}/availableZone
@param serviceName [required] The internal name of your vrack
@param ip [required] Your IP block | [
"Zone",
"available",
"to",
"announce",
"your",
"block"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vrack/src/main/java/net/minidev/ovh/api/ApiOvhVrack.java#L470-L475 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.field2inout | public void field2inout(Object o, String field, Object comp) {
"""
Maps a field to an In and Out field
@param o the object
@param field the field name
@param comp the component
"""
field2inout(o, field, comp, field);
} | java | public void field2inout(Object o, String field, Object comp) {
field2inout(o, field, comp, field);
} | [
"public",
"void",
"field2inout",
"(",
"Object",
"o",
",",
"String",
"field",
",",
"Object",
"comp",
")",
"{",
"field2inout",
"(",
"o",
",",
"field",
",",
"comp",
",",
"field",
")",
";",
"}"
] | Maps a field to an In and Out field
@param o the object
@param field the field name
@param comp the component | [
"Maps",
"a",
"field",
"to",
"an",
"In",
"and",
"Out",
"field"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L178-L180 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/style/stylers/AdvancedImpl.java | AdvancedImpl.cellLayout | @Override
public final void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) {
"""
An advanced styler may be added as event to a cell by {@link StyleHelper#style(java.lang.Object, java.lang.Object, java.util.Collection) }
when the element styled is a table and the {@link EVENTMODE} is A... | java | @Override
public final void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) {
try {
tableForeground = isBg() ? canvases[PdfPTable.BASECANVAS] : canvases[PdfPTable.TEXTCANVAS];
Rectangle box = getValue(USEPADDING, Boolean.class) ? new Rectangle(
position.g... | [
"@",
"Override",
"public",
"final",
"void",
"cellLayout",
"(",
"PdfPCell",
"cell",
",",
"Rectangle",
"position",
",",
"PdfContentByte",
"[",
"]",
"canvases",
")",
"{",
"try",
"{",
"tableForeground",
"=",
"isBg",
"(",
")",
"?",
"canvases",
"[",
"PdfPTable",
... | An advanced styler may be added as event to a cell by {@link StyleHelper#style(java.lang.Object, java.lang.Object, java.util.Collection) }
when the element styled is a table and the {@link EVENTMODE} is ALL or CELL. This enables drawing near a cell.
Calls {@link #draw(com.itextpdf.text.Rectangle, java.lang.String) } wi... | [
"An",
"advanced",
"styler",
"may",
"be",
"added",
"as",
"event",
"to",
"a",
"cell",
"by",
"{",
"@link",
"StyleHelper#style",
"(",
"java",
".",
"lang",
".",
"Object",
"java",
".",
"lang",
".",
"Object",
"java",
".",
"util",
".",
"Collection",
")",
"}",
... | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/AdvancedImpl.java#L417-L431 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/MapTilePathModel.java | MapTilePathModel.isTileNotAvailable | private boolean isTileNotAvailable(Pathfindable mover, int ctx, int cty, Integer ignoreObjectId) {
"""
Check if area if used.
@param mover The object moving on map.
@param ctx The horizontal tile index.
@param cty The vertical tile index.
@param ignoreObjectId The object ID to ignore.
@return <code>true</co... | java | private boolean isTileNotAvailable(Pathfindable mover, int ctx, int cty, Integer ignoreObjectId)
{
final Collection<Integer> ids = getObjectsId(ctx, cty);
final Tile tile = map.getTile(ctx, cty);
if (tile != null)
{
final TilePath tilePath = tile.getFeature(TilePath.class... | [
"private",
"boolean",
"isTileNotAvailable",
"(",
"Pathfindable",
"mover",
",",
"int",
"ctx",
",",
"int",
"cty",
",",
"Integer",
"ignoreObjectId",
")",
"{",
"final",
"Collection",
"<",
"Integer",
">",
"ids",
"=",
"getObjectsId",
"(",
"ctx",
",",
"cty",
")",
... | Check if area if used.
@param mover The object moving on map.
@param ctx The horizontal tile index.
@param cty The vertical tile index.
@param ignoreObjectId The object ID to ignore.
@return <code>true</code> if area is used, <code>false</code> else. | [
"Check",
"if",
"area",
"if",
"used",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/MapTilePathModel.java#L84-L98 |
mikepenz/Materialize | library/src/main/java/com/mikepenz/materialize/holder/ImageHolder.java | ImageHolder.applyToOrSetGone | public static void applyToOrSetGone(ImageHolder imageHolder, ImageView imageView, String tag) {
"""
a small static helper to set the image from the imageHolder nullSave to the imageView and hide the view if no image was set
@param imageHolder
@param imageView
@param tag used to identify imageViews and... | java | public static void applyToOrSetGone(ImageHolder imageHolder, ImageView imageView, String tag) {
boolean imageSet = applyTo(imageHolder, imageView, tag);
if (imageView != null) {
if (imageSet) {
imageView.setVisibility(View.VISIBLE);
} else {
imageV... | [
"public",
"static",
"void",
"applyToOrSetGone",
"(",
"ImageHolder",
"imageHolder",
",",
"ImageView",
"imageView",
",",
"String",
"tag",
")",
"{",
"boolean",
"imageSet",
"=",
"applyTo",
"(",
"imageHolder",
",",
"imageView",
",",
"tag",
")",
";",
"if",
"(",
"i... | a small static helper to set the image from the imageHolder nullSave to the imageView and hide the view if no image was set
@param imageHolder
@param imageView
@param tag used to identify imageViews and define different placeholders | [
"a",
"small",
"static",
"helper",
"to",
"set",
"the",
"image",
"from",
"the",
"imageHolder",
"nullSave",
"to",
"the",
"imageView",
"and",
"hide",
"the",
"view",
"if",
"no",
"image",
"was",
"set"
] | train | https://github.com/mikepenz/Materialize/blob/2612c10c7570191a78d57f23620e945d61370e3d/library/src/main/java/com/mikepenz/materialize/holder/ImageHolder.java#L223-L232 |
gotev/android-upload-service | uploadservice-ftp/src/main/java/net/gotev/uploadservice/ftp/FTPUploadRequest.java | FTPUploadRequest.addFileToUpload | public FTPUploadRequest addFileToUpload(String filePath, String remotePath) throws FileNotFoundException {
"""
Add a file to be uploaded.
@param filePath path to the local file on the device
@param remotePath absolute path (or relative path to the default remote working directory)
of the file on the FTP server.... | java | public FTPUploadRequest addFileToUpload(String filePath, String remotePath) throws FileNotFoundException {
return addFileToUpload(filePath, remotePath, null);
} | [
"public",
"FTPUploadRequest",
"addFileToUpload",
"(",
"String",
"filePath",
",",
"String",
"remotePath",
")",
"throws",
"FileNotFoundException",
"{",
"return",
"addFileToUpload",
"(",
"filePath",
",",
"remotePath",
",",
"null",
")",
";",
"}"
] | Add a file to be uploaded.
@param filePath path to the local file on the device
@param remotePath absolute path (or relative path to the default remote working directory)
of the file on the FTP server. Valid paths are for example:
{@code /path/to/myfile.txt}, {@code relative/path/} or {@code myfile.zip}.
If any of the ... | [
"Add",
"a",
"file",
"to",
"be",
"uploaded",
"."
] | train | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice-ftp/src/main/java/net/gotev/uploadservice/ftp/FTPUploadRequest.java#L112-L114 |
kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/apis/CustomObjectsApi.java | CustomObjectsApi.listNamespacedCustomObjectAsync | public com.squareup.okhttp.Call listNamespacedCustomObjectAsync(String group, String version, String namespace, String plural, String pretty, String labelSelector, String resourceVersion, Integer timeoutSeconds, Boolean watch, final ApiCallback<Object> callback) throws ApiException {
"""
(asynchronously)
list or ... | java | public com.squareup.okhttp.Call listNamespacedCustomObjectAsync(String group, String version, String namespace, String plural, String pretty, String labelSelector, String resourceVersion, Integer timeoutSeconds, Boolean watch, final ApiCallback<Object> callback) throws ApiException {
ProgressResponseBody.Progr... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"listNamespacedCustomObjectAsync",
"(",
"String",
"group",
",",
"String",
"version",
",",
"String",
"namespace",
",",
"String",
"plural",
",",
"String",
"pretty",
",",
"String",
"labelSelector",
",",
... | (asynchronously)
list or watch namespace scoped custom objects
@param group The custom resource's group name (required)
@param version The custom resource's version (required)
@param namespace The custom resource's namespace (required)
@param plural The custom resource's plural name. For TPRs this would... | [
"(",
"asynchronously",
")",
"list",
"or",
"watch",
"namespace",
"scoped",
"custom",
"objects"
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/apis/CustomObjectsApi.java#L2079-L2104 |
wonderpush/wonderpush-android-sdk | sdk/src/main/java/com/wonderpush/sdk/WonderPushView.java | WonderPushView.setResource | public void setResource(String resource, RequestParams params) {
"""
Sets the resource for the web content displayed in this WonderPushView's WebView.
"""
if (null == resource) {
WonderPush.logError("null resource provided to WonderPushView");
return;
}
mInitialR... | java | public void setResource(String resource, RequestParams params) {
if (null == resource) {
WonderPush.logError("null resource provided to WonderPushView");
return;
}
mInitialResource = resource;
mInitialRequestParams = params;
mIsPreloading = false;
... | [
"public",
"void",
"setResource",
"(",
"String",
"resource",
",",
"RequestParams",
"params",
")",
"{",
"if",
"(",
"null",
"==",
"resource",
")",
"{",
"WonderPush",
".",
"logError",
"(",
"\"null resource provided to WonderPushView\"",
")",
";",
"return",
";",
"}",... | Sets the resource for the web content displayed in this WonderPushView's WebView. | [
"Sets",
"the",
"resource",
"for",
"the",
"web",
"content",
"displayed",
"in",
"this",
"WonderPushView",
"s",
"WebView",
"."
] | train | https://github.com/wonderpush/wonderpush-android-sdk/blob/ba0a1568f705cdd6206639bfab1e5cf529084b59/sdk/src/main/java/com/wonderpush/sdk/WonderPushView.java#L261-L278 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/MapperFactory.java | MapperFactory.setDefaultMapper | public void setDefaultMapper(Type type, Mapper mapper) {
"""
Sets or registers the given mapper for the given type. This method must be called before
performing any persistence operations, preferably, during application startup. Entities that
were introspected before calling this method will NOT use the new mapp... | java | public void setDefaultMapper(Type type, Mapper mapper) {
if (mapper == null) {
throw new IllegalArgumentException("mapper cannot be null");
}
lock.lock();
try {
cache.put(type, mapper);
} finally {
lock.unlock();
}
} | [
"public",
"void",
"setDefaultMapper",
"(",
"Type",
"type",
",",
"Mapper",
"mapper",
")",
"{",
"if",
"(",
"mapper",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"mapper cannot be null\"",
")",
";",
"}",
"lock",
".",
"lock",
"(",
... | Sets or registers the given mapper for the given type. This method must be called before
performing any persistence operations, preferably, during application startup. Entities that
were introspected before calling this method will NOT use the new mapper.
@param type
the type
@param mapper
the mapper to use for the gi... | [
"Sets",
"or",
"registers",
"the",
"given",
"mapper",
"for",
"the",
"given",
"type",
".",
"This",
"method",
"must",
"be",
"called",
"before",
"performing",
"any",
"persistence",
"operations",
"preferably",
"during",
"application",
"startup",
".",
"Entities",
"tha... | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/MapperFactory.java#L160-L170 |
thrau/jarchivelib | src/main/java/org/rauschig/jarchivelib/CommonsArchiver.java | CommonsArchiver.writeToArchive | protected void writeToArchive(File parent, File[] sources, ArchiveOutputStream archive) throws IOException {
"""
Recursively writes all given source {@link File}s into the given {@link ArchiveOutputStream}. The paths of the
sources in the archive will be relative to the given parent {@code File}.
@param parent... | java | protected void writeToArchive(File parent, File[] sources, ArchiveOutputStream archive) throws IOException {
for (File source : sources) {
String relativePath = IOUtils.relativePath(parent, source);
createArchiveEntry(source, relativePath, archive);
if (source.isDirectory()... | [
"protected",
"void",
"writeToArchive",
"(",
"File",
"parent",
",",
"File",
"[",
"]",
"sources",
",",
"ArchiveOutputStream",
"archive",
")",
"throws",
"IOException",
"{",
"for",
"(",
"File",
"source",
":",
"sources",
")",
"{",
"String",
"relativePath",
"=",
"... | Recursively writes all given source {@link File}s into the given {@link ArchiveOutputStream}. The paths of the
sources in the archive will be relative to the given parent {@code File}.
@param parent the parent file node for computing a relative path (see {@link IOUtils#relativePath(File, File)})
@param sources the fil... | [
"Recursively",
"writes",
"all",
"given",
"source",
"{",
"@link",
"File",
"}",
"s",
"into",
"the",
"given",
"{",
"@link",
"ArchiveOutputStream",
"}",
".",
"The",
"paths",
"of",
"the",
"sources",
"in",
"the",
"archive",
"will",
"be",
"relative",
"to",
"the",... | train | https://github.com/thrau/jarchivelib/blob/8afee5124c588f589306796985b722d63572bbfa/src/main/java/org/rauschig/jarchivelib/CommonsArchiver.java#L236-L246 |
networknt/light-4j | client/src/main/java/com/networknt/client/ssl/APINameChecker.java | APINameChecker.verify | public static boolean verify(final String name, final X509Certificate cert) {
"""
Call DefaultHostnameVerifier to check hostnames as per HTTPS (RFC 2818)
@param name - a name
@param cert - the server certificate
@return - whether the given name matches names in the cert
"""
try {
verifier... | java | public static boolean verify(final String name, final X509Certificate cert) {
try {
verifier.verify(name, cert);
return true;
} catch (final SSLException ex) {
// this is only logged here because eventually a CertificateException will be throw in verifyAndThrow.
//... | [
"public",
"static",
"boolean",
"verify",
"(",
"final",
"String",
"name",
",",
"final",
"X509Certificate",
"cert",
")",
"{",
"try",
"{",
"verifier",
".",
"verify",
"(",
"name",
",",
"cert",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"final",
"S... | Call DefaultHostnameVerifier to check hostnames as per HTTPS (RFC 2818)
@param name - a name
@param cert - the server certificate
@return - whether the given name matches names in the cert | [
"Call",
"DefaultHostnameVerifier",
"to",
"check",
"hostnames",
"as",
"per",
"HTTPS",
"(",
"RFC",
"2818",
")"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/ssl/APINameChecker.java#L82-L93 |
mp911de/spinach | src/main/java/biz/paluch/spinach/impl/ClusterAwareNodeSupport.java | ClusterAwareNodeSupport.reloadNodes | protected void reloadNodes() {
"""
Load/reload cluster nodes and order the nodes by its priority.
"""
Hello hello = HelloParser.parse(disqueConnection.sync().hello());
Collections.sort(hello.nodes, new Comparator<PrioritizedDisqueNode>() {
@Override
public int compare(P... | java | protected void reloadNodes() {
Hello hello = HelloParser.parse(disqueConnection.sync().hello());
Collections.sort(hello.nodes, new Comparator<PrioritizedDisqueNode>() {
@Override
public int compare(PrioritizedDisqueNode o1, PrioritizedDisqueNode o2) {
if (o1.pri... | [
"protected",
"void",
"reloadNodes",
"(",
")",
"{",
"Hello",
"hello",
"=",
"HelloParser",
".",
"parse",
"(",
"disqueConnection",
".",
"sync",
"(",
")",
".",
"hello",
"(",
")",
")",
";",
"Collections",
".",
"sort",
"(",
"hello",
".",
"nodes",
",",
"new",... | Load/reload cluster nodes and order the nodes by its priority. | [
"Load",
"/",
"reload",
"cluster",
"nodes",
"and",
"order",
"the",
"nodes",
"by",
"its",
"priority",
"."
] | train | https://github.com/mp911de/spinach/blob/ca8081f52de17c46dce6ffdcb519eec600c5c93d/src/main/java/biz/paluch/spinach/impl/ClusterAwareNodeSupport.java#L42-L64 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/Astar.java | Astar.createPathFinder | public static PathFinder createPathFinder(MapTile map, int maxSearchDistance, Heuristic heuristic) {
"""
Create a path finder.
@param map The map to be searched. Must have the
{@link com.b3dgs.lionengine.game.feature.tile.map.pathfinding.MapTilePath} feature.
@param maxSearchDistance The maximum depth we'll s... | java | public static PathFinder createPathFinder(MapTile map, int maxSearchDistance, Heuristic heuristic)
{
return new PathFinderImpl(map, maxSearchDistance, heuristic);
} | [
"public",
"static",
"PathFinder",
"createPathFinder",
"(",
"MapTile",
"map",
",",
"int",
"maxSearchDistance",
",",
"Heuristic",
"heuristic",
")",
"{",
"return",
"new",
"PathFinderImpl",
"(",
"map",
",",
"maxSearchDistance",
",",
"heuristic",
")",
";",
"}"
] | Create a path finder.
@param map The map to be searched. Must have the
{@link com.b3dgs.lionengine.game.feature.tile.map.pathfinding.MapTilePath} feature.
@param maxSearchDistance The maximum depth we'll search before giving up.
@param heuristic The heuristic used to determine the search order of the map.
@return The ... | [
"Create",
"a",
"path",
"finder",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/Astar.java#L37-L40 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/util/comparator/CompoundComparator.java | CompoundComparator.setComparator | public void setComparator(int index, Comparator<T> comparator) {
"""
Replace the Comparator at the given index.
<p>The Comparator will default to ascending sort order,
unless it is a InvertibleComparator.
@param index the index of the Comparator to replace
@param comparator the Comparator to place at the given... | java | public void setComparator(int index, Comparator<T> comparator) {
if (comparator instanceof InvertibleComparator) {
this.comparators.set(index, (InvertibleComparator<T>) comparator);
}
else {
this.comparators.set(index, new InvertibleComparator<T>(comparator));
}
} | [
"public",
"void",
"setComparator",
"(",
"int",
"index",
",",
"Comparator",
"<",
"T",
">",
"comparator",
")",
"{",
"if",
"(",
"comparator",
"instanceof",
"InvertibleComparator",
")",
"{",
"this",
".",
"comparators",
".",
"set",
"(",
"index",
",",
"(",
"Inve... | Replace the Comparator at the given index.
<p>The Comparator will default to ascending sort order,
unless it is a InvertibleComparator.
@param index the index of the Comparator to replace
@param comparator the Comparator to place at the given index
@see InvertibleComparator | [
"Replace",
"the",
"Comparator",
"at",
"the",
"given",
"index",
".",
"<p",
">",
"The",
"Comparator",
"will",
"default",
"to",
"ascending",
"sort",
"order",
"unless",
"it",
"is",
"a",
"InvertibleComparator",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/util/comparator/CompoundComparator.java#L105-L112 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/SpiderSession.java | SpiderSession.addBatch | @Override
public BatchResult addBatch(String tableName, DBObjectBatch dbObjBatch) {
"""
Add the given batch of objects to the given table, which must belong to this
session's application. Objects are added if they do not currently exist or do not
have an object ID assigned. Otherwise, existing objects are u... | java | @Override
public BatchResult addBatch(String tableName, DBObjectBatch dbObjBatch) {
Utils.require(!Utils.isEmpty(tableName), "tableName");
Utils.require(dbObjBatch != null && dbObjBatch.getObjectCount() > 0,
"Object batch must have at least 1 object");
tr... | [
"@",
"Override",
"public",
"BatchResult",
"addBatch",
"(",
"String",
"tableName",
",",
"DBObjectBatch",
"dbObjBatch",
")",
"{",
"Utils",
".",
"require",
"(",
"!",
"Utils",
".",
"isEmpty",
"(",
"tableName",
")",
",",
"\"tableName\"",
")",
";",
"Utils",
".",
... | Add the given batch of objects to the given table, which must belong to this
session's application. Objects are added if they do not currently exist or do not
have an object ID assigned. Otherwise, existing objects are updated. The result of
the update is returned as a {@link BatchResult}.
@param tableName Name of... | [
"Add",
"the",
"given",
"batch",
"of",
"objects",
"to",
"the",
"given",
"table",
"which",
"must",
"belong",
"to",
"this",
"session",
"s",
"application",
".",
"Objects",
"are",
"added",
"if",
"they",
"do",
"not",
"currently",
"exist",
"or",
"do",
"not",
"h... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/SpiderSession.java#L67-L88 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseInt | public static int parseInt (@Nullable final Object aObject, @Nonnegative final int nRadix, final int nDefault) {
"""
Parse the given {@link Object} as int with the specified radix.
@param aObject
The object to parse. May be <code>null</code>.
@param nRadix
The radix to use. Must be ≥ {@link Character#MIN_... | java | public static int parseInt (@Nullable final Object aObject, @Nonnegative final int nRadix, final int nDefault)
{
if (aObject == null)
return nDefault;
if (aObject instanceof Number)
return ((Number) aObject).intValue ();
return parseInt (aObject.toString (), nRadix, nDefault);
} | [
"public",
"static",
"int",
"parseInt",
"(",
"@",
"Nullable",
"final",
"Object",
"aObject",
",",
"@",
"Nonnegative",
"final",
"int",
"nRadix",
",",
"final",
"int",
"nDefault",
")",
"{",
"if",
"(",
"aObject",
"==",
"null",
")",
"return",
"nDefault",
";",
"... | Parse the given {@link Object} as int with the specified radix.
@param aObject
The object to parse. May be <code>null</code>.
@param nRadix
The radix to use. Must be ≥ {@link Character#MIN_RADIX} and ≤
{@link Character#MAX_RADIX}.
@param nDefault
The default value to be returned if the passed object could not be... | [
"Parse",
"the",
"given",
"{",
"@link",
"Object",
"}",
"as",
"int",
"with",
"the",
"specified",
"radix",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L727-L734 |
apereo/cas | support/cas-server-support-aws/src/main/java/org/apereo/cas/aws/ChainingAWSCredentialsProvider.java | ChainingAWSCredentialsProvider.getInstance | public static AWSCredentialsProvider getInstance(final String credentialAccessKey, final String credentialSecretKey,
final Resource credentialPropertiesFile,
final String profilePath, final String profileName) {
... | java | public static AWSCredentialsProvider getInstance(final String credentialAccessKey, final String credentialSecretKey,
final Resource credentialPropertiesFile,
final String profilePath, final String profileName) {
... | [
"public",
"static",
"AWSCredentialsProvider",
"getInstance",
"(",
"final",
"String",
"credentialAccessKey",
",",
"final",
"String",
"credentialSecretKey",
",",
"final",
"Resource",
"credentialPropertiesFile",
",",
"final",
"String",
"profilePath",
",",
"final",
"String",
... | Gets instance.
@param credentialAccessKey the credential access key
@param credentialSecretKey the credential secret key
@param credentialPropertiesFile the credential properties file
@param profilePath the profile path
@param profileName the profile name
@return the instance | [
"Gets",
"instance",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-aws/src/main/java/org/apereo/cas/aws/ChainingAWSCredentialsProvider.java#L80-L128 |
Wikidata/Wikidata-Toolkit | wdtk-client/src/main/java/org/wikidata/wdtk/client/SchemaUsageAnalyzer.java | SchemaUsageAnalyzer.getNumId | private Integer getNumId(String idString, boolean isUri) {
"""
Extracts a numeric id from a string, which can be either a Wikidata
entity URI or a short entity or property id.
@param idString
@param isUri
@return numeric id, or 0 if there was an error
"""
String numString;
if (isUri) {
if (!idStri... | java | private Integer getNumId(String idString, boolean isUri) {
String numString;
if (isUri) {
if (!idString.startsWith("http://www.wikidata.org/entity/")) {
return 0;
}
numString = idString.substring("http://www.wikidata.org/entity/Q"
.length());
} else {
numString = idString.substring(1);
}
... | [
"private",
"Integer",
"getNumId",
"(",
"String",
"idString",
",",
"boolean",
"isUri",
")",
"{",
"String",
"numString",
";",
"if",
"(",
"isUri",
")",
"{",
"if",
"(",
"!",
"idString",
".",
"startsWith",
"(",
"\"http://www.wikidata.org/entity/\"",
")",
")",
"{"... | Extracts a numeric id from a string, which can be either a Wikidata
entity URI or a short entity or property id.
@param idString
@param isUri
@return numeric id, or 0 if there was an error | [
"Extracts",
"a",
"numeric",
"id",
"from",
"a",
"string",
"which",
"can",
"be",
"either",
"a",
"Wikidata",
"entity",
"URI",
"or",
"a",
"short",
"entity",
"or",
"property",
"id",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-client/src/main/java/org/wikidata/wdtk/client/SchemaUsageAnalyzer.java#L705-L717 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/context/FlushManager.java | FlushManager.buildFlushStack | public void buildFlushStack(Node headNode, EventType eventType) {
"""
Builds the flush stack.
@param headNode
the head node
@param eventType
the event type
"""
if (headNode != null)
{
headNode.setTraversed(false);
addNodesToFlushStack(headNode, eventType);
... | java | public void buildFlushStack(Node headNode, EventType eventType)
{
if (headNode != null)
{
headNode.setTraversed(false);
addNodesToFlushStack(headNode, eventType);
}
} | [
"public",
"void",
"buildFlushStack",
"(",
"Node",
"headNode",
",",
"EventType",
"eventType",
")",
"{",
"if",
"(",
"headNode",
"!=",
"null",
")",
"{",
"headNode",
".",
"setTraversed",
"(",
"false",
")",
";",
"addNodesToFlushStack",
"(",
"headNode",
",",
"even... | Builds the flush stack.
@param headNode
the head node
@param eventType
the event type | [
"Builds",
"the",
"flush",
"stack",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/context/FlushManager.java#L125-L132 |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.addBooleanFilter | @SuppressWarnings( {
"""
Adds a boolean refinement for the next queries.
@param attribute the attribute to refine on.
@param value the value to refine with.
@return this {@link Searcher} for chaining.
""""WeakerAccess", "unused"}) // For library users
public Searcher addBooleanFilter(String attrib... | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher addBooleanFilter(String attribute, Boolean value) {
booleanFilterMap.put(attribute, value);
rebuildQueryFacetFilters();
return this;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"Searcher",
"addBooleanFilter",
"(",
"String",
"attribute",
",",
"Boolean",
"value",
")",
"{",
"booleanFilterMap",
".",
"put",
"(",
"attribute",
"... | Adds a boolean refinement for the next queries.
@param attribute the attribute to refine on.
@param value the value to refine with.
@return this {@link Searcher} for chaining. | [
"Adds",
"a",
"boolean",
"refinement",
"for",
"the",
"next",
"queries",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L768-L773 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/api/Configuration.java | Configuration.putWithSystemPropertyDefault | private void putWithSystemPropertyDefault(String key, String defaultValue) {
"""
Internal setter that first checks for <code>System.property</code> default values.
@param key key to set value for
@param defaultValue default value if not found
"""
properties.put(key, System.getProperty("paldb." + key, d... | java | private void putWithSystemPropertyDefault(String key, String defaultValue) {
properties.put(key, System.getProperty("paldb." + key, defaultValue));
} | [
"private",
"void",
"putWithSystemPropertyDefault",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"properties",
".",
"put",
"(",
"key",
",",
"System",
".",
"getProperty",
"(",
"\"paldb.\"",
"+",
"key",
",",
"defaultValue",
")",
")",
";",
"}"
... | Internal setter that first checks for <code>System.property</code> default values.
@param key key to set value for
@param defaultValue default value if not found | [
"Internal",
"setter",
"that",
"first",
"checks",
"for",
"<code",
">",
"System",
".",
"property<",
"/",
"code",
">",
"default",
"values",
"."
] | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/api/Configuration.java#L109-L111 |
aboutsip/pkts | pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipParser.java | SipParser.consumeGenericParam | public static Buffer[] consumeGenericParam(final Buffer buffer) throws IndexOutOfBoundsException, IOException {
"""
Consumes a generic param, which according to RFC 3261 section 25.1 is:
<pre>
generic-param = token [ EQUAL gen-value ]
gen-value = token / host / quoted-string
</pre>
The return valu... | java | public static Buffer[] consumeGenericParam(final Buffer buffer) throws IndexOutOfBoundsException, IOException {
final Buffer key = consumeToken(buffer);
Buffer value = null;
if (key == null) {
return new Buffer[2];
}
if (consumeEQUAL(buffer) > 0) {
// TODO... | [
"public",
"static",
"Buffer",
"[",
"]",
"consumeGenericParam",
"(",
"final",
"Buffer",
"buffer",
")",
"throws",
"IndexOutOfBoundsException",
",",
"IOException",
"{",
"final",
"Buffer",
"key",
"=",
"consumeToken",
"(",
"buffer",
")",
";",
"Buffer",
"value",
"=",
... | Consumes a generic param, which according to RFC 3261 section 25.1 is:
<pre>
generic-param = token [ EQUAL gen-value ]
gen-value = token / host / quoted-string
</pre>
The return value is two buffers returned as an array and if the second
element is null (so make sure you check it!) then there was no value for... | [
"Consumes",
"a",
"generic",
"param",
"which",
"according",
"to",
"RFC",
"3261",
"section",
"25",
".",
"1",
"is",
":"
] | train | https://github.com/aboutsip/pkts/blob/0f06bb0dac76c812187829f580a8d476ca99a1a1/pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipParser.java#L485-L501 |
unic/neba | core/src/main/java/io/neba/core/resourcemodels/registration/ModelRegistry.java | ModelRegistry.resolveMostSpecificModelSources | private Collection<LookupResult> resolveMostSpecificModelSources(Resource resource, String modelName) {
"""
Finds all {@link OsgiModelSource model sources} representing models for the given
{@link Resource} who's {@link OsgiModelSource#getModelName() model name}
matches the given model name.
@param resource ... | java | private Collection<LookupResult> resolveMostSpecificModelSources(Resource resource, String modelName) {
Collection<LookupResult> sources = new ArrayList<>();
for (final String resourceType : mappableTypeHierarchyOf(resource)) {
Collection<OsgiModelSource<?>> allSourcesForType = this.typeName... | [
"private",
"Collection",
"<",
"LookupResult",
">",
"resolveMostSpecificModelSources",
"(",
"Resource",
"resource",
",",
"String",
"modelName",
")",
"{",
"Collection",
"<",
"LookupResult",
">",
"sources",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
... | Finds all {@link OsgiModelSource model sources} representing models for the given
{@link Resource} who's {@link OsgiModelSource#getModelName() model name}
matches the given model name.
@param resource must not be <code>null</code>.
@param modelName can be <code>null</code>.
@return never <code>null</code> but rather ... | [
"Finds",
"all",
"{",
"@link",
"OsgiModelSource",
"model",
"sources",
"}",
"representing",
"models",
"for",
"the",
"given",
"{",
"@link",
"Resource",
"}",
"who",
"s",
"{",
"@link",
"OsgiModelSource#getModelName",
"()",
"model",
"name",
"}",
"matches",
"the",
"g... | train | https://github.com/unic/neba/blob/4d762e60112a1fcb850926a56a9843d5aa424c4b/core/src/main/java/io/neba/core/resourcemodels/registration/ModelRegistry.java#L428-L439 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.triangulateNView | public static TriangulateNViewsProjective triangulateNView( @Nullable ConfigTriangulation config ) {
"""
Triangulate N views using the Discrete Linear Transform (DLT) with an uncalibrated camera
@see TriangulateProjectiveLinearDLT
@return Two view triangulation algorithm
"""
if( config == null )
con... | java | public static TriangulateNViewsProjective triangulateNView( @Nullable ConfigTriangulation config ) {
if( config == null )
config = new ConfigTriangulation();
switch( config.type) {
case DLT:
return new WrapNViewsTriangulateProjectiveDLT();
case ALGEBRAIC:
case GEOMETRIC: {
TriangulateNViewsPro... | [
"public",
"static",
"TriangulateNViewsProjective",
"triangulateNView",
"(",
"@",
"Nullable",
"ConfigTriangulation",
"config",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"config",
"=",
"new",
"ConfigTriangulation",
"(",
")",
";",
"switch",
"(",
"config",
"... | Triangulate N views using the Discrete Linear Transform (DLT) with an uncalibrated camera
@see TriangulateProjectiveLinearDLT
@return Two view triangulation algorithm | [
"Triangulate",
"N",
"views",
"using",
"the",
"Discrete",
"Linear",
"Transform",
"(",
"DLT",
")",
"with",
"an",
"uncalibrated",
"camera"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L610-L626 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.alterColumnType | private void alterColumnType(TableInfo tableInfo, CQLTranslator translator, ColumnInfo column) throws Exception {
"""
showSchema Alters column type of an existing column.
@param tableInfo
the table info
@param translator
the translator
@param column
the column
@throws Exception
the exception
"""
... | java | private void alterColumnType(TableInfo tableInfo, CQLTranslator translator, ColumnInfo column) throws Exception
{
StringBuilder alterColumnTypeQuery = new StringBuilder("ALTER TABLE ");
translator.ensureCase(alterColumnTypeQuery, tableInfo.getTableName(), false);
alterColumnTypeQuery.append(... | [
"private",
"void",
"alterColumnType",
"(",
"TableInfo",
"tableInfo",
",",
"CQLTranslator",
"translator",
",",
"ColumnInfo",
"column",
")",
"throws",
"Exception",
"{",
"StringBuilder",
"alterColumnTypeQuery",
"=",
"new",
"StringBuilder",
"(",
"\"ALTER TABLE \"",
")",
"... | showSchema Alters column type of an existing column.
@param tableInfo
the table info
@param translator
the translator
@param column
the column
@throws Exception
the exception | [
"showSchema",
"Alters",
"column",
"type",
"of",
"an",
"existing",
"column",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L1523-L1536 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/Logger.java | Logger.logMessage | public synchronized void logMessage(final Level level, final String message) {
"""
This method will be called with a message and the related log level. It
be verified if the message should be logged or not.
The format of the logged message is: \t consumerName [ Type of Logger ]
\t message \r\n
@param level... | java | public synchronized void logMessage(final Level level, final String message)
{
if (logLevel.toInt() > level.toInt()) {
return;
}
try {
this.writer.write(System.currentTimeMillis() + "\t" + consumerName
+ " [" + type.toString() + "] " + "\t" + message + "\r\n");
this.writer.flush();
}
catch (I... | [
"public",
"synchronized",
"void",
"logMessage",
"(",
"final",
"Level",
"level",
",",
"final",
"String",
"message",
")",
"{",
"if",
"(",
"logLevel",
".",
"toInt",
"(",
")",
">",
"level",
".",
"toInt",
"(",
")",
")",
"{",
"return",
";",
"}",
"try",
"{"... | This method will be called with a message and the related log level. It
be verified if the message should be logged or not.
The format of the logged message is: \t consumerName [ Type of Logger ]
\t message \r\n
@param level
level
@param message
message | [
"This",
"method",
"will",
"be",
"called",
"with",
"a",
"message",
"and",
"the",
"related",
"log",
"level",
".",
"It",
"be",
"verified",
"if",
"the",
"message",
"should",
"be",
"logged",
"or",
"not",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/Logger.java#L229-L244 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_tcp_route_routeId_rule_ruleId_PUT | public void serviceName_tcp_route_routeId_rule_ruleId_PUT(String serviceName, Long routeId, Long ruleId, OvhRouteRule body) throws IOException {
"""
Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/tcp/route/{routeId}/rule/{ruleId}
@param body [required] New object properties
@param servi... | java | public void serviceName_tcp_route_routeId_rule_ruleId_PUT(String serviceName, Long routeId, Long ruleId, OvhRouteRule body) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/tcp/route/{routeId}/rule/{ruleId}";
StringBuilder sb = path(qPath, serviceName, routeId, ruleId);
exec(qPath, "PUT", sb.to... | [
"public",
"void",
"serviceName_tcp_route_routeId_rule_ruleId_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"routeId",
",",
"Long",
"ruleId",
",",
"OvhRouteRule",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/tcp/ro... | Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/tcp/route/{routeId}/rule/{ruleId}
@param body [required] New object properties
@param serviceName [required] The internal name of your IP load balancing
@param routeId [required] Id of your route
@param ruleId [required] Id of your rule | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1405-L1409 |
looly/hutool | hutool-cron/src/main/java/cn/hutool/cron/pattern/matcher/DayOfMonthValueMatcher.java | DayOfMonthValueMatcher.isLastDayOfMonth | private static boolean isLastDayOfMonth(int value, int month, boolean isLeapYear) {
"""
是否为本月最后一天,规则如下:
<pre>
1、闰年2月匹配是否为29
2、其它月份是否匹配最后一天的日期(可能为30或者31)
</pre>
@param value 被检查的值
@param month 月份
@param isLeapYear 是否闰年
@return 是否为本月最后一天
"""
if (isLeapYear && month == 2) {
return value == 29;
... | java | private static boolean isLastDayOfMonth(int value, int month, boolean isLeapYear) {
if (isLeapYear && month == 2) {
return value == 29;
} else {
return value == LAST_DAYS[month - 1];
}
} | [
"private",
"static",
"boolean",
"isLastDayOfMonth",
"(",
"int",
"value",
",",
"int",
"month",
",",
"boolean",
"isLeapYear",
")",
"{",
"if",
"(",
"isLeapYear",
"&&",
"month",
"==",
"2",
")",
"{",
"return",
"value",
"==",
"29",
";",
"}",
"else",
"{",
"re... | 是否为本月最后一天,规则如下:
<pre>
1、闰年2月匹配是否为29
2、其它月份是否匹配最后一天的日期(可能为30或者31)
</pre>
@param value 被检查的值
@param month 月份
@param isLeapYear 是否闰年
@return 是否为本月最后一天 | [
"是否为本月最后一天,规则如下:",
"<pre",
">",
"1、闰年2月匹配是否为29",
"2、其它月份是否匹配最后一天的日期(可能为30或者31)",
"<",
"/",
"pre",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/pattern/matcher/DayOfMonthValueMatcher.java#L51-L57 |
OpenLiberty/open-liberty | dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/java2sec/PermissionManager.java | PermissionManager.getCombinedPermissions | @Override
public PermissionCollection getCombinedPermissions(PermissionCollection staticPolicyPermissionCollection, CodeSource codesource) {
"""
Combine the static permissions with the server.xml and permissions.xml permissions, removing any restricted permission.
This is called back from the dynamic policy t... | java | @Override
public PermissionCollection getCombinedPermissions(PermissionCollection staticPolicyPermissionCollection, CodeSource codesource) {
Permissions effectivePermissions = new Permissions();
List<Permission> staticPolicyPermissions = Collections.list(staticPolicyPermissionCollection.elements());... | [
"@",
"Override",
"public",
"PermissionCollection",
"getCombinedPermissions",
"(",
"PermissionCollection",
"staticPolicyPermissionCollection",
",",
"CodeSource",
"codesource",
")",
"{",
"Permissions",
"effectivePermissions",
"=",
"new",
"Permissions",
"(",
")",
";",
"List",
... | Combine the static permissions with the server.xml and permissions.xml permissions, removing any restricted permission.
This is called back from the dynamic policy to obtain the permissions for the JSP classes. | [
"Combine",
"the",
"static",
"permissions",
"with",
"the",
"server",
".",
"xml",
"and",
"permissions",
".",
"xml",
"permissions",
"removing",
"any",
"restricted",
"permission",
".",
"This",
"is",
"called",
"back",
"from",
"the",
"dynamic",
"policy",
"to",
"obta... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/java2sec/PermissionManager.java#L573-L585 |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientMockBuilder.java | HttpClientMockBuilder.doReturn | public HttpClientResponseBuilder doReturn(String response, Charset charset) {
"""
Adds action which returns provided response in provided charset and status 200.
@param response response to return
@param charset charset to return
@return response builder
"""
return responseBuilder.doReturn(respon... | java | public HttpClientResponseBuilder doReturn(String response, Charset charset) {
return responseBuilder.doReturn(response, charset);
} | [
"public",
"HttpClientResponseBuilder",
"doReturn",
"(",
"String",
"response",
",",
"Charset",
"charset",
")",
"{",
"return",
"responseBuilder",
".",
"doReturn",
"(",
"response",
",",
"charset",
")",
";",
"}"
] | Adds action which returns provided response in provided charset and status 200.
@param response response to return
@param charset charset to return
@return response builder | [
"Adds",
"action",
"which",
"returns",
"provided",
"response",
"in",
"provided",
"charset",
"and",
"status",
"200",
"."
] | train | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientMockBuilder.java#L183-L185 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailmxplan/src/main/java/net/minidev/ovh/api/ApiOvhEmailmxplan.java | ApiOvhEmailmxplan.service_domain_domainName_disclaimerAttribute_GET | public ArrayList<OvhDisclaimerAttributeEnum> service_domain_domainName_disclaimerAttribute_GET(String service, String domainName) throws IOException {
"""
Get diclaimer attributes to substitute with Active Directory properties
REST: GET /email/mxplan/{service}/domain/{domainName}/disclaimerAttribute
@param ser... | java | public ArrayList<OvhDisclaimerAttributeEnum> service_domain_domainName_disclaimerAttribute_GET(String service, String domainName) throws IOException {
String qPath = "/email/mxplan/{service}/domain/{domainName}/disclaimerAttribute";
StringBuilder sb = path(qPath, service, domainName);
String resp = exec(qPath, "G... | [
"public",
"ArrayList",
"<",
"OvhDisclaimerAttributeEnum",
">",
"service_domain_domainName_disclaimerAttribute_GET",
"(",
"String",
"service",
",",
"String",
"domainName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/mxplan/{service}/domain/{domainName}/d... | Get diclaimer attributes to substitute with Active Directory properties
REST: GET /email/mxplan/{service}/domain/{domainName}/disclaimerAttribute
@param service [required] The internal name of your mxplan organization
@param domainName [required] Domain name
API beta | [
"Get",
"diclaimer",
"attributes",
"to",
"substitute",
"with",
"Active",
"Directory",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailmxplan/src/main/java/net/minidev/ovh/api/ApiOvhEmailmxplan.java#L651-L656 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/VarOptItemsSketch.java | VarOptItemsSketch.updateLight | private void updateLight(final T item, final double weight, final boolean mark) {
"""
/* In the "light" case the new item has weight <= old_tau, so
would appear to the right of the R items in a hypothetical reverse-sorted
list. It is easy to prove that it is light enough to be part of this
round's downsampling
... | java | private void updateLight(final T item, final double weight, final boolean mark) {
assert r_ >= 1;
assert (r_ + h_) == k_;
final int mSlot = h_; // index of the gap, which becomes the M region
data_.set(mSlot, item);
weights_.set(mSlot, weight);
if (marks_ != null) { marks_.set(mSlot, mark); }
... | [
"private",
"void",
"updateLight",
"(",
"final",
"T",
"item",
",",
"final",
"double",
"weight",
",",
"final",
"boolean",
"mark",
")",
"{",
"assert",
"r_",
">=",
"1",
";",
"assert",
"(",
"r_",
"+",
"h_",
")",
"==",
"k_",
";",
"final",
"int",
"mSlot",
... | /* In the "light" case the new item has weight <= old_tau, so
would appear to the right of the R items in a hypothetical reverse-sorted
list. It is easy to prove that it is light enough to be part of this
round's downsampling | [
"/",
"*",
"In",
"the",
"light",
"case",
"the",
"new",
"item",
"has",
"weight",
"<",
"=",
"old_tau",
"so",
"would",
"appear",
"to",
"the",
"right",
"of",
"the",
"R",
"items",
"in",
"a",
"hypothetical",
"reverse",
"-",
"sorted",
"list",
".",
"It",
"is"... | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/VarOptItemsSketch.java#L902-L913 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.