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 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HeapDumpForTaskUtils.java | HeapDumpForTaskUtils.generateDumpScript | public static void generateDumpScript(Path dumpScript, FileSystem fs, String heapFileName, String chmod)
throws IOException {
"""
Generate the dumpScript, which is used when OOM error is thrown during task execution.
The current content dumpScript puts the .prof files to the DUMP_FOLDER within the same dire... | java | public static void generateDumpScript(Path dumpScript, FileSystem fs, String heapFileName, String chmod)
throws IOException {
if (fs.exists(dumpScript)) {
LOG.info("Heap dump script already exists: " + dumpScript);
return;
}
try (BufferedWriter scriptWriter =
new BufferedWriter(ne... | [
"public",
"static",
"void",
"generateDumpScript",
"(",
"Path",
"dumpScript",
",",
"FileSystem",
"fs",
",",
"String",
"heapFileName",
",",
"String",
"chmod",
")",
"throws",
"IOException",
"{",
"if",
"(",
"fs",
".",
"exists",
"(",
"dumpScript",
")",
")",
"{",
... | Generate the dumpScript, which is used when OOM error is thrown during task execution.
The current content dumpScript puts the .prof files to the DUMP_FOLDER within the same directory of the dumpScript.
User needs to add the following options to the task java.opts:
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./h... | [
"Generate",
"the",
"dumpScript",
"which",
"is",
"used",
"when",
"OOM",
"error",
"is",
"thrown",
"during",
"task",
"execution",
".",
"The",
"current",
"content",
"dumpScript",
"puts",
"the",
".",
"prof",
"files",
"to",
"the",
"DUMP_FOLDER",
"within",
"the",
"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HeapDumpForTaskUtils.java#L55-L86 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/MethodUtils.java | MethodUtils.getAccessibleMethod | public static Method getAccessibleMethod(Class<?> clazz, String methodName) {
"""
<p>Return an accessible method (that is, one that can be invoked via
reflection) with given name and a single parameter. If no such method
can be found, return {@code null}.
Basically, a convenience wrapper that constructs a {@co... | java | public static Method getAccessibleMethod(Class<?> clazz, String methodName) {
return getAccessibleMethod(clazz, methodName, EMPTY_CLASS_PARAMETERS);
} | [
"public",
"static",
"Method",
"getAccessibleMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
")",
"{",
"return",
"getAccessibleMethod",
"(",
"clazz",
",",
"methodName",
",",
"EMPTY_CLASS_PARAMETERS",
")",
";",
"}"
] | <p>Return an accessible method (that is, one that can be invoked via
reflection) with given name and a single parameter. If no such method
can be found, return {@code null}.
Basically, a convenience wrapper that constructs a {@code Class}
array for you.</p>
@param clazz get method from this class
@param methodName ge... | [
"<p",
">",
"Return",
"an",
"accessible",
"method",
"(",
"that",
"is",
"one",
"that",
"can",
"be",
"invoked",
"via",
"reflection",
")",
"with",
"given",
"name",
"and",
"a",
"single",
"parameter",
".",
"If",
"no",
"such",
"method",
"can",
"be",
"found",
... | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/MethodUtils.java#L607-L609 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/JulianChronology.java | JulianChronology.dateYearDay | @Override
public JulianDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
"""
Obtains a local date in Julian calendar system from the
era, year-of-era and day-of-year fields.
@param era the Julian era, not null
@param yearOfEra the year-of-era
@param dayOfYear the day-of-year
@return the Julia... | java | @Override
public JulianDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear);
} | [
"@",
"Override",
"public",
"JulianDate",
"dateYearDay",
"(",
"Era",
"era",
",",
"int",
"yearOfEra",
",",
"int",
"dayOfYear",
")",
"{",
"return",
"dateYearDay",
"(",
"prolepticYear",
"(",
"era",
",",
"yearOfEra",
")",
",",
"dayOfYear",
")",
";",
"}"
] | Obtains a local date in Julian calendar system from the
era, year-of-era and day-of-year fields.
@param era the Julian era, not null
@param yearOfEra the year-of-era
@param dayOfYear the day-of-year
@return the Julian local date, not null
@throws DateTimeException if unable to create the date
@throws ClassCastExcep... | [
"Obtains",
"a",
"local",
"date",
"in",
"Julian",
"calendar",
"system",
"from",
"the",
"era",
"year",
"-",
"of",
"-",
"era",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
"."
] | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/JulianChronology.java#L201-L204 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_account_accountName_migrate_destinationServiceName_destinationEmailAddress_destinationEmailAddress_GET | public OvhMigrationAccount domain_account_accountName_migrate_destinationServiceName_destinationEmailAddress_destinationEmailAddress_GET(String domain, String accountName, String destinationServiceName, String destinationEmailAddress) throws IOException {
"""
Get this object properties
REST: GET /email/domain/{... | java | public OvhMigrationAccount domain_account_accountName_migrate_destinationServiceName_destinationEmailAddress_destinationEmailAddress_GET(String domain, String accountName, String destinationServiceName, String destinationEmailAddress) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/m... | [
"public",
"OvhMigrationAccount",
"domain_account_accountName_migrate_destinationServiceName_destinationEmailAddress_destinationEmailAddress_GET",
"(",
"String",
"domain",
",",
"String",
"accountName",
",",
"String",
"destinationServiceName",
",",
"String",
"destinationEmailAddress",
")... | Get this object properties
REST: GET /email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}
@param domain [required] Name of your domain name
@param accountName [required] Name of account
@param destinationServiceName [required] Service name allo... | [
"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#L525-L530 |
samskivert/samskivert | src/main/java/com/samskivert/util/PropertiesUtil.java | PropertiesUtil.requireProperty | public static String requireProperty (Properties props, String key) {
"""
Returns the specified property from the supplied properties object.
@throws MissingPropertyException with the text "Missing required property
'<code>key</code>'." if the property does not exist or is the empty string.
"""
retur... | java | public static String requireProperty (Properties props, String key)
{
return requireProperty(props, key, "Missing required property '" + key + "'.");
} | [
"public",
"static",
"String",
"requireProperty",
"(",
"Properties",
"props",
",",
"String",
"key",
")",
"{",
"return",
"requireProperty",
"(",
"props",
",",
"key",
",",
"\"Missing required property '\"",
"+",
"key",
"+",
"\"'.\"",
")",
";",
"}"
] | Returns the specified property from the supplied properties object.
@throws MissingPropertyException with the text "Missing required property
'<code>key</code>'." if the property does not exist or is the empty string. | [
"Returns",
"the",
"specified",
"property",
"from",
"the",
"supplied",
"properties",
"object",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/PropertiesUtil.java#L212-L215 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexController.java | CmsFlexController.updateDates | public void updateDates(long dateLastModified, long dateExpires) {
"""
Updates the "last modified" date and the "expires" date
for all resources read during this request with the given values.<p>
The currently stored value for "last modified" is only updated with the new value if
the new value is either large... | java | public void updateDates(long dateLastModified, long dateExpires) {
int pos = m_flexContextInfoList.size() - 1;
if (pos < 0) {
// ensure a valid position is used
return;
}
(m_flexContextInfoList.get(pos)).updateDates(dateLastModified, dateExpires);
} | [
"public",
"void",
"updateDates",
"(",
"long",
"dateLastModified",
",",
"long",
"dateExpires",
")",
"{",
"int",
"pos",
"=",
"m_flexContextInfoList",
".",
"size",
"(",
")",
"-",
"1",
";",
"if",
"(",
"pos",
"<",
"0",
")",
"{",
"// ensure a valid position is use... | Updates the "last modified" date and the "expires" date
for all resources read during this request with the given values.<p>
The currently stored value for "last modified" is only updated with the new value if
the new value is either larger (i.e. newer) then the stored value,
or if the new value is less then zero, whi... | [
"Updates",
"the",
"last",
"modified",
"date",
"and",
"the",
"expires",
"date",
"for",
"all",
"resources",
"read",
"during",
"this",
"request",
"with",
"the",
"given",
"values",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexController.java#L705-L713 |
ludovicianul/selenium-on-steroids | src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java | WebDriverHelper.isElementPresent | public boolean isElementPresent(final WebElement element, final By by) {
"""
Checks if the supplied {@code element} contains another element
identified by {@code by}.
@param by
the method of identifying the element
@param element
the root element that will be searched
@return true if {@code element} contai... | java | public boolean isElementPresent(final WebElement element, final By by) {
try {
element.findElement(by);
} catch (Exception e) {
return false;
}
return true;
} | [
"public",
"boolean",
"isElementPresent",
"(",
"final",
"WebElement",
"element",
",",
"final",
"By",
"by",
")",
"{",
"try",
"{",
"element",
".",
"findElement",
"(",
"by",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"false",
";",
"... | Checks if the supplied {@code element} contains another element
identified by {@code by}.
@param by
the method of identifying the element
@param element
the root element that will be searched
@return true if {@code element} contains an element identified by
{@code by} or false otherwise | [
"Checks",
"if",
"the",
"supplied",
"{",
"@code",
"element",
"}",
"contains",
"another",
"element",
"identified",
"by",
"{",
"@code",
"by",
"}",
"."
] | train | https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java#L452-L459 |
elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/kernel/KernelMatrix.java | KernelMatrix.getDistance | public double getDistance(final DBIDRef o1, final DBIDRef o2) {
"""
Returns the kernel distance between the two specified objects.
@param o1 first ObjectID
@param o2 second ObjectID
@return the distance between the two objects
"""
return FastMath.sqrt(getSquaredDistance(o1, o2));
} | java | public double getDistance(final DBIDRef o1, final DBIDRef o2) {
return FastMath.sqrt(getSquaredDistance(o1, o2));
} | [
"public",
"double",
"getDistance",
"(",
"final",
"DBIDRef",
"o1",
",",
"final",
"DBIDRef",
"o2",
")",
"{",
"return",
"FastMath",
".",
"sqrt",
"(",
"getSquaredDistance",
"(",
"o1",
",",
"o2",
")",
")",
";",
"}"
] | Returns the kernel distance between the two specified objects.
@param o1 first ObjectID
@param o2 second ObjectID
@return the distance between the two objects | [
"Returns",
"the",
"kernel",
"distance",
"between",
"the",
"two",
"specified",
"objects",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/kernel/KernelMatrix.java#L209-L211 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/ExcludeOperator.java | ExcludeOperator.doExec | @Override
protected Object doExec(Element element, Object scope, String booleanExpression, Object... arguments) {
"""
Execute EXCLUDE operator. Returns branch enabled flag, that is, true to indicate branch is to be included in resulting
document. Since exclude operator has opposite logic we need to negate give... | java | @Override
protected Object doExec(Element element, Object scope, String booleanExpression, Object... arguments)
{
// returned value is interpreted as branch enabled
// boolean expression argument is true if branch should be excluded, so we need to inverse it
return !Boolean.valueOf(booleanExpressio... | [
"@",
"Override",
"protected",
"Object",
"doExec",
"(",
"Element",
"element",
",",
"Object",
"scope",
",",
"String",
"booleanExpression",
",",
"Object",
"...",
"arguments",
")",
"{",
"// returned value is interpreted as branch enabled\r",
"// boolean expression argument is t... | Execute EXCLUDE operator. Returns branch enabled flag, that is, true to indicate branch is to be included in resulting
document. Since exclude operator has opposite logic we need to negate given boolean expression; so, if operand is 'true'
meaning the branch should be excluded this method returns false.
@param element... | [
"Execute",
"EXCLUDE",
"operator",
".",
"Returns",
"branch",
"enabled",
"flag",
"that",
"is",
"true",
"to",
"indicate",
"branch",
"is",
"to",
"be",
"included",
"in",
"resulting",
"document",
".",
"Since",
"exclude",
"operator",
"has",
"opposite",
"logic",
"we",... | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/ExcludeOperator.java#L38-L44 |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/tree/btree/InternalPage.java | InternalPage.binarySearchGuess | protected static int binarySearchGuess(@NotNull final BasePage page, @NotNull final ByteIterable key) {
"""
/*
Returns safe binary search.
@return index (non-negative result is guaranteed)
"""
int index = binarySearchGuessUnsafe(page, key);
if (index < 0) index = 0;
return index;
... | java | protected static int binarySearchGuess(@NotNull final BasePage page, @NotNull final ByteIterable key) {
int index = binarySearchGuessUnsafe(page, key);
if (index < 0) index = 0;
return index;
} | [
"protected",
"static",
"int",
"binarySearchGuess",
"(",
"@",
"NotNull",
"final",
"BasePage",
"page",
",",
"@",
"NotNull",
"final",
"ByteIterable",
"key",
")",
"{",
"int",
"index",
"=",
"binarySearchGuessUnsafe",
"(",
"page",
",",
"key",
")",
";",
"if",
"(",
... | /*
Returns safe binary search.
@return index (non-negative result is guaranteed) | [
"/",
"*",
"Returns",
"safe",
"binary",
"search",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/tree/btree/InternalPage.java#L193-L197 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/Collectors.java | Collectors.groupingByConcurrent | public static <T, K, A, D>
Collector<T, ?, ConcurrentMap<K, D>> groupingByConcurrent(Function<? super T, ? extends K> classifier,
Collector<? super T, A, D> downstream) {
"""
Returns a concurrent {@code Collector} implementing a cascaded "group by"
... | java | public static <T, K, A, D>
Collector<T, ?, ConcurrentMap<K, D>> groupingByConcurrent(Function<? super T, ? extends K> classifier,
Collector<? super T, A, D> downstream) {
return groupingByConcurrent(classifier, ConcurrentHashMap::new, downstream)... | [
"public",
"static",
"<",
"T",
",",
"K",
",",
"A",
",",
"D",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"ConcurrentMap",
"<",
"K",
",",
"D",
">",
">",
"groupingByConcurrent",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"K",
">",
... | Returns a concurrent {@code Collector} implementing a cascaded "group by"
operation on input elements of type {@code T}, grouping elements
according to a classification function, and then performing a reduction
operation on the values associated with a given key using the specified
downstream {@code Collector}.
<p>Thi... | [
"Returns",
"a",
"concurrent",
"{",
"@code",
"Collector",
"}",
"implementing",
"a",
"cascaded",
"group",
"by",
"operation",
"on",
"input",
"elements",
"of",
"type",
"{",
"@code",
"T",
"}",
"grouping",
"elements",
"according",
"to",
"a",
"classification",
"funct... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/Collectors.java#L1005-L1009 |
alibaba/jstorm | jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java | UIUtils.getTaskEntity | public static TaskEntity getTaskEntity(List<TaskSummary> tasks, int taskId) {
"""
get the specific task entity
@param tasks list of task summaries
@param taskId task id
@return
"""
TaskEntity entity = null;
for (TaskSummary task : tasks) {
if (task.get_taskId() == taskId) {
... | java | public static TaskEntity getTaskEntity(List<TaskSummary> tasks, int taskId) {
TaskEntity entity = null;
for (TaskSummary task : tasks) {
if (task.get_taskId() == taskId) {
entity = new TaskEntity(task);
break;
}
}
return entity;
... | [
"public",
"static",
"TaskEntity",
"getTaskEntity",
"(",
"List",
"<",
"TaskSummary",
">",
"tasks",
",",
"int",
"taskId",
")",
"{",
"TaskEntity",
"entity",
"=",
"null",
";",
"for",
"(",
"TaskSummary",
"task",
":",
"tasks",
")",
"{",
"if",
"(",
"task",
".",... | get the specific task entity
@param tasks list of task summaries
@param taskId task id
@return | [
"get",
"the",
"specific",
"task",
"entity"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-ui/src/main/java/com/alibaba/jstorm/ui/utils/UIUtils.java#L288-L297 |
att/openstacksdk | openstack-java-sdk/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyConnector.java | JerseyConnector.getSSLContext | private SSLContext getSSLContext() throws NoSuchAlgorithmException, KeyManagementException {
"""
This SSLContext is used only when the protocol is HTTPS AND a trusted hosts list has been provided. In that case,
this SSLContext accepts all certificates, whether they are expired or not, and regardless of the CA tha... | java | private SSLContext getSSLContext() throws NoSuchAlgorithmException, KeyManagementException {
SSLContext sslContext = SSLContext.getInstance("SSL");
sslContext.init(null, new TrustManager[] {
new X509TrustManager() {
@Override
public void checkClientTrusted(X50... | [
"private",
"SSLContext",
"getSSLContext",
"(",
")",
"throws",
"NoSuchAlgorithmException",
",",
"KeyManagementException",
"{",
"SSLContext",
"sslContext",
"=",
"SSLContext",
".",
"getInstance",
"(",
"\"SSL\"",
")",
";",
"sslContext",
".",
"init",
"(",
"null",
",",
... | This SSLContext is used only when the protocol is HTTPS AND a trusted hosts list has been provided. In that case,
this SSLContext accepts all certificates, whether they are expired or not, and regardless of the CA that issued
them.
@return An SSL context that does not validate certificates
@throws NoSuchAlgorithmExcep... | [
"This",
"SSLContext",
"is",
"used",
"only",
"when",
"the",
"protocol",
"is",
"HTTPS",
"AND",
"a",
"trusted",
"hosts",
"list",
"has",
"been",
"provided",
".",
"In",
"that",
"case",
"this",
"SSLContext",
"accepts",
"all",
"certificates",
"whether",
"they",
"ar... | train | https://github.com/att/openstacksdk/blob/16a81c460a7186ebe1ea63b7682486ba147208b9/openstack-java-sdk/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyConnector.java#L335-L356 |
micrometer-metrics/micrometer | micrometer-core/src/main/java/io/micrometer/core/instrument/util/JsonUtils.java | JsonUtils.appendIndentedNewLine | private static void appendIndentedNewLine(int indentLevel, StringBuilder stringBuilder) {
"""
Print a new line with indention at the beginning of the new line.
@param indentLevel
@param stringBuilder
"""
stringBuilder.append("\n");
for (int i = 0; i < indentLevel; i++) {
// Assu... | java | private static void appendIndentedNewLine(int indentLevel, StringBuilder stringBuilder) {
stringBuilder.append("\n");
for (int i = 0; i < indentLevel; i++) {
// Assuming indention using 2 spaces
stringBuilder.append(" ");
}
} | [
"private",
"static",
"void",
"appendIndentedNewLine",
"(",
"int",
"indentLevel",
",",
"StringBuilder",
"stringBuilder",
")",
"{",
"stringBuilder",
".",
"append",
"(",
"\"\\n\"",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"indentLevel",
";",
... | Print a new line with indention at the beginning of the new line.
@param indentLevel
@param stringBuilder | [
"Print",
"a",
"new",
"line",
"with",
"indention",
"at",
"the",
"beginning",
"of",
"the",
"new",
"line",
"."
] | train | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/util/JsonUtils.java#L80-L86 |
jenkinsci/jenkins | core/src/main/java/hudson/console/ConsoleLogFilter.java | ConsoleLogFilter.decorateLogger | public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException {
"""
Called on the start of each build, giving extensions a chance to intercept
the data that is written to the log.
@deprecated as of 1.632. Use {@link #decorateLogger(Run, OutputStream)}
... | java | public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException {
if (Util.isOverridden(ConsoleLogFilter.class, getClass(), "decorateLogger", Run.class, OutputStream.class)) {
// old client calling newer implementation. forward the call.
... | [
"public",
"OutputStream",
"decorateLogger",
"(",
"AbstractBuild",
"build",
",",
"OutputStream",
"logger",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"if",
"(",
"Util",
".",
"isOverridden",
"(",
"ConsoleLogFilter",
".",
"class",
",",
"getClass",
... | Called on the start of each build, giving extensions a chance to intercept
the data that is written to the log.
@deprecated as of 1.632. Use {@link #decorateLogger(Run, OutputStream)} | [
"Called",
"on",
"the",
"start",
"of",
"each",
"build",
"giving",
"extensions",
"a",
"chance",
"to",
"intercept",
"the",
"data",
"that",
"is",
"written",
"to",
"the",
"log",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/console/ConsoleLogFilter.java#L63-L73 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/throttling/ThrottlingRpcService.java | ThrottlingRpcService.newDecorator | public static Function<Service<RpcRequest, RpcResponse>, ThrottlingRpcService>
newDecorator(ThrottlingStrategy<RpcRequest> strategy) {
"""
Creates a new decorator using the specified {@link ThrottlingStrategy} instance.
@param strategy The {@link ThrottlingStrategy} instance to be used
"""
requi... | java | public static Function<Service<RpcRequest, RpcResponse>, ThrottlingRpcService>
newDecorator(ThrottlingStrategy<RpcRequest> strategy) {
requireNonNull(strategy, "strategy");
return delegate -> new ThrottlingRpcService(delegate, strategy);
} | [
"public",
"static",
"Function",
"<",
"Service",
"<",
"RpcRequest",
",",
"RpcResponse",
">",
",",
"ThrottlingRpcService",
">",
"newDecorator",
"(",
"ThrottlingStrategy",
"<",
"RpcRequest",
">",
"strategy",
")",
"{",
"requireNonNull",
"(",
"strategy",
",",
"\"strate... | Creates a new decorator using the specified {@link ThrottlingStrategy} instance.
@param strategy The {@link ThrottlingStrategy} instance to be used | [
"Creates",
"a",
"new",
"decorator",
"using",
"the",
"specified",
"{",
"@link",
"ThrottlingStrategy",
"}",
"instance",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/throttling/ThrottlingRpcService.java#L40-L44 |
mapbox/mapbox-java | services-turf/src/main/java/com/mapbox/turf/TurfConversion.java | TurfConversion.lengthToRadians | public static double lengthToRadians(double distance, @NonNull @TurfUnitCriteria String units) {
"""
Convert a distance measurement (assuming a spherical Earth) from a real-world unit into
radians.
@param distance double representing a distance value
@param units pass in one of the units defined in {@link ... | java | public static double lengthToRadians(double distance, @NonNull @TurfUnitCriteria String units) {
return distance / FACTORS.get(units);
} | [
"public",
"static",
"double",
"lengthToRadians",
"(",
"double",
"distance",
",",
"@",
"NonNull",
"@",
"TurfUnitCriteria",
"String",
"units",
")",
"{",
"return",
"distance",
"/",
"FACTORS",
".",
"get",
"(",
"units",
")",
";",
"}"
] | Convert a distance measurement (assuming a spherical Earth) from a real-world unit into
radians.
@param distance double representing a distance value
@param units pass in one of the units defined in {@link TurfUnitCriteria}
@return converted distance to radians value
@since 1.2.0 | [
"Convert",
"a",
"distance",
"measurement",
"(",
"assuming",
"a",
"spherical",
"Earth",
")",
"from",
"a",
"real",
"-",
"world",
"unit",
"into",
"radians",
"."
] | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-turf/src/main/java/com/mapbox/turf/TurfConversion.java#L129-L131 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.getInt | public int getInt(@NotNull final String key) throws InvalidSettingException {
"""
Returns an int value from the properties file. If the value was specified
as a system property or passed in via the -Dprop=value argument - this
method will return the value from the system properties before the values
in the cont... | java | public int getInt(@NotNull final String key) throws InvalidSettingException {
try {
return Integer.parseInt(getString(key));
} catch (NumberFormatException ex) {
throw new InvalidSettingException("Could not convert property '" + key + "' to an int.", ex);
}
} | [
"public",
"int",
"getInt",
"(",
"@",
"NotNull",
"final",
"String",
"key",
")",
"throws",
"InvalidSettingException",
"{",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"getString",
"(",
"key",
")",
")",
";",
"}",
"catch",
"(",
"NumberFormatException"... | Returns an int value from the properties file. If the value was specified
as a system property or passed in via the -Dprop=value argument - this
method will return the value from the system properties before the values
in the contained configuration file.
@param key the key to lookup within the properties file
@return... | [
"Returns",
"an",
"int",
"value",
"from",
"the",
"properties",
"file",
".",
"If",
"the",
"value",
"was",
"specified",
"as",
"a",
"system",
"property",
"or",
"passed",
"in",
"via",
"the",
"-",
"Dprop",
"=",
"value",
"argument",
"-",
"this",
"method",
"will... | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L975-L981 |
basho/riak-java-client | src/main/java/com/basho/riak/client/api/convert/reflection/AnnotationUtil.java | AnnotationUtil.setKey | public static <T> T setKey(T domainObject, BinaryValue key) throws ConversionException {
"""
Attempts to inject <code>key</code> as the value of the {@literal @RiakKey}
annotated member of <code>domainObject</code>
@param <T> the type of <code>domainObject</code>
@param domainObject the object to inject the k... | java | public static <T> T setKey(T domainObject, BinaryValue key) throws ConversionException
{
T obj = AnnotationHelper.getInstance().setRiakKey(domainObject, key);
return obj;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"setKey",
"(",
"T",
"domainObject",
",",
"BinaryValue",
"key",
")",
"throws",
"ConversionException",
"{",
"T",
"obj",
"=",
"AnnotationHelper",
".",
"getInstance",
"(",
")",
".",
"setRiakKey",
"(",
"domainObject",
",",
... | Attempts to inject <code>key</code> as the value of the {@literal @RiakKey}
annotated member of <code>domainObject</code>
@param <T> the type of <code>domainObject</code>
@param domainObject the object to inject the key into
@param key the key to inject
@return <code>domainObject</code> with {@literal @RiakKey} annota... | [
"Attempts",
"to",
"inject",
"<code",
">",
"key<",
"/",
"code",
">",
"as",
"the",
"value",
"of",
"the",
"{",
"@literal",
"@RiakKey",
"}",
"annotated",
"member",
"of",
"<code",
">",
"domainObject<",
"/",
"code",
">"
] | train | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/convert/reflection/AnnotationUtil.java#L47-L51 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/SimpleMDAGNode.java | SimpleMDAGNode.traverseMDAG | public static SimpleMDAGNode traverseMDAG(SimpleMDAGNode[] mdagDataArray, SimpleMDAGNode sourceNode, String str) {
"""
Follows a _transition path starting from the source node of a MDAG.
@param mdagDataArray the array containing the data of the MDAG to be traversed
@param sourceNode the dummy SimpleMDAGNode... | java | public static SimpleMDAGNode traverseMDAG(SimpleMDAGNode[] mdagDataArray, SimpleMDAGNode sourceNode, String str)
{
// char firstLetter = str.charAt(0);
//Loop through the SimpleMDAGNodes in the processing MDAG's source node's _transition set,
//searching for the the one with a letter (char) ... | [
"public",
"static",
"SimpleMDAGNode",
"traverseMDAG",
"(",
"SimpleMDAGNode",
"[",
"]",
"mdagDataArray",
",",
"SimpleMDAGNode",
"sourceNode",
",",
"String",
"str",
")",
"{",
"// char firstLetter = str.charAt(0);",
"//Loop through the SimpleMDAGNodes in the processing MDAG's... | Follows a _transition path starting from the source node of a MDAG.
@param mdagDataArray the array containing the data of the MDAG to be traversed
@param sourceNode the dummy SimpleMDAGNode which functions as the source of the MDAG data in {@code mdagDataArray}
@param str a String corresponding to a _tran... | [
"Follows",
"a",
"_transition",
"path",
"starting",
"from",
"the",
"source",
"node",
"of",
"a",
"MDAG",
"."
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/SimpleMDAGNode.java#L264-L280 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java | JavacState.performTranslation | public void performTranslation(File gensrcDir, Map<String,Transformer> suffixRules) {
"""
Run all the translators that translate into java source code.
I.e. all translators that are not copy nor compile_java_source.
"""
Map<String,Transformer> sr = new HashMap<>();
for (Map.Entry<String,Transf... | java | public void performTranslation(File gensrcDir, Map<String,Transformer> suffixRules) {
Map<String,Transformer> sr = new HashMap<>();
for (Map.Entry<String,Transformer> e : suffixRules.entrySet()) {
Class<?> trClass = e.getValue().getClass();
if (trClass == CompileJavaPackages.clas... | [
"public",
"void",
"performTranslation",
"(",
"File",
"gensrcDir",
",",
"Map",
"<",
"String",
",",
"Transformer",
">",
"suffixRules",
")",
"{",
"Map",
"<",
"String",
",",
"Transformer",
">",
"sr",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
... | Run all the translators that translate into java source code.
I.e. all translators that are not copy nor compile_java_source. | [
"Run",
"all",
"the",
"translators",
"that",
"translate",
"into",
"java",
"source",
"code",
".",
"I",
".",
"e",
".",
"all",
"translators",
"that",
"are",
"not",
"copy",
"nor",
"compile_java_source",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java#L715-L725 |
phax/ph-commons | ph-json/src/main/java/com/helger/json/serialize/JsonReader.java | JsonReader.readFromStream | @Nullable
public static IJson readFromStream (@Nonnull final IHasInputStream aISP,
@Nonnull final Charset aFallbackCharset,
@Nullable final IJsonParseExceptionCallback aCustomExceptionHandler) {
"""
Read the Json from the passed {@link I... | java | @Nullable
public static IJson readFromStream (@Nonnull final IHasInputStream aISP,
@Nonnull final Charset aFallbackCharset,
@Nullable final IJsonParseExceptionCallback aCustomExceptionHandler)
{
ValueEnforcer.notNull (aISP, "InputStream... | [
"@",
"Nullable",
"public",
"static",
"IJson",
"readFromStream",
"(",
"@",
"Nonnull",
"final",
"IHasInputStream",
"aISP",
",",
"@",
"Nonnull",
"final",
"Charset",
"aFallbackCharset",
",",
"@",
"Nullable",
"final",
"IJsonParseExceptionCallback",
"aCustomExceptionHandler",... | Read the Json from the passed {@link IHasInputStream}.
@param aISP
The input stream to use. May not be <code>null</code>.
@param aFallbackCharset
The charset to be used in case no BOM is present. May not be
<code>null</code>.
@param aCustomExceptionHandler
An optional custom exception handler that can be used to colle... | [
"Read",
"the",
"Json",
"from",
"the",
"passed",
"{",
"@link",
"IHasInputStream",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-json/src/main/java/com/helger/json/serialize/JsonReader.java#L618-L628 |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/astar/AStar.java | AStar.solve | @Pure
public GP solve(PT startPoint, PT endPoint) {
"""
Run the A* algorithm assuming that the graph is oriented is
an orientation tool was passed to the constructor.
<p>The orientation of the graph may also be overridden by the implementations
of the {@link AStarNode A* nodes}.
@param startPoint is the s... | java | @Pure
public GP solve(PT startPoint, PT endPoint) {
return solve(
node(startPoint,
0f,
estimate(startPoint, endPoint), null),
endPoint);
} | [
"@",
"Pure",
"public",
"GP",
"solve",
"(",
"PT",
"startPoint",
",",
"PT",
"endPoint",
")",
"{",
"return",
"solve",
"(",
"node",
"(",
"startPoint",
",",
"0f",
",",
"estimate",
"(",
"startPoint",
",",
"endPoint",
")",
",",
"null",
")",
",",
"endPoint",
... | Run the A* algorithm assuming that the graph is oriented is
an orientation tool was passed to the constructor.
<p>The orientation of the graph may also be overridden by the implementations
of the {@link AStarNode A* nodes}.
@param startPoint is the starting point.
@param endPoint is the point to reach.
@return the fo... | [
"Run",
"the",
"A",
"*",
"algorithm",
"assuming",
"that",
"the",
"graph",
"is",
"oriented",
"is",
"an",
"orientation",
"tool",
"was",
"passed",
"to",
"the",
"constructor",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/astar/AStar.java#L414-L421 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/Context.java | Context.getThreadContext | public static Context getThreadContext()
throws EFapsException {
"""
The method checks if for the current thread a context object is defined.
This found context object is returned.
@return defined context object of current thread
@throws EFapsException if no context object for current thread is define... | java | public static Context getThreadContext()
throws EFapsException
{
Context context = Context.THREADCONTEXT.get();
if (context == null) {
context = Context.INHERITTHREADCONTEXT.get();
}
if (context == null) {
throw new EFapsException(Context.class, "getTh... | [
"public",
"static",
"Context",
"getThreadContext",
"(",
")",
"throws",
"EFapsException",
"{",
"Context",
"context",
"=",
"Context",
".",
"THREADCONTEXT",
".",
"get",
"(",
")",
";",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"context",
"=",
"Context",
".... | The method checks if for the current thread a context object is defined.
This found context object is returned.
@return defined context object of current thread
@throws EFapsException if no context object for current thread is defined
@see #INHERITTHREADCONTEXT | [
"The",
"method",
"checks",
"if",
"for",
"the",
"current",
"thread",
"a",
"context",
"object",
"is",
"defined",
".",
"This",
"found",
"context",
"object",
"is",
"returned",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/Context.java#L885-L896 |
census-instrumentation/opencensus-java | contrib/exemplar_util/src/main/java/io/opencensus/contrib/exemplar/util/ExemplarUtils.java | ExemplarUtils.putSpanContextAttachments | public static void putSpanContextAttachments(MeasureMap measureMap, SpanContext spanContext) {
"""
Puts a {@link SpanContext} into the attachments of the given {@link MeasureMap}.
@param measureMap the {@code MeasureMap}.
@param spanContext the {@code SpanContext} to be put as attachments.
@since 0.16
"""... | java | public static void putSpanContextAttachments(MeasureMap measureMap, SpanContext spanContext) {
checkNotNull(measureMap, "measureMap");
checkNotNull(spanContext, "spanContext");
measureMap.putAttachment(
ATTACHMENT_KEY_SPAN_CONTEXT, AttachmentValueSpanContext.create(spanContext));
} | [
"public",
"static",
"void",
"putSpanContextAttachments",
"(",
"MeasureMap",
"measureMap",
",",
"SpanContext",
"spanContext",
")",
"{",
"checkNotNull",
"(",
"measureMap",
",",
"\"measureMap\"",
")",
";",
"checkNotNull",
"(",
"spanContext",
",",
"\"spanContext\"",
")",
... | Puts a {@link SpanContext} into the attachments of the given {@link MeasureMap}.
@param measureMap the {@code MeasureMap}.
@param spanContext the {@code SpanContext} to be put as attachments.
@since 0.16 | [
"Puts",
"a",
"{",
"@link",
"SpanContext",
"}",
"into",
"the",
"attachments",
"of",
"the",
"given",
"{",
"@link",
"MeasureMap",
"}",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/contrib/exemplar_util/src/main/java/io/opencensus/contrib/exemplar/util/ExemplarUtils.java#L45-L50 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/LocalDateTime.java | LocalDateTime.ofInstant | public static LocalDateTime ofInstant(Instant instant, ZoneId zone) {
"""
Obtains an instance of {@code LocalDateTime} from an {@code Instant} and zone ID.
<p>
This creates a local date-time based on the specified instant.
First, the offset from UTC/Greenwich is obtained using the zone ID and instant,
which is... | java | public static LocalDateTime ofInstant(Instant instant, ZoneId zone) {
Jdk8Methods.requireNonNull(instant, "instant");
Jdk8Methods.requireNonNull(zone, "zone");
ZoneRules rules = zone.getRules();
ZoneOffset offset = rules.getOffset(instant);
return ofEpochSecond(instant.getEpochSe... | [
"public",
"static",
"LocalDateTime",
"ofInstant",
"(",
"Instant",
"instant",
",",
"ZoneId",
"zone",
")",
"{",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"instant",
",",
"\"instant\"",
")",
";",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"zone",
",",
"\"zone\"",
... | Obtains an instance of {@code LocalDateTime} from an {@code Instant} and zone ID.
<p>
This creates a local date-time based on the specified instant.
First, the offset from UTC/Greenwich is obtained using the zone ID and instant,
which is simple as there is only one valid offset for each instant.
Then, the instant and o... | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"LocalDateTime",
"}",
"from",
"an",
"{",
"@code",
"Instant",
"}",
"and",
"zone",
"ID",
".",
"<p",
">",
"This",
"creates",
"a",
"local",
"date",
"-",
"time",
"based",
"on",
"the",
"specified",
"instant",
... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/LocalDateTime.java#L353-L359 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IteratorExtensions.java | IteratorExtensions.findFirst | public static <T> T findFirst(Iterator<T> iterator, Function1<? super T, Boolean> predicate) {
"""
Finds the first element in the given iterator that fulfills the predicate. If none is found or the iterator is
empty, <code>null</code> is returned.
@param iterator
the iterator. May not be <code>null</code>.
@... | java | public static <T> T findFirst(Iterator<T> iterator, Function1<? super T, Boolean> predicate) {
if (predicate == null)
throw new NullPointerException("predicate");
while(iterator.hasNext()) {
T t = iterator.next();
if (predicate.apply(t))
return t;
}
return null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"findFirst",
"(",
"Iterator",
"<",
"T",
">",
"iterator",
",",
"Function1",
"<",
"?",
"super",
"T",
",",
"Boolean",
">",
"predicate",
")",
"{",
"if",
"(",
"predicate",
"==",
"null",
")",
"throw",
"new",
"NullPoi... | Finds the first element in the given iterator that fulfills the predicate. If none is found or the iterator is
empty, <code>null</code> is returned.
@param iterator
the iterator. May not be <code>null</code>.
@param predicate
the predicate. May not be <code>null</code>.
@return the first element in the iterator for wh... | [
"Finds",
"the",
"first",
"element",
"in",
"the",
"given",
"iterator",
"that",
"fulfills",
"the",
"predicate",
".",
"If",
"none",
"is",
"found",
"or",
"the",
"iterator",
"is",
"empty",
"<code",
">",
"null<",
"/",
"code",
">",
"is",
"returned",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IteratorExtensions.java#L103-L112 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parsePersistence | private void parsePersistence(Map<Object, Object> props) {
"""
Method to handle parsing all of the persistence related configuration
values.
@param props
"""
parseKeepAliveEnabled(props);
if (isKeepAliveEnabled()) {
parseMaxPersist(props);
}
} | java | private void parsePersistence(Map<Object, Object> props) {
parseKeepAliveEnabled(props);
if (isKeepAliveEnabled()) {
parseMaxPersist(props);
}
} | [
"private",
"void",
"parsePersistence",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"parseKeepAliveEnabled",
"(",
"props",
")",
";",
"if",
"(",
"isKeepAliveEnabled",
"(",
")",
")",
"{",
"parseMaxPersist",
"(",
"props",
")",
";",
"}",
... | Method to handle parsing all of the persistence related configuration
values.
@param props | [
"Method",
"to",
"handle",
"parsing",
"all",
"of",
"the",
"persistence",
"related",
"configuration",
"values",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L476-L481 |
alkacon/opencms-core | src/org/opencms/cmis/CmsCmisUtil.java | CmsCmisUtil.addPropertyBoolean | public static void addPropertyBoolean(
CmsCmisTypeManager typeManager,
PropertiesImpl props,
String typeId,
Set<String> filter,
String id,
boolean value) {
"""
Adds a boolean property to a PropertiesImpl.<p>
@param typeManager
@param props the properties
@... | java | public static void addPropertyBoolean(
CmsCmisTypeManager typeManager,
PropertiesImpl props,
String typeId,
Set<String> filter,
String id,
boolean value) {
if (!checkAddProperty(typeManager, props, typeId, filter, id)) {
return;
}
... | [
"public",
"static",
"void",
"addPropertyBoolean",
"(",
"CmsCmisTypeManager",
"typeManager",
",",
"PropertiesImpl",
"props",
",",
"String",
"typeId",
",",
"Set",
"<",
"String",
">",
"filter",
",",
"String",
"id",
",",
"boolean",
"value",
")",
"{",
"if",
"(",
... | Adds a boolean property to a PropertiesImpl.<p>
@param typeManager
@param props the properties
@param typeId the type id
@param filter the property filter string
@param id the property id
@param value the property value | [
"Adds",
"a",
"boolean",
"property",
"to",
"a",
"PropertiesImpl",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisUtil.java#L167-L180 |
eurekaclinical/aiw-i2b2-etl | src/main/java/edu/emory/cci/aiw/i2b2etl/dest/metadata/conceptid/PropDefConceptId.java | PropDefConceptId.getInstance | public static ConceptId getInstance(String propId, String propertyName, Metadata metadata) {
"""
Returns a concept propId with the given proposition propId and property name.
@param propId a proposition propId {@link String}. Cannot be
<code>null</code>.
@param propertyName a property name {@link String}.
@r... | java | public static ConceptId getInstance(String propId, String propertyName, Metadata metadata) {
return getInstance(propId, propertyName, null, metadata);
} | [
"public",
"static",
"ConceptId",
"getInstance",
"(",
"String",
"propId",
",",
"String",
"propertyName",
",",
"Metadata",
"metadata",
")",
"{",
"return",
"getInstance",
"(",
"propId",
",",
"propertyName",
",",
"null",
",",
"metadata",
")",
";",
"}"
] | Returns a concept propId with the given proposition propId and property name.
@param propId a proposition propId {@link String}. Cannot be
<code>null</code>.
@param propertyName a property name {@link String}.
@return a {@link PropDefConceptId}. | [
"Returns",
"a",
"concept",
"propId",
"with",
"the",
"given",
"proposition",
"propId",
"and",
"property",
"name",
"."
] | train | https://github.com/eurekaclinical/aiw-i2b2-etl/blob/3eed6bda7755919cb9466d2930723a0f4748341a/src/main/java/edu/emory/cci/aiw/i2b2etl/dest/metadata/conceptid/PropDefConceptId.java#L53-L55 |
mozilla/rhino | src/org/mozilla/javascript/FunctionObject.java | FunctionObject.createObject | @Override
public Scriptable createObject(Context cx, Scriptable scope) {
"""
Return new {@link Scriptable} instance using the default
constructor for the class of the underlying Java method.
Return null to indicate that the call method should be used to create
new objects.
"""
if (member.isCtor(... | java | @Override
public Scriptable createObject(Context cx, Scriptable scope) {
if (member.isCtor() || parmsLength == VARARGS_CTOR) {
return null;
}
Scriptable result;
try {
result = (Scriptable) member.getDeclaringClass().newInstance();
} catch (Exception ex... | [
"@",
"Override",
"public",
"Scriptable",
"createObject",
"(",
"Context",
"cx",
",",
"Scriptable",
"scope",
")",
"{",
"if",
"(",
"member",
".",
"isCtor",
"(",
")",
"||",
"parmsLength",
"==",
"VARARGS_CTOR",
")",
"{",
"return",
"null",
";",
"}",
"Scriptable"... | Return new {@link Scriptable} instance using the default
constructor for the class of the underlying Java method.
Return null to indicate that the call method should be used to create
new objects. | [
"Return",
"new",
"{"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/FunctionObject.java#L479-L494 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/api/ApiImplementor.java | ApiImplementor.handleApiPersistentConnection | public void handleApiPersistentConnection(HttpMessage msg,
HttpInputStream httpIn, HttpOutputStream httpOut, String name,
JSONObject params) throws ApiException {
"""
Override if implementing one or more 'persistent connection' operations.
These are operations that maintain long running connections, potenti... | java | public void handleApiPersistentConnection(HttpMessage msg,
HttpInputStream httpIn, HttpOutputStream httpOut, String name,
JSONObject params) throws ApiException {
throw new ApiException(ApiException.Type.BAD_PCONN, name);
} | [
"public",
"void",
"handleApiPersistentConnection",
"(",
"HttpMessage",
"msg",
",",
"HttpInputStream",
"httpIn",
",",
"HttpOutputStream",
"httpOut",
",",
"String",
"name",
",",
"JSONObject",
"params",
")",
"throws",
"ApiException",
"{",
"throw",
"new",
"ApiException",
... | Override if implementing one or more 'persistent connection' operations.
These are operations that maintain long running connections, potentially staying alive
as long as the client holds them open.
@param msg the HTTP message containing the API request
@param httpIn the input stream
@param httpOut the output stream
@p... | [
"Override",
"if",
"implementing",
"one",
"or",
"more",
"persistent",
"connection",
"operations",
".",
"These",
"are",
"operations",
"that",
"maintain",
"long",
"running",
"connections",
"potentially",
"staying",
"alive",
"as",
"long",
"as",
"the",
"client",
"holds... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/api/ApiImplementor.java#L362-L366 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/ui/CmsTypesTab.java | CmsTypesTab.updateContent | public void updateContent(List<CmsResourceTypeBean> types, List<String> selectedTypes) {
"""
Updates the types list.<p>
@param types the new types list
@param selectedTypes the list of types to select
"""
clearList();
fillContent(types, selectedTypes);
} | java | public void updateContent(List<CmsResourceTypeBean> types, List<String> selectedTypes) {
clearList();
fillContent(types, selectedTypes);
} | [
"public",
"void",
"updateContent",
"(",
"List",
"<",
"CmsResourceTypeBean",
">",
"types",
",",
"List",
"<",
"String",
">",
"selectedTypes",
")",
"{",
"clearList",
"(",
")",
";",
"fillContent",
"(",
"types",
",",
"selectedTypes",
")",
";",
"}"
] | Updates the types list.<p>
@param types the new types list
@param selectedTypes the list of types to select | [
"Updates",
"the",
"types",
"list",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/CmsTypesTab.java#L250-L254 |
Syncleus/aparapi | src/main/java/com/aparapi/internal/model/ClassModel.java | ClassModel.getMethod | public ClassModelMethod getMethod(MethodEntry _methodEntry, boolean _isSpecial) {
"""
Look up a ConstantPool MethodEntry and return the corresponding Method.
@param _methodEntry The ConstantPool MethodEntry we want.
@param _isSpecial True if we wish to delegate to super (to support <code>super.foo()</code>)
... | java | public ClassModelMethod getMethod(MethodEntry _methodEntry, boolean _isSpecial) {
final String entryClassNameInDotForm = _methodEntry.getClassEntry().getNameUTF8Entry().getUTF8().replace('/', '.');
// Shortcut direct calls to supers to allow "foo() { super.foo() }" type stuff to work
if (_isSpecial &... | [
"public",
"ClassModelMethod",
"getMethod",
"(",
"MethodEntry",
"_methodEntry",
",",
"boolean",
"_isSpecial",
")",
"{",
"final",
"String",
"entryClassNameInDotForm",
"=",
"_methodEntry",
".",
"getClassEntry",
"(",
")",
".",
"getNameUTF8Entry",
"(",
")",
".",
"getUTF8... | Look up a ConstantPool MethodEntry and return the corresponding Method.
@param _methodEntry The ConstantPool MethodEntry we want.
@param _isSpecial True if we wish to delegate to super (to support <code>super.foo()</code>)
@return The Method or null if we fail to locate a given method. | [
"Look",
"up",
"a",
"ConstantPool",
"MethodEntry",
"and",
"return",
"the",
"corresponding",
"Method",
"."
] | train | https://github.com/Syncleus/aparapi/blob/6d5892c8e69854b3968c541023de37cf4762bd24/src/main/java/com/aparapi/internal/model/ClassModel.java#L2957-L2975 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getTaggedImageCount | public int getTaggedImageCount(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) {
"""
Gets the number of images tagged with the provided {tagIds}.
The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and
"Cat" tags, then only... | java | public int getTaggedImageCount(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) {
return getTaggedImageCountWithServiceResponseAsync(projectId, getTaggedImageCountOptionalParameter).toBlocking().single().body();
} | [
"public",
"int",
"getTaggedImageCount",
"(",
"UUID",
"projectId",
",",
"GetTaggedImageCountOptionalParameter",
"getTaggedImageCountOptionalParameter",
")",
"{",
"return",
"getTaggedImageCountWithServiceResponseAsync",
"(",
"projectId",
",",
"getTaggedImageCountOptionalParameter",
"... | Gets the number of images tagged with the provided {tagIds}.
The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and
"Cat" tags, then only images tagged with Dog and/or Cat will be returned.
@param projectId The project id
@param getTaggedImageCountOptionalParameter the o... | [
"Gets",
"the",
"number",
"of",
"images",
"tagged",
"with",
"the",
"provided",
"{",
"tagIds",
"}",
".",
"The",
"filtering",
"is",
"on",
"an",
"and",
"/",
"or",
"relationship",
".",
"For",
"example",
"if",
"the",
"provided",
"tag",
"ids",
"are",
"for",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L4614-L4616 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/buttonGroup/ButtonGroupRenderer.java | ButtonGroupRenderer.encodeEnd | @Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
"""
This methods generates the HTML code of the current b:buttonGroup.
<code>encodeBegin</code> generates the start of the component. After the,
the JSF framework calls <code>encodeChildren()</code> to generate the... | java | @Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
ButtonGroup buttonGroup = (ButtonGroup) component;
ResponseWriter rw = context.getResponseWriter();
endDisabledFieldset(buttonGroup, rw);
rw.endElement("div");
Str... | [
"@",
"Override",
"public",
"void",
"encodeEnd",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"ButtonGroup",
"button... | This methods generates the HTML code of the current b:buttonGroup.
<code>encodeBegin</code> generates the start of the component. After the,
the JSF framework calls <code>encodeChildren()</code> to generate the
HTML code between the beginning and the end of the component. For
instance, in the case of a panel component ... | [
"This",
"methods",
"generates",
"the",
"HTML",
"code",
"of",
"the",
"current",
"b",
":",
"buttonGroup",
".",
"<code",
">",
"encodeBegin<",
"/",
"code",
">",
"generates",
"the",
"start",
"of",
"the",
"component",
".",
"After",
"the",
"the",
"JSF",
"framewor... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/buttonGroup/ButtonGroupRenderer.java#L112-L126 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/ReferenceEntityLockService.java | ReferenceEntityLockService.newLock | @Override
public IEntityLock newLock(Class entityType, String entityKey, int lockType, String owner)
throws LockingException {
"""
Returns a lock for the entity, lock type and owner if no conflicting locks exist.
@param entityType
@param entityKey
@param lockType
@param owner
@return org.ape... | java | @Override
public IEntityLock newLock(Class entityType, String entityKey, int lockType, String owner)
throws LockingException {
return newLock(entityType, entityKey, lockType, owner, defaultLockPeriod);
} | [
"@",
"Override",
"public",
"IEntityLock",
"newLock",
"(",
"Class",
"entityType",
",",
"String",
"entityKey",
",",
"int",
"lockType",
",",
"String",
"owner",
")",
"throws",
"LockingException",
"{",
"return",
"newLock",
"(",
"entityType",
",",
"entityKey",
",",
... | Returns a lock for the entity, lock type and owner if no conflicting locks exist.
@param entityType
@param entityKey
@param lockType
@param owner
@return org.apereo.portal.groups.IEntityLock
@exception LockingException | [
"Returns",
"a",
"lock",
"for",
"the",
"entity",
"lock",
"type",
"and",
"owner",
"if",
"no",
"conflicting",
"locks",
"exist",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/ReferenceEntityLockService.java#L244-L248 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/cpc/CompressionData.java | CompressionData.validateDecodingTable | static void validateDecodingTable(final short[] decodingTable, final short[] encodingTable) {
"""
These short arrays are being treated as unsigned
@param decodingTable unsigned
@param encodingTable unsigned
"""
for (int decodeThis = 0; decodeThis < 4096; decodeThis++) {
final int tmpD = decodingTab... | java | static void validateDecodingTable(final short[] decodingTable, final short[] encodingTable) {
for (int decodeThis = 0; decodeThis < 4096; decodeThis++) {
final int tmpD = decodingTable[decodeThis] & 0xFFFF;
final int decodedByte = tmpD & 0xff;
final int decodedLength = tmpD >> 8;
final in... | [
"static",
"void",
"validateDecodingTable",
"(",
"final",
"short",
"[",
"]",
"decodingTable",
",",
"final",
"short",
"[",
"]",
"encodingTable",
")",
"{",
"for",
"(",
"int",
"decodeThis",
"=",
"0",
";",
"decodeThis",
"<",
"4096",
";",
"decodeThis",
"++",
")"... | These short arrays are being treated as unsigned
@param decodingTable unsigned
@param encodingTable unsigned | [
"These",
"short",
"arrays",
"are",
"being",
"treated",
"as",
"unsigned"
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/cpc/CompressionData.java#L74-L91 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java | BootstrapConfig.getUserOutputFile | public File getUserOutputFile(String relativePath) {
"""
Allocate a file in the user output directory, e.g.
WLP_OUTPUT_DIR/relativePath
@param relativePath
relative path of file to create in the WLP_OUTPUT_DIR directory
@return File object for relative path, or for the WLP_OUTPUT_DIR directory itself
if the... | java | public File getUserOutputFile(String relativePath) {
if (relativePath == null)
return outputRoot;
else
return new File(outputRoot, relativePath);
} | [
"public",
"File",
"getUserOutputFile",
"(",
"String",
"relativePath",
")",
"{",
"if",
"(",
"relativePath",
"==",
"null",
")",
"return",
"outputRoot",
";",
"else",
"return",
"new",
"File",
"(",
"outputRoot",
",",
"relativePath",
")",
";",
"}"
] | Allocate a file in the user output directory, e.g.
WLP_OUTPUT_DIR/relativePath
@param relativePath
relative path of file to create in the WLP_OUTPUT_DIR directory
@return File object for relative path, or for the WLP_OUTPUT_DIR directory itself
if the relative path argument is null | [
"Allocate",
"a",
"file",
"in",
"the",
"user",
"output",
"directory",
"e",
".",
"g",
".",
"WLP_OUTPUT_DIR",
"/",
"relativePath"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java#L596-L601 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getImagesByIds | public List<Image> getImagesByIds(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter) {
"""
Get images by id for a given project iteration.
This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the
current workspace is used... | java | public List<Image> getImagesByIds(UUID projectId, GetImagesByIdsOptionalParameter getImagesByIdsOptionalParameter) {
return getImagesByIdsWithServiceResponseAsync(projectId, getImagesByIdsOptionalParameter).toBlocking().single().body();
} | [
"public",
"List",
"<",
"Image",
">",
"getImagesByIds",
"(",
"UUID",
"projectId",
",",
"GetImagesByIdsOptionalParameter",
"getImagesByIdsOptionalParameter",
")",
"{",
"return",
"getImagesByIdsWithServiceResponseAsync",
"(",
"projectId",
",",
"getImagesByIdsOptionalParameter",
... | Get images by id for a given project iteration.
This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the
current workspace is used.
@param projectId The project id
@param getImagesByIdsOptionalParameter the object representing the optional parameters to be ... | [
"Get",
"images",
"by",
"id",
"for",
"a",
"given",
"project",
"iteration",
".",
"This",
"API",
"will",
"return",
"a",
"set",
"of",
"Images",
"for",
"the",
"specified",
"tags",
"and",
"optionally",
"iteration",
".",
"If",
"no",
"iteration",
"is",
"specified"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L4283-L4285 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/types/StringValue.java | StringValue.setValueAscii | public void setValueAscii(byte[] bytes, int offset, int len) {
"""
Sets the value of this <code>StringValue</code>, assuming that the binary data is ASCII coded. The n-th character of the
<code>StringValue</code> corresponds directly to the n-th byte in the given array after the offset.
@param bytes The binary... | java | public void setValueAscii(byte[] bytes, int offset, int len) {
if (bytes == null) {
throw new NullPointerException("Bytes must not be null");
}
if (len < 0 | offset < 0 | offset > bytes.length - len) {
throw new IndexOutOfBoundsException();
}
ensureSize(len);
this.len = len;
this.hashCode = 0;
... | [
"public",
"void",
"setValueAscii",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"if",
"(",
"bytes",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Bytes must not be null\"",
")",
";",
"}",
"i... | Sets the value of this <code>StringValue</code>, assuming that the binary data is ASCII coded. The n-th character of the
<code>StringValue</code> corresponds directly to the n-th byte in the given array after the offset.
@param bytes The binary character data.
@param offset The offset in the array.
@param len The numb... | [
"Sets",
"the",
"value",
"of",
"this",
"<code",
">",
"StringValue<",
"/",
"code",
">",
"assuming",
"that",
"the",
"binary",
"data",
"is",
"ASCII",
"coded",
".",
"The",
"n",
"-",
"th",
"character",
"of",
"the",
"<code",
">",
"StringValue<",
"/",
"code",
... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/types/StringValue.java#L236-L253 |
Waikato/moa | moa/src/main/java/moa/classifiers/meta/AccuracyUpdatedEnsemble.java | AccuracyUpdatedEnsemble.addToStored | protected Classifier addToStored(Classifier newClassifier, double newClassifiersWeight) {
"""
Adds a classifier to the storage.
@param newClassifier
The classifier to add.
@param newClassifiersWeight
The new classifiers weight.
"""
Classifier addedClassifier = null;
Classifier[] newStored = new Cla... | java | protected Classifier addToStored(Classifier newClassifier, double newClassifiersWeight) {
Classifier addedClassifier = null;
Classifier[] newStored = new Classifier[this.learners.length + 1];
double[][] newStoredWeights = new double[newStored.length][2];
for (int i = 0; i < newStored.length; i++) {
if... | [
"protected",
"Classifier",
"addToStored",
"(",
"Classifier",
"newClassifier",
",",
"double",
"newClassifiersWeight",
")",
"{",
"Classifier",
"addedClassifier",
"=",
"null",
";",
"Classifier",
"[",
"]",
"newStored",
"=",
"new",
"Classifier",
"[",
"this",
".",
"lear... | Adds a classifier to the storage.
@param newClassifier
The classifier to add.
@param newClassifiersWeight
The new classifiers weight. | [
"Adds",
"a",
"classifier",
"to",
"the",
"storage",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/meta/AccuracyUpdatedEnsemble.java#L309-L329 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/main/Enforcer.java | Enforcer.hasRoleForUser | public boolean hasRoleForUser(String name, String role) {
"""
hasRoleForUser determines whether a user has a role.
@param name the user.
@param role the role.
@return whether the user has the role.
"""
List<String> roles = getRolesForUser(name);
boolean hasRole = false;
for (Strin... | java | public boolean hasRoleForUser(String name, String role) {
List<String> roles = getRolesForUser(name);
boolean hasRole = false;
for (String r : roles) {
if (r.equals(role)) {
hasRole = true;
break;
}
}
return hasRole;
} | [
"public",
"boolean",
"hasRoleForUser",
"(",
"String",
"name",
",",
"String",
"role",
")",
"{",
"List",
"<",
"String",
">",
"roles",
"=",
"getRolesForUser",
"(",
"name",
")",
";",
"boolean",
"hasRole",
"=",
"false",
";",
"for",
"(",
"String",
"r",
":",
... | hasRoleForUser determines whether a user has a role.
@param name the user.
@param role the role.
@return whether the user has the role. | [
"hasRoleForUser",
"determines",
"whether",
"a",
"user",
"has",
"a",
"role",
"."
] | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/Enforcer.java#L151-L163 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/DynamicArray.java | DynamicArray.addAll | public boolean addAll(int index, Collection<? extends E> c) {
"""
Inserts all of the elements in the specified collection into this
list, starting at the specified position. Shifts the element
currently at that position (if any) and any subsequent elements to
the right (increases their indices). The new eleme... | java | public boolean addAll(int index, Collection<? extends E> c) {
if (index > size || index < 0)
throw new IndexOutOfBoundsException(
"Index: " + index + ", Size: " + size);
Object[] a = c.toArray();
int numNew = a.length;
ensureCapacity(size + numNew); // Increments modCount
int numM... | [
"public",
"boolean",
"addAll",
"(",
"int",
"index",
",",
"Collection",
"<",
"?",
"extends",
"E",
">",
"c",
")",
"{",
"if",
"(",
"index",
">",
"size",
"||",
"index",
"<",
"0",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Index: \"",
"+",
"i... | Inserts all of the elements in the specified collection into this
list, starting at the specified position. Shifts the element
currently at that position (if any) and any subsequent elements to
the right (increases their indices). The new elements will appear
in the list in the order that they are returned by the
spe... | [
"Inserts",
"all",
"of",
"the",
"elements",
"in",
"the",
"specified",
"collection",
"into",
"this",
"list",
"starting",
"at",
"the",
"specified",
"position",
".",
"Shifts",
"the",
"element",
"currently",
"at",
"that",
"position",
"(",
"if",
"any",
")",
"and",... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/DynamicArray.java#L426-L443 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/SslListener.java | SslListener.customizeRequest | protected void customizeRequest(Socket socket, HttpRequest request) {
"""
Allow the Listener a chance to customise the request. before the server does its stuff. <br>
This allows the required attributes to be set for SSL requests. <br>
The requirements of the Servlet specs are:
<ul>
<li>an attribute named "jav... | java | protected void customizeRequest(Socket socket, HttpRequest request)
{
super.customizeRequest(socket, request);
if (!(socket instanceof javax.net.ssl.SSLSocket)) return; // I'm tempted to let it throw an
// exception...
try
... | [
"protected",
"void",
"customizeRequest",
"(",
"Socket",
"socket",
",",
"HttpRequest",
"request",
")",
"{",
"super",
".",
"customizeRequest",
"(",
"socket",
",",
"request",
")",
";",
"if",
"(",
"!",
"(",
"socket",
"instanceof",
"javax",
".",
"net",
".",
"ss... | Allow the Listener a chance to customise the request. before the server does its stuff. <br>
This allows the required attributes to be set for SSL requests. <br>
The requirements of the Servlet specs are:
<ul>
<li>an attribute named "javax.servlet.request.cipher_suite" of type String.</li>
<li>an attribute named "javax... | [
"Allow",
"the",
"Listener",
"a",
"chance",
"to",
"customise",
"the",
"request",
".",
"before",
"the",
"server",
"does",
"its",
"stuff",
".",
"<br",
">",
"This",
"allows",
"the",
"required",
"attributes",
"to",
"be",
"set",
"for",
"SSL",
"requests",
".",
... | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/SslListener.java#L357-L398 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_ssl_id_PUT | public void serviceName_ssl_id_PUT(String serviceName, Long id, OvhSsl body) throws IOException {
"""
Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/ssl/{id}
@param body [required] New object properties
@param serviceName [required] The internal name of your IP load balancing
@param id... | java | public void serviceName_ssl_id_PUT(String serviceName, Long id, OvhSsl body) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/ssl/{id}";
StringBuilder sb = path(qPath, serviceName, id);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_ssl_id_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"id",
",",
"OvhSsl",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/ssl/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"("... | Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/ssl/{id}
@param body [required] New object properties
@param serviceName [required] The internal name of your IP load balancing
@param id [required] Id of your SSL certificate | [
"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#L1886-L1890 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointBrief.java | DescribePointBrief.process | public void process( double c_x , double c_y , TupleDesc_B feature ) {
"""
Computes the descriptor at the specified point. If the region go outside of the image then a description
will not be made.
@param c_x Center of region being described.
@param c_y Center of region being described.
@param feature Where... | java | public void process( double c_x , double c_y , TupleDesc_B feature ) {
describe.process((int)c_x,(int)c_y,feature);
} | [
"public",
"void",
"process",
"(",
"double",
"c_x",
",",
"double",
"c_y",
",",
"TupleDesc_B",
"feature",
")",
"{",
"describe",
".",
"process",
"(",
"(",
"int",
")",
"c_x",
",",
"(",
"int",
")",
"c_y",
",",
"feature",
")",
";",
"}"
] | Computes the descriptor at the specified point. If the region go outside of the image then a description
will not be made.
@param c_x Center of region being described.
@param c_y Center of region being described.
@param feature Where the descriptor is written to. | [
"Computes",
"the",
"descriptor",
"at",
"the",
"specified",
"point",
".",
"If",
"the",
"region",
"go",
"outside",
"of",
"the",
"image",
"then",
"a",
"description",
"will",
"not",
"be",
"made",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointBrief.java#L87-L89 |
pedrovgs/Lynx | lynx/src/main/java/com/github/pedrovgs/lynx/LynxView.java | LynxView.onVisibilityChanged | @Override protected void onVisibilityChanged(View changedView, int visibility) {
"""
Initializes or stops LynxPresenter based on visibility changes. Doing this Lynx is not going
to
read your application Logcat if LynxView is not visible or attached.
"""
super.onVisibilityChanged(changedView, visibility);... | java | @Override protected void onVisibilityChanged(View changedView, int visibility) {
super.onVisibilityChanged(changedView, visibility);
if (changedView != this) {
return;
}
if (visibility == View.VISIBLE) {
resumePresenter();
} else {
pausePresenter();
}
} | [
"@",
"Override",
"protected",
"void",
"onVisibilityChanged",
"(",
"View",
"changedView",
",",
"int",
"visibility",
")",
"{",
"super",
".",
"onVisibilityChanged",
"(",
"changedView",
",",
"visibility",
")",
";",
"if",
"(",
"changedView",
"!=",
"this",
")",
"{",... | Initializes or stops LynxPresenter based on visibility changes. Doing this Lynx is not going
to
read your application Logcat if LynxView is not visible or attached. | [
"Initializes",
"or",
"stops",
"LynxPresenter",
"based",
"on",
"visibility",
"changes",
".",
"Doing",
"this",
"Lynx",
"is",
"not",
"going",
"to",
"read",
"your",
"application",
"Logcat",
"if",
"LynxView",
"is",
"not",
"visible",
"or",
"attached",
"."
] | train | https://github.com/pedrovgs/Lynx/blob/6097ab18b76c1ebdd0819c10e5d09ec19ea5bf4d/lynx/src/main/java/com/github/pedrovgs/lynx/LynxView.java#L118-L129 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/LocalTime.java | LocalTime.ofSecondOfDay | static LocalTime ofSecondOfDay(long secondOfDay, int nanoOfSecond) {
"""
Obtains an instance of {@code LocalTime} from a second-of-day value, with
associated nanos of second.
<p>
This factory may return a cached value, but applications must not rely on this.
@param secondOfDay the second-of-day, from {@code... | java | static LocalTime ofSecondOfDay(long secondOfDay, int nanoOfSecond) {
SECOND_OF_DAY.checkValidValue(secondOfDay);
NANO_OF_SECOND.checkValidValue(nanoOfSecond);
int hours = (int) (secondOfDay / SECONDS_PER_HOUR);
secondOfDay -= hours * SECONDS_PER_HOUR;
int minutes = (int) (secondO... | [
"static",
"LocalTime",
"ofSecondOfDay",
"(",
"long",
"secondOfDay",
",",
"int",
"nanoOfSecond",
")",
"{",
"SECOND_OF_DAY",
".",
"checkValidValue",
"(",
"secondOfDay",
")",
";",
"NANO_OF_SECOND",
".",
"checkValidValue",
"(",
"nanoOfSecond",
")",
";",
"int",
"hours"... | Obtains an instance of {@code LocalTime} from a second-of-day value, with
associated nanos of second.
<p>
This factory may return a cached value, but applications must not rely on this.
@param secondOfDay the second-of-day, from {@code 0} to {@code 24 * 60 * 60 - 1}
@param nanoOfSecond the nano-of-second, from 0 to ... | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"LocalTime",
"}",
"from",
"a",
"second",
"-",
"of",
"-",
"day",
"value",
"with",
"associated",
"nanos",
"of",
"second",
".",
"<p",
">",
"This",
"factory",
"may",
"return",
"a",
"cached",
"value",
"but",
... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/LocalTime.java#L354-L362 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ClassUtils.java | ClassUtils.assignableTo | @NullSafe
public static boolean assignableTo(Class<?> fromType, Class<?> toType) {
"""
Determines whether a given Class type is assignable to a declared Class type. A given Class type is assignable to
a declared Class type if it is in the same Class type hierarchy, i.e. the given Class type is a subclass,
or ... | java | @NullSafe
public static boolean assignableTo(Class<?> fromType, Class<?> toType) {
return (toType != null && (fromType == null || toType.isAssignableFrom(fromType)));
} | [
"@",
"NullSafe",
"public",
"static",
"boolean",
"assignableTo",
"(",
"Class",
"<",
"?",
">",
"fromType",
",",
"Class",
"<",
"?",
">",
"toType",
")",
"{",
"return",
"(",
"toType",
"!=",
"null",
"&&",
"(",
"fromType",
"==",
"null",
"||",
"toType",
".",
... | Determines whether a given Class type is assignable to a declared Class type. A given Class type is assignable to
a declared Class type if it is in the same Class type hierarchy, i.e. the given Class type is a subclass,
or sub-interface of the declared Class type. Null is also assignable to the declared (to) Class ty... | [
"Determines",
"whether",
"a",
"given",
"Class",
"type",
"is",
"assignable",
"to",
"a",
"declared",
"Class",
"type",
".",
"A",
"given",
"Class",
"type",
"is",
"assignable",
"to",
"a",
"declared",
"Class",
"type",
"if",
"it",
"is",
"in",
"the",
"same",
"Cl... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ClassUtils.java#L82-L85 |
bwkimmel/java-util | src/main/java/ca/eandb/util/FloatArray.java | FloatArray.add | public void add(int index, float e) {
"""
Inserts a value into the array at the specified index.
@param index
The index at which to insert the new value.
@param e
The new value to insert.
@throws IndexOutOfBoundsException
if <code>index < 0 || index > size()</code>.
"""
if (index < 0 || index... | java | public void add(int index, float e) {
if (index < 0 || index > size) {
throw new IndexOutOfBoundsException();
}
ensureCapacity(size + 1);
if (index < size) {
for (int i = size; i > index; i--) {
elements[i] = elements[i - 1];
}
}
elements[index] = e;
size++;
} | [
"public",
"void",
"add",
"(",
"int",
"index",
",",
"float",
"e",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">",
"size",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"ensureCapacity",
"(",
"size",
"+",
"1",
... | Inserts a value into the array at the specified index.
@param index
The index at which to insert the new value.
@param e
The new value to insert.
@throws IndexOutOfBoundsException
if <code>index < 0 || index > size()</code>. | [
"Inserts",
"a",
"value",
"into",
"the",
"array",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/FloatArray.java#L394-L406 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionCategoryPersistenceImpl.java | CPOptionCategoryPersistenceImpl.removeByG_K | @Override
public CPOptionCategory removeByG_K(long groupId, String key)
throws NoSuchCPOptionCategoryException {
"""
Removes the cp option category where groupId = ? and key = ? from the database.
@param groupId the group ID
@param key the key
@return the cp option category that was removed
"""... | java | @Override
public CPOptionCategory removeByG_K(long groupId, String key)
throws NoSuchCPOptionCategoryException {
CPOptionCategory cpOptionCategory = findByG_K(groupId, key);
return remove(cpOptionCategory);
} | [
"@",
"Override",
"public",
"CPOptionCategory",
"removeByG_K",
"(",
"long",
"groupId",
",",
"String",
"key",
")",
"throws",
"NoSuchCPOptionCategoryException",
"{",
"CPOptionCategory",
"cpOptionCategory",
"=",
"findByG_K",
"(",
"groupId",
",",
"key",
")",
";",
"return... | Removes the cp option category where groupId = ? and key = ? from the database.
@param groupId the group ID
@param key the key
@return the cp option category that was removed | [
"Removes",
"the",
"cp",
"option",
"category",
"where",
"groupId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionCategoryPersistenceImpl.java#L2671-L2677 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.createGridGeometryGeneralParameter | public static GeneralParameterValue[] createGridGeometryGeneralParameter( RegionMap regionMap,
CoordinateReferenceSystem crs ) {
"""
Utility method to create read parameters for {@link GridCoverageReader}
@param regionMap the RegionMap.
@param crs the {@link CoordinateReferenceSystem}. Can be null,... | java | public static GeneralParameterValue[] createGridGeometryGeneralParameter( RegionMap regionMap,
CoordinateReferenceSystem crs ) {
GeneralParameterValue[] readParams = new GeneralParameterValue[1];
Parameter<GridGeometry2D> readGG = new Parameter<GridGeometry2D>(AbstractGridFormat.READ_GRIDGEO... | [
"public",
"static",
"GeneralParameterValue",
"[",
"]",
"createGridGeometryGeneralParameter",
"(",
"RegionMap",
"regionMap",
",",
"CoordinateReferenceSystem",
"crs",
")",
"{",
"GeneralParameterValue",
"[",
"]",
"readParams",
"=",
"new",
"GeneralParameterValue",
"[",
"1",
... | Utility method to create read parameters for {@link GridCoverageReader}
@param regionMap the RegionMap.
@param crs the {@link CoordinateReferenceSystem}. Can be null, even if it should not.
@return the {@link GeneralParameterValue array of parameters}. | [
"Utility",
"method",
"to",
"create",
"read",
"parameters",
"for",
"{",
"@link",
"GridCoverageReader",
"}"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L650-L670 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/descriptor/DescriptorDistance.java | DescriptorDistance.euclideanSq | public static double euclideanSq(TupleDesc_F64 a, TupleDesc_F64 b) {
"""
Returns the Euclidean distance squared between the two descriptors.
@param a First descriptor
@param b Second descriptor
@return Euclidean distance squared
"""
final int N = a.value.length;
double total = 0;
for( int i = 0; i <... | java | public static double euclideanSq(TupleDesc_F64 a, TupleDesc_F64 b) {
final int N = a.value.length;
double total = 0;
for( int i = 0; i < N; i++ ) {
double d = a.value[i]-b.value[i];
total += d*d;
}
return total;
} | [
"public",
"static",
"double",
"euclideanSq",
"(",
"TupleDesc_F64",
"a",
",",
"TupleDesc_F64",
"b",
")",
"{",
"final",
"int",
"N",
"=",
"a",
".",
"value",
".",
"length",
";",
"double",
"total",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"... | Returns the Euclidean distance squared between the two descriptors.
@param a First descriptor
@param b Second descriptor
@return Euclidean distance squared | [
"Returns",
"the",
"Euclidean",
"distance",
"squared",
"between",
"the",
"two",
"descriptors",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/descriptor/DescriptorDistance.java#L55-L64 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowCell.java | RowCell.compareByNative | public static Comparator<RowCell> compareByNative() {
"""
A comparator that compares the cells by Bigtable native ordering:
<ul>
<li>Family lexicographically ascending
<li>Qualifier lexicographically ascending
<li>Timestamp in reverse chronological order
</ul>
<p>Labels and values are not included in the... | java | public static Comparator<RowCell> compareByNative() {
return new Comparator<RowCell>() {
@Override
public int compare(RowCell c1, RowCell c2) {
return ComparisonChain.start()
.compare(c1.getFamily(), c2.getFamily())
.compare(c1.getQualifier(), c2.getQualifier(), ByteStrin... | [
"public",
"static",
"Comparator",
"<",
"RowCell",
">",
"compareByNative",
"(",
")",
"{",
"return",
"new",
"Comparator",
"<",
"RowCell",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"compare",
"(",
"RowCell",
"c1",
",",
"RowCell",
"c2",
")",
"{",... | A comparator that compares the cells by Bigtable native ordering:
<ul>
<li>Family lexicographically ascending
<li>Qualifier lexicographically ascending
<li>Timestamp in reverse chronological order
</ul>
<p>Labels and values are not included in the comparison. | [
"A",
"comparator",
"that",
"compares",
"the",
"cells",
"by",
"Bigtable",
"native",
"ordering",
":"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowCell.java#L44-L55 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/util/TextUtils.java | TextUtils.startsWith | public static boolean startsWith(final boolean caseSensitive, final CharSequence text, final CharSequence prefix) {
"""
<p>
Checks whether a text starts with a specified prefix.
</p>
@param caseSensitive whether the comparison must be done in a case-sensitive or case-insensitive way.
@param text the text to ... | java | public static boolean startsWith(final boolean caseSensitive, final CharSequence text, final CharSequence prefix) {
if (text == null) {
throw new IllegalArgumentException("Text cannot be null");
}
if (prefix == null) {
throw new IllegalArgumentException("Prefix cannot be... | [
"public",
"static",
"boolean",
"startsWith",
"(",
"final",
"boolean",
"caseSensitive",
",",
"final",
"CharSequence",
"text",
",",
"final",
"CharSequence",
"prefix",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | <p>
Checks whether a text starts with a specified prefix.
</p>
@param caseSensitive whether the comparison must be done in a case-sensitive or case-insensitive way.
@param text the text to be checked for prefixes.
@param prefix the prefix to be searched.
@return whether the text starts with the prefix or not. | [
"<p",
">",
"Checks",
"whether",
"a",
"text",
"starts",
"with",
"a",
"specified",
"prefix",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/util/TextUtils.java#L334-L349 |
sdl/odata | odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java | EntityDataModelUtil.checkIsStructuredType | public static StructuredType checkIsStructuredType(Type type) {
"""
Checks if the specified OData type is a structured type and throws an exception if it is not.
@param type The OData type.
@return The OData type.
@throws ODataSystemException If the OData type is not a structured type.
"""
if (!is... | java | public static StructuredType checkIsStructuredType(Type type) {
if (!isStructuredType(type)) {
throw new ODataSystemException("A structured type is required, but '" + type.getFullyQualifiedName() +
"' is not a structured type: " + type.getMetaType());
}
return (St... | [
"public",
"static",
"StructuredType",
"checkIsStructuredType",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"!",
"isStructuredType",
"(",
"type",
")",
")",
"{",
"throw",
"new",
"ODataSystemException",
"(",
"\"A structured type is required, but '\"",
"+",
"type",
".",
... | Checks if the specified OData type is a structured type and throws an exception if it is not.
@param type The OData type.
@return The OData type.
@throws ODataSystemException If the OData type is not a structured type. | [
"Checks",
"if",
"the",
"specified",
"OData",
"type",
"is",
"a",
"structured",
"type",
"and",
"throws",
"an",
"exception",
"if",
"it",
"is",
"not",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L151-L157 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpMediaType.java | HttpMediaType.equalsIgnoreParameters | public static boolean equalsIgnoreParameters(String mediaTypeA, String mediaTypeB) {
"""
Returns {@code true} if the two specified media types have the same type and subtype, or if
both types are {@code null}.
"""
// TODO(mlinder): Make the HttpMediaType.isSameType implementation more performant.
retu... | java | public static boolean equalsIgnoreParameters(String mediaTypeA, String mediaTypeB) {
// TODO(mlinder): Make the HttpMediaType.isSameType implementation more performant.
return (mediaTypeA == null && mediaTypeB == null)
|| mediaTypeA != null
&& mediaTypeB != null
&& new HttpMediaT... | [
"public",
"static",
"boolean",
"equalsIgnoreParameters",
"(",
"String",
"mediaTypeA",
",",
"String",
"mediaTypeB",
")",
"{",
"// TODO(mlinder): Make the HttpMediaType.isSameType implementation more performant.",
"return",
"(",
"mediaTypeA",
"==",
"null",
"&&",
"mediaTypeB",
"... | Returns {@code true} if the two specified media types have the same type and subtype, or if
both types are {@code null}. | [
"Returns",
"{"
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpMediaType.java#L306-L312 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZoneOffset.java | ZoneOffset.ofHoursMinutesSeconds | public static ZoneOffset ofHoursMinutesSeconds(int hours, int minutes, int seconds) {
"""
Obtains an instance of {@code ZoneOffset} using an offset in
hours, minutes and seconds.
<p>
The sign of the hours, minutes and seconds components must match.
Thus, if the hours is negative, the minutes and seconds must b... | java | public static ZoneOffset ofHoursMinutesSeconds(int hours, int minutes, int seconds) {
validate(hours, minutes, seconds);
int totalSeconds = totalSeconds(hours, minutes, seconds);
return ofTotalSeconds(totalSeconds);
} | [
"public",
"static",
"ZoneOffset",
"ofHoursMinutesSeconds",
"(",
"int",
"hours",
",",
"int",
"minutes",
",",
"int",
"seconds",
")",
"{",
"validate",
"(",
"hours",
",",
"minutes",
",",
"seconds",
")",
";",
"int",
"totalSeconds",
"=",
"totalSeconds",
"(",
"hour... | Obtains an instance of {@code ZoneOffset} using an offset in
hours, minutes and seconds.
<p>
The sign of the hours, minutes and seconds components must match.
Thus, if the hours is negative, the minutes and seconds must be negative or zero.
@param hours the time-zone offset in hours, from -18 to +18
@param minutes t... | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"ZoneOffset",
"}",
"using",
"an",
"offset",
"in",
"hours",
"minutes",
"and",
"seconds",
".",
"<p",
">",
"The",
"sign",
"of",
"the",
"hours",
"minutes",
"and",
"seconds",
"components",
"must",
"match",
".",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZoneOffset.java#L310-L314 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_task_taskId_GET | public OvhIpTask ip_task_taskId_GET(String ip, Long taskId) throws IOException {
"""
Get this object properties
REST: GET /ip/{ip}/task/{taskId}
@param ip [required]
@param taskId [required] the id of the task
"""
String qPath = "/ip/{ip}/task/{taskId}";
StringBuilder sb = path(qPath, ip, taskId);
S... | java | public OvhIpTask ip_task_taskId_GET(String ip, Long taskId) throws IOException {
String qPath = "/ip/{ip}/task/{taskId}";
StringBuilder sb = path(qPath, ip, taskId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhIpTask.class);
} | [
"public",
"OvhIpTask",
"ip_task_taskId_GET",
"(",
"String",
"ip",
",",
"Long",
"taskId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/task/{taskId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip",
",",
"taskId",
"... | Get this object properties
REST: GET /ip/{ip}/task/{taskId}
@param ip [required]
@param taskId [required] the id of the task | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L844-L849 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.attachUserData | public void attachUserData(String connId, KeyValueCollection userData) throws WorkspaceApiException {
"""
Attach the provided data to the call. This adds the data to the call even if data already exists
with the provided keys.
@param connId The connection ID of the call.
@param userData The data to attach to th... | java | public void attachUserData(String connId, KeyValueCollection userData) throws WorkspaceApiException {
try {
VoicecallsidcompleteData completeData = new VoicecallsidcompleteData();
completeData.setUserData(Util.toKVList(userData));
UserDataOperationId data = new UserDataOp... | [
"public",
"void",
"attachUserData",
"(",
"String",
"connId",
",",
"KeyValueCollection",
"userData",
")",
"throws",
"WorkspaceApiException",
"{",
"try",
"{",
"VoicecallsidcompleteData",
"completeData",
"=",
"new",
"VoicecallsidcompleteData",
"(",
")",
";",
"completeData"... | Attach the provided data to the call. This adds the data to the call even if data already exists
with the provided keys.
@param connId The connection ID of the call.
@param userData The data to attach to the call. This is an array of objects with the properties key, type, and value. | [
"Attach",
"the",
"provided",
"data",
"to",
"the",
"call",
".",
"This",
"adds",
"the",
"data",
"to",
"the",
"call",
"even",
"if",
"data",
"already",
"exists",
"with",
"the",
"provided",
"keys",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L1066-L1078 |
timehop/sticky-headers-recyclerview | library/src/main/java/com/timehop/stickyheadersrecyclerview/HeaderPositionCalculator.java | HeaderPositionCalculator.hasNewHeader | public boolean hasNewHeader(int position, boolean isReverseLayout) {
"""
Determines if an item in the list should have a header that is different than the item in the
list that immediately precedes it. Items with no headers will always return false.
@param position of the list item in questions
@param isRever... | java | public boolean hasNewHeader(int position, boolean isReverseLayout) {
if (indexOutOfBounds(position)) {
return false;
}
long headerId = mAdapter.getHeaderId(position);
if (headerId < 0) {
return false;
}
long nextItemHeaderId = -1;
int nextItemPosition = position + (isReverseLa... | [
"public",
"boolean",
"hasNewHeader",
"(",
"int",
"position",
",",
"boolean",
"isReverseLayout",
")",
"{",
"if",
"(",
"indexOutOfBounds",
"(",
"position",
")",
")",
"{",
"return",
"false",
";",
"}",
"long",
"headerId",
"=",
"mAdapter",
".",
"getHeaderId",
"("... | Determines if an item in the list should have a header that is different than the item in the
list that immediately precedes it. Items with no headers will always return false.
@param position of the list item in questions
@param isReverseLayout TRUE if layout manager has flag isReverseLayout
@return true if this item... | [
"Determines",
"if",
"an",
"item",
"in",
"the",
"list",
"should",
"have",
"a",
"header",
"that",
"is",
"different",
"than",
"the",
"item",
"in",
"the",
"list",
"that",
"immediately",
"precedes",
"it",
".",
"Items",
"with",
"no",
"headers",
"will",
"always",... | train | https://github.com/timehop/sticky-headers-recyclerview/blob/f5a9e9b8f5d96734e20439b0a41381865fa52fb7/library/src/main/java/com/timehop/stickyheadersrecyclerview/HeaderPositionCalculator.java#L72-L91 |
FudanNLP/fnlp | fnlp-core/src/main/java/org/fnlp/ml/classifier/LinkedPredict.java | LinkedPredict.add | public int add(T label,float score) {
"""
增加新的标签和得分,并根据得分调整排序 *
@param label 标签
@param score 得分
@return 插入位置
"""
int j = 0;
for(; j < labels.size(); j++)
if(scores.get(j) < score){
labels.add(j, label);
scores.add(j,score);
break;
}
if(j == labels.size() && labels.size()... | java | public int add(T label,float score) {
int j = 0;
for(; j < labels.size(); j++)
if(scores.get(j) < score){
labels.add(j, label);
scores.add(j,score);
break;
}
if(j == labels.size() && labels.size() < k){
labels.add(j, label);
scores.add(j,score);
}
if(labels.size() > k... | [
"public",
"int",
"add",
"(",
"T",
"label",
",",
"float",
"score",
")",
"{",
"int",
"j",
"=",
"0",
";",
"for",
"(",
";",
"j",
"<",
"labels",
".",
"size",
"(",
")",
";",
"j",
"++",
")",
"if",
"(",
"scores",
".",
"get",
"(",
"j",
")",
"<",
"... | 增加新的标签和得分,并根据得分调整排序 *
@param label 标签
@param score 得分
@return 插入位置 | [
"增加新的标签和得分,并根据得分调整排序",
"*"
] | train | https://github.com/FudanNLP/fnlp/blob/ce258f3e4a5add2ba0b5e4cbac7cab2190af6659/fnlp-core/src/main/java/org/fnlp/ml/classifier/LinkedPredict.java#L84-L104 |
unic/neba | core/src/main/java/io/neba/core/resourcemodels/mapping/FieldValueMappingCallback.java | FieldValueMappingCallback.applyCustomMappings | @SuppressWarnings("unchecked")
private Object applyCustomMappings(FieldData fieldData, final Object value) {
"""
Applies all {@link AnnotatedFieldMapper registered field mappers}
to the provided value and returns the result.
"""
Object result = value;
for (final AnnotationMapping mapping :... | java | @SuppressWarnings("unchecked")
private Object applyCustomMappings(FieldData fieldData, final Object value) {
Object result = value;
for (final AnnotationMapping mapping : this.annotatedFieldMappers.get(fieldData.metaData)) {
result = mapping.getMapper().map(new OngoingFieldMapping(this.m... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Object",
"applyCustomMappings",
"(",
"FieldData",
"fieldData",
",",
"final",
"Object",
"value",
")",
"{",
"Object",
"result",
"=",
"value",
";",
"for",
"(",
"final",
"AnnotationMapping",
"mapping",
... | Applies all {@link AnnotatedFieldMapper registered field mappers}
to the provided value and returns the result. | [
"Applies",
"all",
"{"
] | train | https://github.com/unic/neba/blob/4d762e60112a1fcb850926a56a9843d5aa424c4b/core/src/main/java/io/neba/core/resourcemodels/mapping/FieldValueMappingCallback.java#L176-L183 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java | ListManagementImagesImpl.addImageFileInput | public Image addImageFileInput(String listId, byte[] imageStream, AddImageFileInputOptionalParameter addImageFileInputOptionalParameter) {
"""
Add an image to the list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param imageStream The image file.
@param addImageFileInputOpti... | java | public Image addImageFileInput(String listId, byte[] imageStream, AddImageFileInputOptionalParameter addImageFileInputOptionalParameter) {
return addImageFileInputWithServiceResponseAsync(listId, imageStream, addImageFileInputOptionalParameter).toBlocking().single().body();
} | [
"public",
"Image",
"addImageFileInput",
"(",
"String",
"listId",
",",
"byte",
"[",
"]",
"imageStream",
",",
"AddImageFileInputOptionalParameter",
"addImageFileInputOptionalParameter",
")",
"{",
"return",
"addImageFileInputWithServiceResponseAsync",
"(",
"listId",
",",
"imag... | Add an image to the list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param imageStream The image file.
@param addImageFileInputOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fa... | [
"Add",
"an",
"image",
"to",
"the",
"list",
"with",
"list",
"Id",
"equal",
"to",
"list",
"Id",
"passed",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java#L702-L704 |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/UserService.java | UserService.retrieveAuthenticatedUser | public ModeledAuthenticatedUser retrieveAuthenticatedUser(AuthenticationProvider authenticationProvider,
Credentials credentials) throws GuacamoleException {
"""
Retrieves the user corresponding to the given credentials from the
database. Note that this function will not enforce any additional
accoun... | java | public ModeledAuthenticatedUser retrieveAuthenticatedUser(AuthenticationProvider authenticationProvider,
Credentials credentials) throws GuacamoleException {
// Get username and password
String username = credentials.getUsername();
String password = credentials.getPassword();
... | [
"public",
"ModeledAuthenticatedUser",
"retrieveAuthenticatedUser",
"(",
"AuthenticationProvider",
"authenticationProvider",
",",
"Credentials",
"credentials",
")",
"throws",
"GuacamoleException",
"{",
"// Get username and password",
"String",
"username",
"=",
"credentials",
".",
... | Retrieves the user corresponding to the given credentials from the
database. Note that this function will not enforce any additional
account restrictions, including explicitly disabled accounts,
scheduling, and password expiration. It is the responsibility of the
caller to enforce such restrictions, if desired.
@param... | [
"Retrieves",
"the",
"user",
"corresponding",
"to",
"the",
"given",
"credentials",
"from",
"the",
"database",
".",
"Note",
"that",
"this",
"function",
"will",
"not",
"enforce",
"any",
"additional",
"account",
"restrictions",
"including",
"explicitly",
"disabled",
"... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/UserService.java#L357-L381 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/AbstractGeneratedSQLTransform.java | AbstractGeneratedSQLTransform.generateWriteParam2ContentValues | @Override
public void generateWriteParam2ContentValues(Builder methodBuilder, SQLiteModelMethod method, String paramName, TypeName paramTypeName, ModelProperty property) {
"""
/* (non-Javadoc)
@see com.abubusoft.kripton.processor.sqlite.transform.AbstractSQLTransform#generateWriteParam2ContentValues(com.squareup... | java | @Override
public void generateWriteParam2ContentValues(Builder methodBuilder, SQLiteModelMethod method, String paramName, TypeName paramTypeName, ModelProperty property) {
String methodName = method.getParent().generateJava2ContentSerializer(paramTypeName);
methodBuilder.addCode("$L($L)", methodName, paramName);... | [
"@",
"Override",
"public",
"void",
"generateWriteParam2ContentValues",
"(",
"Builder",
"methodBuilder",
",",
"SQLiteModelMethod",
"method",
",",
"String",
"paramName",
",",
"TypeName",
"paramTypeName",
",",
"ModelProperty",
"property",
")",
"{",
"String",
"methodName",
... | /* (non-Javadoc)
@see com.abubusoft.kripton.processor.sqlite.transform.AbstractSQLTransform#generateWriteParam2ContentValues(com.squareup.javapoet.MethodSpec.Builder, com.abubusoft.kripton.processor.sqlite.model.SQLiteModelMethod, java.lang.String, com.squareup.javapoet.TypeName, com.abubusoft.kripton.processor.core.Mo... | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/AbstractGeneratedSQLTransform.java#L49-L54 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java | ST_RemoveRepeatedPoints.removeDuplicateCoordinates | public static MultiPolygon removeDuplicateCoordinates(MultiPolygon multiPolygon, double tolerance) throws SQLException {
"""
Removes duplicated coordinates within a MultiPolygon.
@param multiPolygon
@param tolerance to delete the coordinates
@return
@throws java.sql.SQLException
"""
ArrayList<Pol... | java | public static MultiPolygon removeDuplicateCoordinates(MultiPolygon multiPolygon, double tolerance) throws SQLException {
ArrayList<Polygon> polys = new ArrayList<Polygon>();
for (int i = 0; i < multiPolygon.getNumGeometries(); i++) {
Polygon poly = (Polygon) multiPolygon.getGeometryN(i);
... | [
"public",
"static",
"MultiPolygon",
"removeDuplicateCoordinates",
"(",
"MultiPolygon",
"multiPolygon",
",",
"double",
"tolerance",
")",
"throws",
"SQLException",
"{",
"ArrayList",
"<",
"Polygon",
">",
"polys",
"=",
"new",
"ArrayList",
"<",
"Polygon",
">",
"(",
")"... | Removes duplicated coordinates within a MultiPolygon.
@param multiPolygon
@param tolerance to delete the coordinates
@return
@throws java.sql.SQLException | [
"Removes",
"duplicated",
"coordinates",
"within",
"a",
"MultiPolygon",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java#L179-L186 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jaas.common/src/com/ibm/ws/security/jaas/common/internal/JAASLoginModuleConfigImpl.java | JAASLoginModuleConfigImpl.processConfigProps | private void processConfigProps(Map<String, Object> props) {
"""
Process the properties from the server.xml/client.xml
@param props
"""
controlFlag = setControlFlag(moduleConfig.controlFlag());
Map<String, Object> options = extractOptions(props);
String originalLoginModuleClassName ... | java | private void processConfigProps(Map<String, Object> props) {
controlFlag = setControlFlag(moduleConfig.controlFlag());
Map<String, Object> options = extractOptions(props);
String originalLoginModuleClassName = moduleConfig.className();
if (isDefaultLoginModule()) {
String ta... | [
"private",
"void",
"processConfigProps",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"{",
"controlFlag",
"=",
"setControlFlag",
"(",
"moduleConfig",
".",
"controlFlag",
"(",
")",
")",
";",
"Map",
"<",
"String",
",",
"Object",
">",
"options... | Process the properties from the server.xml/client.xml
@param props | [
"Process",
"the",
"properties",
"from",
"the",
"server",
".",
"xml",
"/",
"client",
".",
"xml"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jaas.common/src/com/ibm/ws/security/jaas/common/internal/JAASLoginModuleConfigImpl.java#L84-L97 |
code4everything/util | src/main/java/com/zhazhapan/util/MailSender.java | MailSender.config | public static void config(MailHost mailHost, String personal, String from, String key) {
"""
配置邮箱
@param mailHost 邮件服务器
@param personal 个人名称
@param from 发件箱
@param key 密码
"""
setHost(mailHost);
setPersonal(personal);
setFrom(from);
setKey(key);
} | java | public static void config(MailHost mailHost, String personal, String from, String key) {
setHost(mailHost);
setPersonal(personal);
setFrom(from);
setKey(key);
} | [
"public",
"static",
"void",
"config",
"(",
"MailHost",
"mailHost",
",",
"String",
"personal",
",",
"String",
"from",
",",
"String",
"key",
")",
"{",
"setHost",
"(",
"mailHost",
")",
";",
"setPersonal",
"(",
"personal",
")",
";",
"setFrom",
"(",
"from",
"... | 配置邮箱
@param mailHost 邮件服务器
@param personal 个人名称
@param from 发件箱
@param key 密码 | [
"配置邮箱"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/MailSender.java#L106-L111 |
ktoso/janbanery | janbanery-android/src/main/java/pl/project13/janbanery/android/util/Strings.java | Strings.joinAnd | public static <T> String joinAnd(final String delimiter, final String lastDelimiter, final Collection<T> objs) {
"""
Like join, but allows for a distinct final delimiter. For english sentences such
as "Alice, Bob and Charlie" use ", " and " and " as the delimiters.
@param delimiter usually ", "
@param la... | java | public static <T> String joinAnd(final String delimiter, final String lastDelimiter, final Collection<T> objs) {
if (objs == null || objs.isEmpty()) {
return "";
}
final Iterator<T> iter = objs.iterator();
final StringBuffer buffer = new StringBuffer(Strings.toString(iter.next()));
int i = 1;... | [
"public",
"static",
"<",
"T",
">",
"String",
"joinAnd",
"(",
"final",
"String",
"delimiter",
",",
"final",
"String",
"lastDelimiter",
",",
"final",
"Collection",
"<",
"T",
">",
"objs",
")",
"{",
"if",
"(",
"objs",
"==",
"null",
"||",
"objs",
".",
"isEm... | Like join, but allows for a distinct final delimiter. For english sentences such
as "Alice, Bob and Charlie" use ", " and " and " as the delimiters.
@param delimiter usually ", "
@param lastDelimiter usually " and "
@param objs the objects
@param <T> the type
@return a string | [
"Like",
"join",
"but",
"allows",
"for",
"a",
"distinct",
"final",
"delimiter",
".",
"For",
"english",
"sentences",
"such",
"as",
"Alice",
"Bob",
"and",
"Charlie",
"use",
"and",
"and",
"as",
"the",
"delimiters",
"."
] | train | https://github.com/ktoso/janbanery/blob/cd77b774814c7fbb2a0c9c55d4c3f7e76affa636/janbanery-android/src/main/java/pl/project13/janbanery/android/util/Strings.java#L28-L43 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeTraversal.java | NodeTraversal.traverseWithScope | void traverseWithScope(Node root, AbstractScope<?, ?> s) {
"""
Traverses a parse tree recursively with a scope, starting with the given
root. This should only be used in the global scope or module scopes. Otherwise, use
{@link #traverseAtScope}.
"""
checkState(s.isGlobal() || s.isModuleScope(), s);
t... | java | void traverseWithScope(Node root, AbstractScope<?, ?> s) {
checkState(s.isGlobal() || s.isModuleScope(), s);
try {
initTraversal(root);
curNode = root;
pushScope(s);
traverseBranch(root, null);
popScope();
} catch (Error | Exception unexpectedException) {
throwUnexpectedE... | [
"void",
"traverseWithScope",
"(",
"Node",
"root",
",",
"AbstractScope",
"<",
"?",
",",
"?",
">",
"s",
")",
"{",
"checkState",
"(",
"s",
".",
"isGlobal",
"(",
")",
"||",
"s",
".",
"isModuleScope",
"(",
")",
",",
"s",
")",
";",
"try",
"{",
"initTrave... | Traverses a parse tree recursively with a scope, starting with the given
root. This should only be used in the global scope or module scopes. Otherwise, use
{@link #traverseAtScope}. | [
"Traverses",
"a",
"parse",
"tree",
"recursively",
"with",
"a",
"scope",
"starting",
"with",
"the",
"given",
"root",
".",
"This",
"should",
"only",
"be",
"used",
"in",
"the",
"global",
"scope",
"or",
"module",
"scopes",
".",
"Otherwise",
"use",
"{"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeTraversal.java#L438-L449 |
netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.containsAllContentEqualsIgnoreCase | public static boolean containsAllContentEqualsIgnoreCase(Collection<CharSequence> a, Collection<CharSequence> b) {
"""
Determine if {@code a} contains all of the values in {@code b} using
{@link #contentEqualsIgnoreCase(CharSequence, CharSequence)} to compare values.
@param a The collection under test.
@param b... | java | public static boolean containsAllContentEqualsIgnoreCase(Collection<CharSequence> a, Collection<CharSequence> b) {
for (CharSequence v : b) {
if (!containsContentEqualsIgnoreCase(a, v)) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"containsAllContentEqualsIgnoreCase",
"(",
"Collection",
"<",
"CharSequence",
">",
"a",
",",
"Collection",
"<",
"CharSequence",
">",
"b",
")",
"{",
"for",
"(",
"CharSequence",
"v",
":",
"b",
")",
"{",
"if",
"(",
"!",
"containsC... | Determine if {@code a} contains all of the values in {@code b} using
{@link #contentEqualsIgnoreCase(CharSequence, CharSequence)} to compare values.
@param a The collection under test.
@param b The values to test for.
@return {@code true} if {@code a} contains all of the values in {@code b} using
{@link #contentEqualsI... | [
"Determine",
"if",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L1490-L1497 |
kuujo/vertigo | core/src/main/java/net/kuujo/vertigo/Vertigo.java | Vertigo.deployCluster | public Vertigo deployCluster(String cluster, String group, int nodes) {
"""
Deploys multiple cluster nodes to a specific cluster group.
@param cluster The cluster event bus address.
@param group The cluster group to which to deploy the nodes.
@param nodes The number of nodes to deploy.
@return The Vertigo in... | java | public Vertigo deployCluster(String cluster, String group, int nodes) {
return deployCluster(cluster, group, nodes, null);
} | [
"public",
"Vertigo",
"deployCluster",
"(",
"String",
"cluster",
",",
"String",
"group",
",",
"int",
"nodes",
")",
"{",
"return",
"deployCluster",
"(",
"cluster",
",",
"group",
",",
"nodes",
",",
"null",
")",
";",
"}"
] | Deploys multiple cluster nodes to a specific cluster group.
@param cluster The cluster event bus address.
@param group The cluster group to which to deploy the nodes.
@param nodes The number of nodes to deploy.
@return The Vertigo instance. | [
"Deploys",
"multiple",
"cluster",
"nodes",
"to",
"a",
"specific",
"cluster",
"group",
"."
] | train | https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/Vertigo.java#L260-L262 |
ops4j/org.ops4j.pax.logging | pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/appender/PaxOsgiAppender.java | PaxOsgiAppender.createAppender | @PluginFactory
public static PaxOsgiAppender createAppender(
// @formatter:off
@PluginAttribute("name") final String name,
@PluginAttribute("filter") final String filter,
@PluginConfiguration final Configuration config) {
"""
Create a Pax Osgi Appender.
@param n... | java | @PluginFactory
public static PaxOsgiAppender createAppender(
// @formatter:off
@PluginAttribute("name") final String name,
@PluginAttribute("filter") final String filter,
@PluginConfiguration final Configuration config) {
// @formatter:on
if (name... | [
"@",
"PluginFactory",
"public",
"static",
"PaxOsgiAppender",
"createAppender",
"(",
"// @formatter:off",
"@",
"PluginAttribute",
"(",
"\"name\"",
")",
"final",
"String",
"name",
",",
"@",
"PluginAttribute",
"(",
"\"filter\"",
")",
"final",
"String",
"filter",
",",
... | Create a Pax Osgi Appender.
@param name The name of the Appender.
@param filter defaults to "*", can be any string that works as a value in {@link org.osgi.framework.Filter}
@param config The Configuration
@return The FileAppender. | [
"Create",
"a",
"Pax",
"Osgi",
"Appender",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/appender/PaxOsgiAppender.java#L93-L106 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/message/process/TrxMessageListener.java | TrxMessageListener.handleMessage | public int handleMessage(BaseMessage message) {
"""
Handle this message.
Get the name of this process and run it.
"""
String strClassName = this.getMessageProcessorClassName(message);
if ((strClassName == null) || (strClassName.length() == 0))
return this.handleOtherMessage(message... | java | public int handleMessage(BaseMessage message)
{
String strClassName = this.getMessageProcessorClassName(message);
if ((strClassName == null) || (strClassName.length() == 0))
return this.handleOtherMessage(message);
message.consume(); // I'll be handling this one.
Str... | [
"public",
"int",
"handleMessage",
"(",
"BaseMessage",
"message",
")",
"{",
"String",
"strClassName",
"=",
"this",
".",
"getMessageProcessorClassName",
"(",
"message",
")",
";",
"if",
"(",
"(",
"strClassName",
"==",
"null",
")",
"||",
"(",
"strClassName",
".",
... | Handle this message.
Get the name of this process and run it. | [
"Handle",
"this",
"message",
".",
"Get",
"the",
"name",
"of",
"this",
"process",
"and",
"run",
"it",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/message/process/TrxMessageListener.java#L97-L112 |
apiman/apiman | gateway/engine/redis/src/main/java/io/apiman/gateway/engine/redis/common/RedisBackingStore.java | RedisBackingStore.onMap | private <T> T onMap(Function<RMap<String, String>, T> func) {
"""
Pass an {@link RMap} to the function and return its result.
@param func the function to apply using the {@link RMap}
@return the result
"""
final RMap<String, String> map = client.getMap(prefix);
return func.apply(map);
} | java | private <T> T onMap(Function<RMap<String, String>, T> func) {
final RMap<String, String> map = client.getMap(prefix);
return func.apply(map);
} | [
"private",
"<",
"T",
">",
"T",
"onMap",
"(",
"Function",
"<",
"RMap",
"<",
"String",
",",
"String",
">",
",",
"T",
">",
"func",
")",
"{",
"final",
"RMap",
"<",
"String",
",",
"String",
">",
"map",
"=",
"client",
".",
"getMap",
"(",
"prefix",
")",... | Pass an {@link RMap} to the function and return its result.
@param func the function to apply using the {@link RMap}
@return the result | [
"Pass",
"an",
"{",
"@link",
"RMap",
"}",
"to",
"the",
"function",
"and",
"return",
"its",
"result",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/redis/src/main/java/io/apiman/gateway/engine/redis/common/RedisBackingStore.java#L50-L53 |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/Context.java | Context.handleRequest | void handleRequest(final ModClusterProxyTarget target, final HttpServerExchange exchange, final ProxyCallback<ProxyConnection> callback, long timeout, TimeUnit timeUnit, boolean exclusive) {
"""
Handle a proxy request for this context.
@param target the proxy target
@param exchange the http server ex... | java | void handleRequest(final ModClusterProxyTarget target, final HttpServerExchange exchange, final ProxyCallback<ProxyConnection> callback, long timeout, TimeUnit timeUnit, boolean exclusive) {
if (addRequest()) {
exchange.addExchangeCompleteListener(new ExchangeCompletionListener() {
@... | [
"void",
"handleRequest",
"(",
"final",
"ModClusterProxyTarget",
"target",
",",
"final",
"HttpServerExchange",
"exchange",
",",
"final",
"ProxyCallback",
"<",
"ProxyConnection",
">",
"callback",
",",
"long",
"timeout",
",",
"TimeUnit",
"timeUnit",
",",
"boolean",
"ex... | Handle a proxy request for this context.
@param target the proxy target
@param exchange the http server exchange
@param callback the proxy callback
@param timeout the timeout
@param timeUnit the time unit
@param exclusive whether this connection is exclusive | [
"Handle",
"a",
"proxy",
"request",
"for",
"this",
"context",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/Context.java#L170-L183 |
entrusc/xdata | src/main/java/com/moebiusgames/xdata/XData.java | XData.marshalObject | private static DataNode marshalObject(Map<String, AbstractDataMarshaller<?>> marshallerMap, Object object) {
"""
wraps an deSerializedObject using the data marshaller for that given deSerializedObject
@param marshallerMap
@param object
@return
"""
//can't be null here because it is not resolved: m... | java | private static DataNode marshalObject(Map<String, AbstractDataMarshaller<?>> marshallerMap, Object object) {
//can't be null here because it is not resolved: meaning, it is an instance of an unknown class
final Class<?> clazz = object.getClass();
final AbstractDataMarshaller<Object> serializer ... | [
"private",
"static",
"DataNode",
"marshalObject",
"(",
"Map",
"<",
"String",
",",
"AbstractDataMarshaller",
"<",
"?",
">",
">",
"marshallerMap",
",",
"Object",
"object",
")",
"{",
"//can't be null here because it is not resolved: meaning, it is an instance of an unknown class... | wraps an deSerializedObject using the data marshaller for that given deSerializedObject
@param marshallerMap
@param object
@return | [
"wraps",
"an",
"deSerializedObject",
"using",
"the",
"data",
"marshaller",
"for",
"that",
"given",
"deSerializedObject"
] | train | https://github.com/entrusc/xdata/blob/44ba4c59fd639c99b89fc8995ba83fe89ca4239d/src/main/java/com/moebiusgames/xdata/XData.java#L1192-L1203 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/DataCubeAPI.java | DataCubeAPI.getweanalysisappidvisitdistribution | public static VisitdistributionResult getweanalysisappidvisitdistribution(String access_token, String begin_date,String end_date) {
"""
访问分布 (小程序)<br>
@param access_token access_token
@param begin_date begin_date
@param end_date end_date
@return result
@since 2.8.9
"""
String requestJson = String.forma... | java | public static VisitdistributionResult getweanalysisappidvisitdistribution(String access_token, String begin_date,String end_date) {
String requestJson = String.format("{\"begin_date\":\"%s\",\"end_date\":\"%s\"}", begin_date,end_date);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHead... | [
"public",
"static",
"VisitdistributionResult",
"getweanalysisappidvisitdistribution",
"(",
"String",
"access_token",
",",
"String",
"begin_date",
",",
"String",
"end_date",
")",
"{",
"String",
"requestJson",
"=",
"String",
".",
"format",
"(",
"\"{\\\"begin_date\\\":\\\"%s... | 访问分布 (小程序)<br>
@param access_token access_token
@param begin_date begin_date
@param end_date end_date
@return result
@since 2.8.9 | [
"访问分布",
"(",
"小程序",
")",
"<br",
">"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/DataCubeAPI.java#L558-L567 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java | CPAttachmentFileEntryPersistenceImpl.removeByUuid_C | @Override
public void removeByUuid_C(String uuid, long companyId) {
"""
Removes all the cp attachment file entries where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID
"""
for (CPAttachmentFileEntry cpAttachmentFileEntry : findByUuid_C(uuid,
... | java | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPAttachmentFileEntry cpAttachmentFileEntry : findByUuid_C(uuid,
companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpAttachmentFileEntry);
}
} | [
"@",
"Override",
"public",
"void",
"removeByUuid_C",
"(",
"String",
"uuid",
",",
"long",
"companyId",
")",
"{",
"for",
"(",
"CPAttachmentFileEntry",
"cpAttachmentFileEntry",
":",
"findByUuid_C",
"(",
"uuid",
",",
"companyId",
",",
"QueryUtil",
".",
"ALL_POS",
",... | Removes all the cp attachment file entries where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID | [
"Removes",
"all",
"the",
"cp",
"attachment",
"file",
"entries",
"where",
"uuid",
"=",
"?",
";",
"and",
"companyId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java#L1416-L1422 |
netty/netty | common/src/main/java/io/netty/util/NetUtil.java | NetUtil.toAddressString | public static String toAddressString(InetAddress ip, boolean ipv4Mapped) {
"""
Returns the {@link String} representation of an {@link InetAddress}.
<ul>
<li>Inet4Address results are identical to {@link InetAddress#getHostAddress()}</li>
<li>Inet6Address results adhere to
<a href="http://tools.ietf.org/html/rfc... | java | public static String toAddressString(InetAddress ip, boolean ipv4Mapped) {
if (ip instanceof Inet4Address) {
return ip.getHostAddress();
}
if (!(ip instanceof Inet6Address)) {
throw new IllegalArgumentException("Unhandled type: " + ip);
}
return toAddress... | [
"public",
"static",
"String",
"toAddressString",
"(",
"InetAddress",
"ip",
",",
"boolean",
"ipv4Mapped",
")",
"{",
"if",
"(",
"ip",
"instanceof",
"Inet4Address",
")",
"{",
"return",
"ip",
".",
"getHostAddress",
"(",
")",
";",
"}",
"if",
"(",
"!",
"(",
"i... | Returns the {@link String} representation of an {@link InetAddress}.
<ul>
<li>Inet4Address results are identical to {@link InetAddress#getHostAddress()}</li>
<li>Inet6Address results adhere to
<a href="http://tools.ietf.org/html/rfc5952#section-4">rfc 5952 section 4</a> if
{@code ipv4Mapped} is false. If {@code ipv4Ma... | [
"Returns",
"the",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/NetUtil.java#L1017-L1026 |
bazaarvoice/emodb | common/uuid/src/main/java/com/bazaarvoice/emodb/common/uuid/TimeUUIDs.java | TimeUUIDs.uuidForTimeMillis | public static UUID uuidForTimeMillis(long timeMillis, int sequence) {
"""
Fabricates a non-unique UUID value for the specified timestamp that sorts relative to other similar UUIDs based
on the value of {@code sequence}. Be very careful about using this as a unique identifier since the usual
protections against ... | java | public static UUID uuidForTimeMillis(long timeMillis, int sequence) {
long time = getRawTimestamp(timeMillis);
return new UUID(getMostSignificantBits(time), getLeastSignificantBits(sequence, 0));
} | [
"public",
"static",
"UUID",
"uuidForTimeMillis",
"(",
"long",
"timeMillis",
",",
"int",
"sequence",
")",
"{",
"long",
"time",
"=",
"getRawTimestamp",
"(",
"timeMillis",
")",
";",
"return",
"new",
"UUID",
"(",
"getMostSignificantBits",
"(",
"time",
")",
",",
... | Fabricates a non-unique UUID value for the specified timestamp that sorts relative to other similar UUIDs based
on the value of {@code sequence}. Be very careful about using this as a unique identifier since the usual
protections against conflicts do not apply. At most, only assume this is unique within a specific co... | [
"Fabricates",
"a",
"non",
"-",
"unique",
"UUID",
"value",
"for",
"the",
"specified",
"timestamp",
"that",
"sorts",
"relative",
"to",
"other",
"similar",
"UUIDs",
"based",
"on",
"the",
"value",
"of",
"{"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/uuid/src/main/java/com/bazaarvoice/emodb/common/uuid/TimeUUIDs.java#L83-L86 |
bazaarvoice/emodb | common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StandardStashReader.java | StandardStashReader.lockToStashCreatedAt | public void lockToStashCreatedAt(Date creationTime)
throws StashNotAvailableException {
"""
This method is like {@link #lockToLatest()} except that the caller requests a specific Stash time.
@throws StashNotAvailableException Thrown if no Stash is available for the given time
"""
String st... | java | public void lockToStashCreatedAt(Date creationTime)
throws StashNotAvailableException {
String stashDirectory = StashUtil.getStashDirectoryForCreationTime(creationTime);
// The following call will raise an AmazonS3Exception if the file cannot be read
try (S3Object s3Object = _s3.getO... | [
"public",
"void",
"lockToStashCreatedAt",
"(",
"Date",
"creationTime",
")",
"throws",
"StashNotAvailableException",
"{",
"String",
"stashDirectory",
"=",
"StashUtil",
".",
"getStashDirectoryForCreationTime",
"(",
"creationTime",
")",
";",
"// The following call will raise an ... | This method is like {@link #lockToLatest()} except that the caller requests a specific Stash time.
@throws StashNotAvailableException Thrown if no Stash is available for the given time | [
"This",
"method",
"is",
"like",
"{"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StandardStashReader.java#L172-L188 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/io/ByteIOUtils.java | ByteIOUtils.readLong | public static long readLong(byte[] buf, int pos) {
"""
Reads a specific long byte value (8 bytes) from the input byte array at the given offset.
@param buf input byte buffer
@param pos offset into the byte buffer to read
@return the long value read
"""
checkBoundary(buf, pos, 8);
return (((long) (... | java | public static long readLong(byte[] buf, int pos) {
checkBoundary(buf, pos, 8);
return (((long) (buf[pos++] & 0xff) << 56) | ((long) (buf[pos++] & 0xff) << 48)
| ((long) (buf[pos++] & 0xff) << 40) | ((long) (buf[pos++] & 0xff) << 32)
| ((long) (buf[pos++] & 0xff) << 24) | ((long) (buf[pos++] & 0x... | [
"public",
"static",
"long",
"readLong",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"pos",
")",
"{",
"checkBoundary",
"(",
"buf",
",",
"pos",
",",
"8",
")",
";",
"return",
"(",
"(",
"(",
"long",
")",
"(",
"buf",
"[",
"pos",
"++",
"]",
"&",
"0xff"... | Reads a specific long byte value (8 bytes) from the input byte array at the given offset.
@param buf input byte buffer
@param pos offset into the byte buffer to read
@return the long value read | [
"Reads",
"a",
"specific",
"long",
"byte",
"value",
"(",
"8",
"bytes",
")",
"from",
"the",
"input",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/ByteIOUtils.java#L95-L101 |
keyboardsurfer/Crouton | library/src/main/java/de/keyboardsurfer/android/widget/crouton/Manager.java | Manager.sendMessageDelayed | private void sendMessageDelayed(Crouton crouton, final int messageId, final long delay) {
"""
Sends a {@link Crouton} within a delayed {@link Message}.
@param crouton
The {@link Crouton} that should be sent.
@param messageId
The {@link Message} id.
@param delay
The delay in milliseconds.
"""
Messag... | java | private void sendMessageDelayed(Crouton crouton, final int messageId, final long delay) {
Message message = obtainMessage(messageId);
message.obj = crouton;
sendMessageDelayed(message, delay);
} | [
"private",
"void",
"sendMessageDelayed",
"(",
"Crouton",
"crouton",
",",
"final",
"int",
"messageId",
",",
"final",
"long",
"delay",
")",
"{",
"Message",
"message",
"=",
"obtainMessage",
"(",
"messageId",
")",
";",
"message",
".",
"obj",
"=",
"crouton",
";",... | Sends a {@link Crouton} within a delayed {@link Message}.
@param crouton
The {@link Crouton} that should be sent.
@param messageId
The {@link Message} id.
@param delay
The delay in milliseconds. | [
"Sends",
"a",
"{",
"@link",
"Crouton",
"}",
"within",
"a",
"delayed",
"{",
"@link",
"Message",
"}",
"."
] | train | https://github.com/keyboardsurfer/Crouton/blob/7806b15e4d52793e1f5aeaa4a55b1e220289e619/library/src/main/java/de/keyboardsurfer/android/widget/crouton/Manager.java#L142-L146 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java | Jar.setOutputStream | public Jar setOutputStream(OutputStream os) {
"""
Sets an {@link OutputStream} to which the JAR will be written.
If used, this method must be called before any entries have been added or the JAR written. Calling this method prevents this
object from using an internal buffer to store the JAR, and therefore, none ... | java | public Jar setOutputStream(OutputStream os) {
if (os == null)
throw new NullPointerException("The OutputStream is null");
if (jos != null)
throw new IllegalStateException("Entries have already been added, the JAR has been written or setOutputStream has already been called.");
... | [
"public",
"Jar",
"setOutputStream",
"(",
"OutputStream",
"os",
")",
"{",
"if",
"(",
"os",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"The OutputStream is null\"",
")",
";",
"if",
"(",
"jos",
"!=",
"null",
")",
"throw",
"new",
"IllegalS... | Sets an {@link OutputStream} to which the JAR will be written.
If used, this method must be called before any entries have been added or the JAR written. Calling this method prevents this
object from using an internal buffer to store the JAR, and therefore, none of the other {@code write} methods can be called.
@param... | [
"Sets",
"an",
"{",
"@link",
"OutputStream",
"}",
"to",
"which",
"the",
"JAR",
"will",
"be",
"written",
".",
"If",
"used",
"this",
"method",
"must",
"be",
"called",
"before",
"any",
"entries",
"have",
"been",
"added",
"or",
"the",
"JAR",
"written",
".",
... | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java#L629-L636 |
kiswanij/jk-util | src/main/java/com/jk/util/JKStringUtil.java | JKStringUtil.removeLast | public static String removeLast(String original, String string) {
"""
This method create nre properties from the origianl one and remove any key
with the password , then call toString method on this prperties.
@param original the original
@param string the string
@return the string
"""
int lastIndex... | java | public static String removeLast(String original, String string) {
int lastIndexOf = original.lastIndexOf(string);
if (lastIndexOf == -1) {
return original;
}
return original.substring(0, lastIndexOf);
} | [
"public",
"static",
"String",
"removeLast",
"(",
"String",
"original",
",",
"String",
"string",
")",
"{",
"int",
"lastIndexOf",
"=",
"original",
".",
"lastIndexOf",
"(",
"string",
")",
";",
"if",
"(",
"lastIndexOf",
"==",
"-",
"1",
")",
"{",
"return",
"o... | This method create nre properties from the origianl one and remove any key
with the password , then call toString method on this prperties.
@param original the original
@param string the string
@return the string | [
"This",
"method",
"create",
"nre",
"properties",
"from",
"the",
"origianl",
"one",
"and",
"remove",
"any",
"key",
"with",
"the",
"password",
"then",
"call",
"toString",
"method",
"on",
"this",
"prperties",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKStringUtil.java#L119-L125 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getTaggedImageCountWithServiceResponseAsync | public Observable<ServiceResponse<Integer>> getTaggedImageCountWithServiceResponseAsync(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) {
"""
Gets the number of images tagged with the provided {tagIds}.
The filtering is on an and/or relationship. For example, if the prov... | java | public Observable<ServiceResponse<Integer>> getTaggedImageCountWithServiceResponseAsync(UUID projectId, GetTaggedImageCountOptionalParameter getTaggedImageCountOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");
... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Integer",
">",
">",
"getTaggedImageCountWithServiceResponseAsync",
"(",
"UUID",
"projectId",
",",
"GetTaggedImageCountOptionalParameter",
"getTaggedImageCountOptionalParameter",
")",
"{",
"if",
"(",
"projectId",
"==",
"n... | Gets the number of images tagged with the provided {tagIds}.
The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and
"Cat" tags, then only images tagged with Dog and/or Cat will be returned.
@param projectId The project id
@param getTaggedImageCountOptionalParameter the o... | [
"Gets",
"the",
"number",
"of",
"images",
"tagged",
"with",
"the",
"provided",
"{",
"tagIds",
"}",
".",
"The",
"filtering",
"is",
"on",
"an",
"and",
"/",
"or",
"relationship",
".",
"For",
"example",
"if",
"the",
"provided",
"tag",
"ids",
"are",
"for",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L4662-L4673 |
eclipse/xtext-core | org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/editor/contentassist/antlr/RequiredRuleNameComputer.java | RequiredRuleNameComputer.isFiltered | protected boolean isFiltered(AbstractElement canddiate, Param param) {
"""
Returns true if the given candidate is a group that is filtered due to rule parameters in the current call graph.
"""
if (canddiate instanceof Group) {
Group group = (Group) canddiate;
if (group.getGuardCondition() != null) {
... | java | protected boolean isFiltered(AbstractElement canddiate, Param param) {
if (canddiate instanceof Group) {
Group group = (Group) canddiate;
if (group.getGuardCondition() != null) {
Set<Parameter> context = param.getAssignedParametes();
ConditionEvaluator evaluator = new ConditionEvaluator(context);
if... | [
"protected",
"boolean",
"isFiltered",
"(",
"AbstractElement",
"canddiate",
",",
"Param",
"param",
")",
"{",
"if",
"(",
"canddiate",
"instanceof",
"Group",
")",
"{",
"Group",
"group",
"=",
"(",
"Group",
")",
"canddiate",
";",
"if",
"(",
"group",
".",
"getGu... | Returns true if the given candidate is a group that is filtered due to rule parameters in the current call graph. | [
"Returns",
"true",
"if",
"the",
"given",
"candidate",
"is",
"a",
"group",
"that",
"is",
"filtered",
"due",
"to",
"rule",
"parameters",
"in",
"the",
"current",
"call",
"graph",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/editor/contentassist/antlr/RequiredRuleNameComputer.java#L198-L210 |
lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.withMessageSerializer | public Descriptor withMessageSerializer(Type messageType, MessageSerializer<?, ?> messageSerializer) {
"""
Provide a custom MessageSerializer for the given message type.
@param messageType The type of the message.
@param messageSerializer The message serializer for that type.
@return A copy of this descriptor... | java | public Descriptor withMessageSerializer(Type messageType, MessageSerializer<?, ?> messageSerializer) {
return replaceAllMessageSerializers(messageSerializers.plus(messageType, messageSerializer));
} | [
"public",
"Descriptor",
"withMessageSerializer",
"(",
"Type",
"messageType",
",",
"MessageSerializer",
"<",
"?",
",",
"?",
">",
"messageSerializer",
")",
"{",
"return",
"replaceAllMessageSerializers",
"(",
"messageSerializers",
".",
"plus",
"(",
"messageType",
",",
... | Provide a custom MessageSerializer for the given message type.
@param messageType The type of the message.
@param messageSerializer The message serializer for that type.
@return A copy of this descriptor. | [
"Provide",
"a",
"custom",
"MessageSerializer",
"for",
"the",
"given",
"message",
"type",
"."
] | train | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L700-L702 |
jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessage.java | BaseMessage.init | public void init(BaseMessageHeader messageHeader, Object data) {
"""
Constructor.
@param messageHeader The message header which contains information such as destination and type.
@param data This properties object is a default way to pass messages.
"""
m_messageDataDesc = null;
m_externalMess... | java | public void init(BaseMessageHeader messageHeader, Object data)
{
m_messageDataDesc = null;
m_externalMessage = null;
m_messageHeader = messageHeader;
this.setData(data);
m_bIsConsumed = false;
} | [
"public",
"void",
"init",
"(",
"BaseMessageHeader",
"messageHeader",
",",
"Object",
"data",
")",
"{",
"m_messageDataDesc",
"=",
"null",
";",
"m_externalMessage",
"=",
"null",
";",
"m_messageHeader",
"=",
"messageHeader",
";",
"this",
".",
"setData",
"(",
"data",... | Constructor.
@param messageHeader The message header which contains information such as destination and type.
@param data This properties object is a default way to pass messages. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessage.java#L99-L107 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataPropertyRangeAxiomImpl_CustomFieldSerializer.java | OWLDataPropertyRangeAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataPropertyRangeAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataPropertyRangeAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDataPropertyRangeAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataPropertyRangeAxiomImpl_CustomFieldSerializer.java#L99-L102 |
GerdHolz/TOVAL | src/de/invation/code/toval/graphic/ui/VerticalLabelUI.java | VerticalLabelUI.paint | @Override
public void paint(Graphics g, JComponent c) {
"""
Transforms the Graphics for vertical rendering and invokes the
super method.
"""
Graphics2D g2 = (Graphics2D) g.create();
if (clockwiseRotation) {
g2.rotate(Math.PI / 2, c.getSize().width / 2, c.getSize().width / 2);
} e... | java | @Override
public void paint(Graphics g, JComponent c) {
Graphics2D g2 = (Graphics2D) g.create();
if (clockwiseRotation) {
g2.rotate(Math.PI / 2, c.getSize().width / 2, c.getSize().width / 2);
} else {
g2.rotate(-Math.PI / 2, c.getSize().height / 2, c.getSize().height / 2);
}... | [
"@",
"Override",
"public",
"void",
"paint",
"(",
"Graphics",
"g",
",",
"JComponent",
"c",
")",
"{",
"Graphics2D",
"g2",
"=",
"(",
"Graphics2D",
")",
"g",
".",
"create",
"(",
")",
";",
"if",
"(",
"clockwiseRotation",
")",
"{",
"g2",
".",
"rotate",
"("... | Transforms the Graphics for vertical rendering and invokes the
super method. | [
"Transforms",
"the",
"Graphics",
"for",
"vertical",
"rendering",
"and",
"invokes",
"the",
"super",
"method",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/ui/VerticalLabelUI.java#L113-L122 |
wdullaer/SwipeActionAdapter | library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java | SwipeActionAdapter.onAction | @Override
public void onAction(ListView listView, int[] position, SwipeDirection[] direction) {
"""
SwipeActionTouchListener.ActionCallbacks callback
We just link it through to our own interface
@param listView The originating {@link ListView}.
@param position The positions to perform the action on, sorte... | java | @Override
public void onAction(ListView listView, int[] position, SwipeDirection[] direction){
if(mSwipeActionListener != null) mSwipeActionListener.onSwipe(position, direction);
} | [
"@",
"Override",
"public",
"void",
"onAction",
"(",
"ListView",
"listView",
",",
"int",
"[",
"]",
"position",
",",
"SwipeDirection",
"[",
"]",
"direction",
")",
"{",
"if",
"(",
"mSwipeActionListener",
"!=",
"null",
")",
"mSwipeActionListener",
".",
"onSwipe",
... | SwipeActionTouchListener.ActionCallbacks callback
We just link it through to our own interface
@param listView The originating {@link ListView}.
@param position The positions to perform the action on, sorted in descending order
for convenience.
@param direction The type of swipe that triggered the action. | [
"SwipeActionTouchListener",
".",
"ActionCallbacks",
"callback",
"We",
"just",
"link",
"it",
"through",
"to",
"our",
"own",
"interface"
] | train | https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java#L105-L108 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java | NameNode.adjustMetaDirectoryNames | protected static void adjustMetaDirectoryNames(Configuration conf, String serviceKey) {
"""
Append service name to each meta directory name
@param conf configuration of NameNode
@param serviceKey the non-empty name of the name node service
"""
adjustMetaDirectoryName(conf, DFS_NAMENODE_NAME_DIR_KEY, se... | java | protected static void adjustMetaDirectoryNames(Configuration conf, String serviceKey) {
adjustMetaDirectoryName(conf, DFS_NAMENODE_NAME_DIR_KEY, serviceKey);
adjustMetaDirectoryName(conf, DFS_NAMENODE_EDITS_DIR_KEY, serviceKey);
adjustMetaDirectoryName(conf, DFS_NAMENODE_CHECKPOINT_DIR_KEY, serviceKey);
... | [
"protected",
"static",
"void",
"adjustMetaDirectoryNames",
"(",
"Configuration",
"conf",
",",
"String",
"serviceKey",
")",
"{",
"adjustMetaDirectoryName",
"(",
"conf",
",",
"DFS_NAMENODE_NAME_DIR_KEY",
",",
"serviceKey",
")",
";",
"adjustMetaDirectoryName",
"(",
"conf",... | Append service name to each meta directory name
@param conf configuration of NameNode
@param serviceKey the non-empty name of the name node service | [
"Append",
"service",
"name",
"to",
"each",
"meta",
"directory",
"name"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java#L570-L576 |
alkacon/opencms-core | src/org/opencms/acacia/shared/CmsEntity.java | CmsEntity.removeAttributeValue | public void removeAttributeValue(String attributeName, int index) {
"""
Removes a specific attribute value.<p>
@param attributeName the attribute name
@param index the value index
"""
if (m_simpleAttributes.containsKey(attributeName)) {
List<String> values = m_simpleAttributes.get(a... | java | public void removeAttributeValue(String attributeName, int index) {
if (m_simpleAttributes.containsKey(attributeName)) {
List<String> values = m_simpleAttributes.get(attributeName);
if ((values.size() == 1) && (index == 0)) {
removeAttributeSilent(attributeName);
... | [
"public",
"void",
"removeAttributeValue",
"(",
"String",
"attributeName",
",",
"int",
"index",
")",
"{",
"if",
"(",
"m_simpleAttributes",
".",
"containsKey",
"(",
"attributeName",
")",
")",
"{",
"List",
"<",
"String",
">",
"values",
"=",
"m_simpleAttributes",
... | Removes a specific attribute value.<p>
@param attributeName the attribute name
@param index the value index | [
"Removes",
"a",
"specific",
"attribute",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/acacia/shared/CmsEntity.java#L556-L575 |
alkacon/opencms-core | src/org/opencms/ui/components/fileselect/CmsResourceTreeContainer.java | CmsResourceTreeContainer.addTreeItem | public void addTreeItem(CmsObject cms, CmsResource resource, CmsUUID parentId) {
"""
Adds an item to the folder tree.<p>
@param cms the CMS context
@param resource the folder resource
@param parentId the parent folder id
"""
List<Container.Filter> filters = Lists.newArrayList(getContainerFilters(... | java | public void addTreeItem(CmsObject cms, CmsResource resource, CmsUUID parentId) {
List<Container.Filter> filters = Lists.newArrayList(getContainerFilters());
// getItem only finds an existing item if it isn't filtered out by the container
// filters, so we temporarily remove the filters to acce... | [
"public",
"void",
"addTreeItem",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"CmsUUID",
"parentId",
")",
"{",
"List",
"<",
"Container",
".",
"Filter",
">",
"filters",
"=",
"Lists",
".",
"newArrayList",
"(",
"getContainerFilters",
"(",
")",
... | Adds an item to the folder tree.<p>
@param cms the CMS context
@param resource the folder resource
@param parentId the parent folder id | [
"Adds",
"an",
"item",
"to",
"the",
"folder",
"tree",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/fileselect/CmsResourceTreeContainer.java#L101-L125 |
haifengl/smile | graph/src/main/java/smile/graph/AdjacencyMatrix.java | AdjacencyMatrix.dfs | private void dfs(Visitor visitor, int v, int[] cc, int id) {
"""
Depth-first search of graph.
@param v the start vertex.
@param cc the array to store the connected component id of vertices.
@param id the current component id.
"""
visitor.visit(v);
cc[v] = id;
for (int t = 0; t < n; t... | java | private void dfs(Visitor visitor, int v, int[] cc, int id) {
visitor.visit(v);
cc[v] = id;
for (int t = 0; t < n; t++) {
if (graph[v][t] != 0.0) {
if (cc[t] == -1) {
dfs(visitor, t, cc, id);
}
}
}
} | [
"private",
"void",
"dfs",
"(",
"Visitor",
"visitor",
",",
"int",
"v",
",",
"int",
"[",
"]",
"cc",
",",
"int",
"id",
")",
"{",
"visitor",
".",
"visit",
"(",
"v",
")",
";",
"cc",
"[",
"v",
"]",
"=",
"id",
";",
"for",
"(",
"int",
"t",
"=",
"0"... | Depth-first search of graph.
@param v the start vertex.
@param cc the array to store the connected component id of vertices.
@param id the current component id. | [
"Depth",
"-",
"first",
"search",
"of",
"graph",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/graph/src/main/java/smile/graph/AdjacencyMatrix.java#L344-L354 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java | KMLWriterDriver.writeSchema | private void writeSchema(XMLStreamWriter xmlOut, ResultSetMetaData metaData) throws XMLStreamException, SQLException {
"""
Specifies a custom KML schema that is used to add custom data to KML
Features. The "id" attribute is required and must be unique within the
KML file.
<Schema> is always a child of <Document... | java | private void writeSchema(XMLStreamWriter xmlOut, ResultSetMetaData metaData) throws XMLStreamException, SQLException {
columnCount = metaData.getColumnCount();
//The schema is writing only if there is more than one column
if (columnCount > 1) {
xmlOut.writeStartElement("Schema");
... | [
"private",
"void",
"writeSchema",
"(",
"XMLStreamWriter",
"xmlOut",
",",
"ResultSetMetaData",
"metaData",
")",
"throws",
"XMLStreamException",
",",
"SQLException",
"{",
"columnCount",
"=",
"metaData",
".",
"getColumnCount",
"(",
")",
";",
"//The schema is writing only i... | Specifies a custom KML schema that is used to add custom data to KML
Features. The "id" attribute is required and must be unique within the
KML file.
<Schema> is always a child of <Document>.
Syntax :
<Schema name="string" id="ID">
<SimpleField type="string" name="string">
<displayName>...</displayName> <!-- string -... | [
"Specifies",
"a",
"custom",
"KML",
"schema",
"that",
"is",
"used",
"to",
"add",
"custom",
"data",
"to",
"KML",
"Features",
".",
"The",
"id",
"attribute",
"is",
"required",
"and",
"must",
"be",
"unique",
"within",
"the",
"KML",
"file",
".",
"<Schema",
">"... | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java#L220-L240 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.