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 |
|---|---|---|---|---|---|---|---|---|---|---|
duracloud/duracloud | synctool/src/main/java/org/duracloud/sync/mgmt/SyncManager.java | SyncManager.handleChangedFile | public synchronized boolean handleChangedFile(ChangedFile changedFile) {
"""
Notifies the SyncManager that a file has changed
@param changedFile the changed file
@returns true if file accepted for processing, false otherwise
"""
File watchDir = getWatchDir(changedFile.getFile());
SyncWorker... | java | public synchronized boolean handleChangedFile(ChangedFile changedFile) {
File watchDir = getWatchDir(changedFile.getFile());
SyncWorker worker = new SyncWorker(changedFile, watchDir, endpoint);
try {
addToWorkerList(worker);
workerPool.execute(worker);
return... | [
"public",
"synchronized",
"boolean",
"handleChangedFile",
"(",
"ChangedFile",
"changedFile",
")",
"{",
"File",
"watchDir",
"=",
"getWatchDir",
"(",
"changedFile",
".",
"getFile",
"(",
")",
")",
";",
"SyncWorker",
"worker",
"=",
"new",
"SyncWorker",
"(",
"changed... | Notifies the SyncManager that a file has changed
@param changedFile the changed file
@returns true if file accepted for processing, false otherwise | [
"Notifies",
"the",
"SyncManager",
"that",
"a",
"file",
"has",
"changed"
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/synctool/src/main/java/org/duracloud/sync/mgmt/SyncManager.java#L106-L118 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java | JBossASClient.setPossibleExpression | public static ModelNode setPossibleExpression(ModelNode node, String name, String value) {
"""
This sets the given node's named attribute to the given value. If the value
appears to be an expression (that is, contains "${" somewhere in it), this will
set the value as an expression on the node.
@param node the... | java | public static ModelNode setPossibleExpression(ModelNode node, String name, String value) {
if (value != null) {
if (value.contains("${")) {
return node.get(name).set(new ValueExpression(value));
} else {
return node.get(name).set(value);
}
... | [
"public",
"static",
"ModelNode",
"setPossibleExpression",
"(",
"ModelNode",
"node",
",",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"value",
".",
"contains",
"(",
"\"${\"",
")",
")",
"{",
... | This sets the given node's named attribute to the given value. If the value
appears to be an expression (that is, contains "${" somewhere in it), this will
set the value as an expression on the node.
@param node the node whose attribute is to be set
@param name the name of the attribute whose value is to be set
@param... | [
"This",
"sets",
"the",
"given",
"node",
"s",
"named",
"attribute",
"to",
"the",
"given",
"value",
".",
"If",
"the",
"value",
"appears",
"to",
"be",
"an",
"expression",
"(",
"that",
"is",
"contains",
"$",
"{",
"somewhere",
"in",
"it",
")",
"this",
"will... | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java#L251-L261 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.preCompileJava | protected boolean preCompileJava(File sourceDirectory, File classDirectory, IProgressMonitor progress) {
"""
Compile the java files before the compilation of the project's files.
@param sourceDirectory the source directory where java files are stored.
@param classDirectory the output directory, where binary fi... | java | protected boolean preCompileJava(File sourceDirectory, File classDirectory, IProgressMonitor progress) {
assert progress != null;
progress.subTask(Messages.SarlBatchCompiler_51);
return runJavaCompiler(classDirectory, getSourcePaths(),
Iterables.concat(Collections.singleton(sourceDirectory), getClassPath()),
... | [
"protected",
"boolean",
"preCompileJava",
"(",
"File",
"sourceDirectory",
",",
"File",
"classDirectory",
",",
"IProgressMonitor",
"progress",
")",
"{",
"assert",
"progress",
"!=",
"null",
";",
"progress",
".",
"subTask",
"(",
"Messages",
".",
"SarlBatchCompiler_51",... | Compile the java files before the compilation of the project's files.
@param sourceDirectory the source directory where java files are stored.
@param classDirectory the output directory, where binary files should be generated.
@param progress monitor of the progress of the compilation.
@return the success status. Repl... | [
"Compile",
"the",
"java",
"files",
"before",
"the",
"compilation",
"of",
"the",
"project",
"s",
"files",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1692-L1698 |
flex-oss/flex-fruit | fruit-jpa/src/main/java/org/cdlflex/fruit/jpa/JpaRepository.java | JpaRepository.findOneByAttribute | public T findOneByAttribute(String attribute, Object value) {
"""
Finds an entity by a given attribute. Returns null if none was found.
@param attribute the attribute to search for
@param value the value
@return the entity or null if none was found
"""
CriteriaBuilder cb = getEntityManager().getCr... | java | public T findOneByAttribute(String attribute, Object value) {
CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
CriteriaQuery<T> query = cb.createQuery(getEntityClass());
Root<T> from = query.from(getEntityClass());
query.where(cb.equal(from.get(attribute), value));
... | [
"public",
"T",
"findOneByAttribute",
"(",
"String",
"attribute",
",",
"Object",
"value",
")",
"{",
"CriteriaBuilder",
"cb",
"=",
"getEntityManager",
"(",
")",
".",
"getCriteriaBuilder",
"(",
")",
";",
"CriteriaQuery",
"<",
"T",
">",
"query",
"=",
"cb",
".",
... | Finds an entity by a given attribute. Returns null if none was found.
@param attribute the attribute to search for
@param value the value
@return the entity or null if none was found | [
"Finds",
"an",
"entity",
"by",
"a",
"given",
"attribute",
".",
"Returns",
"null",
"if",
"none",
"was",
"found",
"."
] | train | https://github.com/flex-oss/flex-fruit/blob/30d7eca5ee796b829f96c9932a95b259ca9738d9/fruit-jpa/src/main/java/org/cdlflex/fruit/jpa/JpaRepository.java#L190-L202 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/Sheet.java | Sheet.setLocalValue | public void setLocalValue(final String rowKey, final int col, final Object value) {
"""
Updates a local value.
@param rowKey
@param col
@param value
"""
localValues.put(new SheetRowColIndex(rowKey, col), value);
} | java | public void setLocalValue(final String rowKey, final int col, final Object value) {
localValues.put(new SheetRowColIndex(rowKey, col), value);
} | [
"public",
"void",
"setLocalValue",
"(",
"final",
"String",
"rowKey",
",",
"final",
"int",
"col",
",",
"final",
"Object",
"value",
")",
"{",
"localValues",
".",
"put",
"(",
"new",
"SheetRowColIndex",
"(",
"rowKey",
",",
"col",
")",
",",
"value",
")",
";",... | Updates a local value.
@param rowKey
@param col
@param value | [
"Updates",
"a",
"local",
"value",
"."
] | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/Sheet.java#L291-L293 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java | ExampleColorHistogramLookup.coupledHueSat | public static List<double[]> coupledHueSat( List<String> images ) {
"""
HSV stores color information in Hue and Saturation while intensity is in Value. This computes a 2D histogram
from hue and saturation only, which makes it lighting independent.
"""
List<double[]> points = new ArrayList<>();
Planar<G... | java | public static List<double[]> coupledHueSat( List<String> images ) {
List<double[]> points = new ArrayList<>();
Planar<GrayF32> rgb = new Planar<>(GrayF32.class,1,1,3);
Planar<GrayF32> hsv = new Planar<>(GrayF32.class,1,1,3);
for( String path : images ) {
BufferedImage buffered = UtilImageIO.loadImage(path... | [
"public",
"static",
"List",
"<",
"double",
"[",
"]",
">",
"coupledHueSat",
"(",
"List",
"<",
"String",
">",
"images",
")",
"{",
"List",
"<",
"double",
"[",
"]",
">",
"points",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Planar",
"<",
"GrayF32",
... | HSV stores color information in Hue and Saturation while intensity is in Value. This computes a 2D histogram
from hue and saturation only, which makes it lighting independent. | [
"HSV",
"stores",
"color",
"information",
"in",
"Hue",
"and",
"Saturation",
"while",
"intensity",
"is",
"in",
"Value",
".",
"This",
"computes",
"a",
"2D",
"histogram",
"from",
"hue",
"and",
"saturation",
"only",
"which",
"makes",
"it",
"lighting",
"independent"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java#L70-L102 |
xvik/dropwizard-guicey | src/main/java/ru/vyarus/dropwizard/guice/module/context/debug/report/tree/ContextTreeRenderer.java | ContextTreeRenderer.renderScopeContent | private void renderScopeContent(final ContextTreeConfig config, final TreeNode root, final Class<?> scope) {
"""
Render entire scope subtree. Scope items are rendered first and bundles at the end (because most likely
they will be subtrees).
@param config tree config
@param root root node
@param scope scop... | java | private void renderScopeContent(final ContextTreeConfig config, final TreeNode root, final Class<?> scope) {
renderScopeItems(config, root, scope);
final List<Class<Object>> bundles = service.getData()
.getItems(Filters.registeredBy(scope).and(Filters.type(ConfigItem.Bundle)));
... | [
"private",
"void",
"renderScopeContent",
"(",
"final",
"ContextTreeConfig",
"config",
",",
"final",
"TreeNode",
"root",
",",
"final",
"Class",
"<",
"?",
">",
"scope",
")",
"{",
"renderScopeItems",
"(",
"config",
",",
"root",
",",
"scope",
")",
";",
"final",
... | Render entire scope subtree. Scope items are rendered first and bundles at the end (because most likely
they will be subtrees).
@param config tree config
@param root root node
@param scope scope to render | [
"Render",
"entire",
"scope",
"subtree",
".",
"Scope",
"items",
"are",
"rendered",
"first",
"and",
"bundles",
"at",
"the",
"end",
"(",
"because",
"most",
"likely",
"they",
"will",
"be",
"subtrees",
")",
"."
] | train | https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/context/debug/report/tree/ContextTreeRenderer.java#L91-L100 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/reflect/misc/ReflectUtil.java | ReflectUtil.needsPackageAccessCheck | public static boolean needsPackageAccessCheck(ClassLoader from, ClassLoader to) {
"""
Returns true if package access check is needed for reflective
access from a class loader 'from' to classes or members in
a class defined by class loader 'to'. This method returns true
if 'from' is not the same as or an ancest... | java | public static boolean needsPackageAccessCheck(ClassLoader from, ClassLoader to) {
if (from == null || from == to)
return false;
if (to == null)
return true;
return !isAncestor(from, to);
} | [
"public",
"static",
"boolean",
"needsPackageAccessCheck",
"(",
"ClassLoader",
"from",
",",
"ClassLoader",
"to",
")",
"{",
"if",
"(",
"from",
"==",
"null",
"||",
"from",
"==",
"to",
")",
"return",
"false",
";",
"if",
"(",
"to",
"==",
"null",
")",
"return"... | Returns true if package access check is needed for reflective
access from a class loader 'from' to classes or members in
a class defined by class loader 'to'. This method returns true
if 'from' is not the same as or an ancestor of 'to'. All code
in a system domain are granted with all permission and so this
method re... | [
"Returns",
"true",
"if",
"package",
"access",
"check",
"is",
"needed",
"for",
"reflective",
"access",
"from",
"a",
"class",
"loader",
"from",
"to",
"classes",
"or",
"members",
"in",
"a",
"class",
"defined",
"by",
"class",
"loader",
"to",
".",
"This",
"meth... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/reflect/misc/ReflectUtil.java#L130-L138 |
rubenlagus/TelegramBots | telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/timedbot/TimedSendLongPollingBot.java | TimedSendLongPollingBot.sendTimed | public void sendTimed(Long chatId, Object messageRequest) {
"""
SendMessage sendMessageRequest = new SendMessage();
sendMessageRequest.setChatId(chatId);
sendMessageRequest.setParseMode("HTML");
sendMessageRequest.setText(text);
sendMessageRequest.setReplyMarkup(replyMarkup);
sendTimed(chatId, sendMessageRequ... | java | public void sendTimed(Long chatId, Object messageRequest)
{
MessageQueue queue = mMessagesMap.get(chatId);
if (queue == null)
{
queue = new MessageQueue(chatId);
queue.putMessage(messageRequest);
mMessagesMap.put(chatId, queue);
}
else
{
queue.putMessage(messageRequest);
mMessagesMap.putIfAb... | [
"public",
"void",
"sendTimed",
"(",
"Long",
"chatId",
",",
"Object",
"messageRequest",
")",
"{",
"MessageQueue",
"queue",
"=",
"mMessagesMap",
".",
"get",
"(",
"chatId",
")",
";",
"if",
"(",
"queue",
"==",
"null",
")",
"{",
"queue",
"=",
"new",
"MessageQ... | SendMessage sendMessageRequest = new SendMessage();
sendMessageRequest.setChatId(chatId);
sendMessageRequest.setParseMode("HTML");
sendMessageRequest.setText(text);
sendMessageRequest.setReplyMarkup(replyMarkup);
sendTimed(chatId, sendMessageRequest); // <-- Instead of sendMessage() API method | [
"SendMessage",
"sendMessageRequest",
"=",
"new",
"SendMessage",
"()",
";",
"sendMessageRequest",
".",
"setChatId",
"(",
"chatId",
")",
";",
"sendMessageRequest",
".",
"setParseMode",
"(",
"HTML",
")",
";",
"sendMessageRequest",
".",
"setText",
"(",
"text",
")",
... | train | https://github.com/rubenlagus/TelegramBots/blob/d62354915d7664597a40fd9858f16bce67ef1478/telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/timedbot/TimedSendLongPollingBot.java#L162-L177 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ViewDefinition.java | ViewDefinition.newBuilder | public static Builder newBuilder(String query, List<UserDefinedFunction> functions) {
"""
Returns a builder for a BigQuery view definition.
@param query the query used to generate the table
@param functions user-defined functions that can be used by the query
"""
return newBuilder(query).setUserDefined... | java | public static Builder newBuilder(String query, List<UserDefinedFunction> functions) {
return newBuilder(query).setUserDefinedFunctions(functions);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"String",
"query",
",",
"List",
"<",
"UserDefinedFunction",
">",
"functions",
")",
"{",
"return",
"newBuilder",
"(",
"query",
")",
".",
"setUserDefinedFunctions",
"(",
"functions",
")",
";",
"}"
] | Returns a builder for a BigQuery view definition.
@param query the query used to generate the table
@param functions user-defined functions that can be used by the query | [
"Returns",
"a",
"builder",
"for",
"a",
"BigQuery",
"view",
"definition",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ViewDefinition.java#L155-L157 |
stephenc/java-iso-tools | loop-fs-spi/src/main/java/com/github/stephenc/javaisotools/loopfs/util/LittleEndian.java | LittleEndian.getUInt32 | public static long getUInt32(byte[] src, int offset) {
"""
Gets a 32-bit unsigned integer from the given byte array at the given offset.
"""
final long v0 = src[offset] & 0xFF;
final long v1 = src[offset + 1] & 0xFF;
final long v2 = src[offset + 2] & 0xFF;
final long v3 = src[of... | java | public static long getUInt32(byte[] src, int offset) {
final long v0 = src[offset] & 0xFF;
final long v1 = src[offset + 1] & 0xFF;
final long v2 = src[offset + 2] & 0xFF;
final long v3 = src[offset + 3] & 0xFF;
return ((v3 << 24) | (v2 << 16) | (v1 << 8) | v0);
} | [
"public",
"static",
"long",
"getUInt32",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"offset",
")",
"{",
"final",
"long",
"v0",
"=",
"src",
"[",
"offset",
"]",
"&",
"0xFF",
";",
"final",
"long",
"v1",
"=",
"src",
"[",
"offset",
"+",
"1",
"]",
"&",
... | Gets a 32-bit unsigned integer from the given byte array at the given offset. | [
"Gets",
"a",
"32",
"-",
"bit",
"unsigned",
"integer",
"from",
"the",
"given",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-spi/src/main/java/com/github/stephenc/javaisotools/loopfs/util/LittleEndian.java#L53-L59 |
twilio/twilio-java | src/main/java/com/twilio/rest/studio/v1/flow/EngagementReader.java | EngagementReader.nextPage | @Override
public Page<Engagement> nextPage(final Page<Engagement> page,
final TwilioRestClient client) {
"""
Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page
"""
... | java | @Override
public Page<Engagement> nextPage(final Page<Engagement> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getNextPageUrl(
Domains.STUDIO.toString(),
client.getRegi... | [
"@",
"Override",
"public",
"Page",
"<",
"Engagement",
">",
"nextPage",
"(",
"final",
"Page",
"<",
"Engagement",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
"... | Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page | [
"Retrieve",
"the",
"next",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/studio/v1/flow/EngagementReader.java#L90-L101 |
janus-project/guava.janusproject.io | guava/src/com/google/common/collect/Maps.java | Maps.filterEntries | public static <K, V> Map<K, V> filterEntries(
Map<K, V> unfiltered, Predicate<? super Entry<K, V>> entryPredicate) {
"""
Returns a map containing the mappings in {@code unfiltered} that satisfy a
predicate. The returned map is a live view of {@code unfiltered}; changes
to one affect the other.
<p>The re... | java | public static <K, V> Map<K, V> filterEntries(
Map<K, V> unfiltered, Predicate<? super Entry<K, V>> entryPredicate) {
if (unfiltered instanceof SortedMap) {
return filterEntries((SortedMap<K, V>) unfiltered, entryPredicate);
} else if (unfiltered instanceof BiMap) {
return filterEntries((BiMap<... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"filterEntries",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"unfiltered",
",",
"Predicate",
"<",
"?",
"super",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"entryPredicate",
")",
... | Returns a map containing the mappings in {@code unfiltered} that satisfy a
predicate. The returned map is a live view of {@code unfiltered}; changes
to one affect the other.
<p>The resulting map's {@code keySet()}, {@code entrySet()}, and {@code
values()} views have iterators that don't support {@code remove()}, but a... | [
"Returns",
"a",
"map",
"containing",
"the",
"mappings",
"in",
"{",
"@code",
"unfiltered",
"}",
"that",
"satisfy",
"a",
"predicate",
".",
"The",
"returned",
"map",
"is",
"a",
"live",
"view",
"of",
"{",
"@code",
"unfiltered",
"}",
";",
"changes",
"to",
"on... | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/collect/Maps.java#L2408-L2419 |
alkacon/opencms-core | src/org/opencms/workplace/CmsDialog.java | CmsDialog.dialogButtonsOkCancel | public String dialogButtonsOkCancel(String okAttributes, String cancelAttributes) {
"""
Builds a button row with an "ok" and a "cancel" button.<p>
@param okAttributes additional attributes for the "ok" button
@param cancelAttributes additional attributes for the "cancel" button
@return the button row
""... | java | public String dialogButtonsOkCancel(String okAttributes, String cancelAttributes) {
return dialogButtons(new int[] {BUTTON_OK, BUTTON_CANCEL}, new String[] {okAttributes, cancelAttributes});
} | [
"public",
"String",
"dialogButtonsOkCancel",
"(",
"String",
"okAttributes",
",",
"String",
"cancelAttributes",
")",
"{",
"return",
"dialogButtons",
"(",
"new",
"int",
"[",
"]",
"{",
"BUTTON_OK",
",",
"BUTTON_CANCEL",
"}",
",",
"new",
"String",
"[",
"]",
"{",
... | Builds a button row with an "ok" and a "cancel" button.<p>
@param okAttributes additional attributes for the "ok" button
@param cancelAttributes additional attributes for the "cancel" button
@return the button row | [
"Builds",
"a",
"button",
"row",
"with",
"an",
"ok",
"and",
"a",
"cancel",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsDialog.java#L721-L724 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/master/resources/HostsResource.java | HostsResource.put | @PUT
@Path(" {
"""
Registers a host with the cluster. The {@code host} is the name of the host. It SHOULD be
the hostname of the machine. The {@code id} should be a persistent value for the host, but
initially randomly generated. This way we don't have two machines claiming to be the same
host: at least b... | java | @PUT
@Path("{host}")
@Produces(APPLICATION_JSON)
@Timed
@ExceptionMetered
public Response.Status put(@PathParam("host") final String host,
@QueryParam("id") @DefaultValue("") final String id) {
if (isNullOrEmpty(id)) {
throw badRequest(new HostRegisterResponse(HostRegist... | [
"@",
"PUT",
"@",
"Path",
"(",
"\"{host}\"",
")",
"@",
"Produces",
"(",
"APPLICATION_JSON",
")",
"@",
"Timed",
"@",
"ExceptionMetered",
"public",
"Response",
".",
"Status",
"put",
"(",
"@",
"PathParam",
"(",
"\"host\"",
")",
"final",
"String",
"host",
",",
... | Registers a host with the cluster. The {@code host} is the name of the host. It SHOULD be
the hostname of the machine. The {@code id} should be a persistent value for the host, but
initially randomly generated. This way we don't have two machines claiming to be the same
host: at least by accident.
@param host The ... | [
"Registers",
"a",
"host",
"with",
"the",
"cluster",
".",
"The",
"{",
"@code",
"host",
"}",
"is",
"the",
"name",
"of",
"the",
"host",
".",
"It",
"SHOULD",
"be",
"the",
"hostname",
"of",
"the",
"machine",
".",
"The",
"{",
"@code",
"id",
"}",
"should",
... | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/master/resources/HostsResource.java#L137-L151 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/equation/Equation.java | Equation.createVariableInferred | private Variable createVariableInferred(TokenList.Token t0, Variable variableRight) {
"""
Infer the type of and create a new output variable using the results from the right side of the equation.
If the type is already known just return that.
"""
Variable result;
if( t0.getType() == Type.WORD... | java | private Variable createVariableInferred(TokenList.Token t0, Variable variableRight) {
Variable result;
if( t0.getType() == Type.WORD ) {
switch( variableRight.getType()) {
case MATRIX:
alias(new DMatrixRMaj(1,1),t0.getWord());
break;
... | [
"private",
"Variable",
"createVariableInferred",
"(",
"TokenList",
".",
"Token",
"t0",
",",
"Variable",
"variableRight",
")",
"{",
"Variable",
"result",
";",
"if",
"(",
"t0",
".",
"getType",
"(",
")",
"==",
"Type",
".",
"WORD",
")",
"{",
"switch",
"(",
"... | Infer the type of and create a new output variable using the results from the right side of the equation.
If the type is already known just return that. | [
"Infer",
"the",
"type",
"of",
"and",
"create",
"a",
"new",
"output",
"variable",
"using",
"the",
"results",
"from",
"the",
"right",
"side",
"of",
"the",
"equation",
".",
"If",
"the",
"type",
"is",
"already",
"known",
"just",
"return",
"that",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/Equation.java#L584-L614 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/entry/JournalEntryContext.java | JournalEntryContext.storeInMap | private <T> void storeInMap(MultiValueMap<T> map, T key, String[] values) {
"""
This method covers the totally bogus Exception that is thrown by
MultiValueMap.set(), and wraps it in an IllegalArgumentException, which
is more appropriate.
@param <T>
"""
try {
map.set(key, values);
... | java | private <T> void storeInMap(MultiValueMap<T> map, T key, String[] values) {
try {
map.set(key, values);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
} | [
"private",
"<",
"T",
">",
"void",
"storeInMap",
"(",
"MultiValueMap",
"<",
"T",
">",
"map",
",",
"T",
"key",
",",
"String",
"[",
"]",
"values",
")",
"{",
"try",
"{",
"map",
".",
"set",
"(",
"key",
",",
"values",
")",
";",
"}",
"catch",
"(",
"Ex... | This method covers the totally bogus Exception that is thrown by
MultiValueMap.set(), and wraps it in an IllegalArgumentException, which
is more appropriate.
@param <T> | [
"This",
"method",
"covers",
"the",
"totally",
"bogus",
"Exception",
"that",
"is",
"thrown",
"by",
"MultiValueMap",
".",
"set",
"()",
"and",
"wraps",
"it",
"in",
"an",
"IllegalArgumentException",
"which",
"is",
"more",
"appropriate",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/entry/JournalEntryContext.java#L81-L87 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/SailthruClient.java | SailthruClient.deleteTemplate | public JsonResponse deleteTemplate(String template) throws IOException {
"""
Delete existing template
@param template template name
@throws IOException
"""
Map<String, Object> data = new HashMap<String, Object>();
data.put(Template.PARAM_TEMPLATE, template);
return apiDelete(ApiAction... | java | public JsonResponse deleteTemplate(String template) throws IOException {
Map<String, Object> data = new HashMap<String, Object>();
data.put(Template.PARAM_TEMPLATE, template);
return apiDelete(ApiAction.template, data);
} | [
"public",
"JsonResponse",
"deleteTemplate",
"(",
"String",
"template",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"data",
".",
"put",
"(",
... | Delete existing template
@param template template name
@throws IOException | [
"Delete",
"existing",
"template"
] | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/SailthruClient.java#L301-L305 |
elki-project/elki | addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/util/Simple1DOFCamera.java | Simple1DOFCamera.squaredDistanceFromCamera | public double squaredDistanceFromCamera(double x, double y, double z) {
"""
Distance from camera
@param x X position
@param y Y position
@param z Z position
@return Squared distance
"""
double dx = (distance * sinZ) - x;
double dy = (distance * -cosZ) - y;
double dz = height - z;
return d... | java | public double squaredDistanceFromCamera(double x, double y, double z) {
double dx = (distance * sinZ) - x;
double dy = (distance * -cosZ) - y;
double dz = height - z;
return dx * dx + dy * dy + dz * dz;
} | [
"public",
"double",
"squaredDistanceFromCamera",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"double",
"dx",
"=",
"(",
"distance",
"*",
"sinZ",
")",
"-",
"x",
";",
"double",
"dy",
"=",
"(",
"distance",
"*",
"-",
"cosZ",
")",... | Distance from camera
@param x X position
@param y Y position
@param z Z position
@return Squared distance | [
"Distance",
"from",
"camera"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/util/Simple1DOFCamera.java#L305-L310 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BatchExecutor.java | BatchExecutor.batchCallback | public <R> void batchCallback(List<? extends Row> actions,
Object[] results, Batch.Callback<R> callback) throws IOException, InterruptedException {
"""
Implementation of
{@link org.apache.hadoop.hbase.client.HTable#batchCallback(List, Object[], Batch.Callback)}
@param actions a {@link java.util.List} obj... | java | public <R> void batchCallback(List<? extends Row> actions,
Object[] results, Batch.Callback<R> callback) throws IOException, InterruptedException {
Preconditions.checkArgument(results.length == actions.size(),
"Result array must have same dimensions as actions list.");
Timer.Context timerContext =... | [
"public",
"<",
"R",
">",
"void",
"batchCallback",
"(",
"List",
"<",
"?",
"extends",
"Row",
">",
"actions",
",",
"Object",
"[",
"]",
"results",
",",
"Batch",
".",
"Callback",
"<",
"R",
">",
"callback",
")",
"throws",
"IOException",
",",
"InterruptedExcept... | Implementation of
{@link org.apache.hadoop.hbase.client.HTable#batchCallback(List, Object[], Batch.Callback)}
@param actions a {@link java.util.List} object.
@param results an array of {@link java.lang.Object} objects.
@param callback a {@link org.apache.hadoop.hbase.client.coprocessor.Batch.Callback} object.
@throws ... | [
"Implementation",
"of",
"{",
"@link",
"org",
".",
"apache",
".",
"hadoop",
".",
"hbase",
".",
"client",
".",
"HTable#batchCallback",
"(",
"List",
"Object",
"[]",
"Batch",
".",
"Callback",
")",
"}"
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BatchExecutor.java#L263-L287 |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroData.java | SynchroData.getTableData | public StreamReader getTableData(String name) throws IOException {
"""
Return an input stream to read the data from the named table.
@param name table name
@return InputStream instance
@throws IOException
"""
InputStream stream = new ByteArrayInputStream(m_tableData.get(name));
if (m_majorVers... | java | public StreamReader getTableData(String name) throws IOException
{
InputStream stream = new ByteArrayInputStream(m_tableData.get(name));
if (m_majorVersion > 5)
{
byte[] header = new byte[24];
stream.read(header);
SynchroLogger.log("TABLE HEADER", header);
}... | [
"public",
"StreamReader",
"getTableData",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"InputStream",
"stream",
"=",
"new",
"ByteArrayInputStream",
"(",
"m_tableData",
".",
"get",
"(",
"name",
")",
")",
";",
"if",
"(",
"m_majorVersion",
">",
"5",
... | Return an input stream to read the data from the named table.
@param name table name
@return InputStream instance
@throws IOException | [
"Return",
"an",
"input",
"stream",
"to",
"read",
"the",
"data",
"from",
"the",
"named",
"table",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroData.java#L69-L79 |
jenkinsci/jenkins | core/src/main/java/jenkins/model/ParameterizedJobMixIn.java | ParameterizedJobMixIn.getTrigger | public static @CheckForNull <T extends Trigger<?>> T getTrigger(Job<?,?> job, Class<T> clazz) {
"""
Checks for the existence of a specific trigger on a job.
@param <T> a trigger type
@param job a job
@param clazz the type of the trigger
@return a configured trigger of the requested type, or null if there is no... | java | public static @CheckForNull <T extends Trigger<?>> T getTrigger(Job<?,?> job, Class<T> clazz) {
if (!(job instanceof ParameterizedJob)) {
return null;
}
for (Trigger<?> t : ((ParameterizedJob<?, ?>) job).getTriggers().values()) {
if (clazz.isInstance(t)) {
... | [
"public",
"static",
"@",
"CheckForNull",
"<",
"T",
"extends",
"Trigger",
"<",
"?",
">",
">",
"T",
"getTrigger",
"(",
"Job",
"<",
"?",
",",
"?",
">",
"job",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"!",
"(",
"job",
"instanceof",
... | Checks for the existence of a specific trigger on a job.
@param <T> a trigger type
@param job a job
@param clazz the type of the trigger
@return a configured trigger of the requested type, or null if there is none such, or {@code job} is not a {@link ParameterizedJob}
@since 1.621 | [
"Checks",
"for",
"the",
"existence",
"of",
"a",
"specific",
"trigger",
"on",
"a",
"job",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java#L306-L316 |
samskivert/samskivert | src/main/java/com/samskivert/util/SortableArrayList.java | SortableArrayList.insertSorted | @SuppressWarnings("unchecked")
public int insertSorted (T value, Comparator<? super T> comp) {
"""
Inserts the specified item into the list into a position that
preserves the sorting of the list according to the supplied {@link
Comparator}. The list must be sorted (via the supplied comparator)
prior to the ... | java | @SuppressWarnings("unchecked")
public int insertSorted (T value, Comparator<? super T> comp)
{
int ipos = binarySearch(value, comp);
if (ipos < 0) {
ipos = -(ipos+1);
}
_elements = (T[])ListUtil.insert(_elements, ipos, value);
_size++;
return ipos;
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"int",
"insertSorted",
"(",
"T",
"value",
",",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comp",
")",
"{",
"int",
"ipos",
"=",
"binarySearch",
"(",
"value",
",",
"comp",
")",
";",
"if",
"("... | Inserts the specified item into the list into a position that
preserves the sorting of the list according to the supplied {@link
Comparator}. The list must be sorted (via the supplied comparator)
prior to the call to this method (an empty list built up entirely
via calls to {@link #insertSorted} will be properly sorted... | [
"Inserts",
"the",
"specified",
"item",
"into",
"the",
"list",
"into",
"a",
"position",
"that",
"preserves",
"the",
"sorting",
"of",
"the",
"list",
"according",
"to",
"the",
"supplied",
"{",
"@link",
"Comparator",
"}",
".",
"The",
"list",
"must",
"be",
"sor... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/SortableArrayList.java#L46-L56 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ejs/ras/TraceNLS.java | TraceNLS.getFormattedMessage | public String getFormattedMessage(String key, Object[] args, String defaultString, boolean quiet) {
"""
Return the message obtained by looking up the localized text indicated by
the key in the ResourceBundle wrapped by this instance, then formatting
the message using the specified arguments as substitution param... | java | public String getFormattedMessage(String key, Object[] args, String defaultString, boolean quiet) {
if (resolver == null)
resolver = TraceNLSResolver.getInstance();
return resolver.getMessage(caller, null, ivBundleName, key, args, defaultString, true, null, quiet);
} | [
"public",
"String",
"getFormattedMessage",
"(",
"String",
"key",
",",
"Object",
"[",
"]",
"args",
",",
"String",
"defaultString",
",",
"boolean",
"quiet",
")",
"{",
"if",
"(",
"resolver",
"==",
"null",
")",
"resolver",
"=",
"TraceNLSResolver",
".",
"getInsta... | Return the message obtained by looking up the localized text indicated by
the key in the ResourceBundle wrapped by this instance, then formatting
the message using the specified arguments as substitution parameters.
<p>
The message is formatted using the java.text.MessageFormat class.
Substitution parameters are handle... | [
"Return",
"the",
"message",
"obtained",
"by",
"looking",
"up",
"the",
"localized",
"text",
"indicated",
"by",
"the",
"key",
"in",
"the",
"ResourceBundle",
"wrapped",
"by",
"this",
"instance",
"then",
"formatting",
"the",
"message",
"using",
"the",
"specified",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ejs/ras/TraceNLS.java#L219-L224 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_migration_servicesToDelete_POST | public ArrayList<OvhSubServiceToDelete> packName_migration_servicesToDelete_POST(String packName, String offerName, OvhOfferOption[] options) throws IOException {
"""
Calculate services to delete with new offer and options
REST: POST /pack/xdsl/{packName}/migration/servicesToDelete
@param options [required] Op... | java | public ArrayList<OvhSubServiceToDelete> packName_migration_servicesToDelete_POST(String packName, String offerName, OvhOfferOption[] options) throws IOException {
String qPath = "/pack/xdsl/{packName}/migration/servicesToDelete";
StringBuilder sb = path(qPath, packName);
HashMap<String, Object>o = new HashMap<Str... | [
"public",
"ArrayList",
"<",
"OvhSubServiceToDelete",
">",
"packName_migration_servicesToDelete_POST",
"(",
"String",
"packName",
",",
"String",
"offerName",
",",
"OvhOfferOption",
"[",
"]",
"options",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/pack... | Calculate services to delete with new offer and options
REST: POST /pack/xdsl/{packName}/migration/servicesToDelete
@param options [required] Options wanted in the new offer
@param offerName [required] Reference of the new offer
@param packName [required] The internal name of your pack | [
"Calculate",
"services",
"to",
"delete",
"with",
"new",
"offer",
"and",
"options"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L940-L948 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/template/Section.java | Section.renderAttribute | private void renderAttribute(InternalStringBuilder buf, String name, String value) {
"""
This method will write append an attribute value to a InternalStringBuilder.
The method assumes that the attr is not <code>null</code>. If the
value is <code>null</code> the attribute will not be appended to the
<code>Inte... | java | private void renderAttribute(InternalStringBuilder buf, String name, String value)
{
assert (name != null);
if (value == null)
return;
buf.append(" ");
buf.append(name);
buf.append("=\"");
buf.append(value);
buf.append("\"");
} | [
"private",
"void",
"renderAttribute",
"(",
"InternalStringBuilder",
"buf",
",",
"String",
"name",
",",
"String",
"value",
")",
"{",
"assert",
"(",
"name",
"!=",
"null",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"return",
";",
"buf",
".",
"append",... | This method will write append an attribute value to a InternalStringBuilder.
The method assumes that the attr is not <code>null</code>. If the
value is <code>null</code> the attribute will not be appended to the
<code>InternalStringBuilder</code>. | [
"This",
"method",
"will",
"write",
"append",
"an",
"attribute",
"value",
"to",
"a",
"InternalStringBuilder",
".",
"The",
"method",
"assumes",
"that",
"the",
"attr",
"is",
"not",
"<code",
">",
"null<",
"/",
"code",
">",
".",
"If",
"the",
"value",
"is",
"<... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/template/Section.java#L352-L363 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/CatalogUtil.java | CatalogUtil.setSecurityEnabled | private static void setSecurityEnabled( Catalog catalog, SecurityType security) {
"""
Set the security setting in the catalog from the deployment file
@param catalog the catalog to be updated
@param security security element of the deployment xml
"""
Cluster cluster = catalog.getClusters().get("clust... | java | private static void setSecurityEnabled( Catalog catalog, SecurityType security) {
Cluster cluster = catalog.getClusters().get("cluster");
Database database = cluster.getDatabases().get("database");
cluster.setSecurityenabled(security.isEnabled());
database.setSecurityprovider(security.g... | [
"private",
"static",
"void",
"setSecurityEnabled",
"(",
"Catalog",
"catalog",
",",
"SecurityType",
"security",
")",
"{",
"Cluster",
"cluster",
"=",
"catalog",
".",
"getClusters",
"(",
")",
".",
"get",
"(",
"\"cluster\"",
")",
";",
"Database",
"database",
"=",
... | Set the security setting in the catalog from the deployment file
@param catalog the catalog to be updated
@param security security element of the deployment xml | [
"Set",
"the",
"security",
"setting",
"in",
"the",
"catalog",
"from",
"the",
"deployment",
"file"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L2024-L2030 |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.getDouble | @PublicEvolving
public double getDouble(ConfigOption<Double> configOption, double overrideDefault) {
"""
Returns the value associated with the given config option as a {@code double}.
If no value is mapped under any key of the option, it returns the specified
default instead of the option's default value.
@p... | java | @PublicEvolving
public double getDouble(ConfigOption<Double> configOption, double overrideDefault) {
Object o = getRawValueFromOption(configOption);
if (o == null) {
return overrideDefault;
}
return convertToDouble(o, configOption.defaultValue());
} | [
"@",
"PublicEvolving",
"public",
"double",
"getDouble",
"(",
"ConfigOption",
"<",
"Double",
">",
"configOption",
",",
"double",
"overrideDefault",
")",
"{",
"Object",
"o",
"=",
"getRawValueFromOption",
"(",
"configOption",
")",
";",
"if",
"(",
"o",
"==",
"null... | Returns the value associated with the given config option as a {@code double}.
If no value is mapped under any key of the option, it returns the specified
default instead of the option's default value.
@param configOption The configuration option
@param overrideDefault The value to return if no value was mapper for an... | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"config",
"option",
"as",
"a",
"{",
"@code",
"double",
"}",
".",
"If",
"no",
"value",
"is",
"mapped",
"under",
"any",
"key",
"of",
"the",
"option",
"it",
"returns",
"the",
"specified",
"def... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L530-L537 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsInner.java | NetworkSecurityGroupsInner.getByResourceGroup | public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName) {
"""
Gets the specified network security group.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.
@throws IllegalArgume... | java | public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body();
} | [
"public",
"NetworkSecurityGroupInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkSecurityGroupName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkSecurityGroupName",
")",
".",
"to... | Gets the specified network security group.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throw... | [
"Gets",
"the",
"specified",
"network",
"security",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsInner.java#L277-L279 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java | SvgGraphicsContext.deleteElement | public void deleteElement(Object parent, String name) {
"""
Delete this element from the graphics DOM structure.
@param parent
parent group object
@param name
The element's name.
"""
if (isAttached()) {
helper.deleteElement(parent, name);
}
} | java | public void deleteElement(Object parent, String name) {
if (isAttached()) {
helper.deleteElement(parent, name);
}
} | [
"public",
"void",
"deleteElement",
"(",
"Object",
"parent",
",",
"String",
"name",
")",
"{",
"if",
"(",
"isAttached",
"(",
")",
")",
"{",
"helper",
".",
"deleteElement",
"(",
"parent",
",",
"name",
")",
";",
"}",
"}"
] | Delete this element from the graphics DOM structure.
@param parent
parent group object
@param name
The element's name. | [
"Delete",
"this",
"element",
"from",
"the",
"graphics",
"DOM",
"structure",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java#L104-L108 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/shared/environment/locale/LocaleFacet.java | LocaleFacet.findOptimumLocale | @SuppressWarnings("All")
public static Locale findOptimumLocale(final String language, final String country, final String variant) {
"""
Helper method to find the best matching locale, implying a workaround for problematic
case-sensitive Locale detection within the JDK. (C.f. Issue #112).
@param language T... | java | @SuppressWarnings("All")
public static Locale findOptimumLocale(final String language, final String country, final String variant) {
final boolean hasCountry = country != null && !country.isEmpty();
final boolean hasVariant = variant != null && !variant.isEmpty();
final Locale[] availableL... | [
"@",
"SuppressWarnings",
"(",
"\"All\"",
")",
"public",
"static",
"Locale",
"findOptimumLocale",
"(",
"final",
"String",
"language",
",",
"final",
"String",
"country",
",",
"final",
"String",
"variant",
")",
"{",
"final",
"boolean",
"hasCountry",
"=",
"country",... | Helper method to find the best matching locale, implying a workaround for problematic
case-sensitive Locale detection within the JDK. (C.f. Issue #112).
@param language The given Language.
@param country The given Country. May be null or empty to indicate that the Locale returned should not
contain a Country definiti... | [
"Helper",
"method",
"to",
"find",
"the",
"best",
"matching",
"locale",
"implying",
"a",
"workaround",
"for",
"problematic",
"case",
"-",
"sensitive",
"Locale",
"detection",
"within",
"the",
"JDK",
".",
"(",
"C",
".",
"f",
".",
"Issue",
"#112",
")",
"."
] | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/shared/environment/locale/LocaleFacet.java#L140-L170 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/internal/crypto/ContentCryptoMaterial.java | ContentCryptoMaterial.secureCEK | private static SecuredCEK secureCEK(SecretKey cek,
EncryptionMaterials materials, S3KeyWrapScheme kwScheme,
SecureRandom srand, Provider p, AWSKMS kms,
AmazonWebServiceRequest req) {
"""
Secure the given CEK. Note network calls are involved if the CEK is to
be protected by KMS... | java | private static SecuredCEK secureCEK(SecretKey cek,
EncryptionMaterials materials, S3KeyWrapScheme kwScheme,
SecureRandom srand, Provider p, AWSKMS kms,
AmazonWebServiceRequest req) {
final Map<String,String> matdesc;
if (materials.isKMSEnabled()) {
matdes... | [
"private",
"static",
"SecuredCEK",
"secureCEK",
"(",
"SecretKey",
"cek",
",",
"EncryptionMaterials",
"materials",
",",
"S3KeyWrapScheme",
"kwScheme",
",",
"SecureRandom",
"srand",
",",
"Provider",
"p",
",",
"AWSKMS",
"kms",
",",
"AmazonWebServiceRequest",
"req",
")"... | Secure the given CEK. Note network calls are involved if the CEK is to
be protected by KMS.
@param cek content encrypting key to be secured
@param materials used to provide the key-encryption-key (KEK); or if
it is KMS-enabled, the customer master key id and material description.
@param contentCryptoScheme the conten... | [
"Secure",
"the",
"given",
"CEK",
".",
"Note",
"network",
"calls",
"are",
"involved",
"if",
"the",
"CEK",
"is",
"to",
"be",
"protected",
"by",
"KMS",
"."
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/internal/crypto/ContentCryptoMaterial.java#L843-L897 |
Omertron/api-tvrage | src/main/java/com/omertron/tvrageapi/model/ShowInfo.java | ShowInfo.addAka | public void addAka(String country, String aka) {
"""
Add single AKA from a country/aka pairing
@param country
@param aka
"""
if (!isValidString(country) || !isValidString(aka)) {
return;
}
this.akas.add(new CountryDetail(country, aka));
} | java | public void addAka(String country, String aka) {
if (!isValidString(country) || !isValidString(aka)) {
return;
}
this.akas.add(new CountryDetail(country, aka));
} | [
"public",
"void",
"addAka",
"(",
"String",
"country",
",",
"String",
"aka",
")",
"{",
"if",
"(",
"!",
"isValidString",
"(",
"country",
")",
"||",
"!",
"isValidString",
"(",
"aka",
")",
")",
"{",
"return",
";",
"}",
"this",
".",
"akas",
".",
"add",
... | Add single AKA from a country/aka pairing
@param country
@param aka | [
"Add",
"single",
"AKA",
"from",
"a",
"country",
"/",
"aka",
"pairing"
] | train | https://github.com/Omertron/api-tvrage/blob/4e805a99de812fabea69d97098f2376be14d51bc/src/main/java/com/omertron/tvrageapi/model/ShowInfo.java#L94-L100 |
google/closure-compiler | src/com/google/javascript/jscomp/DisambiguateProperties.java | DisambiguateProperties.recordInterfaces | private void recordInterfaces(FunctionType constructor, JSType relatedType, Property p) {
"""
Records that this property could be referenced from any interface that this type inherits from.
<p>If the property p is defined only on a subtype of constructor, then this method has no
effect. But we tried modifying ... | java | private void recordInterfaces(FunctionType constructor, JSType relatedType, Property p) {
Iterable<ObjectType> interfaces = ancestorInterfaces.get(constructor);
if (interfaces == null) {
interfaces = constructor.getAncestorInterfaces();
ancestorInterfaces.put(constructor, interfaces);
}
for ... | [
"private",
"void",
"recordInterfaces",
"(",
"FunctionType",
"constructor",
",",
"JSType",
"relatedType",
",",
"Property",
"p",
")",
"{",
"Iterable",
"<",
"ObjectType",
">",
"interfaces",
"=",
"ancestorInterfaces",
".",
"get",
"(",
"constructor",
")",
";",
"if",
... | Records that this property could be referenced from any interface that this type inherits from.
<p>If the property p is defined only on a subtype of constructor, then this method has no
effect. But we tried modifying getTypeWithProperty to tell us when the returned type is a
subtype, and then skip those calls to recor... | [
"Records",
"that",
"this",
"property",
"could",
"be",
"referenced",
"from",
"any",
"interface",
"that",
"this",
"type",
"inherits",
"from",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DisambiguateProperties.java#L1099-L1115 |
xwiki/xwiki-rendering | xwiki-rendering-macros/xwiki-rendering-macro-html/src/main/java/org/xwiki/rendering/internal/macro/html/HTMLMacro.java | HTMLMacro.cleanHTML | private String cleanHTML(String content, MacroTransformationContext context) throws MacroExecutionException {
"""
Clean the HTML entered by the user, transforming it into valid XHTML.
@param content the content to clean
@param context the macro transformation context
@return the cleaned HTML as a string repre... | java | private String cleanHTML(String content, MacroTransformationContext context) throws MacroExecutionException
{
String cleanedContent = content;
HTMLCleanerConfiguration cleanerConfiguration = getCleanerConfiguration(context);
// Note that we trim the content since we want to be lenient with... | [
"private",
"String",
"cleanHTML",
"(",
"String",
"content",
",",
"MacroTransformationContext",
"context",
")",
"throws",
"MacroExecutionException",
"{",
"String",
"cleanedContent",
"=",
"content",
";",
"HTMLCleanerConfiguration",
"cleanerConfiguration",
"=",
"getCleanerConf... | Clean the HTML entered by the user, transforming it into valid XHTML.
@param content the content to clean
@param context the macro transformation context
@return the cleaned HTML as a string representing valid XHTML
@throws MacroExecutionException if the macro is inline and the content is not inline HTML | [
"Clean",
"the",
"HTML",
"entered",
"by",
"the",
"user",
"transforming",
"it",
"into",
"valid",
"XHTML",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-macros/xwiki-rendering-macro-html/src/main/java/org/xwiki/rendering/internal/macro/html/HTMLMacro.java#L181-L231 |
dadoonet/elasticsearch-beyonder | src/main/java/fr/pilato/elasticsearch/tools/template/TemplateElasticsearchUpdater.java | TemplateElasticsearchUpdater.removeTemplate | public static void removeTemplate(RestClient client, String template) throws Exception {
"""
Remove a template
@param client Elasticsearch client
@param template template name
@throws Exception if something goes wrong
"""
logger.trace("removeTemplate({})", template);
client.performRequest(new Request("D... | java | public static void removeTemplate(RestClient client, String template) throws Exception {
logger.trace("removeTemplate({})", template);
client.performRequest(new Request("DELETE", "/_template/" + template));
logger.trace("/removeTemplate({})", template);
} | [
"public",
"static",
"void",
"removeTemplate",
"(",
"RestClient",
"client",
",",
"String",
"template",
")",
"throws",
"Exception",
"{",
"logger",
".",
"trace",
"(",
"\"removeTemplate({})\"",
",",
"template",
")",
";",
"client",
".",
"performRequest",
"(",
"new",
... | Remove a template
@param client Elasticsearch client
@param template template name
@throws Exception if something goes wrong | [
"Remove",
"a",
"template"
] | train | https://github.com/dadoonet/elasticsearch-beyonder/blob/275bf63432b97169a90a266e983143cca9ad7629/src/main/java/fr/pilato/elasticsearch/tools/template/TemplateElasticsearchUpdater.java#L241-L245 |
phax/ph-css | ph-css/src/main/java/com/helger/css/reader/CSSReaderDeclarationList.java | CSSReaderDeclarationList.readFromStream | @Nullable
public static CSSDeclarationList readFromStream (@Nonnull final IHasInputStream aISP,
@Nonnull final Charset aCharset,
@Nonnull final ECSSVersion eVersion) {
"""
Read the CSS from the passed {@link IHa... | java | @Nullable
public static CSSDeclarationList readFromStream (@Nonnull final IHasInputStream aISP,
@Nonnull final Charset aCharset,
@Nonnull final ECSSVersion eVersion)
{
return readFromStream (aISP, aCharset, eVe... | [
"@",
"Nullable",
"public",
"static",
"CSSDeclarationList",
"readFromStream",
"(",
"@",
"Nonnull",
"final",
"IHasInputStream",
"aISP",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
",",
"@",
"Nonnull",
"final",
"ECSSVersion",
"eVersion",
")",
"{",
"return",
... | Read the CSS from the passed {@link IHasInputStream}.
@param aISP
The input stream provider to use. May not be <code>null</code>.
@param aCharset
The charset to be used. May not be <code>null</code>.
@param eVersion
The CSS version to use. May not be <code>null</code>.
@return <code>null</code> if reading failed, the ... | [
"Read",
"the",
"CSS",
"from",
"the",
"passed",
"{",
"@link",
"IHasInputStream",
"}",
"."
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/reader/CSSReaderDeclarationList.java#L446-L452 |
astrapi69/mystic-crypt | crypt-core/src/main/java/de/alpharogroup/crypto/simple/SimpleCrypt.java | SimpleCrypt.encode | public static String encode(final String secret, final int relocate) {
"""
Encrypt the given String.
@param secret
The String to encrypt.
@param relocate
How much places to switch.
@return The encrypted String.
"""
final StringBuffer sb = new StringBuffer();
final char[] encrypt = secret.toCharArray... | java | public static String encode(final String secret, final int relocate)
{
final StringBuffer sb = new StringBuffer();
final char[] encrypt = secret.toCharArray();
final int arraylength = encrypt.length;
for (int i = 0; i < arraylength; i++)
{
final char a = (char)(encrypt[i] + relocate);
sb.append(a);
}... | [
"public",
"static",
"String",
"encode",
"(",
"final",
"String",
"secret",
",",
"final",
"int",
"relocate",
")",
"{",
"final",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"final",
"char",
"[",
"]",
"encrypt",
"=",
"secret",
".",
"toCh... | Encrypt the given String.
@param secret
The String to encrypt.
@param relocate
How much places to switch.
@return The encrypted String. | [
"Encrypt",
"the",
"given",
"String",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-core/src/main/java/de/alpharogroup/crypto/simple/SimpleCrypt.java#L94-L105 |
JodaOrg/joda-time | src/main/java/org/joda/time/MutablePeriod.java | MutablePeriod.setPeriod | public void setPeriod(ReadableDuration duration, Chronology chrono) {
"""
Sets all the fields in one go from a duration dividing the
fields using the period type.
<p>
When dividing the duration, only precise fields in the period type will be used.
For large durations, all the remaining duration will be stored ... | java | public void setPeriod(ReadableDuration duration, Chronology chrono) {
long durationMillis = DateTimeUtils.getDurationMillis(duration);
setPeriod(durationMillis, chrono);
} | [
"public",
"void",
"setPeriod",
"(",
"ReadableDuration",
"duration",
",",
"Chronology",
"chrono",
")",
"{",
"long",
"durationMillis",
"=",
"DateTimeUtils",
".",
"getDurationMillis",
"(",
"duration",
")",
";",
"setPeriod",
"(",
"durationMillis",
",",
"chrono",
")",
... | Sets all the fields in one go from a duration dividing the
fields using the period type.
<p>
When dividing the duration, only precise fields in the period type will be used.
For large durations, all the remaining duration will be stored in the largest
available precise field.
@param duration the duration to set, null... | [
"Sets",
"all",
"the",
"fields",
"in",
"one",
"go",
"from",
"a",
"duration",
"dividing",
"the",
"fields",
"using",
"the",
"period",
"type",
".",
"<p",
">",
"When",
"dividing",
"the",
"duration",
"only",
"precise",
"fields",
"in",
"the",
"period",
"type",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutablePeriod.java#L578-L581 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java | SyncMembersInner.listBySyncGroupWithServiceResponseAsync | public Observable<ServiceResponse<Page<SyncMemberInner>>> listBySyncGroupWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String databaseName, final String syncGroupName) {
"""
Lists sync members in the given sync group.
@param resourceGroupName The name of the resource gr... | java | public Observable<ServiceResponse<Page<SyncMemberInner>>> listBySyncGroupWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String databaseName, final String syncGroupName) {
return listBySyncGroupSinglePageAsync(resourceGroupName, serverName, databaseName, syncGroupName)
... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"SyncMemberInner",
">",
">",
">",
"listBySyncGroupWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
",",
"final",
"String",
"databaseName",
",... | Lists sync members in the given sync group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is ... | [
"Lists",
"sync",
"members",
"in",
"the",
"given",
"sync",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java#L928-L940 |
sirthias/parboiled | parboiled-core/src/main/java/org/parboiled/buffers/DefaultInputBuffer.java | DefaultInputBuffer.getLine0 | private static int getLine0(int[] newlines, int index) {
"""
returns the zero based input line number the character with the given index is found in
"""
int j = Arrays.binarySearch(newlines, index);
return j >= 0 ? j : -(j + 1);
} | java | private static int getLine0(int[] newlines, int index) {
int j = Arrays.binarySearch(newlines, index);
return j >= 0 ? j : -(j + 1);
} | [
"private",
"static",
"int",
"getLine0",
"(",
"int",
"[",
"]",
"newlines",
",",
"int",
"index",
")",
"{",
"int",
"j",
"=",
"Arrays",
".",
"binarySearch",
"(",
"newlines",
",",
"index",
")",
";",
"return",
"j",
">=",
"0",
"?",
"j",
":",
"-",
"(",
"... | returns the zero based input line number the character with the given index is found in | [
"returns",
"the",
"zero",
"based",
"input",
"line",
"number",
"the",
"character",
"with",
"the",
"given",
"index",
"is",
"found",
"in"
] | train | https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/buffers/DefaultInputBuffer.java#L98-L101 |
google/closure-templates | java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java | JavaQualifiedNames.getFileClassName | static String getFileClassName(FileDescriptor file, ProtoFlavor flavor) {
"""
Derives the outer class name based on the protobuf (.proto) file name.
"""
return getFileClassName(file.toProto(), flavor);
} | java | static String getFileClassName(FileDescriptor file, ProtoFlavor flavor) {
return getFileClassName(file.toProto(), flavor);
} | [
"static",
"String",
"getFileClassName",
"(",
"FileDescriptor",
"file",
",",
"ProtoFlavor",
"flavor",
")",
"{",
"return",
"getFileClassName",
"(",
"file",
".",
"toProto",
"(",
")",
",",
"flavor",
")",
";",
"}"
] | Derives the outer class name based on the protobuf (.proto) file name. | [
"Derives",
"the",
"outer",
"class",
"name",
"based",
"on",
"the",
"protobuf",
"(",
".",
"proto",
")",
"file",
"name",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java#L246-L248 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/images/LineChartGenerator.java | LineChartGenerator.dumpChart | @SuppressWarnings("nls")
public void dumpChart( File chartFile, boolean autoRange, boolean withLegend, int imageWidth, int imageHeight )
throws IOException {
"""
Creates the chart image and dumps it to file.
@param chartFile the file to which to write to.
@param autoRange flag to define if to a... | java | @SuppressWarnings("nls")
public void dumpChart( File chartFile, boolean autoRange, boolean withLegend, int imageWidth, int imageHeight )
throws IOException {
JFreeChart chart = ChartFactory.createXYLineChart(title, xLabel, yLabel, collection, PlotOrientation.VERTICAL, withLegend,
... | [
"@",
"SuppressWarnings",
"(",
"\"nls\"",
")",
"public",
"void",
"dumpChart",
"(",
"File",
"chartFile",
",",
"boolean",
"autoRange",
",",
"boolean",
"withLegend",
",",
"int",
"imageWidth",
",",
"int",
"imageHeight",
")",
"throws",
"IOException",
"{",
"JFreeChart"... | Creates the chart image and dumps it to file.
@param chartFile the file to which to write to.
@param autoRange flag to define if to auto define the range from the bounds.
@param withLegend flag to define the legend presence.
@param imageWidth the output image width (if -1 default is used).
@param imageHeight the outpu... | [
"Creates",
"the",
"chart",
"image",
"and",
"dumps",
"it",
"to",
"file",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/images/LineChartGenerator.java#L85-L125 |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/epanet/core/EpanetWrapper.java | EpanetWrapper.ENsetoption | public void ENsetoption( OptionParameterCodes optionCode, float value ) throws EpanetException {
"""
Sets the value of a particular analysis option.
@param optionCode the {@link OptionParameterCodes}.
@param value the option value.
@throws EpanetException
"""
int errcode = epanet.ENsetoption(optio... | java | public void ENsetoption( OptionParameterCodes optionCode, float value ) throws EpanetException {
int errcode = epanet.ENsetoption(optionCode.getCode(), value);
checkError(errcode);
} | [
"public",
"void",
"ENsetoption",
"(",
"OptionParameterCodes",
"optionCode",
",",
"float",
"value",
")",
"throws",
"EpanetException",
"{",
"int",
"errcode",
"=",
"epanet",
".",
"ENsetoption",
"(",
"optionCode",
".",
"getCode",
"(",
")",
",",
"value",
")",
";",
... | Sets the value of a particular analysis option.
@param optionCode the {@link OptionParameterCodes}.
@param value the option value.
@throws EpanetException | [
"Sets",
"the",
"value",
"of",
"a",
"particular",
"analysis",
"option",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/epanet/core/EpanetWrapper.java#L669-L672 |
lecho/hellocharts-android | hellocharts-library/src/lecho/lib/hellocharts/computator/ChartComputator.java | ChartComputator.setMaxViewport | public void setMaxViewport(float left, float top, float right, float bottom) {
"""
Set new values for maximum viewport, that will change what part of chart is visible.
"""
this.maxViewport.set(left, top, right, bottom);
computeMinimumWidthAndHeight();
} | java | public void setMaxViewport(float left, float top, float right, float bottom) {
this.maxViewport.set(left, top, right, bottom);
computeMinimumWidthAndHeight();
} | [
"public",
"void",
"setMaxViewport",
"(",
"float",
"left",
",",
"float",
"top",
",",
"float",
"right",
",",
"float",
"bottom",
")",
"{",
"this",
".",
"maxViewport",
".",
"set",
"(",
"left",
",",
"top",
",",
"right",
",",
"bottom",
")",
";",
"computeMini... | Set new values for maximum viewport, that will change what part of chart is visible. | [
"Set",
"new",
"values",
"for",
"maximum",
"viewport",
"that",
"will",
"change",
"what",
"part",
"of",
"chart",
"is",
"visible",
"."
] | train | https://github.com/lecho/hellocharts-android/blob/c41419c9afa097452dee823c7eba0e5136aa96bd/hellocharts-library/src/lecho/lib/hellocharts/computator/ChartComputator.java#L280-L283 |
Kurento/kurento-module-creator | src/main/java/com/github/zafarkhaja/semver/VersionParser.java | VersionParser.parseVersionCore | private NormalVersion parseVersionCore() {
"""
Parses the {@literal <version core>} non-terminal.
<pre>
{@literal
<version core> ::= <major> "." <minor> "." <patch>
}
</pre>
@return a valid normal version object
"""
int major = Integer.parseInt(numericIdentifier());
consumeNextCharacter(CharT... | java | private NormalVersion parseVersionCore() {
int major = Integer.parseInt(numericIdentifier());
consumeNextCharacter(CharType.DOT);
int minor = Integer.parseInt(numericIdentifier());
consumeNextCharacter(CharType.DOT);
int patch = Integer.parseInt(numericIdentifier());
return new NormalVersion(maj... | [
"private",
"NormalVersion",
"parseVersionCore",
"(",
")",
"{",
"int",
"major",
"=",
"Integer",
".",
"parseInt",
"(",
"numericIdentifier",
"(",
")",
")",
";",
"consumeNextCharacter",
"(",
"CharType",
".",
"DOT",
")",
";",
"int",
"minor",
"=",
"Integer",
".",
... | Parses the {@literal <version core>} non-terminal.
<pre>
{@literal
<version core> ::= <major> "." <minor> "." <patch>
}
</pre>
@return a valid normal version object | [
"Parses",
"the",
"{",
"@literal",
"<version",
"core",
">",
"}",
"non",
"-",
"terminal",
"."
] | train | https://github.com/Kurento/kurento-module-creator/blob/c371516c665b902b5476433496a5aefcbca86d64/src/main/java/com/github/zafarkhaja/semver/VersionParser.java#L269-L276 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImageListsImpl.java | ListManagementImageListsImpl.updateAsync | public Observable<ImageList> updateAsync(String listId, String contentType, BodyModel bodyParameter) {
"""
Updates an image list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param contentType The content type.
@param bodyParameter Schema of the body.
@throws IllegalArgument... | java | public Observable<ImageList> updateAsync(String listId, String contentType, BodyModel bodyParameter) {
return updateWithServiceResponseAsync(listId, contentType, bodyParameter).map(new Func1<ServiceResponse<ImageList>, ImageList>() {
@Override
public ImageList call(ServiceResponse<ImageL... | [
"public",
"Observable",
"<",
"ImageList",
">",
"updateAsync",
"(",
"String",
"listId",
",",
"String",
"contentType",
",",
"BodyModel",
"bodyParameter",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"listId",
",",
"contentType",
",",
"bodyParameter",
")"... | Updates an image list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param contentType The content type.
@param bodyParameter Schema of the body.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ImageList object | [
"Updates",
"an",
"image",
"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/ListManagementImageListsImpl.java#L282-L289 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java | RedBlackTreeInteger.getNext | public Node<T> getNext(Node<T> node) {
"""
Returns the node containing the key just before the key of the given node.
"""
if (node.right != null) {
node = node.right;
while (node.left != null) node = node.left;
return node;
}
// nothing at right, it may be the parent node... | java | public Node<T> getNext(Node<T> node) {
if (node.right != null) {
node = node.right;
while (node.left != null) node = node.left;
return node;
}
// nothing at right, it may be the parent node if the node is at the left
if (node == last) return null;
return getNext(root, ... | [
"public",
"Node",
"<",
"T",
">",
"getNext",
"(",
"Node",
"<",
"T",
">",
"node",
")",
"{",
"if",
"(",
"node",
".",
"right",
"!=",
"null",
")",
"{",
"node",
"=",
"node",
".",
"right",
";",
"while",
"(",
"node",
".",
"left",
"!=",
"null",
")",
"... | Returns the node containing the key just before the key of the given node. | [
"Returns",
"the",
"node",
"containing",
"the",
"key",
"just",
"before",
"the",
"key",
"of",
"the",
"given",
"node",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java#L170-L179 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/mult/VectorVectorMult_ZDRM.java | VectorVectorMult_ZDRM.innerProd | public static Complex_F64 innerProd(ZMatrixRMaj x, ZMatrixRMaj y , Complex_F64 output ) {
"""
<p>
Computes the inner product of the two vectors. In geometry this is known as the dot product.<br>
<br>
∑<sub>k=1:n</sub> x<sub>k</sub> * y<sub>k</sub><br>
where x and y are vectors with n elements.
</p>
<p... | java | public static Complex_F64 innerProd(ZMatrixRMaj x, ZMatrixRMaj y , Complex_F64 output )
{
if( output == null )
output = new Complex_F64();
else {
output.real = output.imaginary = 0;
}
int m = x.getDataLength();
for( int i = 0; i < m; i += 2 ) {
... | [
"public",
"static",
"Complex_F64",
"innerProd",
"(",
"ZMatrixRMaj",
"x",
",",
"ZMatrixRMaj",
"y",
",",
"Complex_F64",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"output",
"=",
"new",
"Complex_F64",
"(",
")",
";",
"else",
"{",
"output",
"... | <p>
Computes the inner product of the two vectors. In geometry this is known as the dot product.<br>
<br>
∑<sub>k=1:n</sub> x<sub>k</sub> * y<sub>k</sub><br>
where x and y are vectors with n elements.
</p>
<p>
These functions are often used inside of highly optimized code and therefor sanity checks are
kept to a ... | [
"<p",
">",
"Computes",
"the",
"inner",
"product",
"of",
"the",
"two",
"vectors",
".",
"In",
"geometry",
"this",
"is",
"known",
"as",
"the",
"dot",
"product",
".",
"<br",
">",
"<br",
">",
"&sum",
";",
"<sub",
">",
"k",
"=",
"1",
":",
"n<",
"/",
"s... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/mult/VectorVectorMult_ZDRM.java#L47-L69 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/query/ServiceInstanceQuery.java | ServiceInstanceQuery.getNotEqualQueryCriterion | public ServiceInstanceQuery getNotEqualQueryCriterion(String key, String value) {
"""
Get a metadata value not equal QueryCriterion.
Add a QueryCriterion to check ServiceInstance has metadata value
not equal to target.
@param key
the metadata key.
@param value
the metadata value should not equal to.
@re... | java | public ServiceInstanceQuery getNotEqualQueryCriterion(String key, String value){
QueryCriterion c = new NotEqualQueryCriterion(key, value);
addQueryCriterion(c);
return this;
} | [
"public",
"ServiceInstanceQuery",
"getNotEqualQueryCriterion",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"QueryCriterion",
"c",
"=",
"new",
"NotEqualQueryCriterion",
"(",
"key",
",",
"value",
")",
";",
"addQueryCriterion",
"(",
"c",
")",
";",
"retu... | Get a metadata value not equal QueryCriterion.
Add a QueryCriterion to check ServiceInstance has metadata value
not equal to target.
@param key
the metadata key.
@param value
the metadata value should not equal to.
@return
the ServiceInstanceQuery. | [
"Get",
"a",
"metadata",
"value",
"not",
"equal",
"QueryCriterion",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/query/ServiceInstanceQuery.java#L80-L84 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java | IdentityPatchContext.resolveForElement | protected PatchEntry resolveForElement(final PatchElement element) throws PatchingException {
"""
Get the target entry for a given patch element.
@param element the patch element
@return the patch entry
@throws PatchingException
"""
assert state == State.NEW;
final PatchElementProvider pro... | java | protected PatchEntry resolveForElement(final PatchElement element) throws PatchingException {
assert state == State.NEW;
final PatchElementProvider provider = element.getProvider();
final String layerName = provider.getName();
final LayerType layerType = provider.getLayerType();
... | [
"protected",
"PatchEntry",
"resolveForElement",
"(",
"final",
"PatchElement",
"element",
")",
"throws",
"PatchingException",
"{",
"assert",
"state",
"==",
"State",
".",
"NEW",
";",
"final",
"PatchElementProvider",
"provider",
"=",
"element",
".",
"getProvider",
"(",... | Get the target entry for a given patch element.
@param element the patch element
@return the patch entry
@throws PatchingException | [
"Get",
"the",
"target",
"entry",
"for",
"a",
"given",
"patch",
"element",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java#L226-L250 |
guardtime/ksi-java-sdk | ksi-api/src/main/java/com/guardtime/ksi/unisignature/inmemory/InMemoryAggregationHashChain.java | InMemoryAggregationHashChain.calculateOutputHash | public final ChainResult calculateOutputHash(long level) throws KSIException {
"""
Calculate hash chain output hash.
@param level
hash chain level
@return hash chain result
"""
// TODO task KSIJAVAAPI-207 If the aggregation hash chain component contains the `input data' field, hash the value part ... | java | public final ChainResult calculateOutputHash(long level) throws KSIException {
// TODO task KSIJAVAAPI-207 If the aggregation hash chain component contains the `input data' field, hash the value part of the field
// using the hash algorithm specified by the first octet of the `input hash' field and veri... | [
"public",
"final",
"ChainResult",
"calculateOutputHash",
"(",
"long",
"level",
")",
"throws",
"KSIException",
"{",
"// TODO task KSIJAVAAPI-207 If the aggregation hash chain component contains the `input data' field, hash the value part of the field",
"// using the hash algorithm specified b... | Calculate hash chain output hash.
@param level
hash chain level
@return hash chain result | [
"Calculate",
"hash",
"chain",
"output",
"hash",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-api/src/main/java/com/guardtime/ksi/unisignature/inmemory/InMemoryAggregationHashChain.java#L140-L157 |
bazaarvoice/emodb | databus-api/src/main/java/com/bazaarvoice/emodb/databus/api/Event.java | Event.getJsonSerializingContent | @JsonView(EventViews.ContentOnly.class)
@JsonProperty("content")
private Map<String, Object> getJsonSerializingContent() {
"""
For purposes of JSON serialization wrapping the content in an unmodifiable view may cause the serializer
to choose a less-optimal implementation. Since JSON serialization cannot ... | java | @JsonView(EventViews.ContentOnly.class)
@JsonProperty("content")
private Map<String, Object> getJsonSerializingContent() {
//noinspection unchecked
return (Map<String, Object>) _content;
} | [
"@",
"JsonView",
"(",
"EventViews",
".",
"ContentOnly",
".",
"class",
")",
"@",
"JsonProperty",
"(",
"\"content\"",
")",
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"getJsonSerializingContent",
"(",
")",
"{",
"//noinspection unchecked",
"return",
"(",
... | For purposes of JSON serialization wrapping the content in an unmodifiable view may cause the serializer
to choose a less-optimal implementation. Since JSON serialization cannot modify the underlying content
it is safe to return the original content object to the serializer. | [
"For",
"purposes",
"of",
"JSON",
"serialization",
"wrapping",
"the",
"content",
"in",
"an",
"unmodifiable",
"view",
"may",
"cause",
"the",
"serializer",
"to",
"choose",
"a",
"less",
"-",
"optimal",
"implementation",
".",
"Since",
"JSON",
"serialization",
"cannot... | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus-api/src/main/java/com/bazaarvoice/emodb/databus/api/Event.java#L45-L50 |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/dialect/impl/MongoHelpers.java | MongoHelpers.resetValue | public static void resetValue(Document entity, String column) {
"""
Remove a column from the Document
@param entity the {@link Document} with the column
@param column the column to remove
"""
// fast path for non-embedded case
if ( !column.contains( "." ) ) {
entity.remove( column );
}
else {
... | java | public static void resetValue(Document entity, String column) {
// fast path for non-embedded case
if ( !column.contains( "." ) ) {
entity.remove( column );
}
else {
String[] path = DOT_SEPARATOR_PATTERN.split( column );
Object field = entity;
int size = path.length;
for ( int index = 0; index < ... | [
"public",
"static",
"void",
"resetValue",
"(",
"Document",
"entity",
",",
"String",
"column",
")",
"{",
"// fast path for non-embedded case",
"if",
"(",
"!",
"column",
".",
"contains",
"(",
"\".\"",
")",
")",
"{",
"entity",
".",
"remove",
"(",
"column",
")",... | Remove a column from the Document
@param entity the {@link Document} with the column
@param column the column to remove | [
"Remove",
"a",
"column",
"from",
"the",
"Document"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/dialect/impl/MongoHelpers.java#L56-L79 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.notNaN | @Throws(IllegalNaNArgumentException.class)
public static double notNaN(final double value, @Nullable final String name) {
"""
Ensures that a double argument is not NaN (not a number).
@see java.lang.Double#NaN
@param value
value which should not be NaN
@param name
name of object reference (in source code... | java | @Throws(IllegalNaNArgumentException.class)
public static double notNaN(final double value, @Nullable final String name) {
// most efficient check for NaN, see Double.isNaN(value))
if (value != value) {
throw new IllegalNaNArgumentException(name);
}
return value;
} | [
"@",
"Throws",
"(",
"IllegalNaNArgumentException",
".",
"class",
")",
"public",
"static",
"double",
"notNaN",
"(",
"final",
"double",
"value",
",",
"@",
"Nullable",
"final",
"String",
"name",
")",
"{",
"// most efficient check for NaN, see Double.isNaN(value))",
"if",... | Ensures that a double argument is not NaN (not a number).
@see java.lang.Double#NaN
@param value
value which should not be NaN
@param name
name of object reference (in source code)
@return the given double value
@throws IllegalNaNArgumentException
if the given argument {@code value} is NaN | [
"Ensures",
"that",
"a",
"double",
"argument",
"is",
"not",
"NaN",
"(",
"not",
"a",
"number",
")",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L2696-L2703 |
duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/rest/SpaceRest.java | SpaceRest.getSpace | @Path("/ {
"""
see SpaceResource.getSpaceProperties(String, String);
see SpaceResource.getSpaceContents(String, String);
@return 200 response with XML listing of space content and
space properties included as header values
"""spaceID}")
@GET
@Produces(XML)
public Response getSpace(@PathParam("... | java | @Path("/{spaceID}")
@GET
@Produces(XML)
public Response getSpace(@PathParam("spaceID") String spaceID,
@QueryParam("storeID") String storeID,
@QueryParam("prefix") String prefix,
@QueryParam("maxResults") long maxResults,... | [
"@",
"Path",
"(",
"\"/{spaceID}\"",
")",
"@",
"GET",
"@",
"Produces",
"(",
"XML",
")",
"public",
"Response",
"getSpace",
"(",
"@",
"PathParam",
"(",
"\"spaceID\"",
")",
"String",
"spaceID",
",",
"@",
"QueryParam",
"(",
"\"storeID\"",
")",
"String",
"storeI... | see SpaceResource.getSpaceProperties(String, String);
see SpaceResource.getSpaceContents(String, String);
@return 200 response with XML listing of space content and
space properties included as header values | [
"see",
"SpaceResource",
".",
"getSpaceProperties",
"(",
"String",
"String",
")",
";",
"see",
"SpaceResource",
".",
"getSpaceContents",
"(",
"String",
"String",
")",
";"
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/SpaceRest.java#L92-L125 |
Guichaguri/MinimalFTP | src/main/java/com/guichaguri/minimalftp/FTPConnection.java | FTPConnection.registerOption | public void registerOption(String option, String value) {
"""
Registers an option for the OPTS command
@param option The option name
@param value The default value
"""
options.put(option.toUpperCase(), value);
} | java | public void registerOption(String option, String value) {
options.put(option.toUpperCase(), value);
} | [
"public",
"void",
"registerOption",
"(",
"String",
"option",
",",
"String",
"value",
")",
"{",
"options",
".",
"put",
"(",
"option",
".",
"toUpperCase",
"(",
")",
",",
"value",
")",
";",
"}"
] | Registers an option for the OPTS command
@param option The option name
@param value The default value | [
"Registers",
"an",
"option",
"for",
"the",
"OPTS",
"command"
] | train | https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L356-L358 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/Projection.java | Projection.toProjectedPixels | @Deprecated
public PointL toProjectedPixels(final long latituteE6, final long longitudeE6, final PointL reuse) {
"""
Performs only the first computationally heavy part of the projection. Call
{@link #getLongPixelsFromProjected(PointL, double, boolean, PointL)} to get the final position.
@param latituteE6
the... | java | @Deprecated
public PointL toProjectedPixels(final long latituteE6, final long longitudeE6, final PointL reuse) {
return toProjectedPixels(latituteE6 * 1E-6, longitudeE6 * 1E-6, reuse);
} | [
"@",
"Deprecated",
"public",
"PointL",
"toProjectedPixels",
"(",
"final",
"long",
"latituteE6",
",",
"final",
"long",
"longitudeE6",
",",
"final",
"PointL",
"reuse",
")",
"{",
"return",
"toProjectedPixels",
"(",
"latituteE6",
"*",
"1E-6",
",",
"longitudeE6",
"*"... | Performs only the first computationally heavy part of the projection. Call
{@link #getLongPixelsFromProjected(PointL, double, boolean, PointL)} to get the final position.
@param latituteE6
the latitute of the point
@param longitudeE6
the longitude of the point
@param reuse
just pass null if you do not have a PointL to... | [
"Performs",
"only",
"the",
"first",
"computationally",
"heavy",
"part",
"of",
"the",
"projection",
".",
"Call",
"{",
"@link",
"#getLongPixelsFromProjected",
"(",
"PointL",
"double",
"boolean",
"PointL",
")",
"}",
"to",
"get",
"the",
"final",
"position",
"."
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L252-L255 |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/EventEngineImpl.java | EventEngineImpl.publishOsgiEvent | void publishOsgiEvent(org.osgi.service.event.Event event, boolean async) {
"""
Publish the specified event to all registered handlers that have an
interest in the event topic.
@param event
the OSGi <code>Event</code> to deliver
@param async
<code>true</code> if the event delivery can be done
asynchronously... | java | void publishOsgiEvent(org.osgi.service.event.Event event, boolean async) {
String topic = event.getTopic();
com.ibm.websphere.event.Event e = createEvent(topic);
for (String key : event.getPropertyNames()) {
e.setProperty(key, event.getProperty(key));
}
publishEvent(e... | [
"void",
"publishOsgiEvent",
"(",
"org",
".",
"osgi",
".",
"service",
".",
"event",
".",
"Event",
"event",
",",
"boolean",
"async",
")",
"{",
"String",
"topic",
"=",
"event",
".",
"getTopic",
"(",
")",
";",
"com",
".",
"ibm",
".",
"websphere",
".",
"e... | Publish the specified event to all registered handlers that have an
interest in the event topic.
@param event
the OSGi <code>Event</code> to deliver
@param async
<code>true</code> if the event delivery can be done
asynchronously | [
"Publish",
"the",
"specified",
"event",
"to",
"all",
"registered",
"handlers",
"that",
"have",
"an",
"interest",
"in",
"the",
"event",
"topic",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/EventEngineImpl.java#L251-L258 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.createRegexEntityRole | public UUID createRegexEntityRole(UUID appId, String versionId, UUID entityId, CreateRegexEntityRoleOptionalParameter createRegexEntityRoleOptionalParameter) {
"""
Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The enti... | java | public UUID createRegexEntityRole(UUID appId, String versionId, UUID entityId, CreateRegexEntityRoleOptionalParameter createRegexEntityRoleOptionalParameter) {
return createRegexEntityRoleWithServiceResponseAsync(appId, versionId, entityId, createRegexEntityRoleOptionalParameter).toBlocking().single().body();
... | [
"public",
"UUID",
"createRegexEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"CreateRegexEntityRoleOptionalParameter",
"createRegexEntityRoleOptionalParameter",
")",
"{",
"return",
"createRegexEntityRoleWithServiceResponseAsync",
"(... | Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity model ID.
@param createRegexEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException... | [
"Create",
"an",
"entity",
"role",
"for",
"an",
"entity",
"in",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L8592-L8594 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/MetricQueryService.java | MetricQueryService.createMetricQueryService | public static MetricQueryService createMetricQueryService(
RpcService rpcService,
ResourceID resourceID,
long maximumFrameSize) {
"""
Starts the MetricQueryService actor in the given actor system.
@param rpcService The rpcService running the MetricQueryService
@param resourceID resource ID to disambiguat... | java | public static MetricQueryService createMetricQueryService(
RpcService rpcService,
ResourceID resourceID,
long maximumFrameSize) {
String endpointId = resourceID == null
? METRIC_QUERY_SERVICE_NAME
: METRIC_QUERY_SERVICE_NAME + "_" + resourceID.getResourceIdString();
return new MetricQueryService(rpcSe... | [
"public",
"static",
"MetricQueryService",
"createMetricQueryService",
"(",
"RpcService",
"rpcService",
",",
"ResourceID",
"resourceID",
",",
"long",
"maximumFrameSize",
")",
"{",
"String",
"endpointId",
"=",
"resourceID",
"==",
"null",
"?",
"METRIC_QUERY_SERVICE_NAME",
... | Starts the MetricQueryService actor in the given actor system.
@param rpcService The rpcService running the MetricQueryService
@param resourceID resource ID to disambiguate the actor name
@return actor reference to the MetricQueryService | [
"Starts",
"the",
"MetricQueryService",
"actor",
"in",
"the",
"given",
"actor",
"system",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/MetricQueryService.java#L243-L253 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java | Matrix.setMatrix | public void setMatrix(int i0, int i1, int j0, int j1, Matrix X) {
"""
Set a submatrix.
@param i0 Initial row index
@param i1 Final row index
@param j0 Initial column index
@param j1 Final column index
@param X A(i0:i1,j0:j1)
@throws ArrayIndexOutOfBoundsException Submatrix indices
"""
try
... | java | public void setMatrix(int i0, int i1, int j0, int j1, Matrix X)
{
try
{
for (int i = i0; i <= i1; i++)
{
for (int j = j0; j <= j1; j++)
{
A[i][j] = X.get(i - i0, j - j0);
}
}
}
cat... | [
"public",
"void",
"setMatrix",
"(",
"int",
"i0",
",",
"int",
"i1",
",",
"int",
"j0",
",",
"int",
"j1",
",",
"Matrix",
"X",
")",
"{",
"try",
"{",
"for",
"(",
"int",
"i",
"=",
"i0",
";",
"i",
"<=",
"i1",
";",
"i",
"++",
")",
"{",
"for",
"(",
... | Set a submatrix.
@param i0 Initial row index
@param i1 Final row index
@param j0 Initial column index
@param j1 Final column index
@param X A(i0:i1,j0:j1)
@throws ArrayIndexOutOfBoundsException Submatrix indices | [
"Set",
"a",
"submatrix",
"."
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L500-L516 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/scientific/ColorImg.java | ColorImg.setValue | public void setValue(final int channel, final int x, final int y, final double value) {
"""
Sets value at the specified position for the specified channel.
No bounds checks will be performed, positions outside of this
images dimension can either result in a value for a different position
or an ArrayIndexOutOfBo... | java | public void setValue(final int channel, final int x, final int y, final double value){
this.data[channel][y*this.width + x] = value;
} | [
"public",
"void",
"setValue",
"(",
"final",
"int",
"channel",
",",
"final",
"int",
"x",
",",
"final",
"int",
"y",
",",
"final",
"double",
"value",
")",
"{",
"this",
".",
"data",
"[",
"channel",
"]",
"[",
"y",
"*",
"this",
".",
"width",
"+",
"x",
... | Sets value at the specified position for the specified channel.
No bounds checks will be performed, positions outside of this
images dimension can either result in a value for a different position
or an ArrayIndexOutOfBoundsException.
@param channel the set value corresponds to
@param x coordinate
@param y coordinate
... | [
"Sets",
"value",
"at",
"the",
"specified",
"position",
"for",
"the",
"specified",
"channel",
".",
"No",
"bounds",
"checks",
"will",
"be",
"performed",
"positions",
"outside",
"of",
"this",
"images",
"dimension",
"can",
"either",
"result",
"in",
"a",
"value",
... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/scientific/ColorImg.java#L946-L948 |
liferay/com-liferay-commerce | commerce-api/src/main/java/com/liferay/commerce/model/CommerceOrderItemWrapper.java | CommerceOrderItemWrapper.getName | @Override
public String getName(String languageId, boolean useDefault) {
"""
Returns the localized name of this commerce order item in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to... | java | @Override
public String getName(String languageId, boolean useDefault) {
return _commerceOrderItem.getName(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getName",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_commerceOrderItem",
".",
"getName",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized name of this commerce order item in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested language
@return... | [
"Returns",
"the",
"localized",
"name",
"of",
"this",
"commerce",
"order",
"item",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/model/CommerceOrderItemWrapper.java#L515-L518 |
davidcarboni/restolino | src/main/java/com/github/davidcarboni/restolino/Configuration.java | Configuration.configureFilesReloadable | void configureFilesReloadable(String path) {
"""
Configures static file serving from a directory. This will be reloadable,
so is most useful for development (rather than deployment). This
typically serves files from the <code>src/main/resources/files/...</code>
directory of your development project.
<p>
NB Th... | java | void configureFilesReloadable(String path) {
try {
// Running with reloading:
Path filesPath = FileSystems.getDefault().getPath(path);
filesUrl = filesPath.toUri().toURL();
} catch (IOException e) {
throw new RuntimeException("Error determining files path... | [
"void",
"configureFilesReloadable",
"(",
"String",
"path",
")",
"{",
"try",
"{",
"// Running with reloading:",
"Path",
"filesPath",
"=",
"FileSystems",
".",
"getDefault",
"(",
")",
".",
"getPath",
"(",
"path",
")",
";",
"filesUrl",
"=",
"filesPath",
".",
"toUr... | Configures static file serving from a directory. This will be reloadable,
so is most useful for development (rather than deployment). This
typically serves files from the <code>src/main/resources/files/...</code>
directory of your development project.
<p>
NB This provides an efficient development workflow, allowing you... | [
"Configures",
"static",
"file",
"serving",
"from",
"a",
"directory",
".",
"This",
"will",
"be",
"reloadable",
"so",
"is",
"most",
"useful",
"for",
"development",
"(",
"rather",
"than",
"deployment",
")",
".",
"This",
"typically",
"serves",
"files",
"from",
"... | train | https://github.com/davidcarboni/restolino/blob/3f84ece1bd016fbb597c624d46fcca5a2580a33d/src/main/java/com/github/davidcarboni/restolino/Configuration.java#L251-L260 |
amzn/ion-java | src/com/amazon/ion/Timestamp.java | Timestamp.forMinute | public static Timestamp forMinute(int year, int month, int day,
int hour, int minute,
Integer offset) {
"""
Returns a Timestamp, precise to the minute, with a given local
offset.
<p>
This is equivalent to the corresponding Ion value
{@... | java | public static Timestamp forMinute(int year, int month, int day,
int hour, int minute,
Integer offset)
{
return new Timestamp(year, month, day, hour, minute, offset);
} | [
"public",
"static",
"Timestamp",
"forMinute",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"day",
",",
"int",
"hour",
",",
"int",
"minute",
",",
"Integer",
"offset",
")",
"{",
"return",
"new",
"Timestamp",
"(",
"year",
",",
"month",
",",
"day",... | Returns a Timestamp, precise to the minute, with a given local
offset.
<p>
This is equivalent to the corresponding Ion value
{@code YYYY-MM-DDThh:mm+-oo:oo}, where {@code oo:oo} represents the
hour and minutes of the local offset from UTC.
@param offset
the local offset from UTC, measured in minutes;
may be {@code nul... | [
"Returns",
"a",
"Timestamp",
"precise",
"to",
"the",
"minute",
"with",
"a",
"given",
"local",
"offset",
".",
"<p",
">",
"This",
"is",
"equivalent",
"to",
"the",
"corresponding",
"Ion",
"value",
"{",
"@code",
"YYYY",
"-",
"MM",
"-",
"DDThh",
":",
"mm",
... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/Timestamp.java#L1268-L1273 |
arquillian/arquillian-core | container/impl-base/src/main/java/org/jboss/arquillian/container/impl/client/container/ContainerDeployController.java | ContainerDeployController.undeployManaged | public void undeployManaged(@Observes UnDeployManagedDeployments event) throws Exception {
"""
Undeploy all deployments marked as managed, and all manually deployed.
@throws Exception
"""
forEachDeployedDeployment(new Operation<Container, Deployment>() {
@Inject
private Event... | java | public void undeployManaged(@Observes UnDeployManagedDeployments event) throws Exception {
forEachDeployedDeployment(new Operation<Container, Deployment>() {
@Inject
private Event<DeploymentEvent> event;
@Override
public void perform(Container container, Deployme... | [
"public",
"void",
"undeployManaged",
"(",
"@",
"Observes",
"UnDeployManagedDeployments",
"event",
")",
"throws",
"Exception",
"{",
"forEachDeployedDeployment",
"(",
"new",
"Operation",
"<",
"Container",
",",
"Deployment",
">",
"(",
")",
"{",
"@",
"Inject",
"privat... | Undeploy all deployments marked as managed, and all manually deployed.
@throws Exception | [
"Undeploy",
"all",
"deployments",
"marked",
"as",
"managed",
"and",
"all",
"manually",
"deployed",
"."
] | train | https://github.com/arquillian/arquillian-core/blob/a85b91789b80cc77e0f0c2e2abac65c2255c0a81/container/impl-base/src/main/java/org/jboss/arquillian/container/impl/client/container/ContainerDeployController.java#L103-L115 |
fcrepo3/fcrepo | fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/finder/policy/PolicyReader.java | PolicyReader.readPolicy | public synchronized Document readPolicy(File file)
throws ParsingException {
"""
Tries to read an XACML policy or policy set from the given file.
@param file
the file containing the policy to read
@return a (potentially schema-validated) policy loaded from the given
file
@throws ParsingException... | java | public synchronized Document readPolicy(File file)
throws ParsingException {
try {
return builder.parse(file);
} catch (IOException ioe) {
throw new ParsingException("Failed to read the file", ioe);
} catch (SAXException saxe) {
throw new ParsingEx... | [
"public",
"synchronized",
"Document",
"readPolicy",
"(",
"File",
"file",
")",
"throws",
"ParsingException",
"{",
"try",
"{",
"return",
"builder",
".",
"parse",
"(",
"file",
")",
";",
"}",
"catch",
"(",
"IOException",
"ioe",
")",
"{",
"throw",
"new",
"Parsi... | Tries to read an XACML policy or policy set from the given file.
@param file
the file containing the policy to read
@return a (potentially schema-validated) policy loaded from the given
file
@throws ParsingException
if an error occurs while reading or parsing the policy | [
"Tries",
"to",
"read",
"an",
"XACML",
"policy",
"or",
"policy",
"set",
"from",
"the",
"given",
"file",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/finder/policy/PolicyReader.java#L150-L159 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spy2nd | public static <T1, T2, T3> TriConsumer<T1, T2, T3> spy2nd(TriConsumer<T1, T2, T3> consumer, Box<T2> param2) {
"""
Proxies a ternary consumer spying for second parameter.
@param <T1> the consumer first parameter type
@param <T2> the consumer second parameter type
@param <T3> the consumer third parameter type
... | java | public static <T1, T2, T3> TriConsumer<T1, T2, T3> spy2nd(TriConsumer<T1, T2, T3> consumer, Box<T2> param2) {
return spy(consumer, Box.<T1>empty(), param2, Box.<T3>empty());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"TriConsumer",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"spy2nd",
"(",
"TriConsumer",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"consumer",
",",
"Box",
"<",
"T2",
">",
"param2",
")",
"{",
"retu... | Proxies a ternary consumer spying for second parameter.
@param <T1> the consumer first parameter type
@param <T2> the consumer second parameter type
@param <T3> the consumer third parameter type
@param consumer the consumer that will be spied
@param param2 a box that will be containing the second spied parameter
@retu... | [
"Proxies",
"a",
"ternary",
"consumer",
"spying",
"for",
"second",
"parameter",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L335-L337 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/Logger.java | Logger.logError | public void logError(final Level level, final String message, final Error e) {
"""
The occurred error with the related log level and message has to be given
to this method.
This method will verify if the message should be logged or not.
@param level
log level
@param message
message
@param e
Error
"... | java | public void logError(final Level level, final String message, final Error e)
{
try {
Logger errors = LoggingFactory
.getLogger(LoggingFactory.NAME_ERROR_LOGGER);
errors.logThrowable(level, message, e);
}
catch (LoggingException ex) {
ex.printStackTrace();
}
if (logLevel.toInt() > level.toInt... | [
"public",
"void",
"logError",
"(",
"final",
"Level",
"level",
",",
"final",
"String",
"message",
",",
"final",
"Error",
"e",
")",
"{",
"try",
"{",
"Logger",
"errors",
"=",
"LoggingFactory",
".",
"getLogger",
"(",
"LoggingFactory",
".",
"NAME_ERROR_LOGGER",
"... | The occurred error with the related log level and message has to be given
to this method.
This method will verify if the message should be logged or not.
@param level
log level
@param message
message
@param e
Error | [
"The",
"occurred",
"error",
"with",
"the",
"related",
"log",
"level",
"and",
"message",
"has",
"to",
"be",
"given",
"to",
"this",
"method",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/Logger.java#L162-L180 |
pravega/pravega | shared/metrics/src/main/java/io/pravega/shared/MetricsNames.java | MetricsNames.metricKey | public static MetricKey metricKey(String metric, String... tags) {
"""
Create an MetricKey object based on metric name, metric type and tags associated.
The MetricKey object contains cache key for cache lookup and registry key for registry lookup.
@param metric the metric name.
@param tags the tag(s) associat... | java | public static MetricKey metricKey(String metric, String... tags) {
if (tags == null || tags.length == 0) { //if no tags supplied, the original metric name is used for both cache key and registry key.
return new MetricKey(metric, metric);
} else { //if tag is supplied, append tag value to f... | [
"public",
"static",
"MetricKey",
"metricKey",
"(",
"String",
"metric",
",",
"String",
"...",
"tags",
")",
"{",
"if",
"(",
"tags",
"==",
"null",
"||",
"tags",
".",
"length",
"==",
"0",
")",
"{",
"//if no tags supplied, the original metric name is used for both cach... | Create an MetricKey object based on metric name, metric type and tags associated.
The MetricKey object contains cache key for cache lookup and registry key for registry lookup.
@param metric the metric name.
@param tags the tag(s) associated with the metric.
@return the MetricKey object contains cache lookup key and m... | [
"Create",
"an",
"MetricKey",
"object",
"based",
"on",
"metric",
"name",
"metric",
"type",
"and",
"tags",
"associated",
".",
"The",
"MetricKey",
"object",
"contains",
"cache",
"key",
"for",
"cache",
"lookup",
"and",
"registry",
"key",
"for",
"registry",
"lookup... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/metrics/src/main/java/io/pravega/shared/MetricsNames.java#L244-L257 |
bazaarvoice/jolt | cli/src/main/java/com/bazaarvoice/jolt/JoltCliUtilities.java | JoltCliUtilities.createJsonObjectFromFile | public static Object createJsonObjectFromFile( File file, boolean suppressOutput ) {
"""
Uses the File to build a Map containing JSON data found in the file. This method will
System exit with an error code of 1 if has any trouble opening the file or the file did not
contain properly formatted JSON (i.e. the JSON... | java | public static Object createJsonObjectFromFile( File file, boolean suppressOutput ) {
Object jsonObject = null;
try {
FileInputStream inputStream = new FileInputStream( file );
jsonObject = JsonUtils.jsonToObject( inputStream );
inputStream.close();
} catch ( I... | [
"public",
"static",
"Object",
"createJsonObjectFromFile",
"(",
"File",
"file",
",",
"boolean",
"suppressOutput",
")",
"{",
"Object",
"jsonObject",
"=",
"null",
";",
"try",
"{",
"FileInputStream",
"inputStream",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";... | Uses the File to build a Map containing JSON data found in the file. This method will
System exit with an error code of 1 if has any trouble opening the file or the file did not
contain properly formatted JSON (i.e. the JSON parser was unable to parse its contents)
@return the Map containing the JSON data | [
"Uses",
"the",
"File",
"to",
"build",
"a",
"Map",
"containing",
"JSON",
"data",
"found",
"in",
"the",
"file",
".",
"This",
"method",
"will",
"System",
"exit",
"with",
"an",
"error",
"code",
"of",
"1",
"if",
"has",
"any",
"trouble",
"opening",
"the",
"f... | train | https://github.com/bazaarvoice/jolt/blob/4cf866a9f4222142da41b50dbcccce022a956bff/cli/src/main/java/com/bazaarvoice/jolt/JoltCliUtilities.java#L49-L64 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/network/inatsession_stats.java | inatsession_stats.get | public static inatsession_stats get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch statistics of inatsession_stats resource of given name .
"""
inatsession_stats obj = new inatsession_stats();
obj.set_name(name);
inatsession_stats response = (inatsession_stats) obj.stat_... | java | public static inatsession_stats get(nitro_service service, String name) throws Exception{
inatsession_stats obj = new inatsession_stats();
obj.set_name(name);
inatsession_stats response = (inatsession_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"inatsession_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"inatsession_stats",
"obj",
"=",
"new",
"inatsession_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
... | Use this API to fetch statistics of inatsession_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"inatsession_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/network/inatsession_stats.java#L231-L236 |
OpenLiberty/open-liberty | dev/com.ibm.ws.opentracing/src/com/ibm/ws/opentracing/filters/SpanFilterBase.java | SpanFilterBase.validatePattern | protected void validatePattern() {
"""
Throw exceptions if the pattern is invalid.
@throws IllegalArgumentException Pattern is blank or non-conformant to RFC 2396.
"""
if (pattern.length() == 0) {
throw new IllegalArgumentException(Tr.formatMessage(tc, "OPENTRACING_FILTER_PATTERN_BLANK")... | java | protected void validatePattern() {
if (pattern.length() == 0) {
throw new IllegalArgumentException(Tr.formatMessage(tc, "OPENTRACING_FILTER_PATTERN_BLANK"));
}
if (!regex) {
try {
URI.create(pattern);
} catch (IllegalArgumentException e) {
... | [
"protected",
"void",
"validatePattern",
"(",
")",
"{",
"if",
"(",
"pattern",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"Tr",
".",
"formatMessage",
"(",
"tc",
",",
"\"OPENTRACING_FILTER_PATTERN_BLANK\"",
")",... | Throw exceptions if the pattern is invalid.
@throws IllegalArgumentException Pattern is blank or non-conformant to RFC 2396. | [
"Throw",
"exceptions",
"if",
"the",
"pattern",
"is",
"invalid",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.opentracing/src/com/ibm/ws/opentracing/filters/SpanFilterBase.java#L103-L115 |
flow/commons | src/main/java/com/flowpowered/commons/queue/SubscribableQueue.java | SubscribableQueue.addAll | public boolean addAll(Collection<? extends T> c, Object identifier) {
"""
Adds a collection of objects to the queue, targeting only the subscriber identified by the provided identifier object, unless said object is null. The added objects will only be visible to the
subscriber.
@param c The collection of objec... | java | public boolean addAll(Collection<? extends T> c, Object identifier) {
checkNotNullArgument(c);
if (isPublisherThread()) {
boolean changed = false;
if (identifier != null) {
final Long id = subscriberIdentifiers.get(identifier);
checkNotNullIdentifi... | [
"public",
"boolean",
"addAll",
"(",
"Collection",
"<",
"?",
"extends",
"T",
">",
"c",
",",
"Object",
"identifier",
")",
"{",
"checkNotNullArgument",
"(",
"c",
")",
";",
"if",
"(",
"isPublisherThread",
"(",
")",
")",
"{",
"boolean",
"changed",
"=",
"false... | Adds a collection of objects to the queue, targeting only the subscriber identified by the provided identifier object, unless said object is null. The added objects will only be visible to the
subscriber.
@param c The collection of objects to add
@param identifier The identifier object, can be null
@return True if thi... | [
"Adds",
"a",
"collection",
"of",
"objects",
"to",
"the",
"queue",
"targeting",
"only",
"the",
"subscriber",
"identified",
"by",
"the",
"provided",
"identifier",
"object",
"unless",
"said",
"object",
"is",
"null",
".",
"The",
"added",
"objects",
"will",
"only",... | train | https://github.com/flow/commons/blob/0690efdac06fd728fcd7e9cf10f2b1319379c45b/src/main/java/com/flowpowered/commons/queue/SubscribableQueue.java#L195-L213 |
WolfgangFahl/Mediawiki-Japi | src/main/java/com/bitplan/mediawiki/japi/Mediawiki.java | Mediawiki.getPages | public List<Page> getPages(List<String> titleList) throws Exception {
"""
get a list of pages for the given titles see
<a href='http://www.mediawiki.org/wiki/API:Query'>API:Query</a>
@param titleList
@return
@throws Exception
"""
String rvprop = "content|ids|timestamp";
List<Page> result = this.g... | java | public List<Page> getPages(List<String> titleList) throws Exception {
String rvprop = "content|ids|timestamp";
List<Page> result = this.getPages(titleList, rvprop);
return result;
} | [
"public",
"List",
"<",
"Page",
">",
"getPages",
"(",
"List",
"<",
"String",
">",
"titleList",
")",
"throws",
"Exception",
"{",
"String",
"rvprop",
"=",
"\"content|ids|timestamp\"",
";",
"List",
"<",
"Page",
">",
"result",
"=",
"this",
".",
"getPages",
"(",... | get a list of pages for the given titles see
<a href='http://www.mediawiki.org/wiki/API:Query'>API:Query</a>
@param titleList
@return
@throws Exception | [
"get",
"a",
"list",
"of",
"pages",
"for",
"the",
"given",
"titles",
"see",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"mediawiki",
".",
"org",
"/",
"wiki",
"/",
"API",
":",
"Query",
">",
"API",
":",
"Query<",
"/",
"a",
">"
] | train | https://github.com/WolfgangFahl/Mediawiki-Japi/blob/78d0177ebfe02eb05da5550839727861f1e888a5/src/main/java/com/bitplan/mediawiki/japi/Mediawiki.java#L872-L876 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyDirectLinearTransform.java | HomographyDirectLinearTransform.computeH | protected boolean computeH(DMatrixRMaj A, DMatrixRMaj H) {
"""
Computes the SVD of A and extracts the homography matrix from its null space
"""
if( !solverNullspace.process(A.copy(),1,H) )
return true;
H.numRows = 3;
H.numCols = 3;
return false;
} | java | protected boolean computeH(DMatrixRMaj A, DMatrixRMaj H) {
if( !solverNullspace.process(A.copy(),1,H) )
return true;
H.numRows = 3;
H.numCols = 3;
return false;
} | [
"protected",
"boolean",
"computeH",
"(",
"DMatrixRMaj",
"A",
",",
"DMatrixRMaj",
"H",
")",
"{",
"if",
"(",
"!",
"solverNullspace",
".",
"process",
"(",
"A",
".",
"copy",
"(",
")",
",",
"1",
",",
"H",
")",
")",
"return",
"true",
";",
"H",
".",
"numR... | Computes the SVD of A and extracts the homography matrix from its null space | [
"Computes",
"the",
"SVD",
"of",
"A",
"and",
"extracts",
"the",
"homography",
"matrix",
"from",
"its",
"null",
"space"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyDirectLinearTransform.java#L189-L198 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java | GeneratedDConnectionDaoImpl.queryByUpdatedBy | public Iterable<DConnection> queryByUpdatedBy(java.lang.String updatedBy) {
"""
query-by method for field updatedBy
@param updatedBy the specified attribute
@return an Iterable of DConnections for the specified updatedBy
"""
return queryByField(null, DConnectionMapper.Field.UPDATEDBY.getFieldName(), upda... | java | public Iterable<DConnection> queryByUpdatedBy(java.lang.String updatedBy) {
return queryByField(null, DConnectionMapper.Field.UPDATEDBY.getFieldName(), updatedBy);
} | [
"public",
"Iterable",
"<",
"DConnection",
">",
"queryByUpdatedBy",
"(",
"java",
".",
"lang",
".",
"String",
"updatedBy",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DConnectionMapper",
".",
"Field",
".",
"UPDATEDBY",
".",
"getFieldName",
"(",
")",
... | query-by method for field updatedBy
@param updatedBy the specified attribute
@return an Iterable of DConnections for the specified updatedBy | [
"query",
"-",
"by",
"method",
"for",
"field",
"updatedBy"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java#L151-L153 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/MessageAPI.java | MessageAPI.mediaUploadvideo | public static Media mediaUploadvideo(String access_token, Uploadvideo uploadvideo) {
"""
高级群发 构成 MassMPvideoMessage 对象的前置请求接口
@param access_token access_token
@param uploadvideo uploadvideo
@return Media
"""
return MediaAPI.mediaUploadvideo(access_token, uploadvideo);
} | java | public static Media mediaUploadvideo(String access_token, Uploadvideo uploadvideo) {
return MediaAPI.mediaUploadvideo(access_token, uploadvideo);
} | [
"public",
"static",
"Media",
"mediaUploadvideo",
"(",
"String",
"access_token",
",",
"Uploadvideo",
"uploadvideo",
")",
"{",
"return",
"MediaAPI",
".",
"mediaUploadvideo",
"(",
"access_token",
",",
"uploadvideo",
")",
";",
"}"
] | 高级群发 构成 MassMPvideoMessage 对象的前置请求接口
@param access_token access_token
@param uploadvideo uploadvideo
@return Media | [
"高级群发",
"构成",
"MassMPvideoMessage",
"对象的前置请求接口"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/MessageAPI.java#L123-L125 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/io/async/AbstractAsyncFuture.java | AbstractAsyncFuture.invokeCallback | protected void invokeCallback(ICompletionListener listener, AbstractAsyncFuture future, Object userState) {
"""
Runs a callback on the given listener safely. We cannot allow misbehaved application
callback code to spoil the notification of subsequent listeners or other tidy-up work,
so the callbacks have to be t... | java | protected void invokeCallback(ICompletionListener listener, AbstractAsyncFuture future, Object userState) {
try {
ExecutorService executorService = CHFWBundle.getExecutorService();
if (null == executorService) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnable... | [
"protected",
"void",
"invokeCallback",
"(",
"ICompletionListener",
"listener",
",",
"AbstractAsyncFuture",
"future",
",",
"Object",
"userState",
")",
"{",
"try",
"{",
"ExecutorService",
"executorService",
"=",
"CHFWBundle",
".",
"getExecutorService",
"(",
")",
";",
... | Runs a callback on the given listener safely. We cannot allow misbehaved application
callback code to spoil the notification of subsequent listeners or other tidy-up work,
so the callbacks have to be tightly wrappered in an exception hander that ignores the
error and continues with the next callback. This could lead to... | [
"Runs",
"a",
"callback",
"on",
"the",
"given",
"listener",
"safely",
".",
"We",
"cannot",
"allow",
"misbehaved",
"application",
"callback",
"code",
"to",
"spoil",
"the",
"notification",
"of",
"subsequent",
"listeners",
"or",
"other",
"tidy",
"-",
"up",
"work",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/io/async/AbstractAsyncFuture.java#L182-L205 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java | SSOCookieHelperImpl.addSSOCookiesToResponse | @Override
public void addSSOCookiesToResponse(Subject subject, HttpServletRequest req, HttpServletResponse resp) {
"""
Set-Cookie: <name>=<value>[; <name>=<value>]...
[; expires=<date>][; domain=<domain_name>]
[; path=<some_path>][; secure][; httponly]
"""
if (!allowToAddCookieToResponse(req))
... | java | @Override
public void addSSOCookiesToResponse(Subject subject, HttpServletRequest req, HttpServletResponse resp) {
if (!allowToAddCookieToResponse(req))
return;
addJwtSsoCookiesToResponse(subject, req, resp);
if (!JwtSSOTokenHelper.shouldAlsoIncludeLtpaCookie()) {
r... | [
"@",
"Override",
"public",
"void",
"addSSOCookiesToResponse",
"(",
"Subject",
"subject",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"{",
"if",
"(",
"!",
"allowToAddCookieToResponse",
"(",
"req",
")",
")",
"return",
";",
"addJwtSsoCo... | Set-Cookie: <name>=<value>[; <name>=<value>]...
[; expires=<date>][; domain=<domain_name>]
[; path=<some_path>][; secure][; httponly] | [
"Set",
"-",
"Cookie",
":",
"<name",
">",
"=",
"<value",
">",
"[",
";",
"<name",
">",
"=",
"<value",
">",
"]",
"...",
"[",
";",
"expires",
"=",
"<date",
">",
"]",
"[",
";",
"domain",
"=",
"<domain_name",
">",
"]",
"[",
";",
"path",
"=",
"<some_p... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java#L73-L103 |
xwiki/xwiki-rendering | xwiki-rendering-api/src/main/java/org/xwiki/rendering/internal/parser/reference/GenericLinkReferenceParser.java | GenericLinkReferenceParser.parseElementAfterString | protected String parseElementAfterString(StringBuilder content, String separator) {
"""
Find out the element located to the right of the passed separator.
@param content the string to parse. This parameter will be modified by the method to remove the parsed content.
@param separator the separator string to loc... | java | protected String parseElementAfterString(StringBuilder content, String separator)
{
String element = null;
// Find the first non escaped separator (starting from the end of the content buffer).
int index = content.lastIndexOf(separator);
while (index != -1) {
// Check if... | [
"protected",
"String",
"parseElementAfterString",
"(",
"StringBuilder",
"content",
",",
"String",
"separator",
")",
"{",
"String",
"element",
"=",
"null",
";",
"// Find the first non escaped separator (starting from the end of the content buffer).",
"int",
"index",
"=",
"cont... | Find out the element located to the right of the passed separator.
@param content the string to parse. This parameter will be modified by the method to remove the parsed content.
@param separator the separator string to locate the element
@return the parsed element or null if the separator string wasn't found | [
"Find",
"out",
"the",
"element",
"located",
"to",
"the",
"right",
"of",
"the",
"passed",
"separator",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-api/src/main/java/org/xwiki/rendering/internal/parser/reference/GenericLinkReferenceParser.java#L260-L282 |
liferay/com-liferay-commerce | commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListPersistenceImpl.java | CommerceWishListPersistenceImpl.removeByG_U_D | @Override
public void removeByG_U_D(long groupId, long userId, boolean defaultWishList) {
"""
Removes all the commerce wish lists where groupId = ? and userId = ? and defaultWishList = ? from the database.
@param groupId the group ID
@param userId the user ID
@param defaultWishList the default wi... | java | @Override
public void removeByG_U_D(long groupId, long userId, boolean defaultWishList) {
for (CommerceWishList commerceWishList : findByG_U_D(groupId, userId,
defaultWishList, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceWishList);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_U_D",
"(",
"long",
"groupId",
",",
"long",
"userId",
",",
"boolean",
"defaultWishList",
")",
"{",
"for",
"(",
"CommerceWishList",
"commerceWishList",
":",
"findByG_U_D",
"(",
"groupId",
",",
"userId",
",",
"defaultWi... | Removes all the commerce wish lists where groupId = ? and userId = ? and defaultWishList = ? from the database.
@param groupId the group ID
@param userId the user ID
@param defaultWishList the default wish list | [
"Removes",
"all",
"the",
"commerce",
"wish",
"lists",
"where",
"groupId",
"=",
"?",
";",
"and",
"userId",
"=",
"?",
";",
"and",
"defaultWishList",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListPersistenceImpl.java#L4133-L4139 |
infinispan/infinispan | core/src/main/java/org/infinispan/util/concurrent/CommandAckCollector.java | CommandAckCollector.completeExceptionally | public void completeExceptionally(long id, Throwable throwable, int topologyId) {
"""
Acknowledges an exception during the operation execution.
<p>
The collector is completed without waiting any further acknowledges.
@param id the id from {@link CommandInvocationId#getId()}.
@param throwable the {@l... | java | public void completeExceptionally(long id, Throwable throwable, int topologyId) {
BaseAckTarget ackTarget = collectorMap.get(id);
if (ackTarget != null) {
ackTarget.completeExceptionally(throwable, topologyId);
}
} | [
"public",
"void",
"completeExceptionally",
"(",
"long",
"id",
",",
"Throwable",
"throwable",
",",
"int",
"topologyId",
")",
"{",
"BaseAckTarget",
"ackTarget",
"=",
"collectorMap",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"ackTarget",
"!=",
"null",
")",
... | Acknowledges an exception during the operation execution.
<p>
The collector is completed without waiting any further acknowledges.
@param id the id from {@link CommandInvocationId#getId()}.
@param throwable the {@link Throwable}.
@param topologyId the topology id. | [
"Acknowledges",
"an",
"exception",
"during",
"the",
"operation",
"execution",
".",
"<p",
">",
"The",
"collector",
"is",
"completed",
"without",
"waiting",
"any",
"further",
"acknowledges",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/util/concurrent/CommandAckCollector.java#L183-L188 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Constraint.java | Constraint.checkHasMainRef | boolean checkHasMainRef(Session session, Object[] row) {
"""
For the candidate table row, finds any referring node in the main table.
This is used to check referential integrity when updating a node. We
have to make sure that the main table still holds a valid main record.
returns true If a valid row is found, ... | java | boolean checkHasMainRef(Session session, Object[] row) {
if (ArrayUtil.hasNull(row, core.refCols)) {
return false;
}
PersistentStore store =
session.sessionData.getRowStore(core.mainTable);
boolean exists = core.mainIndex.exists(session, store, row,
... | [
"boolean",
"checkHasMainRef",
"(",
"Session",
"session",
",",
"Object",
"[",
"]",
"row",
")",
"{",
"if",
"(",
"ArrayUtil",
".",
"hasNull",
"(",
"row",
",",
"core",
".",
"refCols",
")",
")",
"{",
"return",
"false",
";",
"}",
"PersistentStore",
"store",
... | For the candidate table row, finds any referring node in the main table.
This is used to check referential integrity when updating a node. We
have to make sure that the main table still holds a valid main record.
returns true If a valid row is found, false if there are null in the data
Otherwise a 'INTEGRITY VIOLATION'... | [
"For",
"the",
"candidate",
"table",
"row",
"finds",
"any",
"referring",
"node",
"in",
"the",
"main",
"table",
".",
"This",
"is",
"used",
"to",
"check",
"referential",
"integrity",
"when",
"updating",
"a",
"node",
".",
"We",
"have",
"to",
"make",
"sure",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Constraint.java#L923-L943 |
liuyukuai/commons | commons-core/src/main/java/com/itxiaoer/commons/core/date/LocalDateUtil.java | LocalDateUtil.untilDays | public static List<LocalDate> untilDays(String startDate, String endDate, String pattern) {
"""
计算两个时间内的日期
@param startDate 开始时间
@param endDate 结束时间
@param pattern 日期格式
@return 日期集合
"""
return untilDays(parse(startDate, pattern), parse(endDate, pattern));
} | java | public static List<LocalDate> untilDays(String startDate, String endDate, String pattern) {
return untilDays(parse(startDate, pattern), parse(endDate, pattern));
} | [
"public",
"static",
"List",
"<",
"LocalDate",
">",
"untilDays",
"(",
"String",
"startDate",
",",
"String",
"endDate",
",",
"String",
"pattern",
")",
"{",
"return",
"untilDays",
"(",
"parse",
"(",
"startDate",
",",
"pattern",
")",
",",
"parse",
"(",
"endDat... | 计算两个时间内的日期
@param startDate 开始时间
@param endDate 结束时间
@param pattern 日期格式
@return 日期集合 | [
"计算两个时间内的日期"
] | train | https://github.com/liuyukuai/commons/blob/ba67eddb542446b12f419f1866dbaa82e47fbf35/commons-core/src/main/java/com/itxiaoer/commons/core/date/LocalDateUtil.java#L142-L144 |
ryanbrainard/richsobjects | richsobjects-cache-memcached/src/main/java/com/github/ryanbrainard/richsobjects/api/client/ClassLoaderRegisteringObjectInputStream.java | ClassLoaderRegisteringObjectInputStream.resolveClass | @Override
protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
"""
Use the registered ClassLoaders to resolve and then use system class loader
"""
for (ClassLoader loader : classLoaderRegistration) {
try {
return resolveC... | java | @Override
protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
for (ClassLoader loader : classLoaderRegistration) {
try {
return resolveClass(classDesc, loader);
} catch (ClassNotFoundException e) {
// ... | [
"@",
"Override",
"protected",
"Class",
"resolveClass",
"(",
"ObjectStreamClass",
"classDesc",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"for",
"(",
"ClassLoader",
"loader",
":",
"classLoaderRegistration",
")",
"{",
"try",
"{",
"return",
"reso... | Use the registered ClassLoaders to resolve and then use system class loader | [
"Use",
"the",
"registered",
"ClassLoaders",
"to",
"resolve",
"and",
"then",
"use",
"system",
"class",
"loader"
] | train | https://github.com/ryanbrainard/richsobjects/blob/d1af259d9098557c2abd53f94c20cc663cf9b6e7/richsobjects-cache-memcached/src/main/java/com/github/ryanbrainard/richsobjects/api/client/ClassLoaderRegisteringObjectInputStream.java#L49-L59 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/quality/AbstractKMeansQualityMeasure.java | AbstractKMeansQualityMeasure.varianceOfCluster | public static <V extends NumberVector> double varianceOfCluster(Cluster<? extends MeanModel> cluster, NumberVectorDistanceFunction<? super V> distanceFunction, Relation<V> relation) {
"""
Variance contribution of a single cluster.
<p>
If possible, this information is reused from the clustering process (when a
K... | java | public static <V extends NumberVector> double varianceOfCluster(Cluster<? extends MeanModel> cluster, NumberVectorDistanceFunction<? super V> distanceFunction, Relation<V> relation) {
MeanModel model = cluster.getModel();
if(model instanceof KMeansModel) {
return ((KMeansModel) model).getVarianceContribut... | [
"public",
"static",
"<",
"V",
"extends",
"NumberVector",
">",
"double",
"varianceOfCluster",
"(",
"Cluster",
"<",
"?",
"extends",
"MeanModel",
">",
"cluster",
",",
"NumberVectorDistanceFunction",
"<",
"?",
"super",
"V",
">",
"distanceFunction",
",",
"Relation",
... | Variance contribution of a single cluster.
<p>
If possible, this information is reused from the clustering process (when a
KMeansModel is returned).
@param cluster Cluster to access
@param distanceFunction Distance function
@param relation Data relation
@param <V> Vector type
@return Cluster variance | [
"Variance",
"contribution",
"of",
"a",
"single",
"cluster",
".",
"<p",
">",
"If",
"possible",
"this",
"information",
"is",
"reused",
"from",
"the",
"clustering",
"process",
"(",
"when",
"a",
"KMeansModel",
"is",
"returned",
")",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/quality/AbstractKMeansQualityMeasure.java#L95-L111 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java | InodeTree.setDirectChildrenLoaded | public void setDirectChildrenLoaded(Supplier<JournalContext> context, InodeDirectory dir) {
"""
Marks an inode directory as having its direct children loaded.
@param context journal context supplier
@param dir the inode directory
"""
mState.applyAndJournal(context, UpdateInodeDirectoryEntry.newBuilder(... | java | public void setDirectChildrenLoaded(Supplier<JournalContext> context, InodeDirectory dir) {
mState.applyAndJournal(context, UpdateInodeDirectoryEntry.newBuilder()
.setId(dir.getId())
.setDirectChildrenLoaded(true)
.build());
} | [
"public",
"void",
"setDirectChildrenLoaded",
"(",
"Supplier",
"<",
"JournalContext",
">",
"context",
",",
"InodeDirectory",
"dir",
")",
"{",
"mState",
".",
"applyAndJournal",
"(",
"context",
",",
"UpdateInodeDirectoryEntry",
".",
"newBuilder",
"(",
")",
".",
"setI... | Marks an inode directory as having its direct children loaded.
@param context journal context supplier
@param dir the inode directory | [
"Marks",
"an",
"inode",
"directory",
"as",
"having",
"its",
"direct",
"children",
"loaded",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java#L257-L262 |
alkacon/opencms-core | src/org/opencms/site/CmsSiteManagerImpl.java | CmsSiteManagerImpl.addServer | private void addServer(CmsSiteMatcher matcher, CmsSite site) {
"""
Adds a new Site matcher object to the map of server names.
@param matcher the SiteMatcher of the server
@param site the site to add
"""
Map<CmsSiteMatcher, CmsSite> siteMatcherSites = new HashMap<CmsSiteMatcher, CmsSite>(m_siteMatc... | java | private void addServer(CmsSiteMatcher matcher, CmsSite site) {
Map<CmsSiteMatcher, CmsSite> siteMatcherSites = new HashMap<CmsSiteMatcher, CmsSite>(m_siteMatcherSites);
siteMatcherSites.put(matcher, site);
setSiteMatcherSites(siteMatcherSites);
} | [
"private",
"void",
"addServer",
"(",
"CmsSiteMatcher",
"matcher",
",",
"CmsSite",
"site",
")",
"{",
"Map",
"<",
"CmsSiteMatcher",
",",
"CmsSite",
">",
"siteMatcherSites",
"=",
"new",
"HashMap",
"<",
"CmsSiteMatcher",
",",
"CmsSite",
">",
"(",
"m_siteMatcherSites... | Adds a new Site matcher object to the map of server names.
@param matcher the SiteMatcher of the server
@param site the site to add | [
"Adds",
"a",
"new",
"Site",
"matcher",
"object",
"to",
"the",
"map",
"of",
"server",
"names",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/CmsSiteManagerImpl.java#L1632-L1637 |
AKSW/RDFUnit | rdfunit-validate/src/main/java/org/aksw/rdfunit/validate/ws/AbstractRDFUnitWebService.java | AbstractRDFUnitWebService.handleRequestAndRespond | private void handleRequestAndRespond(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException {
"""
Has all the workflow logic for getting the parameters, performing a validation and writing the output
"""
RDFUnitConfiguration configuration = null;
try ... | java | private void handleRequestAndRespond(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException {
RDFUnitConfiguration configuration = null;
try {
configuration = getConfiguration(httpServletRequest);
} catch (ParameterException e) {
... | [
"private",
"void",
"handleRequestAndRespond",
"(",
"HttpServletRequest",
"httpServletRequest",
",",
"HttpServletResponse",
"httpServletResponse",
")",
"throws",
"IOException",
"{",
"RDFUnitConfiguration",
"configuration",
"=",
"null",
";",
"try",
"{",
"configuration",
"=",
... | Has all the workflow logic for getting the parameters, performing a validation and writing the output | [
"Has",
"all",
"the",
"workflow",
"logic",
"for",
"getting",
"the",
"parameters",
"performing",
"a",
"validation",
"and",
"writing",
"the",
"output"
] | train | https://github.com/AKSW/RDFUnit/blob/083f18ebda4ad790b1fbb4cfe1c9dd1762d51384/rdfunit-validate/src/main/java/org/aksw/rdfunit/validate/ws/AbstractRDFUnitWebService.java#L45-L78 |
dasein-cloud/dasein-cloud-aws | src/main/java/org/dasein/cloud/aws/AWSCloud.java | AWSCloud.addValueIfNotNull | public static void addValueIfNotNull( @Nonnull Map<String, String> parameters, @Nonnull String key, Object value ) {
"""
Puts the given key/value into the given map only if the value is not null.
@param parameters the map to add to
@param key the key of the value
@param value the value to add if n... | java | public static void addValueIfNotNull( @Nonnull Map<String, String> parameters, @Nonnull String key, Object value ) {
if( value == null ) {
return;
}
parameters.put(key, value.toString());
} | [
"public",
"static",
"void",
"addValueIfNotNull",
"(",
"@",
"Nonnull",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"@",
"Nonnull",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
... | Puts the given key/value into the given map only if the value is not null.
@param parameters the map to add to
@param key the key of the value
@param value the value to add if not null | [
"Puts",
"the",
"given",
"key",
"/",
"value",
"into",
"the",
"given",
"map",
"only",
"if",
"the",
"value",
"is",
"not",
"null",
"."
] | train | https://github.com/dasein-cloud/dasein-cloud-aws/blob/05098574197a1f573f77447cadc39a76bf00b99d/src/main/java/org/dasein/cloud/aws/AWSCloud.java#L1436-L1441 |
hibernate/hibernate-metamodelgen | src/main/java/org/hibernate/jpamodelgen/ClassWriter.java | ClassWriter.extendsSuperMetaModel | private static boolean extendsSuperMetaModel(Element superClassElement, boolean entityMetaComplete, Context context) {
"""
Checks whether this metamodel class needs to extend another metamodel class.
This methods checks whether the processor has generated a metamodel class for the super class, but it also
allows... | java | private static boolean extendsSuperMetaModel(Element superClassElement, boolean entityMetaComplete, Context context) {
// if we processed the superclass in the same run we definitely need to extend
String superClassName = ( (TypeElement) superClassElement ).getQualifiedName().toString();
if ( context.containsMeta... | [
"private",
"static",
"boolean",
"extendsSuperMetaModel",
"(",
"Element",
"superClassElement",
",",
"boolean",
"entityMetaComplete",
",",
"Context",
"context",
")",
"{",
"// if we processed the superclass in the same run we definitely need to extend",
"String",
"superClassName",
"... | Checks whether this metamodel class needs to extend another metamodel class.
This methods checks whether the processor has generated a metamodel class for the super class, but it also
allows for the possibility that the metamodel class was generated in a previous compilation (eg it could be
part of a separate jar. See ... | [
"Checks",
"whether",
"this",
"metamodel",
"class",
"needs",
"to",
"extend",
"another",
"metamodel",
"class",
".",
"This",
"methods",
"checks",
"whether",
"the",
"processor",
"has",
"generated",
"a",
"metamodel",
"class",
"for",
"the",
"super",
"class",
"but",
... | train | https://github.com/hibernate/hibernate-metamodelgen/blob/2c87b262bc03b1a5a541789fc00c54e0531a36b2/src/main/java/org/hibernate/jpamodelgen/ClassWriter.java#L177-L194 |
erlang/otp | lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMbox.java | OtpMbox.receiveMsg | public OtpMsg receiveMsg() throws OtpErlangExit {
"""
Block until a message arrives for this mailbox.
@return an {@link OtpMsg OtpMsg} containing the header information as
well as the body of the next message waiting in this mailbox.
@exception OtpErlangExit
if a linked {@link OtpErlangPid pid} has exited ... | java | public OtpMsg receiveMsg() throws OtpErlangExit {
final OtpMsg m = (OtpMsg) queue.get();
switch (m.type()) {
case OtpMsg.exitTag:
case OtpMsg.exit2Tag:
try {
final OtpErlangObject o = m.getMsg();
throw new OtpErlangExit(o, m.getSenderPid());
... | [
"public",
"OtpMsg",
"receiveMsg",
"(",
")",
"throws",
"OtpErlangExit",
"{",
"final",
"OtpMsg",
"m",
"=",
"(",
"OtpMsg",
")",
"queue",
".",
"get",
"(",
")",
";",
"switch",
"(",
"m",
".",
"type",
"(",
")",
")",
"{",
"case",
"OtpMsg",
".",
"exitTag",
... | Block until a message arrives for this mailbox.
@return an {@link OtpMsg OtpMsg} containing the header information as
well as the body of the next message waiting in this mailbox.
@exception OtpErlangExit
if a linked {@link OtpErlangPid pid} has exited or has
sent an exit signal to this mailbox. | [
"Block",
"until",
"a",
"message",
"arrives",
"for",
"this",
"mailbox",
"."
] | train | https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMbox.java#L263-L280 |
Teddy-Zhu/SilentGo | utils/src/main/java/com/silentgo/utils/asm/ClassUtils.java | ClassUtils.matchesTypeName | public static boolean matchesTypeName(Class<?> clazz, String typeName) {
"""
Check whether the given class matches the user-specified type name.
@param clazz the class to check
@param typeName the type name to match
"""
return (typeName != null &&
(typeName.equals(clazz.getTypeNa... | java | public static boolean matchesTypeName(Class<?> clazz, String typeName) {
return (typeName != null &&
(typeName.equals(clazz.getTypeName()) || typeName.equals(clazz.getSimpleName())));
} | [
"public",
"static",
"boolean",
"matchesTypeName",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"typeName",
")",
"{",
"return",
"(",
"typeName",
"!=",
"null",
"&&",
"(",
"typeName",
".",
"equals",
"(",
"clazz",
".",
"getTypeName",
"(",
")",
")",
... | Check whether the given class matches the user-specified type name.
@param clazz the class to check
@param typeName the type name to match | [
"Check",
"whether",
"the",
"given",
"class",
"matches",
"the",
"user",
"-",
"specified",
"type",
"name",
"."
] | train | https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/utils/src/main/java/com/silentgo/utils/asm/ClassUtils.java#L537-L540 |
jbundle/jbundle | thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/CachedRemoteTable.java | CachedRemoteTable.get | public Object get(int iRowIndex, int iRowCount) throws DBException, RemoteException {
"""
Receive this relative record in the table.
<p>Note: This is usually used only by thin clients, as thick clients have the code to
fake absolute access.
@param iRowIndex The row to retrieve.
@param iRowCount The number of r... | java | public Object get(int iRowIndex, int iRowCount) throws DBException, RemoteException
{
return this.cacheGetMove(iRowIndex, iRowCount, iRowIndex, true);
} | [
"public",
"Object",
"get",
"(",
"int",
"iRowIndex",
",",
"int",
"iRowCount",
")",
"throws",
"DBException",
",",
"RemoteException",
"{",
"return",
"this",
".",
"cacheGetMove",
"(",
"iRowIndex",
",",
"iRowCount",
",",
"iRowIndex",
",",
"true",
")",
";",
"}"
] | Receive this relative record in the table.
<p>Note: This is usually used only by thin clients, as thick clients have the code to
fake absolute access.
@param iRowIndex The row to retrieve.
@param iRowCount The number of rows to retrieve (Used only by EjbCachedTable).
@return The record(s) or an error code as an Integer... | [
"Receive",
"this",
"relative",
"record",
"in",
"the",
"table",
".",
"<p",
">",
"Note",
":",
"This",
"is",
"usually",
"used",
"only",
"by",
"thin",
"clients",
"as",
"thick",
"clients",
"have",
"the",
"code",
"to",
"fake",
"absolute",
"access",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/CachedRemoteTable.java#L511-L514 |
apereo/cas | support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/MetadataUIUtils.java | MetadataUIUtils.locateMetadataUserInterfaceForEntityId | public static SamlMetadataUIInfo locateMetadataUserInterfaceForEntityId(final EntityDescriptor entityDescriptor, final String entityId,
final RegisteredService registeredService, final HttpServletRequest requestContext) {
"""
Locate mdui f... | java | public static SamlMetadataUIInfo locateMetadataUserInterfaceForEntityId(final EntityDescriptor entityDescriptor, final String entityId,
final RegisteredService registeredService, final HttpServletRequest requestContext) {
val mdui = new... | [
"public",
"static",
"SamlMetadataUIInfo",
"locateMetadataUserInterfaceForEntityId",
"(",
"final",
"EntityDescriptor",
"entityDescriptor",
",",
"final",
"String",
"entityId",
",",
"final",
"RegisteredService",
"registeredService",
",",
"final",
"HttpServletRequest",
"requestCont... | Locate mdui for entity id simple metadata ui info.
@param entityDescriptor the entity descriptor
@param entityId the entity id
@param registeredService the registered service
@param requestContext the request context
@return the simple metadata ui info | [
"Locate",
"mdui",
"for",
"entity",
"id",
"simple",
"metadata",
"ui",
"info",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/MetadataUIUtils.java#L81-L109 |
jenkinsci/github-plugin | src/main/java/org/jenkinsci/plugins/github/extension/GHEventsSubscriber.java | GHEventsSubscriber.isApplicable | @Deprecated
protected boolean isApplicable(@Nullable Job<?, ?> project) {
"""
Should return true only if this subscriber interested in {@link #events()} set for this project
Don't call it directly, use {@link #isApplicableFor} static function
@param project to check
@return {@code true} to provide event... | java | @Deprecated
protected boolean isApplicable(@Nullable Job<?, ?> project) {
if (checkIsApplicableItem()) {
return isApplicable((Item) project);
}
// a legacy implementation which should not have been calling super.isApplicable(Job)
throw new AbstractMethodError("you must ov... | [
"@",
"Deprecated",
"protected",
"boolean",
"isApplicable",
"(",
"@",
"Nullable",
"Job",
"<",
"?",
",",
"?",
">",
"project",
")",
"{",
"if",
"(",
"checkIsApplicableItem",
"(",
")",
")",
"{",
"return",
"isApplicable",
"(",
"(",
"Item",
")",
"project",
")",... | Should return true only if this subscriber interested in {@link #events()} set for this project
Don't call it directly, use {@link #isApplicableFor} static function
@param project to check
@return {@code true} to provide events to register and subscribe for this project
@deprecated override {@link #isApplicable(Item)... | [
"Should",
"return",
"true",
"only",
"if",
"this",
"subscriber",
"interested",
"in",
"{",
"@link",
"#events",
"()",
"}",
"set",
"for",
"this",
"project",
"Don",
"t",
"call",
"it",
"directly",
"use",
"{",
"@link",
"#isApplicableFor",
"}",
"static",
"function"
... | train | https://github.com/jenkinsci/github-plugin/blob/4e05b9aeb488af5342c78f78aa3c55114e8d462a/src/main/java/org/jenkinsci/plugins/github/extension/GHEventsSubscriber.java#L53-L60 |
aboutsip/pkts | pkts-buffers/src/main/java/io/pkts/buffer/BoundedInputStreamBuffer.java | BoundedInputStreamBuffer.readFromStream | private int readFromStream(final long length) throws IOException {
"""
Method for reading bytes off the stream and store it in the local
"storage"
@param length
the length we wish to read
@return the actual amount of bytes we read
@throws IOException
in case anything goes wrong while reading
"""
... | java | private int readFromStream(final long length) throws IOException {
if (getReadableBytes() + length > localCapacity ) {
throw new IllegalArgumentException("Trying to read too far ahead, will cause wrap-around issues: " + length);
}
int total = 0;
int actual = 0;
while ... | [
"private",
"int",
"readFromStream",
"(",
"final",
"long",
"length",
")",
"throws",
"IOException",
"{",
"if",
"(",
"getReadableBytes",
"(",
")",
"+",
"length",
">",
"localCapacity",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Trying to read too fa... | Method for reading bytes off the stream and store it in the local
"storage"
@param length
the length we wish to read
@return the actual amount of bytes we read
@throws IOException
in case anything goes wrong while reading | [
"Method",
"for",
"reading",
"bytes",
"off",
"the",
"stream",
"and",
"store",
"it",
"in",
"the",
"local",
"storage"
] | train | https://github.com/aboutsip/pkts/blob/0f06bb0dac76c812187829f580a8d476ca99a1a1/pkts-buffers/src/main/java/io/pkts/buffer/BoundedInputStreamBuffer.java#L234-L254 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java | IntegralImageOps.block_zero | public static float block_zero(GrayF32 integral , int x0 , int y0 , int x1 , int y1 ) {
"""
<p>
Computes the value of a block inside an integral image and treats pixels outside of the
image as zero. The block is defined as follows: x0 < x ≤ x1 and y0 < y ≤ y1.
</p>
@param integral Integral image... | java | public static float block_zero(GrayF32 integral , int x0 , int y0 , int x1 , int y1 )
{
return ImplIntegralImageOps.block_zero(integral,x0,y0,x1,y1);
} | [
"public",
"static",
"float",
"block_zero",
"(",
"GrayF32",
"integral",
",",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"return",
"ImplIntegralImageOps",
".",
"block_zero",
"(",
"integral",
",",
"x0",
",",
"y0",
",",
"x... | <p>
Computes the value of a block inside an integral image and treats pixels outside of the
image as zero. The block is defined as follows: x0 < x ≤ x1 and y0 < y ≤ y1.
</p>
@param integral Integral image.
@param x0 Lower bound of the block. Exclusive.
@param y0 Lower bound of the block. Exclusive.
@par... | [
"<p",
">",
"Computes",
"the",
"value",
"of",
"a",
"block",
"inside",
"an",
"integral",
"image",
"and",
"treats",
"pixels",
"outside",
"of",
"the",
"image",
"as",
"zero",
".",
"The",
"block",
"is",
"defined",
"as",
"follows",
":",
"x0",
"<",
";",
"x",... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java#L444-L447 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.