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 |
|---|---|---|---|---|---|---|---|---|---|---|
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfilePackageSummaryBuilder.java | ProfilePackageSummaryBuilder.buildClassSummary | public void buildClassSummary(XMLNode node, Content summaryContentTree) {
"""
Build the summary for the classes in this package.
@param node the XML element that specifies which components to document
@param summaryContentTree the summary tree to which the class summary will
be added
"""
String cl... | java | public void buildClassSummary(XMLNode node, Content summaryContentTree) {
String classTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Class_Summary"),
configuration.getText("doclet.classes"));
String[] clas... | [
"public",
"void",
"buildClassSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"summaryContentTree",
")",
"{",
"String",
"classTableSummary",
"=",
"configuration",
".",
"getText",
"(",
"\"doclet.Member_Table_Summary\"",
",",
"configuration",
".",
"getText",
"(",
"\"do... | Build the summary for the classes in this package.
@param node the XML element that specifies which components to document
@param summaryContentTree the summary tree to which the class summary will
be added | [
"Build",
"the",
"summary",
"for",
"the",
"classes",
"in",
"this",
"package",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfilePackageSummaryBuilder.java#L209-L229 |
tvesalainen/util | util/src/main/java/org/vesalainen/net/ExceptionParser.java | ExceptionParser.brokenConnection | public static final Level brokenConnection(Level level, Throwable thr) {
"""
Tries to detect if Throwable is caused by broken connection. If detected
returns level, else return SEVERE.
@param level
@param thr
@return
"""
if (thr instanceof EOFException)
{
return level;
... | java | public static final Level brokenConnection(Level level, Throwable thr)
{
if (thr instanceof EOFException)
{
return level;
}
if (thr instanceof ClosedChannelException)
{
return level;
}
if ((thr instanceof IOException) && (
... | [
"public",
"static",
"final",
"Level",
"brokenConnection",
"(",
"Level",
"level",
",",
"Throwable",
"thr",
")",
"{",
"if",
"(",
"thr",
"instanceof",
"EOFException",
")",
"{",
"return",
"level",
";",
"}",
"if",
"(",
"thr",
"instanceof",
"ClosedChannelException",... | Tries to detect if Throwable is caused by broken connection. If detected
returns level, else return SEVERE.
@param level
@param thr
@return | [
"Tries",
"to",
"detect",
"if",
"Throwable",
"is",
"caused",
"by",
"broken",
"connection",
".",
"If",
"detected",
"returns",
"level",
"else",
"return",
"SEVERE",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/net/ExceptionParser.java#L38-L70 |
pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/WriteQueue.java | WriteQueue.getStatistics | synchronized QueueStats getStatistics() {
"""
Gets a snapshot of the queue internals.
@return The snapshot, including Queue Size, Item Fill Rate and elapsed time of the oldest item.
"""
int size = this.writes.size();
double fillRatio = calculateFillRatio(this.totalLength, size);
int ... | java | synchronized QueueStats getStatistics() {
int size = this.writes.size();
double fillRatio = calculateFillRatio(this.totalLength, size);
int processingTime = this.lastDurationMillis;
if (processingTime == 0 && size > 0) {
// We get in here when this method is invoked prior to ... | [
"synchronized",
"QueueStats",
"getStatistics",
"(",
")",
"{",
"int",
"size",
"=",
"this",
".",
"writes",
".",
"size",
"(",
")",
";",
"double",
"fillRatio",
"=",
"calculateFillRatio",
"(",
"this",
".",
"totalLength",
",",
"size",
")",
";",
"int",
"processin... | Gets a snapshot of the queue internals.
@return The snapshot, including Queue Size, Item Fill Rate and elapsed time of the oldest item. | [
"Gets",
"a",
"snapshot",
"of",
"the",
"queue",
"internals",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/WriteQueue.java#L77-L89 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/StringFunctions.java | StringFunctions.ltrim | public static Expression ltrim(String expression, String characters) {
"""
Returned expression results in the string with all leading chars removed (any char in the characters string).
"""
return ltrim(x(expression), characters);
} | java | public static Expression ltrim(String expression, String characters) {
return ltrim(x(expression), characters);
} | [
"public",
"static",
"Expression",
"ltrim",
"(",
"String",
"expression",
",",
"String",
"characters",
")",
"{",
"return",
"ltrim",
"(",
"x",
"(",
"expression",
")",
",",
"characters",
")",
";",
"}"
] | Returned expression results in the string with all leading chars removed (any char in the characters string). | [
"Returned",
"expression",
"results",
"in",
"the",
"string",
"with",
"all",
"leading",
"chars",
"removed",
"(",
"any",
"char",
"in",
"the",
"characters",
"string",
")",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/StringFunctions.java#L137-L139 |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java | GenMapAndTopicListModule.writeListFile | private void writeListFile(final File inputfile, final String relativeRootFile) {
"""
Write list file.
@param inputfile output list file
@param relativeRootFile list value
"""
try (Writer bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(inputfile)))) {
buffe... | java | private void writeListFile(final File inputfile, final String relativeRootFile) {
try (Writer bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(inputfile)))) {
bufferedWriter.write(relativeRootFile);
bufferedWriter.flush();
} catch (final IOException... | [
"private",
"void",
"writeListFile",
"(",
"final",
"File",
"inputfile",
",",
"final",
"String",
"relativeRootFile",
")",
"{",
"try",
"(",
"Writer",
"bufferedWriter",
"=",
"new",
"BufferedWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"new",
"FileOutputStream",
"("... | Write list file.
@param inputfile output list file
@param relativeRootFile list value | [
"Write",
"list",
"file",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java#L864-L871 |
facebookarchive/hadoop-20 | src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorEngine.java | SimulatorEngine.startTaskTrackers | void startTaskTrackers(ClusterStory clusterStory, long now) {
"""
Start simulated task trackers based on topology.
@param clusterStory The cluster topology.
@param now
time stamp when the simulator is started, {@link SimulatorTaskTracker}s
are started shortly after this time stamp
"""
/** port assigned... | java | void startTaskTrackers(ClusterStory clusterStory, long now) {
/** port assigned to TTs, incremented by 1 for each TT */
int port = 10000;
long ms = now + 100;
for (MachineNode node : clusterStory.getMachines()) {
String hostname = node.getName();
RackNode rackNode = node.getRackNode();
... | [
"void",
"startTaskTrackers",
"(",
"ClusterStory",
"clusterStory",
",",
"long",
"now",
")",
"{",
"/** port assigned to TTs, incremented by 1 for each TT */",
"int",
"port",
"=",
"10000",
";",
"long",
"ms",
"=",
"now",
"+",
"100",
";",
"for",
"(",
"MachineNode",
"no... | Start simulated task trackers based on topology.
@param clusterStory The cluster topology.
@param now
time stamp when the simulator is started, {@link SimulatorTaskTracker}s
are started shortly after this time stamp | [
"Start",
"simulated",
"task",
"trackers",
"based",
"on",
"topology",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorEngine.java#L74-L90 |
elvishew/xLog | sample/src/main/java/com/elvishew/xlogsample/MainActivity.java | MainActivity.setEnabledStateOnViews | public static void setEnabledStateOnViews(View v, boolean enabled) {
"""
Makes sure the view (and any children) get the enabled state changed.
"""
v.setEnabled(enabled);
if (v instanceof ViewGroup) {
final ViewGroup vg = (ViewGroup) v;
for (int i = vg.getChildCount() - 1; i >= 0; i--) {
... | java | public static void setEnabledStateOnViews(View v, boolean enabled) {
v.setEnabled(enabled);
if (v instanceof ViewGroup) {
final ViewGroup vg = (ViewGroup) v;
for (int i = vg.getChildCount() - 1; i >= 0; i--) {
setEnabledStateOnViews(vg.getChildAt(i), enabled);
}
}
} | [
"public",
"static",
"void",
"setEnabledStateOnViews",
"(",
"View",
"v",
",",
"boolean",
"enabled",
")",
"{",
"v",
".",
"setEnabled",
"(",
"enabled",
")",
";",
"if",
"(",
"v",
"instanceof",
"ViewGroup",
")",
"{",
"final",
"ViewGroup",
"vg",
"=",
"(",
"Vie... | Makes sure the view (and any children) get the enabled state changed. | [
"Makes",
"sure",
"the",
"view",
"(",
"and",
"any",
"children",
")",
"get",
"the",
"enabled",
"state",
"changed",
"."
] | train | https://github.com/elvishew/xLog/blob/c6fb95555ce619d3e527f5ba6c45d4d247c5a838/sample/src/main/java/com/elvishew/xlogsample/MainActivity.java#L247-L256 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/tracing/DefaultOrphanResponseReporter.java | DefaultOrphanResponseReporter.logOrphans | void logOrphans(final List<Map<String, Object>> toLog) {
"""
This method is intended to be overridden in test implementations
to assert against the output.
"""
try {
String result = pretty
? prettyWriter().writeValueAsString(toLog)
: writer().writeVa... | java | void logOrphans(final List<Map<String, Object>> toLog) {
try {
String result = pretty
? prettyWriter().writeValueAsString(toLog)
: writer().writeValueAsString(toLog);
LOGGER.warn("Orphan responses observed: {}", result);
} catch (Exception ... | [
"void",
"logOrphans",
"(",
"final",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"toLog",
")",
"{",
"try",
"{",
"String",
"result",
"=",
"pretty",
"?",
"prettyWriter",
"(",
")",
".",
"writeValueAsString",
"(",
"toLog",
")",
":",
"writer"... | This method is intended to be overridden in test implementations
to assert against the output. | [
"This",
"method",
"is",
"intended",
"to",
"be",
"overridden",
"in",
"test",
"implementations",
"to",
"assert",
"against",
"the",
"output",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/tracing/DefaultOrphanResponseReporter.java#L406-L415 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/DocumentFactory.java | DocumentFactory.createRaw | public Document createRaw(@NonNull String id, @NonNull String content, @NonNull Language language, @NonNull Map<AttributeType, ?> attributeMap) {
"""
Creates a document with the given id and content written in the given language having the given set of attributes.
This method does not apply any {@link TextNormali... | java | public Document createRaw(@NonNull String id, @NonNull String content, @NonNull Language language, @NonNull Map<AttributeType, ?> attributeMap) {
Document document = new Document(id, content, language);
document.putAll(attributeMap);
document.setLanguage(language);
return document;
} | [
"public",
"Document",
"createRaw",
"(",
"@",
"NonNull",
"String",
"id",
",",
"@",
"NonNull",
"String",
"content",
",",
"@",
"NonNull",
"Language",
"language",
",",
"@",
"NonNull",
"Map",
"<",
"AttributeType",
",",
"?",
">",
"attributeMap",
")",
"{",
"Docum... | Creates a document with the given id and content written in the given language having the given set of attributes.
This method does not apply any {@link TextNormalizer}
@param id the id
@param content the content
@param language the language
@param attributeMap the attribute map
@return the document | [
"Creates",
"a",
"document",
"with",
"the",
"given",
"id",
"and",
"content",
"written",
"in",
"the",
"given",
"language",
"having",
"the",
"given",
"set",
"of",
"attributes",
".",
"This",
"method",
"does",
"not",
"apply",
"any",
"{",
"@link",
"TextNormalizer"... | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/DocumentFactory.java#L167-L172 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java | JsonModelCoder.encodeValue | public void encodeValue(Writer writer, T obj) throws IOException {
"""
*** Internal use only; please do not call directly. ***<br>
*** Public access granted only to allow reusing from other packages. ***
@param writer {@link Writer}
@param obj value
@throws IOException
@author vvakame
"""
int count = ... | java | public void encodeValue(Writer writer, T obj) throws IOException {
int count = 0;
for (String key : map.keySet()) {
JsonUtil.putKey(writer, key);
JsonPropertyCoder<T, ?> enc = map.get(key);
enc.encode(writer, obj);
count++;
if (count != map.size()) {
JsonUtil.addSeparator(writer);
}
}
} | [
"public",
"void",
"encodeValue",
"(",
"Writer",
"writer",
",",
"T",
"obj",
")",
"throws",
"IOException",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"String",
"key",
":",
"map",
".",
"keySet",
"(",
")",
")",
"{",
"JsonUtil",
".",
"putKey",
"(",
... | *** Internal use only; please do not call directly. ***<br>
*** Public access granted only to allow reusing from other packages. ***
@param writer {@link Writer}
@param obj value
@throws IOException
@author vvakame | [
"***",
"Internal",
"use",
"only",
";",
"please",
"do",
"not",
"call",
"directly",
".",
"***",
"<br",
">",
"***",
"Public",
"access",
"granted",
"only",
"to",
"allow",
"reusing",
"from",
"other",
"packages",
".",
"***"
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java#L453-L464 |
moparisthebest/beehive | beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java | ValidatableField.setRuleMessage | void setRuleMessage(XmlModelWriter xw, ValidatorRule rule, Element element) {
"""
Set up the desired <msg> element and attributes for the given rule.
@param rule the rule with the message to use
"""
String messageKey = rule.getMessageKey();
String message = rule.getMessage();
... | java | void setRuleMessage(XmlModelWriter xw, ValidatorRule rule, Element element)
{
String messageKey = rule.getMessageKey();
String message = rule.getMessage();
if ( messageKey != null || message != null )
{
Element msgElementToUse = findChildElement(xw, element, "msg", "name... | [
"void",
"setRuleMessage",
"(",
"XmlModelWriter",
"xw",
",",
"ValidatorRule",
"rule",
",",
"Element",
"element",
")",
"{",
"String",
"messageKey",
"=",
"rule",
".",
"getMessageKey",
"(",
")",
";",
"String",
"message",
"=",
"rule",
".",
"getMessage",
"(",
")",... | Set up the desired <msg> element and attributes for the given rule.
@param rule the rule with the message to use | [
"Set",
"up",
"the",
"desired",
"<",
";",
"msg>",
";",
"element",
"and",
"attributes",
"for",
"the",
"given",
"rule",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java#L235-L258 |
graknlabs/grakn | server/src/server/kb/concept/TypeImpl.java | TypeImpl.addInstance | V addInstance(Schema.BaseType instanceBaseType, BiFunction<VertexElement, T, V> producer, boolean isInferred) {
"""
Utility method used to create an instance of this type
@param instanceBaseType The base type of the instances of this type
@param producer The factory method to produce the instance
@ret... | java | V addInstance(Schema.BaseType instanceBaseType, BiFunction<VertexElement, T, V> producer, boolean isInferred) {
preCheckForInstanceCreation();
if (isAbstract()) throw TransactionException.addingInstancesToAbstractType(this);
VertexElement instanceVertex = vertex().tx().addVertexElement(instanc... | [
"V",
"addInstance",
"(",
"Schema",
".",
"BaseType",
"instanceBaseType",
",",
"BiFunction",
"<",
"VertexElement",
",",
"T",
",",
"V",
">",
"producer",
",",
"boolean",
"isInferred",
")",
"{",
"preCheckForInstanceCreation",
"(",
")",
";",
"if",
"(",
"isAbstract",... | Utility method used to create an instance of this type
@param instanceBaseType The base type of the instances of this type
@param producer The factory method to produce the instance
@return A new instance | [
"Utility",
"method",
"used",
"to",
"create",
"an",
"instance",
"of",
"this",
"type"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/kb/concept/TypeImpl.java#L92-L108 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jAssociationQueries.java | EmbeddedNeo4jAssociationQueries.createRelationshipForEmbeddedAssociation | public Relationship createRelationshipForEmbeddedAssociation(GraphDatabaseService executionEngine, AssociationKey associationKey, EntityKey embeddedKey) {
"""
Give an embedded association, creates all the nodes and relationships required to represent it.
It assumes that the entity node containing the association ... | java | public Relationship createRelationshipForEmbeddedAssociation(GraphDatabaseService executionEngine, AssociationKey associationKey, EntityKey embeddedKey) {
String query = initCreateEmbeddedAssociationQuery( associationKey, embeddedKey );
Object[] queryValues = createRelationshipForEmbeddedQueryValues( associationKey... | [
"public",
"Relationship",
"createRelationshipForEmbeddedAssociation",
"(",
"GraphDatabaseService",
"executionEngine",
",",
"AssociationKey",
"associationKey",
",",
"EntityKey",
"embeddedKey",
")",
"{",
"String",
"query",
"=",
"initCreateEmbeddedAssociationQuery",
"(",
"associat... | Give an embedded association, creates all the nodes and relationships required to represent it.
It assumes that the entity node containing the association already exists in the db.
@param executionEngine the {@link GraphDatabaseService} to run the query
@param associationKey the {@link AssociationKey} identifying the ... | [
"Give",
"an",
"embedded",
"association",
"creates",
"all",
"the",
"nodes",
"and",
"relationships",
"required",
"to",
"represent",
"it",
".",
"It",
"assumes",
"that",
"the",
"entity",
"node",
"containing",
"the",
"association",
"already",
"exists",
"in",
"the",
... | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jAssociationQueries.java#L136-L140 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/EntrySerializer.java | EntrySerializer.readHeader | Header readHeader(@NonNull InputStream input) throws IOException {
"""
Reads the Entry's Header from the given {@link InputStream}.
@param input The {@link InputStream} to read from.
@return The Entry Header.
@throws IOException If an invalid header was detected or another IOException occurred.
"""
... | java | Header readHeader(@NonNull InputStream input) throws IOException {
byte version = (byte) input.read();
int keyLength = BitConverter.readInt(input);
int valueLength = BitConverter.readInt(input);
long entryVersion = BitConverter.readLong(input);
validateHeader(keyLength, valueLeng... | [
"Header",
"readHeader",
"(",
"@",
"NonNull",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"byte",
"version",
"=",
"(",
"byte",
")",
"input",
".",
"read",
"(",
")",
";",
"int",
"keyLength",
"=",
"BitConverter",
".",
"readInt",
"(",
"input",
... | Reads the Entry's Header from the given {@link InputStream}.
@param input The {@link InputStream} to read from.
@return The Entry Header.
@throws IOException If an invalid header was detected or another IOException occurred. | [
"Reads",
"the",
"Entry",
"s",
"Header",
"from",
"the",
"given",
"{",
"@link",
"InputStream",
"}",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/EntrySerializer.java#L197-L204 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.doubleSupplier | public static DoubleSupplier doubleSupplier(CheckedDoubleSupplier supplier, Consumer<Throwable> handler) {
"""
Wrap a {@link CheckedDoubleSupplier} in a {@link DoubleSupplier} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
ResultSet rs = statement.executeQuery();
Stream.generate(Unch... | java | public static DoubleSupplier doubleSupplier(CheckedDoubleSupplier supplier, Consumer<Throwable> handler) {
return () -> {
try {
return supplier.getAsDouble();
}
catch (Throwable e) {
handler.accept(e);
throw new IllegalStateExc... | [
"public",
"static",
"DoubleSupplier",
"doubleSupplier",
"(",
"CheckedDoubleSupplier",
"supplier",
",",
"Consumer",
"<",
"Throwable",
">",
"handler",
")",
"{",
"return",
"(",
")",
"->",
"{",
"try",
"{",
"return",
"supplier",
".",
"getAsDouble",
"(",
")",
";",
... | Wrap a {@link CheckedDoubleSupplier} in a {@link DoubleSupplier} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
ResultSet rs = statement.executeQuery();
Stream.generate(Unchecked.doubleSupplier(
() -> rs.getDouble(1),
e -> {
throw new IllegalStateException(e);
}
));
</pre></code> | [
"Wrap",
"a",
"{",
"@link",
"CheckedDoubleSupplier",
"}",
"in",
"a",
"{",
"@link",
"DoubleSupplier",
"}",
"with",
"a",
"custom",
"handler",
"for",
"checked",
"exceptions",
".",
"<p",
">",
"Example",
":",
"<code",
">",
"<pre",
">",
"ResultSet",
"rs",
"=",
... | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L1815-L1826 |
apache/incubator-gobblin | gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/type/ContentTypeUtils.java | ContentTypeUtils.registerCharsetMapping | public void registerCharsetMapping(String contentType, String charSet) {
"""
Register a new contentType to charSet mapping.
@param contentType Content-type to register
@param charSet charSet associated with the content-type
"""
if (knownCharsets.contains(contentType)) {
log.warn("{} is already regi... | java | public void registerCharsetMapping(String contentType, String charSet) {
if (knownCharsets.contains(contentType)) {
log.warn("{} is already registered; re-registering");
}
knownCharsets.put(contentType, charSet);
} | [
"public",
"void",
"registerCharsetMapping",
"(",
"String",
"contentType",
",",
"String",
"charSet",
")",
"{",
"if",
"(",
"knownCharsets",
".",
"contains",
"(",
"contentType",
")",
")",
"{",
"log",
".",
"warn",
"(",
"\"{} is already registered; re-registering\"",
"... | Register a new contentType to charSet mapping.
@param contentType Content-type to register
@param charSet charSet associated with the content-type | [
"Register",
"a",
"new",
"contentType",
"to",
"charSet",
"mapping",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/type/ContentTypeUtils.java#L80-L86 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/Utils.java | Utils.formatDate | public static String formatDate(Long timestamp, String format, Locale loc) {
"""
Formats a date in a specific format.
@param timestamp the Java timestamp
@param format the date format
@param loc the locale instance
@return a formatted date
"""
if (StringUtils.isBlank(format)) {
format = DateFormatUtil... | java | public static String formatDate(Long timestamp, String format, Locale loc) {
if (StringUtils.isBlank(format)) {
format = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.getPattern();
}
if (timestamp == null) {
timestamp = timestamp();
}
if (loc == null) {
loc = Locale.US;
}
return DateFormatUtils.f... | [
"public",
"static",
"String",
"formatDate",
"(",
"Long",
"timestamp",
",",
"String",
"format",
",",
"Locale",
"loc",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"format",
")",
")",
"{",
"format",
"=",
"DateFormatUtils",
".",
"ISO_8601_EXTENDED_D... | Formats a date in a specific format.
@param timestamp the Java timestamp
@param format the date format
@param loc the locale instance
@return a formatted date | [
"Formats",
"a",
"date",
"in",
"a",
"specific",
"format",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/Utils.java#L449-L460 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java | VpnConnectionsInner.get | public VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName) {
"""
Retrieves the details of a vpn connection.
@param resourceGroupName The resource group name of the VpnGateway.
@param gatewayName The name of the gateway.
@param connectionName The name of the vpn connecti... | java | public VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName) {
return getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().single().body();
} | [
"public",
"VpnConnectionInner",
"get",
"(",
"String",
"resourceGroupName",
",",
"String",
"gatewayName",
",",
"String",
"connectionName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"gatewayName",
",",
"connectionName",
")",
".",
... | Retrieves the details of a vpn connection.
@param resourceGroupName The resource group name of the VpnGateway.
@param gatewayName The name of the gateway.
@param connectionName The name of the vpn connection.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorException thrown if the... | [
"Retrieves",
"the",
"details",
"of",
"a",
"vpn",
"connection",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java#L105-L107 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpd/MPD9DatabaseReader.java | MPD9DatabaseReader.processCalendarData | private void processCalendarData(ProjectCalendar calendar, List<ResultSetRow> calendarData) {
"""
Process the hours and exceptions for an individual calendar.
@param calendar project calendar
@param calendarData hours and exception rows for this calendar
"""
for (ResultSetRow row : calendarData)
... | java | private void processCalendarData(ProjectCalendar calendar, List<ResultSetRow> calendarData)
{
for (ResultSetRow row : calendarData)
{
processCalendarData(calendar, row);
}
} | [
"private",
"void",
"processCalendarData",
"(",
"ProjectCalendar",
"calendar",
",",
"List",
"<",
"ResultSetRow",
">",
"calendarData",
")",
"{",
"for",
"(",
"ResultSetRow",
"row",
":",
"calendarData",
")",
"{",
"processCalendarData",
"(",
"calendar",
",",
"row",
"... | Process the hours and exceptions for an individual calendar.
@param calendar project calendar
@param calendarData hours and exception rows for this calendar | [
"Process",
"the",
"hours",
"and",
"exceptions",
"for",
"an",
"individual",
"calendar",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9DatabaseReader.java#L218-L224 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java | AbstractQueuedLongSynchronizer.setHeadAndPropagate | private void setHeadAndPropagate(Node node, long propagate) {
"""
Sets head of queue, and checks if successor may be waiting
in shared mode, if so propagating if either propagate > 0 or
PROPAGATE status was set.
@param node the node
@param propagate the return value from a tryAcquireShared
"""
No... | java | private void setHeadAndPropagate(Node node, long propagate) {
Node h = head; // Record old head for check below
setHead(node);
/*
* Try to signal next queued node if:
* Propagation was indicated by caller,
* or was recorded (as h.waitStatus either before
... | [
"private",
"void",
"setHeadAndPropagate",
"(",
"Node",
"node",
",",
"long",
"propagate",
")",
"{",
"Node",
"h",
"=",
"head",
";",
"// Record old head for check below",
"setHead",
"(",
"node",
")",
";",
"/*\n * Try to signal next queued node if:\n * Propa... | Sets head of queue, and checks if successor may be waiting
in shared mode, if so propagating if either propagate > 0 or
PROPAGATE status was set.
@param node the node
@param propagate the return value from a tryAcquireShared | [
"Sets",
"head",
"of",
"queue",
"and",
"checks",
"if",
"successor",
"may",
"be",
"waiting",
"in",
"shared",
"mode",
"if",
"so",
"propagating",
"if",
"either",
"propagate",
">",
"0",
"or",
"PROPAGATE",
"status",
"was",
"set",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java#L277-L302 |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/components/factories/JComponentFactory.java | JComponentFactory.newJSplitPane | public static JSplitPane newJSplitPane(int newOrientation, Component newLeftComponent,
Component newRightComponent) {
"""
Factory method for create new {@link JSplitPane} object
@param newOrientation
<code>JSplitPane.HORIZONTAL_SPLIT</code> or <code>JSplitPane.VERTICAL_SPLIT</code>
@param newLeftComponent
... | java | public static JSplitPane newJSplitPane(int newOrientation, Component newLeftComponent,
Component newRightComponent)
{
return newJSplitPane(newOrientation, true, newLeftComponent, newRightComponent);
} | [
"public",
"static",
"JSplitPane",
"newJSplitPane",
"(",
"int",
"newOrientation",
",",
"Component",
"newLeftComponent",
",",
"Component",
"newRightComponent",
")",
"{",
"return",
"newJSplitPane",
"(",
"newOrientation",
",",
"true",
",",
"newLeftComponent",
",",
"newRig... | Factory method for create new {@link JSplitPane} object
@param newOrientation
<code>JSplitPane.HORIZONTAL_SPLIT</code> or <code>JSplitPane.VERTICAL_SPLIT</code>
@param newLeftComponent
the <code>Component</code> that will appear on the left of a horizontally-split
pane, or at the top of a vertically-split pane
@param ... | [
"Factory",
"method",
"for",
"create",
"new",
"{",
"@link",
"JSplitPane",
"}",
"object"
] | train | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/components/factories/JComponentFactory.java#L101-L105 |
paypal/SeLion | client/src/main/java/com/paypal/selion/internal/platform/grid/LocalSelendroidNode.java | LocalSelendroidNode.checkAndValidateParameters | private void checkAndValidateParameters(ConfigProperty configProperty) {
"""
/*
Checks the presence of selendroid specific parameters provided by the user and validates them.
IllegalArgumentException is thrown if the parameter is either insufficient or irrelevant. Throws a
NullPointerException if the received c... | java | private void checkAndValidateParameters(ConfigProperty configProperty) {
LOGGER.entering(configProperty);
try {
switch (configProperty) {
case SELENDROID_SERVER_START_TIMEOUT:
case SELENDROID_EMULATOR_START_TIMEOUT: {
// Selendroid takes timeoutEmulato... | [
"private",
"void",
"checkAndValidateParameters",
"(",
"ConfigProperty",
"configProperty",
")",
"{",
"LOGGER",
".",
"entering",
"(",
"configProperty",
")",
";",
"try",
"{",
"switch",
"(",
"configProperty",
")",
"{",
"case",
"SELENDROID_SERVER_START_TIMEOUT",
":",
"ca... | /*
Checks the presence of selendroid specific parameters provided by the user and validates them.
IllegalArgumentException is thrown if the parameter is either insufficient or irrelevant. Throws a
NullPointerException if the received configProperty is null.
@param configProperty a SeLion {@link ConfigProperty} to vali... | [
"/",
"*",
"Checks",
"the",
"presence",
"of",
"selendroid",
"specific",
"parameters",
"provided",
"by",
"the",
"user",
"and",
"validates",
"them",
".",
"IllegalArgumentException",
"is",
"thrown",
"if",
"the",
"parameter",
"is",
"either",
"insufficient",
"or",
"ir... | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/platform/grid/LocalSelendroidNode.java#L149-L182 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapPonctualElement.java | MapPonctualElement.contains | @Pure
@Override
public boolean contains(Point2D<?, ?> point, double delta) {
"""
Replies if the specified point (<var>x</var>,<var>y</var>)
was inside the figure of this MapElement.
@param point is a geo-referenced coordinate
@param delta is the geo-referenced distance that corresponds to a approximation
d... | java | @Pure
@Override
public boolean contains(Point2D<?, ?> point, double delta) {
return this.position.getDistance(point) <= delta;
} | [
"@",
"Pure",
"@",
"Override",
"public",
"boolean",
"contains",
"(",
"Point2D",
"<",
"?",
",",
"?",
">",
"point",
",",
"double",
"delta",
")",
"{",
"return",
"this",
".",
"position",
".",
"getDistance",
"(",
"point",
")",
"<=",
"delta",
";",
"}"
] | Replies if the specified point (<var>x</var>,<var>y</var>)
was inside the figure of this MapElement.
@param point is a geo-referenced coordinate
@param delta is the geo-referenced distance that corresponds to a approximation
distance in the screen coordinate system
@return <code>true</code> if the specified point has ... | [
"Replies",
"if",
"the",
"specified",
"point",
"(",
"<var",
">",
"x<",
"/",
"var",
">",
"<var",
">",
"y<",
"/",
"var",
">",
")",
"was",
"inside",
"the",
"figure",
"of",
"this",
"MapElement",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapPonctualElement.java#L210-L214 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/bootstrapcontext/BootstrapContextCoordinator.java | BootstrapContextCoordinator.createIdentifier | public String createIdentifier(String raClz, Collection<ConfigProperty> configProperties) {
"""
Create an identifier
@param raClz The resource adapter class name
@param configProperties The config properties
@return The id
"""
return createIdentifier(raClz, configProperties, null);
} | java | public String createIdentifier(String raClz, Collection<ConfigProperty> configProperties)
{
return createIdentifier(raClz, configProperties, null);
} | [
"public",
"String",
"createIdentifier",
"(",
"String",
"raClz",
",",
"Collection",
"<",
"ConfigProperty",
">",
"configProperties",
")",
"{",
"return",
"createIdentifier",
"(",
"raClz",
",",
"configProperties",
",",
"null",
")",
";",
"}"
] | Create an identifier
@param raClz The resource adapter class name
@param configProperties The config properties
@return The id | [
"Create",
"an",
"identifier"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/bootstrapcontext/BootstrapContextCoordinator.java#L263-L266 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/Drawer.java | Drawer.setItems | private void setItems(@NonNull List<IDrawerItem> drawerItems, boolean switchedItems) {
"""
replace the current DrawerItems with the new ArrayList.
@param drawerItems
@param switchedItems
"""
//if we are currently at a switched list set the new reference
if (originalDrawerItems != null && !s... | java | private void setItems(@NonNull List<IDrawerItem> drawerItems, boolean switchedItems) {
//if we are currently at a switched list set the new reference
if (originalDrawerItems != null && !switchedItems) {
originalDrawerItems = drawerItems;
}
mDrawerBuilder.getItemAdapter().setN... | [
"private",
"void",
"setItems",
"(",
"@",
"NonNull",
"List",
"<",
"IDrawerItem",
">",
"drawerItems",
",",
"boolean",
"switchedItems",
")",
"{",
"//if we are currently at a switched list set the new reference",
"if",
"(",
"originalDrawerItems",
"!=",
"null",
"&&",
"!",
... | replace the current DrawerItems with the new ArrayList.
@param drawerItems
@param switchedItems | [
"replace",
"the",
"current",
"DrawerItems",
"with",
"the",
"new",
"ArrayList",
"."
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L821-L827 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AlertResources.java | AlertResources.addTrigger | @POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/ {
"""
Creates a new Trigger for a given alert.
@param req The HttpServlet request object. Cannot be null.
@param alertId The alert Id. Cannot be null and must be a positive non-zero number.
@param t... | java | @POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/{alertId}/triggers")
@Description("Creates new triggers for the given alert ID.")
public List<TriggerDto> addTrigger(@Context HttpServletRequest req,
@PathParam("alertId") BigInteger alertId, TriggerDto triggerDto) {
if ... | [
"@",
"POST",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Path",
"(",
"\"/{alertId}/triggers\"",
")",
"@",
"Description",
"(",
"\"Creates new triggers for the given alert ID.\""... | Creates a new Trigger for a given alert.
@param req The HttpServlet request object. Cannot be null.
@param alertId The alert Id. Cannot be null and must be a positive non-zero number.
@param triggerDto The trigger object. Cannot be null.
@return The alert object for which the trigger was added.
@... | [
"Creates",
"a",
"new",
"Trigger",
"for",
"a",
"given",
"alert",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AlertResources.java#L854-L883 |
alkacon/opencms-core | src-gwt/org/opencms/ade/publish/client/CmsPublishDataModel.java | CmsPublishDataModel.signalGroup | public void signalGroup(Signal signal, int groupNum) {
"""
Sends a signal to all publish items in a given group.<p>
@param signal the signal to send
@param groupNum the group index
"""
CmsPublishGroup group = m_groups.get(groupNum);
for (CmsPublishResource res : group.getResources()) {
... | java | public void signalGroup(Signal signal, int groupNum) {
CmsPublishGroup group = m_groups.get(groupNum);
for (CmsPublishResource res : group.getResources()) {
CmsUUID id = res.getId();
m_status.get(id).handleSignal(signal);
}
runSelectionChangeAction();
} | [
"public",
"void",
"signalGroup",
"(",
"Signal",
"signal",
",",
"int",
"groupNum",
")",
"{",
"CmsPublishGroup",
"group",
"=",
"m_groups",
".",
"get",
"(",
"groupNum",
")",
";",
"for",
"(",
"CmsPublishResource",
"res",
":",
"group",
".",
"getResources",
"(",
... | Sends a signal to all publish items in a given group.<p>
@param signal the signal to send
@param groupNum the group index | [
"Sends",
"a",
"signal",
"to",
"all",
"publish",
"items",
"in",
"a",
"given",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/publish/client/CmsPublishDataModel.java#L415-L423 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java | CmsContainerpageController.checkElementReferences | private void checkElementReferences(
final CmsContainerPageElementPanel element,
final AsyncCallback<CmsRemovedElementStatus> callback) {
"""
Checks whether there are other references to a given container page element.<p>
@param element the element to check
@param callback the callback which wi... | java | private void checkElementReferences(
final CmsContainerPageElementPanel element,
final AsyncCallback<CmsRemovedElementStatus> callback) {
ReferenceCheckVisitor visitor = new ReferenceCheckVisitor(element);
processPageContent(visitor);
if (visitor.hasReferences()) {
/... | [
"private",
"void",
"checkElementReferences",
"(",
"final",
"CmsContainerPageElementPanel",
"element",
",",
"final",
"AsyncCallback",
"<",
"CmsRemovedElementStatus",
">",
"callback",
")",
"{",
"ReferenceCheckVisitor",
"visitor",
"=",
"new",
"ReferenceCheckVisitor",
"(",
"e... | Checks whether there are other references to a given container page element.<p>
@param element the element to check
@param callback the callback which will be called with the result of the check (true if there are other references) | [
"Checks",
"whether",
"there",
"are",
"other",
"references",
"to",
"a",
"given",
"container",
"page",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java#L3872-L3921 |
lucee/Lucee | core/src/main/java/lucee/runtime/interpreter/CFMLExpressionInterpreter.java | CFMLExpressionInterpreter.xorOp | private Ref xorOp() throws PageException {
"""
Transfomiert eine Xor (xor) Operation. <br />
EBNF:<br />
<code>orOp {"xor" spaces orOp};</code>
@return CFXD Element
@throws PageException
"""
Ref ref = orOp();
while (cfml.forwardIfCurrent("xor")) {
cfml.removeSpace();
ref = new Xor(ref, orOp(... | java | private Ref xorOp() throws PageException {
Ref ref = orOp();
while (cfml.forwardIfCurrent("xor")) {
cfml.removeSpace();
ref = new Xor(ref, orOp(), limited);
}
return ref;
} | [
"private",
"Ref",
"xorOp",
"(",
")",
"throws",
"PageException",
"{",
"Ref",
"ref",
"=",
"orOp",
"(",
")",
";",
"while",
"(",
"cfml",
".",
"forwardIfCurrent",
"(",
"\"xor\"",
")",
")",
"{",
"cfml",
".",
"removeSpace",
"(",
")",
";",
"ref",
"=",
"new",... | Transfomiert eine Xor (xor) Operation. <br />
EBNF:<br />
<code>orOp {"xor" spaces orOp};</code>
@return CFXD Element
@throws PageException | [
"Transfomiert",
"eine",
"Xor",
"(",
"xor",
")",
"Operation",
".",
"<br",
"/",
">",
"EBNF",
":",
"<br",
"/",
">",
"<code",
">",
"orOp",
"{",
"xor",
"spaces",
"orOp",
"}",
";",
"<",
"/",
"code",
">"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/interpreter/CFMLExpressionInterpreter.java#L380-L387 |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/util/DefaultConverterStep.java | DefaultConverterStep.invokeValueOf | private Object invokeValueOf(Class<?> clazz, String value) throws IllegalAccessException,
InvocationTargetException {
"""
Tries to invoke the method valueOf of the given class object. If this method can be called, the result will be
given back based on the given value which is used as parameter for the me... | java | private Object invokeValueOf(Class<?> clazz, String value) throws IllegalAccessException,
InvocationTargetException {
try {
return MethodUtils.invokeExactStaticMethod(clazz, "valueOf", value);
} catch (NoSuchMethodException e) {
return null;
}
} | [
"private",
"Object",
"invokeValueOf",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"value",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"try",
"{",
"return",
"MethodUtils",
".",
"invokeExactStaticMethod",
"(",
"clazz",
"... | Tries to invoke the method valueOf of the given class object. If this method can be called, the result will be
given back based on the given value which is used as parameter for the method. If this method can't be called
null will be given back. | [
"Tries",
"to",
"invoke",
"the",
"method",
"valueOf",
"of",
"the",
"given",
"class",
"object",
".",
"If",
"this",
"method",
"can",
"be",
"called",
"the",
"result",
"will",
"be",
"given",
"back",
"based",
"on",
"the",
"given",
"value",
"which",
"is",
"used... | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/util/DefaultConverterStep.java#L119-L126 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_features_firewall_PUT | public void serviceName_features_firewall_PUT(String serviceName, OvhFirewall body) throws IOException {
"""
Alter this object properties
REST: PUT /dedicated/server/{serviceName}/features/firewall
@param body [required] New object properties
@param serviceName [required] The internal name of your dedicated s... | java | public void serviceName_features_firewall_PUT(String serviceName, OvhFirewall body) throws IOException {
String qPath = "/dedicated/server/{serviceName}/features/firewall";
StringBuilder sb = path(qPath, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_features_firewall_PUT",
"(",
"String",
"serviceName",
",",
"OvhFirewall",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/features/firewall\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(... | Alter this object properties
REST: PUT /dedicated/server/{serviceName}/features/firewall
@param body [required] New object properties
@param serviceName [required] The internal name of your dedicated server | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L979-L983 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Array.java | Array.bucketSort | static void bucketSort(final Object[] a, final int fromIndex, final int toIndex) {
"""
Note: All the objects with same value will be replaced with first element with the same value.
@param a the elements in the array must implements the <code>Comparable</code> interface.
@param fromIndex
@param toIndex
""... | java | static void bucketSort(final Object[] a, final int fromIndex, final int toIndex) {
bucketSort(a, fromIndex, toIndex, null);
} | [
"static",
"void",
"bucketSort",
"(",
"final",
"Object",
"[",
"]",
"a",
",",
"final",
"int",
"fromIndex",
",",
"final",
"int",
"toIndex",
")",
"{",
"bucketSort",
"(",
"a",
",",
"fromIndex",
",",
"toIndex",
",",
"null",
")",
";",
"}"
] | Note: All the objects with same value will be replaced with first element with the same value.
@param a the elements in the array must implements the <code>Comparable</code> interface.
@param fromIndex
@param toIndex | [
"Note",
":",
"All",
"the",
"objects",
"with",
"same",
"value",
"will",
"be",
"replaced",
"with",
"first",
"element",
"with",
"the",
"same",
"value",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Array.java#L3088-L3090 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfFileSpecification.java | PdfFileSpecification.setUnicodeFileName | public void setUnicodeFileName(String filename, boolean unicode) {
"""
Adds the unicode file name (the key /UF). This entry was introduced
in PDF 1.7. The filename must have the slash and backslash escaped
according to the file specification rules.
@param filename the filename
@param unicode if true, the filen... | java | public void setUnicodeFileName(String filename, boolean unicode) {
put(PdfName.UF, new PdfString(filename, unicode ? PdfObject.TEXT_UNICODE : PdfObject.TEXT_PDFDOCENCODING));
} | [
"public",
"void",
"setUnicodeFileName",
"(",
"String",
"filename",
",",
"boolean",
"unicode",
")",
"{",
"put",
"(",
"PdfName",
".",
"UF",
",",
"new",
"PdfString",
"(",
"filename",
",",
"unicode",
"?",
"PdfObject",
".",
"TEXT_UNICODE",
":",
"PdfObject",
".",
... | Adds the unicode file name (the key /UF). This entry was introduced
in PDF 1.7. The filename must have the slash and backslash escaped
according to the file specification rules.
@param filename the filename
@param unicode if true, the filename is UTF-16BE encoded; otherwise PDFDocEncoding is used; | [
"Adds",
"the",
"unicode",
"file",
"name",
"(",
"the",
"key",
"/",
"UF",
")",
".",
"This",
"entry",
"was",
"introduced",
"in",
"PDF",
"1",
".",
"7",
".",
"The",
"filename",
"must",
"have",
"the",
"slash",
"and",
"backslash",
"escaped",
"according",
"to"... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfFileSpecification.java#L269-L271 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WPartialDateField.java | WPartialDateField.setPartialDate | public void setPartialDate(final Integer day, final Integer month, final Integer year) {
"""
Set the WPartialDateField with the given day, month and year. Each of the day, month and year parameters that
make up the partial date are optional.
@param day A number from 1 to 31 or null if unknown.
@param month A ... | java | public void setPartialDate(final Integer day, final Integer month, final Integer year) {
// Validate Year
if (!isValidYear(year)) {
throw new IllegalArgumentException("Setting invalid partial year value (" + year
+ "). Year should be between " + YEAR_MIN + " to " + YEAR_MAX + ".");
}
// Validate Month
... | [
"public",
"void",
"setPartialDate",
"(",
"final",
"Integer",
"day",
",",
"final",
"Integer",
"month",
",",
"final",
"Integer",
"year",
")",
"{",
"// Validate Year",
"if",
"(",
"!",
"isValidYear",
"(",
"year",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentEx... | Set the WPartialDateField with the given day, month and year. Each of the day, month and year parameters that
make up the partial date are optional.
@param day A number from 1 to 31 or null if unknown.
@param month A number from 1 to 12, or null if unknown.
@param year A number, or null if unknown. | [
"Set",
"the",
"WPartialDateField",
"with",
"the",
"given",
"day",
"month",
"and",
"year",
".",
"Each",
"of",
"the",
"day",
"month",
"and",
"year",
"parameters",
"that",
"make",
"up",
"the",
"partial",
"date",
"are",
"optional",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WPartialDateField.java#L240-L265 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxUploadSession.java | BoxUploadSession.getChunkSize | public static int getChunkSize(BoxUploadSession uploadSession, int partNumber, long fileSize) {
"""
Computes the actual bytes to be sent in a part, which equals the partsize for all parts
except the last.
@param uploadSession
@param partNumber
@param fileSize
@return
"""
if (partNumber == uploadSe... | java | public static int getChunkSize(BoxUploadSession uploadSession, int partNumber, long fileSize) {
if (partNumber == uploadSession.getTotalParts() - 1) {
return (int) (fileSize - partNumber * uploadSession.getPartSize());
}
return uploadSession.getPartSize();
} | [
"public",
"static",
"int",
"getChunkSize",
"(",
"BoxUploadSession",
"uploadSession",
",",
"int",
"partNumber",
",",
"long",
"fileSize",
")",
"{",
"if",
"(",
"partNumber",
"==",
"uploadSession",
".",
"getTotalParts",
"(",
")",
"-",
"1",
")",
"{",
"return",
"(... | Computes the actual bytes to be sent in a part, which equals the partsize for all parts
except the last.
@param uploadSession
@param partNumber
@param fileSize
@return | [
"Computes",
"the",
"actual",
"bytes",
"to",
"be",
"sent",
"in",
"a",
"part",
"which",
"equals",
"the",
"partsize",
"for",
"all",
"parts",
"except",
"the",
"last",
"."
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxUploadSession.java#L160-L165 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Types.java | Types.toArray | public static Object toArray(Collection<?> collection, Class<?> componentType) {
"""
Returns a new array of the given component type (possibly a Java primitive) that is a copy of
the content of the given collection.
@param collection collection
@param componentType component type (possibly a Java primitive)
... | java | public static Object toArray(Collection<?> collection, Class<?> componentType) {
if (componentType.isPrimitive()) {
Object array = Array.newInstance(componentType, collection.size());
int index = 0;
for (Object value : collection) {
Array.set(array, index++, value);
}
return ar... | [
"public",
"static",
"Object",
"toArray",
"(",
"Collection",
"<",
"?",
">",
"collection",
",",
"Class",
"<",
"?",
">",
"componentType",
")",
"{",
"if",
"(",
"componentType",
".",
"isPrimitive",
"(",
")",
")",
"{",
"Object",
"array",
"=",
"Array",
".",
"... | Returns a new array of the given component type (possibly a Java primitive) that is a copy of
the content of the given collection.
@param collection collection
@param componentType component type (possibly a Java primitive)
@return new array | [
"Returns",
"a",
"new",
"array",
"of",
"the",
"given",
"component",
"type",
"(",
"possibly",
"a",
"Java",
"primitive",
")",
"that",
"is",
"a",
"copy",
"of",
"the",
"content",
"of",
"the",
"given",
"collection",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Types.java#L388-L398 |
FitLayout/segmentation | src/main/java/org/fit/segm/grouping/SegmentationAreaTree.java | SegmentationAreaTree.findStandaloneAreas | private void findStandaloneAreas(Box boxroot, Area arearoot) {
"""
Goes through a box tree and tries to identify the boxes that form standalone
visual areas. From these boxes, new areas are created, which are added to the
area tree. Other boxes are ignored.
@param boxroot the root of the box tree
@param arearo... | java | private void findStandaloneAreas(Box boxroot, Area arearoot)
{
if (boxroot.isVisible())
{
for (int i = 0; i < boxroot.getChildCount(); i++)
{
Box child = boxroot.getChildAt(i);
if (child.isVisible())
{
if (isVisuallySeparat... | [
"private",
"void",
"findStandaloneAreas",
"(",
"Box",
"boxroot",
",",
"Area",
"arearoot",
")",
"{",
"if",
"(",
"boxroot",
".",
"isVisible",
"(",
")",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"boxroot",
".",
"getChildCount",
"(",
")"... | Goes through a box tree and tries to identify the boxes that form standalone
visual areas. From these boxes, new areas are created, which are added to the
area tree. Other boxes are ignored.
@param boxroot the root of the box tree
@param arearoot the root node of the new area tree | [
"Goes",
"through",
"a",
"box",
"tree",
"and",
"tries",
"to",
"identify",
"the",
"boxes",
"that",
"form",
"standalone",
"visual",
"areas",
".",
"From",
"these",
"boxes",
"new",
"areas",
"are",
"created",
"which",
"are",
"added",
"to",
"the",
"area",
"tree",... | train | https://github.com/FitLayout/segmentation/blob/12998087d576640c2f2a6360cf6088af95eea5f4/src/main/java/org/fit/segm/grouping/SegmentationAreaTree.java#L103-L126 |
meertensinstituut/mtas | src/main/java/mtas/analysis/token/MtasToken.java | MtasToken.addPositionRange | final public void addPositionRange(int start, int end) {
"""
Adds the position range.
@param start the start
@param end the end
"""
if (tokenPosition == null) {
tokenPosition = new MtasPosition(start, end);
} else {
int[] positions = new int[end - start + 1];
for (int i = start; i... | java | final public void addPositionRange(int start, int end) {
if (tokenPosition == null) {
tokenPosition = new MtasPosition(start, end);
} else {
int[] positions = new int[end - start + 1];
for (int i = start; i <= end; i++) {
positions[i - start] = i;
}
tokenPosition.add(positi... | [
"final",
"public",
"void",
"addPositionRange",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"tokenPosition",
"==",
"null",
")",
"{",
"tokenPosition",
"=",
"new",
"MtasPosition",
"(",
"start",
",",
"end",
")",
";",
"}",
"else",
"{",
"int... | Adds the position range.
@param start the start
@param end the end | [
"Adds",
"the",
"position",
"range",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/token/MtasToken.java#L293-L303 |
sahan/ZombieLink | zombielink/src/main/java/com/lonepulse/zombielink/executor/AsyncExecutionHandler.java | AsyncExecutionHandler.onSuccess | @Override
public void onSuccess(InvocationContext context, HttpResponse response) {
"""
<p>The given {@link HttpResponse} with a successful status code is processed using the response
processor chain ({@link Processors#RESPONSE} and if an {@link AsyncHandler} is defined, the result
of the processor chain is sub... | java | @Override
public void onSuccess(InvocationContext context, HttpResponse response) {
Object reponseEntity = null;
try {
reponseEntity = Processors.RESPONSE.run(context, response); //process, regardless of an AsyncHandler definition
}
catch(Exception e) {
onError(context, InvocationException.n... | [
"@",
"Override",
"public",
"void",
"onSuccess",
"(",
"InvocationContext",
"context",
",",
"HttpResponse",
"response",
")",
"{",
"Object",
"reponseEntity",
"=",
"null",
";",
"try",
"{",
"reponseEntity",
"=",
"Processors",
".",
"RESPONSE",
".",
"run",
"(",
"cont... | <p>The given {@link HttpResponse} with a successful status code is processed using the response
processor chain ({@link Processors#RESPONSE} and if an {@link AsyncHandler} is defined, the result
of the processor chain is submitted to the <i>onSuccess</i> callback. If response processing
resulted in an error, execution ... | [
"<p",
">",
"The",
"given",
"{",
"@link",
"HttpResponse",
"}",
"with",
"a",
"successful",
"status",
"code",
"is",
"processed",
"using",
"the",
"response",
"processor",
"chain",
"(",
"{",
"@link",
"Processors#RESPONSE",
"}",
"and",
"if",
"an",
"{",
"@link",
... | train | https://github.com/sahan/ZombieLink/blob/a9971add56d4f6919a4a5e84c78e9220011d8982/zombielink/src/main/java/com/lonepulse/zombielink/executor/AsyncExecutionHandler.java#L92-L120 |
atomix/atomix | protocols/gossip/src/main/java/io/atomix/protocols/gossip/map/AntiEntropyMapDelegate.java | AntiEntropyMapDelegate.handleBootstrap | private CompletableFuture<Void> handleBootstrap(MemberId peer) {
"""
Handles a bootstrap request from a peer.
<p>
When handling a bootstrap request from a peer, the node sends batches of entries back to the peer and completes the
bootstrap request once all batches have been received and processed.
@param pee... | java | private CompletableFuture<Void> handleBootstrap(MemberId peer) {
LOGGER.trace("Received bootstrap request from {} for {}", peer, bootstrapMessageSubject);
Function<List<UpdateEntry>, CompletableFuture<Void>> sendUpdates = updates -> {
LOGGER.trace("Initializing {} with {} entries", peer, updates.size());... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"handleBootstrap",
"(",
"MemberId",
"peer",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"Received bootstrap request from {} for {}\"",
",",
"peer",
",",
"bootstrapMessageSubject",
")",
";",
"Function",
"<",
"List",
"<",... | Handles a bootstrap request from a peer.
<p>
When handling a bootstrap request from a peer, the node sends batches of entries back to the peer and completes the
bootstrap request once all batches have been received and processed.
@param peer the peer that sent the bootstrap request
@return a future to be completed onc... | [
"Handles",
"a",
"bootstrap",
"request",
"from",
"a",
"peer",
".",
"<p",
">",
"When",
"handling",
"a",
"bootstrap",
"request",
"from",
"a",
"peer",
"the",
"node",
"sends",
"batches",
"of",
"entries",
"back",
"to",
"the",
"peer",
"and",
"completes",
"the",
... | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/gossip/src/main/java/io/atomix/protocols/gossip/map/AntiEntropyMapDelegate.java#L809-L845 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/StreamRecord.java | StreamRecord.withKeys | public StreamRecord withKeys(java.util.Map<String, AttributeValue> keys) {
"""
<p>
The primary key attribute(s) for the DynamoDB item that was modified.
</p>
@param keys
The primary key attribute(s) for the DynamoDB item that was modified.
@return Returns a reference to this object so that method calls can ... | java | public StreamRecord withKeys(java.util.Map<String, AttributeValue> keys) {
setKeys(keys);
return this;
} | [
"public",
"StreamRecord",
"withKeys",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
"keys",
")",
"{",
"setKeys",
"(",
"keys",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The primary key attribute(s) for the DynamoDB item that was modified.
</p>
@param keys
The primary key attribute(s) for the DynamoDB item that was modified.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"primary",
"key",
"attribute",
"(",
"s",
")",
"for",
"the",
"DynamoDB",
"item",
"that",
"was",
"modified",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/StreamRecord.java#L178-L181 |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/map/MapDataDao.java | MapDataDao.uploadChanges | public void uploadChanges(long changesetId, Iterable<Element> elements, Handler<DiffElement> handler) {
"""
Upload changes into an opened changeset.
@param elements elements to upload. No special order required
@param handler handler that processes the server's diffResult response. Optional.
@throws OsmNotF... | java | public void uploadChanges(long changesetId, Iterable<Element> elements, Handler<DiffElement> handler)
{
MapDataDiffParser parser = null;
if(handler != null)
{
parser = new MapDataDiffParser(handler);
}
osm.makeAuthenticatedRequest(
"changeset/" + changesetId + "/upload", "POST",
new MapDataChange... | [
"public",
"void",
"uploadChanges",
"(",
"long",
"changesetId",
",",
"Iterable",
"<",
"Element",
">",
"elements",
",",
"Handler",
"<",
"DiffElement",
">",
"handler",
")",
"{",
"MapDataDiffParser",
"parser",
"=",
"null",
";",
"if",
"(",
"handler",
"!=",
"null"... | Upload changes into an opened changeset.
@param elements elements to upload. No special order required
@param handler handler that processes the server's diffResult response. Optional.
@throws OsmNotFoundException if the changeset does not exist (yet) or an element in the
does not exist
@throws OsmConflictException i... | [
"Upload",
"changes",
"into",
"an",
"opened",
"changeset",
"."
] | train | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/map/MapDataDao.java#L112-L124 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/utils/ValueMap.java | ValueMap.withNumberSet | public ValueMap withNumberSet(String key, Number ... val) {
"""
Sets the value of the specified key in the current ValueMap to the
given value.
"""
super.put(key, InternalUtils.toBigDecimalSet(val));
return this;
} | java | public ValueMap withNumberSet(String key, Number ... val) {
super.put(key, InternalUtils.toBigDecimalSet(val));
return this;
} | [
"public",
"ValueMap",
"withNumberSet",
"(",
"String",
"key",
",",
"Number",
"...",
"val",
")",
"{",
"super",
".",
"put",
"(",
"key",
",",
"InternalUtils",
".",
"toBigDecimalSet",
"(",
"val",
")",
")",
";",
"return",
"this",
";",
"}"
] | Sets the value of the specified key in the current ValueMap to the
given value. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"key",
"in",
"the",
"current",
"ValueMap",
"to",
"the",
"given",
"value",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/utils/ValueMap.java#L131-L134 |
lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/util/ShellUtils.java | ShellUtils.execCommand | public static CommandResult execCommand(List<String> commands, boolean isRoot, boolean isNeedResultMsg) {
"""
execute shell commands
@param commands command list
@param isRoot whether need to run with root
@param isNeedResultMsg whether need result msg
@return
@see ShellUtils#execCommand(Str... | java | public static CommandResult execCommand(List<String> commands, boolean isRoot, boolean isNeedResultMsg) {
return execCommand(commands == null ? null : commands.toArray(new String[]{}), isRoot, isNeedResultMsg);
} | [
"public",
"static",
"CommandResult",
"execCommand",
"(",
"List",
"<",
"String",
">",
"commands",
",",
"boolean",
"isRoot",
",",
"boolean",
"isNeedResultMsg",
")",
"{",
"return",
"execCommand",
"(",
"commands",
"==",
"null",
"?",
"null",
":",
"commands",
".",
... | execute shell commands
@param commands command list
@param isRoot whether need to run with root
@param isNeedResultMsg whether need result msg
@return
@see ShellUtils#execCommand(String[], boolean, boolean) | [
"execute",
"shell",
"commands"
] | train | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/util/ShellUtils.java#L94-L96 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchIndex.java | CmsSearchIndex.extendPathFilter | protected void extendPathFilter(List<Term> terms, String searchRoot) {
"""
Extends the given path query with another term for the given search root element.<p>
@param terms the path filter to extend
@param searchRoot the search root to add to the path query
"""
if (!CmsResource.isFolder(searchRoot... | java | protected void extendPathFilter(List<Term> terms, String searchRoot) {
if (!CmsResource.isFolder(searchRoot)) {
searchRoot += "/";
}
terms.add(new Term(CmsSearchField.FIELD_PARENT_FOLDERS, searchRoot));
} | [
"protected",
"void",
"extendPathFilter",
"(",
"List",
"<",
"Term",
">",
"terms",
",",
"String",
"searchRoot",
")",
"{",
"if",
"(",
"!",
"CmsResource",
".",
"isFolder",
"(",
"searchRoot",
")",
")",
"{",
"searchRoot",
"+=",
"\"/\"",
";",
"}",
"terms",
".",... | Extends the given path query with another term for the given search root element.<p>
@param terms the path filter to extend
@param searchRoot the search root to add to the path query | [
"Extends",
"the",
"given",
"path",
"query",
"with",
"another",
"term",
"for",
"the",
"given",
"search",
"root",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchIndex.java#L1593-L1599 |
groupon/monsoon | intf/src/main/java/com/groupon/lex/metrics/Histogram.java | Histogram.modifyEventCounters | public Histogram modifyEventCounters(BiFunction<Range, Double, Double> fn) {
"""
Create a new histogram, after applying the function on each of the event
counters.
"""
return new Histogram(stream()
.map(entry -> {
entry.setCount(fn.apply(entry.getRange(), entry.getC... | java | public Histogram modifyEventCounters(BiFunction<Range, Double, Double> fn) {
return new Histogram(stream()
.map(entry -> {
entry.setCount(fn.apply(entry.getRange(), entry.getCount()));
return entry;
}));
} | [
"public",
"Histogram",
"modifyEventCounters",
"(",
"BiFunction",
"<",
"Range",
",",
"Double",
",",
"Double",
">",
"fn",
")",
"{",
"return",
"new",
"Histogram",
"(",
"stream",
"(",
")",
".",
"map",
"(",
"entry",
"->",
"{",
"entry",
".",
"setCount",
"(",
... | Create a new histogram, after applying the function on each of the event
counters. | [
"Create",
"a",
"new",
"histogram",
"after",
"applying",
"the",
"function",
"on",
"each",
"of",
"the",
"event",
"counters",
"."
] | train | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/Histogram.java#L184-L190 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/rules/WorkflowEngineOperationsProcessor.java | WorkflowEngineOperationsProcessor.waitForChanges | private void waitForChanges(final Map<String, String> changes) throws InterruptedException {
"""
Sleep until changes are available on the queue, if any are found then consume remaining and
return false, otherwise return true
@param changes
@return true if no changes found in the sleep time.
@throws Inter... | java | private void waitForChanges(final Map<String, String> changes) throws InterruptedException {
WorkflowSystem.OperationCompleted<DAT> take = stateChangeQueue.poll(sleeper.time(), sleeper.unit());
if (null == take || take.getNewState().getState().isEmpty()) {
sleeper.backoff();
retu... | [
"private",
"void",
"waitForChanges",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"changes",
")",
"throws",
"InterruptedException",
"{",
"WorkflowSystem",
".",
"OperationCompleted",
"<",
"DAT",
">",
"take",
"=",
"stateChangeQueue",
".",
"poll",
"(",
... | Sleep until changes are available on the queue, if any are found then consume remaining and
return false, otherwise return true
@param changes
@return true if no changes found in the sleep time.
@throws InterruptedException | [
"Sleep",
"until",
"changes",
"are",
"available",
"on",
"the",
"queue",
"if",
"any",
"are",
"found",
"then",
"consume",
"remaining",
"and",
"return",
"false",
"otherwise",
"return",
"true"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/rules/WorkflowEngineOperationsProcessor.java#L289-L305 |
springfox/springfox | springfox-core/src/main/java/springfox/documentation/builders/BuilderDefaults.java | BuilderDefaults.emptyToNull | public static AllowableValues emptyToNull(AllowableValues newValue, AllowableValues current) {
"""
Retains current allowable values if then new value is null
@param newValue - new value
@param current - existing values
@return the appropriate value
"""
if (newValue != null) {
if (newValue instance... | java | public static AllowableValues emptyToNull(AllowableValues newValue, AllowableValues current) {
if (newValue != null) {
if (newValue instanceof AllowableListValues) {
return defaultIfAbsent(emptyListValuesToNull((AllowableListValues) newValue), current);
} else {
return defaultIfAbsent(ne... | [
"public",
"static",
"AllowableValues",
"emptyToNull",
"(",
"AllowableValues",
"newValue",
",",
"AllowableValues",
"current",
")",
"{",
"if",
"(",
"newValue",
"!=",
"null",
")",
"{",
"if",
"(",
"newValue",
"instanceof",
"AllowableListValues",
")",
"{",
"return",
... | Retains current allowable values if then new value is null
@param newValue - new value
@param current - existing values
@return the appropriate value | [
"Retains",
"current",
"allowable",
"values",
"if",
"then",
"new",
"value",
"is",
"null"
] | train | https://github.com/springfox/springfox/blob/e40e2d6f4b345ffa35cd5c0ca7a12589036acaf7/springfox-core/src/main/java/springfox/documentation/builders/BuilderDefaults.java#L151-L160 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java | BpmnParse.parseScope | public void parseScope(Element scopeElement, ScopeImpl parentScope) {
"""
Parses a scope: a process, subprocess, etc.
Note that a process definition is a scope on itself.
@param scopeElement
The XML element defining the scope
@param parentScope
The scope that contains the nested scope.
"""
// Not... | java | public void parseScope(Element scopeElement, ScopeImpl parentScope) {
// Not yet supported on process level (PVM additions needed):
// parseProperties(processElement);
// filter activities that must be parsed separately
List<Element> activityElements = new ArrayList<Element>(scopeElement.elements());
... | [
"public",
"void",
"parseScope",
"(",
"Element",
"scopeElement",
",",
"ScopeImpl",
"parentScope",
")",
"{",
"// Not yet supported on process level (PVM additions needed):",
"// parseProperties(processElement);",
"// filter activities that must be parsed separately",
"List",
"<",
"Elem... | Parses a scope: a process, subprocess, etc.
Note that a process definition is a scope on itself.
@param scopeElement
The XML element defining the scope
@param parentScope
The scope that contains the nested scope. | [
"Parses",
"a",
"scope",
":",
"a",
"process",
"subprocess",
"etc",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L630-L659 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java | NewSarlProjectWizard.createDefaultMavenPom | protected void createDefaultMavenPom(IJavaProject project, String compilerCompliance) {
"""
Create the default Maven pom file for the project.
<p>Even if the project has not the Maven nature when it is created with this wizard,
the pom file is created in order to let the developer to switch to the Maven nature... | java | protected void createDefaultMavenPom(IJavaProject project, String compilerCompliance) {
// Get the template resource.
final URL templateUrl = getPomTemplateLocation();
if (templateUrl != null) {
final String compliance = Strings.isNullOrEmpty(compilerCompliance) ? SARLVersion.MINIMAL_JDK_VERSION : compilerComp... | [
"protected",
"void",
"createDefaultMavenPom",
"(",
"IJavaProject",
"project",
",",
"String",
"compilerCompliance",
")",
"{",
"// Get the template resource.",
"final",
"URL",
"templateUrl",
"=",
"getPomTemplateLocation",
"(",
")",
";",
"if",
"(",
"templateUrl",
"!=",
"... | Create the default Maven pom file for the project.
<p>Even if the project has not the Maven nature when it is created with this wizard,
the pom file is created in order to let the developer to switch to the Maven nature easily.
@param project the new project.
@param compilerCompliance the Java version that is support... | [
"Create",
"the",
"default",
"Maven",
"pom",
"file",
"for",
"the",
"project",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java#L292-L325 |
rapidpro/expressions | java/src/main/java/io/rapidpro/expressions/evaluator/Evaluator.java | Evaluator.evaluateTemplate | public EvaluatedTemplate evaluateTemplate(String template, EvaluationContext context, boolean urlEncode) {
"""
Evaluates a template string, e.g. "Hello @contact.name you have @(contact.reports * 2) reports"
@param template the template string
@param context the evaluation context
@param urlEncode whether or not... | java | public EvaluatedTemplate evaluateTemplate(String template, EvaluationContext context, boolean urlEncode) {
return evaluateTemplate(template, context, urlEncode, EvaluationStrategy.COMPLETE);
} | [
"public",
"EvaluatedTemplate",
"evaluateTemplate",
"(",
"String",
"template",
",",
"EvaluationContext",
"context",
",",
"boolean",
"urlEncode",
")",
"{",
"return",
"evaluateTemplate",
"(",
"template",
",",
"context",
",",
"urlEncode",
",",
"EvaluationStrategy",
".",
... | Evaluates a template string, e.g. "Hello @contact.name you have @(contact.reports * 2) reports"
@param template the template string
@param context the evaluation context
@param urlEncode whether or not values should be URL encoded
@return a tuple of the evaluated template and a list of evaluation errors | [
"Evaluates",
"a",
"template",
"string",
"e",
".",
"g",
".",
"Hello"
] | train | https://github.com/rapidpro/expressions/blob/b03d91ec58fc328960bce90ecb5fa49dcf467627/java/src/main/java/io/rapidpro/expressions/evaluator/Evaluator.java#L88-L90 |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/util/ThreadLogger.java | ThreadLogger.logThreads | public static void logThreads(final Logger logger, final Level level, final String prefix) {
"""
Same as <code>logThreads(logger, level, prefix, "\n\t", "\n\t\t")</code>.
"""
logThreads(logger, level, prefix, "\n\t", "\n\t\t");
} | java | public static void logThreads(final Logger logger, final Level level, final String prefix) {
logThreads(logger, level, prefix, "\n\t", "\n\t\t");
} | [
"public",
"static",
"void",
"logThreads",
"(",
"final",
"Logger",
"logger",
",",
"final",
"Level",
"level",
",",
"final",
"String",
"prefix",
")",
"{",
"logThreads",
"(",
"logger",
",",
"level",
",",
"prefix",
",",
"\"\\n\\t\"",
",",
"\"\\n\\t\\t\"",
")",
... | Same as <code>logThreads(logger, level, prefix, "\n\t", "\n\t\t")</code>. | [
"Same",
"as",
"<code",
">",
"logThreads",
"(",
"logger",
"level",
"prefix",
"\\",
"n",
"\\",
"t",
"\\",
"n",
"\\",
"t",
"\\",
"t",
")",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/util/ThreadLogger.java#L44-L46 |
phax/ph-pdf-layout | src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java | PDPageContentStreamExt.setNonStrokingColor | public void setNonStrokingColor (final int r, final int g, final int b) throws IOException {
"""
Set the non-stroking color in the DeviceRGB color space. Range is 0..255.
@param r
The red value.
@param g
The green value.
@param b
The blue value.
@throws IOException
If an IO error occurs while writing to ... | java | public void setNonStrokingColor (final int r, final int g, final int b) throws IOException
{
if (_isOutside255Interval (r) || _isOutside255Interval (g) || _isOutside255Interval (b))
{
throw new IllegalArgumentException ("Parameters must be within 0..255, but are (" + r + "," + g + "," + b + ")");
}
... | [
"public",
"void",
"setNonStrokingColor",
"(",
"final",
"int",
"r",
",",
"final",
"int",
"g",
",",
"final",
"int",
"b",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_isOutside255Interval",
"(",
"r",
")",
"||",
"_isOutside255Interval",
"(",
"g",
")",
"||",... | Set the non-stroking color in the DeviceRGB color space. Range is 0..255.
@param r
The red value.
@param g
The green value.
@param b
The blue value.
@throws IOException
If an IO error occurs while writing to the stream.
@throws IllegalArgumentException
If the parameters are invalid. | [
"Set",
"the",
"non",
"-",
"stroking",
"color",
"in",
"the",
"DeviceRGB",
"color",
"space",
".",
"Range",
"is",
"0",
"..",
"255",
"."
] | train | https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java#L952-L962 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/MP3FileID3Controller.java | MP3FileID3Controller.setTextFrame | public void setTextFrame(String id, String data) {
"""
Set the text of the text frame specified by the id (id3v2 only). The
id should be one of the static strings specifed in ID3v2Frames class.
All id's that begin with 'T' (excluding "TXXX") are considered text
frames.
@param id the id of the frame to set t... | java | public void setTextFrame(String id, String data)
{
if (allow(ID3V2))
{
id3v2.setTextFrame(id, data);
}
} | [
"public",
"void",
"setTextFrame",
"(",
"String",
"id",
",",
"String",
"data",
")",
"{",
"if",
"(",
"allow",
"(",
"ID3V2",
")",
")",
"{",
"id3v2",
".",
"setTextFrame",
"(",
"id",
",",
"data",
")",
";",
"}",
"}"
] | Set the text of the text frame specified by the id (id3v2 only). The
id should be one of the static strings specifed in ID3v2Frames class.
All id's that begin with 'T' (excluding "TXXX") are considered text
frames.
@param id the id of the frame to set the data for
@param data the data to set | [
"Set",
"the",
"text",
"of",
"the",
"text",
"frame",
"specified",
"by",
"the",
"id",
"(",
"id3v2",
"only",
")",
".",
"The",
"id",
"should",
"be",
"one",
"of",
"the",
"static",
"strings",
"specifed",
"in",
"ID3v2Frames",
"class",
".",
"All",
"id",
"s",
... | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/MP3FileID3Controller.java#L364-L370 |
landawn/AbacusUtil | src/com/landawn/abacus/android/util/SQLiteExecutor.java | SQLiteExecutor.exists | @SafeVarargs
public final boolean exists(String sql, Object... parameters) {
"""
Remember to add {@code limit} condition if big result will be returned by the query.
@param sql
@param parameters A Object Array/List, and Map/Entity with getter/setter methods for parameterized sql with named parameters
@re... | java | @SafeVarargs
public final boolean exists(String sql, Object... parameters) {
final Cursor cursor = rawQuery(sql, parameters);
try {
return cursor.moveToNext();
} finally {
cursor.close();
}
} | [
"@",
"SafeVarargs",
"public",
"final",
"boolean",
"exists",
"(",
"String",
"sql",
",",
"Object",
"...",
"parameters",
")",
"{",
"final",
"Cursor",
"cursor",
"=",
"rawQuery",
"(",
"sql",
",",
"parameters",
")",
";",
"try",
"{",
"return",
"cursor",
".",
"m... | Remember to add {@code limit} condition if big result will be returned by the query.
@param sql
@param parameters A Object Array/List, and Map/Entity with getter/setter methods for parameterized sql with named parameters
@return | [
"Remember",
"to",
"add",
"{",
"@code",
"limit",
"}",
"condition",
"if",
"big",
"result",
"will",
"be",
"returned",
"by",
"the",
"query",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/android/util/SQLiteExecutor.java#L1251-L1260 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AutomationAccountsInner.java | AutomationAccountsInner.getByResourceGroupAsync | public Observable<AutomationAccountInner> getByResourceGroupAsync(String resourceGroupName, String automationAccountName) {
"""
Get information about an Automation Account.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws Illega... | java | public Observable<AutomationAccountInner> getByResourceGroupAsync(String resourceGroupName, String automationAccountName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, automationAccountName).map(new Func1<ServiceResponse<AutomationAccountInner>, AutomationAccountInner>() {
@... | [
"public",
"Observable",
"<",
"AutomationAccountInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccount... | Get information about an Automation Account.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the AutomationAccountInner object | [
"Get",
"information",
"about",
"an",
"Automation",
"Account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AutomationAccountsInner.java#L408-L415 |
banq/jdonframework | src/main/java/com/jdon/util/FileUtil.java | FileUtil.CopyDir | public static void CopyDir(String sourcedir, String destdir) throws Exception {
"""
This class copies an input files of a directory to another directory not
include subdir
@param String
sourcedir the directory to copy from such as:/home/bqlr/images
@param String
destdir the target directory
"""
File ... | java | public static void CopyDir(String sourcedir, String destdir) throws Exception {
File dest = new File(destdir);
File source = new File(sourcedir);
String[] files = source.list();
try {
makehome(destdir);
} catch (Exception ex) {
throw new Exception("CopyDir:" + ex.getMessage());
}
for (i... | [
"public",
"static",
"void",
"CopyDir",
"(",
"String",
"sourcedir",
",",
"String",
"destdir",
")",
"throws",
"Exception",
"{",
"File",
"dest",
"=",
"new",
"File",
"(",
"destdir",
")",
";",
"File",
"source",
"=",
"new",
"File",
"(",
"sourcedir",
")",
";",
... | This class copies an input files of a directory to another directory not
include subdir
@param String
sourcedir the directory to copy from such as:/home/bqlr/images
@param String
destdir the target directory | [
"This",
"class",
"copies",
"an",
"input",
"files",
"of",
"a",
"directory",
"to",
"another",
"directory",
"not",
"include",
"subdir"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/FileUtil.java#L166-L189 |
projectodd/wunderboss-release | messaging-hornetq/src/main/java/org/projectodd/wunderboss/messaging/hornetq/HQMessaging.java | HQMessaging.invokeDestroy | private void invokeDestroy(String method, String name) {
"""
HornetQ 2.3 has single-arity destroy functions, 2.4 has double-arity
"""
Class clazz = this.jmsServerManager().getClass();
Method destroy = null;
for (Method each: clazz.getMethods()) {
if (method.equals(each.getNa... | java | private void invokeDestroy(String method, String name) {
Class clazz = this.jmsServerManager().getClass();
Method destroy = null;
for (Method each: clazz.getMethods()) {
if (method.equals(each.getName())) {
destroy = each;
break;
}
... | [
"private",
"void",
"invokeDestroy",
"(",
"String",
"method",
",",
"String",
"name",
")",
"{",
"Class",
"clazz",
"=",
"this",
".",
"jmsServerManager",
"(",
")",
".",
"getClass",
"(",
")",
";",
"Method",
"destroy",
"=",
"null",
";",
"for",
"(",
"Method",
... | HornetQ 2.3 has single-arity destroy functions, 2.4 has double-arity | [
"HornetQ",
"2",
".",
"3",
"has",
"single",
"-",
"arity",
"destroy",
"functions",
"2",
".",
"4",
"has",
"double",
"-",
"arity"
] | train | https://github.com/projectodd/wunderboss-release/blob/f67c68e80c5798169e3a9b2015e278239dbf005d/messaging-hornetq/src/main/java/org/projectodd/wunderboss/messaging/hornetq/HQMessaging.java#L190-L213 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/paramavg/ParameterAveragingTrainingMaster.java | ParameterAveragingTrainingMaster.fromJson | public static ParameterAveragingTrainingMaster fromJson(String jsonStr) {
"""
Create a ParameterAveragingTrainingMaster instance by deserializing a JSON string that has been serialized with
{@link #toJson()}
@param jsonStr ParameterAveragingTrainingMaster configuration serialized as JSON
"""
Object... | java | public static ParameterAveragingTrainingMaster fromJson(String jsonStr) {
ObjectMapper om = getJsonMapper();
try {
return om.readValue(jsonStr, ParameterAveragingTrainingMaster.class);
} catch (IOException e) {
throw new RuntimeException("Could not parse JSON", e);
... | [
"public",
"static",
"ParameterAveragingTrainingMaster",
"fromJson",
"(",
"String",
"jsonStr",
")",
"{",
"ObjectMapper",
"om",
"=",
"getJsonMapper",
"(",
")",
";",
"try",
"{",
"return",
"om",
".",
"readValue",
"(",
"jsonStr",
",",
"ParameterAveragingTrainingMaster",
... | Create a ParameterAveragingTrainingMaster instance by deserializing a JSON string that has been serialized with
{@link #toJson()}
@param jsonStr ParameterAveragingTrainingMaster configuration serialized as JSON | [
"Create",
"a",
"ParameterAveragingTrainingMaster",
"instance",
"by",
"deserializing",
"a",
"JSON",
"string",
"that",
"has",
"been",
"serialized",
"with",
"{",
"@link",
"#toJson",
"()",
"}"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/paramavg/ParameterAveragingTrainingMaster.java#L255-L262 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/global/postprocessor/google/closure/ClosureGlobalPostProcessor.java | ClosureGlobalPostProcessor.checkBundleName | private void checkBundleName(String bundleName, Map<String, JoinableResourceBundle> bundleMap) {
"""
Checks the bundle name
@param bundleName
the bundle name
@param bundleMap
the bundle map
"""
if (!JAWR_ROOT_MODULE_NAME.equals(bundleName)) {
boolean moduleExist = bundleMap.get(bundleName) != null;
... | java | private void checkBundleName(String bundleName, Map<String, JoinableResourceBundle> bundleMap) {
if (!JAWR_ROOT_MODULE_NAME.equals(bundleName)) {
boolean moduleExist = bundleMap.get(bundleName) != null;
if (!moduleExist) {
throw new BundlingProcessException("The bundle name '" + bundleName
+ "' define... | [
"private",
"void",
"checkBundleName",
"(",
"String",
"bundleName",
",",
"Map",
"<",
"String",
",",
"JoinableResourceBundle",
">",
"bundleMap",
")",
"{",
"if",
"(",
"!",
"JAWR_ROOT_MODULE_NAME",
".",
"equals",
"(",
"bundleName",
")",
")",
"{",
"boolean",
"modul... | Checks the bundle name
@param bundleName
the bundle name
@param bundleMap
the bundle map | [
"Checks",
"the",
"bundle",
"name"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/global/postprocessor/google/closure/ClosureGlobalPostProcessor.java#L597-L605 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/TextModerationsImpl.java | TextModerationsImpl.detectLanguage | public DetectedLanguage detectLanguage(String textContentType, byte[] textContent) {
"""
This operation will detect the language of given input content. Returns the <a href="http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 code</a> for the predominant language comprising the submitted text. Over 110... | java | public DetectedLanguage detectLanguage(String textContentType, byte[] textContent) {
return detectLanguageWithServiceResponseAsync(textContentType, textContent).toBlocking().single().body();
} | [
"public",
"DetectedLanguage",
"detectLanguage",
"(",
"String",
"textContentType",
",",
"byte",
"[",
"]",
"textContent",
")",
"{",
"return",
"detectLanguageWithServiceResponseAsync",
"(",
"textContentType",
",",
"textContent",
")",
".",
"toBlocking",
"(",
")",
".",
"... | This operation will detect the language of given input content. Returns the <a href="http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 code</a> for the predominant language comprising the submitted text. Over 110 languages supported.
@param textContentType The content type. Possible values include: 'text... | [
"This",
"operation",
"will",
"detect",
"the",
"language",
"of",
"given",
"input",
"content",
".",
"Returns",
"the",
"<",
";",
"a",
"href",
"=",
"http",
":",
"//",
"www",
"-",
"01",
".",
"sil",
".",
"org",
"/",
"iso639",
"-",
"3",
"/",
"codes",
".... | 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/TextModerationsImpl.java#L292-L294 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Array.java | Array.bucketSort | static <T> void bucketSort(final List<? extends T> c, final Comparator<? super T> cmp) {
"""
Note: All the objects with same value will be replaced with first element with the same value.
@param c
@param cmp
"""
if (N.isNullOrEmpty(c)) {
return;
}
bucketSort(c, 0, ... | java | static <T> void bucketSort(final List<? extends T> c, final Comparator<? super T> cmp) {
if (N.isNullOrEmpty(c)) {
return;
}
bucketSort(c, 0, c.size(), cmp);
} | [
"static",
"<",
"T",
">",
"void",
"bucketSort",
"(",
"final",
"List",
"<",
"?",
"extends",
"T",
">",
"c",
",",
"final",
"Comparator",
"<",
"?",
"super",
"T",
">",
"cmp",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"c",
")",
")",
"{",
"r... | Note: All the objects with same value will be replaced with first element with the same value.
@param c
@param cmp | [
"Note",
":",
"All",
"the",
"objects",
"with",
"same",
"value",
"will",
"be",
"replaced",
"with",
"first",
"element",
"with",
"the",
"same",
"value",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Array.java#L3171-L3177 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_voipLine_services_POST | public OvhVoIPLineOrder packName_voipLine_services_POST(String packName, String[] hardwareNames, String mondialRelayId, String shippingId) throws IOException {
"""
Activate a voip line service
REST: POST /pack/xdsl/{packName}/voipLine/services
@param mondialRelayId [required] Mondial relay ID
@param hardwareN... | java | public OvhVoIPLineOrder packName_voipLine_services_POST(String packName, String[] hardwareNames, String mondialRelayId, String shippingId) throws IOException {
String qPath = "/pack/xdsl/{packName}/voipLine/services";
StringBuilder sb = path(qPath, packName);
HashMap<String, Object>o = new HashMap<String, Object>... | [
"public",
"OvhVoIPLineOrder",
"packName_voipLine_services_POST",
"(",
"String",
"packName",
",",
"String",
"[",
"]",
"hardwareNames",
",",
"String",
"mondialRelayId",
",",
"String",
"shippingId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/pack/xdsl... | Activate a voip line service
REST: POST /pack/xdsl/{packName}/voipLine/services
@param mondialRelayId [required] Mondial relay ID
@param hardwareNames [required] List of names from hardwares call
@param shippingId [required] Shipping ID for the order
@param packName [required] The internal name of your pack | [
"Activate",
"a",
"voip",
"line",
"service"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L256-L265 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryDetectPoint.java | FactoryDetectPoint.createShiTomasi | public static <T extends ImageGray<T>, D extends ImageGray<D>>
GeneralFeatureDetector<T, D> createShiTomasi( @Nullable ConfigGeneralDetector configDetector,
@Nullable ConfigShiTomasi configCorner,
Class<D> derivType) {
"""
Detects Shi-Tomasi corners.
@param configDetector Configurat... | java | public static <T extends ImageGray<T>, D extends ImageGray<D>>
GeneralFeatureDetector<T, D> createShiTomasi( @Nullable ConfigGeneralDetector configDetector,
@Nullable ConfigShiTomasi configCorner,
Class<D> derivType) {
if( configDetector == null)
configDetector = new ConfigGeneralDetec... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"GeneralFeatureDetector",
"<",
"T",
",",
"D",
">",
"createShiTomasi",
"(",
"@",
"Nullable",
"ConfigGeneralDetector",
"configDetector",
... | Detects Shi-Tomasi corners.
@param configDetector Configuration for feature extractor.
@param configCorner Configuration for corner intensity computation. If null radius will match detector radius
@param derivType Type of derivative image.
@see boofcv.alg.feature.detect.intensity.ShiTomasiCornerIntensity | [
"Detects",
"Shi",
"-",
"Tomasi",
"corners",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryDetectPoint.java#L86-L101 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ws/logging/internal/TraceNLSResolver.java | TraceNLSResolver.logEvent | protected final static void logEvent(String message, Object[] args) {
"""
Common method to use Tr to log that something above couldn't be resolved.
This method further checks whether or not the
<code>com.ibm.ejs.ras.debugTraceNLSResolver</code> property has been set
before calling Tr to log the event.
@param... | java | protected final static void logEvent(String message, Object[] args) {
if (getInstance().makeNoise && tc.isEventEnabled()) {
if (args == null)
com.ibm.websphere.ras.Tr.event(tc, message);
else
com.ibm.websphere.ras.Tr.event(tc, MessageFormat.format(message,... | [
"protected",
"final",
"static",
"void",
"logEvent",
"(",
"String",
"message",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"getInstance",
"(",
")",
".",
"makeNoise",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"if",
"(",
"args",
"... | Common method to use Tr to log that something above couldn't be resolved.
This method further checks whether or not the
<code>com.ibm.ejs.ras.debugTraceNLSResolver</code> property has been set
before calling Tr to log the event.
@param message
Event message
@param args
Parameters for message formatter | [
"Common",
"method",
"to",
"use",
"Tr",
"to",
"log",
"that",
"something",
"above",
"couldn",
"t",
"be",
"resolved",
".",
"This",
"method",
"further",
"checks",
"whether",
"or",
"not",
"the",
"<code",
">",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ws/logging/internal/TraceNLSResolver.java#L437-L444 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/conversion/provider/SimpleConversionService.java | SimpleConversionService.setDefaultValue | public <T> void setDefaultValue(Class<T> type, Supplier<T> defaultValueSupplier) {
"""
Sets the {@link Supplier} used to supply a {@link Object default value} for the specified {@link Class type}.
This overloaded method is useful for dynamically generating new {@link Object values} at runtime,
such as date/tim... | java | public <T> void setDefaultValue(Class<T> type, Supplier<T> defaultValueSupplier) {
Assert.notNull(type, "Class type is required");
this.defaultValues.put(type, defaultValueSupplier);
} | [
"public",
"<",
"T",
">",
"void",
"setDefaultValue",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Supplier",
"<",
"T",
">",
"defaultValueSupplier",
")",
"{",
"Assert",
".",
"notNull",
"(",
"type",
",",
"\"Class type is required\"",
")",
";",
"this",
".",
"d... | Sets the {@link Supplier} used to supply a {@link Object default value} for the specified {@link Class type}.
This overloaded method is useful for dynamically generating new {@link Object values} at runtime,
such as date/time values
@param <T> {@link Class classification/type} of objects which may have {@link Object ... | [
"Sets",
"the",
"{",
"@link",
"Supplier",
"}",
"used",
"to",
"supply",
"a",
"{",
"@link",
"Object",
"default",
"value",
"}",
"for",
"the",
"specified",
"{",
"@link",
"Class",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/conversion/provider/SimpleConversionService.java#L320-L323 |
Impetus/Kundera | src/kundera-hbase/kundera-hbase/src/main/java/com/impetus/client/hbase/query/HBaseQuery.java | HBaseQuery.onQuery | private List onQuery(EntityMetadata m, Client client) {
"""
Parses and translates query into HBase filter and invokes client's method
to return list of entities.
@param m
Entity metadata
@param client
hbase client
@return list of entities.
"""
// Called only in case of standalone entity.
... | java | private List onQuery(EntityMetadata m, Client client)
{
// Called only in case of standalone entity.
QueryTranslator translator = new QueryTranslator();
translator.translate(getKunderaQuery(), m, ((ClientBase) client).getClientMetadata());
// start with 1 as first element is alias.
... | [
"private",
"List",
"onQuery",
"(",
"EntityMetadata",
"m",
",",
"Client",
"client",
")",
"{",
"// Called only in case of standalone entity.",
"QueryTranslator",
"translator",
"=",
"new",
"QueryTranslator",
"(",
")",
";",
"translator",
".",
"translate",
"(",
"getKundera... | Parses and translates query into HBase filter and invokes client's method
to return list of entities.
@param m
Entity metadata
@param client
hbase client
@return list of entities. | [
"Parses",
"and",
"translates",
"query",
"into",
"HBase",
"filter",
"and",
"invokes",
"client",
"s",
"method",
"to",
"return",
"list",
"of",
"entities",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase/src/main/java/com/impetus/client/hbase/query/HBaseQuery.java#L152-L195 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceCompositeGroupService.java | ReferenceCompositeGroupService.newGroup | @Override
public IEntityGroup newGroup(Class type, Name serviceName) throws GroupsException {
"""
Returns a new <code>IEntityGroup</code> from the named service.
"""
return getComponentService(serviceName).newGroup(type);
} | java | @Override
public IEntityGroup newGroup(Class type, Name serviceName) throws GroupsException {
return getComponentService(serviceName).newGroup(type);
} | [
"@",
"Override",
"public",
"IEntityGroup",
"newGroup",
"(",
"Class",
"type",
",",
"Name",
"serviceName",
")",
"throws",
"GroupsException",
"{",
"return",
"getComponentService",
"(",
"serviceName",
")",
".",
"newGroup",
"(",
"type",
")",
";",
"}"
] | Returns a new <code>IEntityGroup</code> from the named service. | [
"Returns",
"a",
"new",
"<code",
">",
"IEntityGroup<",
"/",
"code",
">",
"from",
"the",
"named",
"service",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceCompositeGroupService.java#L204-L207 |
petergeneric/stdlib | service-manager/service-manager/src/main/java/com/peterphi/servicemanager/service/logging/azure/AzureLogStore.java | AzureLogStore.createPartitionAndRowQuery | public String createPartitionAndRowQuery(final DateTime from, final DateTime to) {
"""
Create a filter condition that returns log lines between two dates. Designed to be used in addition to other criteria
@param from
@param to
@return
"""
final String parMin = TableQuery.generateFilterCondition("Parti... | java | public String createPartitionAndRowQuery(final DateTime from, final DateTime to)
{
final String parMin = TableQuery.generateFilterCondition("PartitionKey",
TableQuery.QueryComparisons.GREATER_THAN_OR_EQUAL,
... | [
"public",
"String",
"createPartitionAndRowQuery",
"(",
"final",
"DateTime",
"from",
",",
"final",
"DateTime",
"to",
")",
"{",
"final",
"String",
"parMin",
"=",
"TableQuery",
".",
"generateFilterCondition",
"(",
"\"PartitionKey\"",
",",
"TableQuery",
".",
"QueryCompa... | Create a filter condition that returns log lines between two dates. Designed to be used in addition to other criteria
@param from
@param to
@return | [
"Create",
"a",
"filter",
"condition",
"that",
"returns",
"log",
"lines",
"between",
"two",
"dates",
".",
"Designed",
"to",
"be",
"used",
"in",
"addition",
"to",
"other",
"criteria"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/service-manager/service-manager/src/main/java/com/peterphi/servicemanager/service/logging/azure/AzureLogStore.java#L199-L228 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/util/ValidateMessageParserUtil.java | ValidateMessageParserUtil.parseJsonPathElements | public static void parseJsonPathElements(Element validateElement, Map<String, Object> validateJsonPathExpressions) {
"""
Parses 'validate' element containing nested 'json-path' elements.
@param validateElement the validate element to parse
@param validateJsonPathExpressions adds the parsed json-path elements to ... | java | public static void parseJsonPathElements(Element validateElement, Map<String, Object> validateJsonPathExpressions) {
List<?> jsonPathElements = DomUtils.getChildElementsByTagName(validateElement, "json-path");
if (jsonPathElements.size() > 0) {
for (Iterator<?> jsonPathIterator = jsonPathEle... | [
"public",
"static",
"void",
"parseJsonPathElements",
"(",
"Element",
"validateElement",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"validateJsonPathExpressions",
")",
"{",
"List",
"<",
"?",
">",
"jsonPathElements",
"=",
"DomUtils",
".",
"getChildElementsByTagNam... | Parses 'validate' element containing nested 'json-path' elements.
@param validateElement the validate element to parse
@param validateJsonPathExpressions adds the parsed json-path elements to this map | [
"Parses",
"validate",
"element",
"containing",
"nested",
"json",
"-",
"path",
"elements",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/util/ValidateMessageParserUtil.java#L40-L51 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java | PredictionsImpl.predictImageUrlWithNoStore | public ImagePrediction predictImageUrlWithNoStore(UUID projectId, PredictImageUrlWithNoStoreOptionalParameter predictImageUrlWithNoStoreOptionalParameter) {
"""
Predict an image url without saving the result.
@param projectId The project id
@param predictImageUrlWithNoStoreOptionalParameter the object represen... | java | public ImagePrediction predictImageUrlWithNoStore(UUID projectId, PredictImageUrlWithNoStoreOptionalParameter predictImageUrlWithNoStoreOptionalParameter) {
return predictImageUrlWithNoStoreWithServiceResponseAsync(projectId, predictImageUrlWithNoStoreOptionalParameter).toBlocking().single().body();
} | [
"public",
"ImagePrediction",
"predictImageUrlWithNoStore",
"(",
"UUID",
"projectId",
",",
"PredictImageUrlWithNoStoreOptionalParameter",
"predictImageUrlWithNoStoreOptionalParameter",
")",
"{",
"return",
"predictImageUrlWithNoStoreWithServiceResponseAsync",
"(",
"projectId",
",",
"pr... | Predict an image url without saving the result.
@param projectId The project id
@param predictImageUrlWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if... | [
"Predict",
"an",
"image",
"url",
"without",
"saving",
"the",
"result",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java#L275-L277 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Call.java | Call.create | public static Call create(final String to, final String from, final String callbackUrl, final String tag) throws Exception {
"""
Convenience method to dials a call from a phone number to a phone number
@param to the to number
@param from the from number
@param callbackUrl the callback URL
@param tag the call ... | java | public static Call create(final String to, final String from, final String callbackUrl, final String tag) throws Exception
{
assert(to != null && from != null);
final Map<String, Object> params = new HashMap<String, Object>();
params.put("to", to);
params.put("from", from);
para... | [
"public",
"static",
"Call",
"create",
"(",
"final",
"String",
"to",
",",
"final",
"String",
"from",
",",
"final",
"String",
"callbackUrl",
",",
"final",
"String",
"tag",
")",
"throws",
"Exception",
"{",
"assert",
"(",
"to",
"!=",
"null",
"&&",
"from",
"!... | Convenience method to dials a call from a phone number to a phone number
@param to the to number
@param from the from number
@param callbackUrl the callback URL
@param tag the call tag
@return the call
@throws IOException unexpected error. | [
"Convenience",
"method",
"to",
"dials",
"a",
"call",
"from",
"a",
"phone",
"number",
"to",
"a",
"phone",
"number"
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Call.java#L118-L131 |
rholder/guava-retrying | src/main/java/com/github/rholder/retry/WaitStrategies.java | WaitStrategies.exponentialWait | public static WaitStrategy exponentialWait(long maximumTime,
@Nonnull TimeUnit maximumTimeUnit) {
"""
Returns a strategy which sleeps for an exponential amount of time after the first failed attempt,
and in exponentially incrementing amounts after each failed attempt... | java | public static WaitStrategy exponentialWait(long maximumTime,
@Nonnull TimeUnit maximumTimeUnit) {
Preconditions.checkNotNull(maximumTimeUnit, "The maximum time unit may not be null");
return new ExponentialWaitStrategy(1, maximumTimeUnit.toMillis(maximumTim... | [
"public",
"static",
"WaitStrategy",
"exponentialWait",
"(",
"long",
"maximumTime",
",",
"@",
"Nonnull",
"TimeUnit",
"maximumTimeUnit",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"maximumTimeUnit",
",",
"\"The maximum time unit may not be null\"",
")",
";",
"re... | Returns a strategy which sleeps for an exponential amount of time after the first failed attempt,
and in exponentially incrementing amounts after each failed attempt up to the maximumTime.
@param maximumTime the maximum time to sleep
@param maximumTimeUnit the unit of the maximum time
@return a wait strategy that ... | [
"Returns",
"a",
"strategy",
"which",
"sleeps",
"for",
"an",
"exponential",
"amount",
"of",
"time",
"after",
"the",
"first",
"failed",
"attempt",
"and",
"in",
"exponentially",
"incrementing",
"amounts",
"after",
"each",
"failed",
"attempt",
"up",
"to",
"the",
"... | train | https://github.com/rholder/guava-retrying/blob/177b6c9b9f3e7957f404f0bdb8e23374cb1de43f/src/main/java/com/github/rholder/retry/WaitStrategies.java#L136-L140 |
lucastheisen/jsch-extension | src/main/java/com/pastdev/jsch/DefaultSessionFactory.java | DefaultSessionFactory.setConfig | public void setConfig( String key, String value ) {
"""
Adds a single configuration options for the sessions created by this
factory. Details on the supported options can be found in the source for
{@link com.jcraft.jsch.Session#applyConfig()}.
@param key
The name of the option
@param value
The value of th... | java | public void setConfig( String key, String value ) {
if ( config == null ) {
config = new HashMap<String, String>();
}
config.put( key, value );
} | [
"public",
"void",
"setConfig",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"{",
"config",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"}",
"config",
".",
"put",
"(",
... | Adds a single configuration options for the sessions created by this
factory. Details on the supported options can be found in the source for
{@link com.jcraft.jsch.Session#applyConfig()}.
@param key
The name of the option
@param value
The value of the option
@see #setConfig(Map)
@see com.jcraft.jsch.Session#setConfi... | [
"Adds",
"a",
"single",
"configuration",
"options",
"for",
"the",
"sessions",
"created",
"by",
"this",
"factory",
".",
"Details",
"on",
"the",
"supported",
"options",
"can",
"be",
"found",
"in",
"the",
"source",
"for",
"{",
"@link",
"com",
".",
"jcraft",
".... | train | https://github.com/lucastheisen/jsch-extension/blob/3c5bfae84d63e8632828a10721f2e605b68d749a/src/main/java/com/pastdev/jsch/DefaultSessionFactory.java#L245-L250 |
datacleaner/DataCleaner | desktop/ui/src/main/java/org/datacleaner/widgets/visualization/JobGraphMouseListener.java | JobGraphMouseListener.onComponentRightClicked | public void onComponentRightClicked(final ComponentBuilder componentBuilder, final MouseEvent me) {
"""
Invoked when a component is right-clicked
@param componentBuilder
@param me
"""
final boolean isMultiStream = componentBuilder.getDescriptor().isMultiStreamComponent();
final JPopupMenu ... | java | public void onComponentRightClicked(final ComponentBuilder componentBuilder, final MouseEvent me) {
final boolean isMultiStream = componentBuilder.getDescriptor().isMultiStreamComponent();
final JPopupMenu popup = new JPopupMenu();
final JMenuItem configureComponentMenuItem = new JMenuItem("Co... | [
"public",
"void",
"onComponentRightClicked",
"(",
"final",
"ComponentBuilder",
"componentBuilder",
",",
"final",
"MouseEvent",
"me",
")",
"{",
"final",
"boolean",
"isMultiStream",
"=",
"componentBuilder",
".",
"getDescriptor",
"(",
")",
".",
"isMultiStreamComponent",
... | Invoked when a component is right-clicked
@param componentBuilder
@param me | [
"Invoked",
"when",
"a",
"component",
"is",
"right",
"-",
"clicked"
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/desktop/ui/src/main/java/org/datacleaner/widgets/visualization/JobGraphMouseListener.java#L144-L186 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.lookUpRegularFile | @Nullable
private RegularFile lookUpRegularFile(JimfsPath path, Set<OpenOption> options)
throws IOException {
"""
Looks up the regular file at the given path, throwing an exception if the file isn't a regular
file. Returns null if the file did not exist.
"""
store.readLock().lock();
try {
... | java | @Nullable
private RegularFile lookUpRegularFile(JimfsPath path, Set<OpenOption> options)
throws IOException {
store.readLock().lock();
try {
DirectoryEntry entry = lookUp(path, options);
if (entry.exists()) {
File file = entry.file();
if (!file.isRegularFile()) {
th... | [
"@",
"Nullable",
"private",
"RegularFile",
"lookUpRegularFile",
"(",
"JimfsPath",
"path",
",",
"Set",
"<",
"OpenOption",
">",
"options",
")",
"throws",
"IOException",
"{",
"store",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"Directo... | Looks up the regular file at the given path, throwing an exception if the file isn't a regular
file. Returns null if the file did not exist. | [
"Looks",
"up",
"the",
"regular",
"file",
"at",
"the",
"given",
"path",
"throwing",
"an",
"exception",
"if",
"the",
"file",
"isn",
"t",
"a",
"regular",
"file",
".",
"Returns",
"null",
"if",
"the",
"file",
"did",
"not",
"exist",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L308-L326 |
aoindustries/ao-encoding | src/main/java/com/aoindustries/encoding/MediaValidator.java | MediaValidator.getMediaValidator | public static MediaValidator getMediaValidator(MediaType contentType, Writer out) throws MediaException {
"""
Gets the media validator for the given type. If the given writer is
already validator for the requested type, will return the provided writer.
@exception MediaException when unable to find an appropri... | java | public static MediaValidator getMediaValidator(MediaType contentType, Writer out) throws MediaException {
// If the existing out is already validating for this type, use it.
// This occurs when one validation validates to a set of characters that are a subset of the requested validator.
// For example, a URL is a... | [
"public",
"static",
"MediaValidator",
"getMediaValidator",
"(",
"MediaType",
"contentType",
",",
"Writer",
"out",
")",
"throws",
"MediaException",
"{",
"// If the existing out is already validating for this type, use it.",
"// This occurs when one validation validates to a set of chara... | Gets the media validator for the given type. If the given writer is
already validator for the requested type, will return the provided writer.
@exception MediaException when unable to find an appropriate validator. | [
"Gets",
"the",
"media",
"validator",
"for",
"the",
"given",
"type",
".",
"If",
"the",
"given",
"writer",
"is",
"already",
"validator",
"for",
"the",
"requested",
"type",
"will",
"return",
"the",
"provided",
"writer",
"."
] | train | https://github.com/aoindustries/ao-encoding/blob/54eeb8ff58ab7b44bb02549bbe2572625b449e4e/src/main/java/com/aoindustries/encoding/MediaValidator.java#L42-L73 |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/compiler/BuilderResultUtils.java | BuilderResultUtils.appendProblems | public static StringBuilder appendProblems(Object object, StringBuilder builder) {
"""
Appends compilation problems to builder if object is an array of {@link CompilationProblem}
or object itself if not
@param object object with compilation results
@param builder message builder
@return builder
"""
... | java | public static StringBuilder appendProblems(Object object, StringBuilder builder) {
if (object instanceof CompilationProblem[]) {
final CompilationProblem[] problem = (CompilationProblem[]) object;
for (CompilationProblem aProblem : problem) {
builder.append("\t")
... | [
"public",
"static",
"StringBuilder",
"appendProblems",
"(",
"Object",
"object",
",",
"StringBuilder",
"builder",
")",
"{",
"if",
"(",
"object",
"instanceof",
"CompilationProblem",
"[",
"]",
")",
"{",
"final",
"CompilationProblem",
"[",
"]",
"problem",
"=",
"(",
... | Appends compilation problems to builder if object is an array of {@link CompilationProblem}
or object itself if not
@param object object with compilation results
@param builder message builder
@return builder | [
"Appends",
"compilation",
"problems",
"to",
"builder",
"if",
"object",
"is",
"an",
"array",
"of",
"{",
"@link",
"CompilationProblem",
"}",
"or",
"object",
"itself",
"if",
"not"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/compiler/BuilderResultUtils.java#L51-L63 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/util/TrieMap.java | TrieMap.replaceValue | private V replaceValue(Node<V> node, V newValue) {
"""
Replaces the value of the provided {@code Node} and returns the old value
or {@code null} if one was not set.
@param node
@param newValue
@return
"""
// Note: a node is terminal if it already has a value
if (node.isTerminal()) {
V old... | java | private V replaceValue(Node<V> node, V newValue) {
// Note: a node is terminal if it already has a value
if (node.isTerminal()) {
V old = node.value;
node.value = newValue;
return old;
}
// the node wasn't already a terminal node (i.e. this char sequence is a
// substring of an existing seque... | [
"private",
"V",
"replaceValue",
"(",
"Node",
"<",
"V",
">",
"node",
",",
"V",
"newValue",
")",
"{",
"// Note: a node is terminal if it already has a value",
"if",
"(",
"node",
".",
"isTerminal",
"(",
")",
")",
"{",
"V",
"old",
"=",
"node",
".",
"value",
";... | Replaces the value of the provided {@code Node} and returns the old value
or {@code null} if one was not set.
@param node
@param newValue
@return | [
"Replaces",
"the",
"value",
"of",
"the",
"provided",
"{",
"@code",
"Node",
"}",
"and",
"returns",
"the",
"old",
"value",
"or",
"{",
"@code",
"null",
"}",
"if",
"one",
"was",
"not",
"set",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/TrieMap.java#L388-L402 |
jfoenixadmin/JFoenix | jfoenix/src/main/java/com/jfoenix/effects/JFXDepthManager.java | JFXDepthManager.setDepth | public static void setDepth(Node control, int level) {
"""
this method is used to add shadow effect to the node,
however the shadow is not real ( gets affected with node transformations)
<p>
use {@link #createMaterialNode(Node, int)} instead to generate a real shadow
"""
level = level < 0 ? 0 : leve... | java | public static void setDepth(Node control, int level) {
level = level < 0 ? 0 : level;
level = level > 5 ? 5 : level;
control.setEffect(new DropShadow(BlurType.GAUSSIAN,
depth[level].getColor(),
depth[level].getRadius(),
depth[level].getSpread(),
de... | [
"public",
"static",
"void",
"setDepth",
"(",
"Node",
"control",
",",
"int",
"level",
")",
"{",
"level",
"=",
"level",
"<",
"0",
"?",
"0",
":",
"level",
";",
"level",
"=",
"level",
">",
"5",
"?",
"5",
":",
"level",
";",
"control",
".",
"setEffect",
... | this method is used to add shadow effect to the node,
however the shadow is not real ( gets affected with node transformations)
<p>
use {@link #createMaterialNode(Node, int)} instead to generate a real shadow | [
"this",
"method",
"is",
"used",
"to",
"add",
"shadow",
"effect",
"to",
"the",
"node",
"however",
"the",
"shadow",
"is",
"not",
"real",
"(",
"gets",
"affected",
"with",
"node",
"transformations",
")",
"<p",
">",
"use",
"{"
] | train | https://github.com/jfoenixadmin/JFoenix/blob/53235b5f561da4a515ef716059b8a8df5239ffa1/jfoenix/src/main/java/com/jfoenix/effects/JFXDepthManager.java#L52-L61 |
bazaarvoice/ostrich | core/src/main/java/com/bazaarvoice/ostrich/pool/ServiceCachingPolicyBuilder.java | ServiceCachingPolicyBuilder.withMaxServiceInstanceIdleTime | public ServiceCachingPolicyBuilder withMaxServiceInstanceIdleTime(int maxServiceInstanceIdleTime, TimeUnit unit) {
"""
Set the amount of time a cached instance is allowed to sit idle in the cache before being eligible for
expiration. If never called, cached instances will not expire solely due to idle time.
@... | java | public ServiceCachingPolicyBuilder withMaxServiceInstanceIdleTime(int maxServiceInstanceIdleTime, TimeUnit unit) {
checkState(maxServiceInstanceIdleTime > 0);
checkNotNull(unit);
_maxServiceInstanceIdleTimeNanos = unit.toNanos(maxServiceInstanceIdleTime);
return this;
} | [
"public",
"ServiceCachingPolicyBuilder",
"withMaxServiceInstanceIdleTime",
"(",
"int",
"maxServiceInstanceIdleTime",
",",
"TimeUnit",
"unit",
")",
"{",
"checkState",
"(",
"maxServiceInstanceIdleTime",
">",
"0",
")",
";",
"checkNotNull",
"(",
"unit",
")",
";",
"_maxServi... | Set the amount of time a cached instance is allowed to sit idle in the cache before being eligible for
expiration. If never called, cached instances will not expire solely due to idle time.
@param maxServiceInstanceIdleTime The time an instance may be idle before allowed to expire.
@param unit T... | [
"Set",
"the",
"amount",
"of",
"time",
"a",
"cached",
"instance",
"is",
"allowed",
"to",
"sit",
"idle",
"in",
"the",
"cache",
"before",
"being",
"eligible",
"for",
"expiration",
".",
"If",
"never",
"called",
"cached",
"instances",
"will",
"not",
"expire",
"... | train | https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/pool/ServiceCachingPolicyBuilder.java#L102-L108 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/DoubleArrayList.java | DoubleArrayList.indexOfFromTo | public int indexOfFromTo(double element, int from, int to) {
"""
Returns the index of the first occurrence of the specified
element. Returns <code>-1</code> if the receiver does not contain this element.
Searches between <code>from</code>, inclusive and <code>to</code>, inclusive.
Tests for identity.
@param ... | java | public int indexOfFromTo(double element, int from, int to) {
// overridden for performance only.
if (size==0) return -1;
checkRangeFromTo(from, to, size);
double[] theElements = elements;
for (int i = from ; i <= to; i++) {
if (element==theElements[i]) {return i;} //found
}
return -1; //not found
... | [
"public",
"int",
"indexOfFromTo",
"(",
"double",
"element",
",",
"int",
"from",
",",
"int",
"to",
")",
"{",
"// overridden for performance only.\r",
"if",
"(",
"size",
"==",
"0",
")",
"return",
"-",
"1",
";",
"checkRangeFromTo",
"(",
"from",
",",
"to",
","... | Returns the index of the first occurrence of the specified
element. Returns <code>-1</code> if the receiver does not contain this element.
Searches between <code>from</code>, inclusive and <code>to</code>, inclusive.
Tests for identity.
@param element element to search for.
@param from the leftmost search position, in... | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"element",
".",
"Returns",
"<code",
">",
"-",
"1<",
"/",
"code",
">",
"if",
"the",
"receiver",
"does",
"not",
"contain",
"this",
"element",
".",
"Searches",
"between",... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/DoubleArrayList.java#L238-L248 |
samskivert/samskivert | src/main/java/com/samskivert/swing/util/MenuUtil.java | MenuUtil.addMenuItem | public static JMenuItem addMenuItem (
ActionListener l, JMenu menu, String name, int mnem) {
"""
Adds a new menu item to the menu with the specified name and
attributes.
@param l the action listener.
@param menu the menu to add the item to.
@param name the item name.
@param mnem the mnemonic key for... | java | public static JMenuItem addMenuItem (
ActionListener l, JMenu menu, String name, int mnem)
{
return addMenuItem(l, menu, name, Integer.valueOf(mnem), null);
} | [
"public",
"static",
"JMenuItem",
"addMenuItem",
"(",
"ActionListener",
"l",
",",
"JMenu",
"menu",
",",
"String",
"name",
",",
"int",
"mnem",
")",
"{",
"return",
"addMenuItem",
"(",
"l",
",",
"menu",
",",
"name",
",",
"Integer",
".",
"valueOf",
"(",
"mnem... | Adds a new menu item to the menu with the specified name and
attributes.
@param l the action listener.
@param menu the menu to add the item to.
@param name the item name.
@param mnem the mnemonic key for the item.
@return the new menu item. | [
"Adds",
"a",
"new",
"menu",
"item",
"to",
"the",
"menu",
"with",
"the",
"specified",
"name",
"and",
"attributes",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/MenuUtil.java#L84-L88 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/download/BaseImageDownloader.java | BaseImageDownloader.getStreamFromNetwork | protected InputStream getStreamFromNetwork(String imageUri, Object extra) throws IOException {
"""
Retrieves {@link InputStream} of image by URI (image is located in the network).
@param imageUri Image URI
@param extra Auxiliary object which was passed to {@link DisplayImageOptions.Builder#extraForDownloade... | java | protected InputStream getStreamFromNetwork(String imageUri, Object extra) throws IOException {
HttpURLConnection conn = createConnection(imageUri, extra);
int redirectCount = 0;
while (conn.getResponseCode() / 100 == 3 && redirectCount < MAX_REDIRECT_COUNT) {
conn = createConnection(conn.getHeaderField("Locat... | [
"protected",
"InputStream",
"getStreamFromNetwork",
"(",
"String",
"imageUri",
",",
"Object",
"extra",
")",
"throws",
"IOException",
"{",
"HttpURLConnection",
"conn",
"=",
"createConnection",
"(",
"imageUri",
",",
"extra",
")",
";",
"int",
"redirectCount",
"=",
"0... | Retrieves {@link InputStream} of image by URI (image is located in the network).
@param imageUri Image URI
@param extra Auxiliary object which was passed to {@link DisplayImageOptions.Builder#extraForDownloader(Object)
DisplayImageOptions.extraForDownloader(Object)}; can be null
@return {@link InputStream} of image... | [
"Retrieves",
"{",
"@link",
"InputStream",
"}",
"of",
"image",
"by",
"URI",
"(",
"image",
"is",
"located",
"in",
"the",
"network",
")",
"."
] | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/download/BaseImageDownloader.java#L113-L136 |
alkacon/opencms-core | src/org/opencms/widgets/CmsHtmlWidget.java | CmsHtmlWidget.getEditorWidget | private I_CmsWidget getEditorWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog) {
"""
Returns the editor widget to use depending on the current users settings, current browser and installed editors.<p>
@param cms the current CmsObject
@param widgetDialog the dialog where the widget is used on
@return the e... | java | private I_CmsWidget getEditorWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog) {
if (m_editorWidget == null) {
// get HTML widget to use from editor manager
String widgetClassName = OpenCms.getWorkplaceManager().getWorkplaceEditorManager().getWidgetEditor(
cms.getReq... | [
"private",
"I_CmsWidget",
"getEditorWidget",
"(",
"CmsObject",
"cms",
",",
"I_CmsWidgetDialog",
"widgetDialog",
")",
"{",
"if",
"(",
"m_editorWidget",
"==",
"null",
")",
"{",
"// get HTML widget to use from editor manager",
"String",
"widgetClassName",
"=",
"OpenCms",
"... | Returns the editor widget to use depending on the current users settings, current browser and installed editors.<p>
@param cms the current CmsObject
@param widgetDialog the dialog where the widget is used on
@return the editor widget to use depending on the current users settings, current browser and installed editors | [
"Returns",
"the",
"editor",
"widget",
"to",
"use",
"depending",
"on",
"the",
"current",
"users",
"settings",
"current",
"browser",
"and",
"installed",
"editors",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/CmsHtmlWidget.java#L474-L509 |
intellimate/Izou | src/main/java/org/intellimate/izou/security/SecurityBreachHandler.java | SecurityBreachHandler.createBreachHandler | static SecurityBreachHandler createBreachHandler(Main main, SystemMail systemMail, String toAddress)
throws IllegalAccessException {
"""
Creates a SecurityBreachHandler. There can only be one single SecurityBreachHandler, so calling this method twice
will cause an illegal access exception.
@param m... | java | static SecurityBreachHandler createBreachHandler(Main main, SystemMail systemMail, String toAddress)
throws IllegalAccessException {
if (!exists) {
SecurityBreachHandler breachHandler = new SecurityBreachHandler(main, systemMail, toAddress);
exists = true;
return ... | [
"static",
"SecurityBreachHandler",
"createBreachHandler",
"(",
"Main",
"main",
",",
"SystemMail",
"systemMail",
",",
"String",
"toAddress",
")",
"throws",
"IllegalAccessException",
"{",
"if",
"(",
"!",
"exists",
")",
"{",
"SecurityBreachHandler",
"breachHandler",
"=",... | Creates a SecurityBreachHandler. There can only be one single SecurityBreachHandler, so calling this method twice
will cause an illegal access exception.
@param main the main instance of izou
@param systemMail the system mail object in order to send e-mails to owner in case of emergency
@param toAddress the email addr... | [
"Creates",
"a",
"SecurityBreachHandler",
".",
"There",
"can",
"only",
"be",
"one",
"single",
"SecurityBreachHandler",
"so",
"calling",
"this",
"method",
"twice",
"will",
"cause",
"an",
"illegal",
"access",
"exception",
"."
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/security/SecurityBreachHandler.java#L31-L40 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/task/TaskUtils.java | TaskUtils.setTaskFactoryClass | public static void setTaskFactoryClass(State state, Class<? extends TaskFactory> klazz) {
"""
Define the {@link TaskFactory} that should be used to run this task.
"""
state.setProp(TASK_FACTORY_CLASS, klazz.getName());
} | java | public static void setTaskFactoryClass(State state, Class<? extends TaskFactory> klazz) {
state.setProp(TASK_FACTORY_CLASS, klazz.getName());
} | [
"public",
"static",
"void",
"setTaskFactoryClass",
"(",
"State",
"state",
",",
"Class",
"<",
"?",
"extends",
"TaskFactory",
">",
"klazz",
")",
"{",
"state",
".",
"setProp",
"(",
"TASK_FACTORY_CLASS",
",",
"klazz",
".",
"getName",
"(",
")",
")",
";",
"}"
] | Define the {@link TaskFactory} that should be used to run this task. | [
"Define",
"the",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/task/TaskUtils.java#L50-L52 |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/SelectionImpl.java | SelectionImpl.manageSubscription | private <T> void manageSubscription(EventStream<T> stream, Consumer<T> consumer) {
"""
/* ********************************************************************** *
*
Private methods *
*
**********************************************************************
... | java | private <T> void manageSubscription(EventStream<T> stream, Consumer<T> consumer) {
manageSubscription(stream.subscribe(consumer));
} | [
"private",
"<",
"T",
">",
"void",
"manageSubscription",
"(",
"EventStream",
"<",
"T",
">",
"stream",
",",
"Consumer",
"<",
"T",
">",
"consumer",
")",
"{",
"manageSubscription",
"(",
"stream",
".",
"subscribe",
"(",
"consumer",
")",
")",
";",
"}"
] | /* ********************************************************************** *
*
Private methods *
*
********************************************************************** | [
"/",
"*",
"**********************************************************************",
"*",
"*",
"Private",
"methods",
"*",
"*",
"**********************************************************************"
] | train | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/SelectionImpl.java#L454-L456 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.newQName | public static Node newQName(
AbstractCompiler compiler, String name) {
"""
Creates a node representing a qualified name.
@param name A qualified name (e.g. "foo" or "foo.bar.baz")
@return A NAME or GETPROP node
"""
int endPos = name.indexOf('.');
if (endPos == -1) {
return newName(compi... | java | public static Node newQName(
AbstractCompiler compiler, String name) {
int endPos = name.indexOf('.');
if (endPos == -1) {
return newName(compiler, name);
}
Node node;
String nodeName = name.substring(0, endPos);
if ("this".equals(nodeName)) {
node = IR.thisNode();
} else i... | [
"public",
"static",
"Node",
"newQName",
"(",
"AbstractCompiler",
"compiler",
",",
"String",
"name",
")",
"{",
"int",
"endPos",
"=",
"name",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"endPos",
"==",
"-",
"1",
")",
"{",
"return",
"newName",
"... | Creates a node representing a qualified name.
@param name A qualified name (e.g. "foo" or "foo.bar.baz")
@return A NAME or GETPROP node | [
"Creates",
"a",
"node",
"representing",
"a",
"qualified",
"name",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L3973-L4004 |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.unbindQueue | public AmqpChannel unbindQueue(String queue, String exchange, String routingKey, AmqpArguments arguments) {
"""
This method unbinds a queue from an exchange.
@param queue
@param exchange
@param routingKey
@param arguments
@return AmqpChannel
"""
Object[] args = {0, queue, exchange, routingKey, a... | java | public AmqpChannel unbindQueue(String queue, String exchange, String routingKey, AmqpArguments arguments) {
Object[] args = {0, queue, exchange, routingKey, arguments};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
String methodName = "unbindQueue";
... | [
"public",
"AmqpChannel",
"unbindQueue",
"(",
"String",
"queue",
",",
"String",
"exchange",
",",
"String",
"routingKey",
",",
"AmqpArguments",
"arguments",
")",
"{",
"Object",
"[",
"]",
"args",
"=",
"{",
"0",
",",
"queue",
",",
"exchange",
",",
"routingKey",
... | This method unbinds a queue from an exchange.
@param queue
@param exchange
@param routingKey
@param arguments
@return AmqpChannel | [
"This",
"method",
"unbinds",
"a",
"queue",
"from",
"an",
"exchange",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L638-L649 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/ItemRule.java | ItemRule.putValue | public void putValue(String name, String text) {
"""
Puts the specified value with the specified key to this Map type item.
@param name the value name; may be null
@param text the value to be analyzed for use as the value of this item
@see #putValue(String, Token[])
"""
Token[] tokens = TokenParse... | java | public void putValue(String name, String text) {
Token[] tokens = TokenParser.makeTokens(text, isTokenize());
putValue(name, tokens);
} | [
"public",
"void",
"putValue",
"(",
"String",
"name",
",",
"String",
"text",
")",
"{",
"Token",
"[",
"]",
"tokens",
"=",
"TokenParser",
".",
"makeTokens",
"(",
"text",
",",
"isTokenize",
"(",
")",
")",
";",
"putValue",
"(",
"name",
",",
"tokens",
")",
... | Puts the specified value with the specified key to this Map type item.
@param name the value name; may be null
@param text the value to be analyzed for use as the value of this item
@see #putValue(String, Token[]) | [
"Puts",
"the",
"specified",
"value",
"with",
"the",
"specified",
"key",
"to",
"this",
"Map",
"type",
"item",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/ItemRule.java#L239-L242 |
Grasia/phatsim | phat-agents/src/main/java/phat/agents/automaton/FSM.java | FSM.registerTransition | public void registerTransition(Automaton source, Automaton destiny) {
"""
Registrar las posibles transiciones desde las que se puede ir a un
estado. Si el automata tiene un único estado, se puede pasar null como
destino.
@param source
@param destiny
"""
source.parent = this;
destiny.paren... | java | public void registerTransition(Automaton source, Automaton destiny) {
source.parent = this;
destiny.parent = this;
ArrayList<Transition> r = possibleTransitions.get(source);
if (r == null) {
r = new ArrayList<Transition>();
}
r.add(new Transition(destiny));
... | [
"public",
"void",
"registerTransition",
"(",
"Automaton",
"source",
",",
"Automaton",
"destiny",
")",
"{",
"source",
".",
"parent",
"=",
"this",
";",
"destiny",
".",
"parent",
"=",
"this",
";",
"ArrayList",
"<",
"Transition",
">",
"r",
"=",
"possibleTransiti... | Registrar las posibles transiciones desde las que se puede ir a un
estado. Si el automata tiene un único estado, se puede pasar null como
destino.
@param source
@param destiny | [
"Registrar",
"las",
"posibles",
"transiciones",
"desde",
"las",
"que",
"se",
"puede",
"ir",
"a",
"un",
"estado",
".",
"Si",
"el",
"automata",
"tiene",
"un",
"único",
"estado",
"se",
"puede",
"pasar",
"null",
"como",
"destino",
"."
] | train | https://github.com/Grasia/phatsim/blob/2d4fc8189be9730b34c8e3e1a08fb4800e01c5df/phat-agents/src/main/java/phat/agents/automaton/FSM.java#L92-L101 |
roboconf/roboconf-platform | core/roboconf-messaging-http/src/main/java/net/roboconf/messaging/http/internal/HttpUtils.java | HttpUtils.sendAsynchronously | public static void sendAsynchronously( Message message, RemoteEndpoint remoteEndpoint )
throws IOException {
"""
Sends a message asynchronously to a remote end point.
<p>
Asynchronous sending is necessary since we may have several threads that
use the same messaging client. Blocking sending may result in iss... | java | public static void sendAsynchronously( Message message, RemoteEndpoint remoteEndpoint )
throws IOException {
Future<Void> fut = null;
Exception exception = null;
try {
byte[] rawData = SerializationUtils.serializeObject( message );
ByteBuffer data = ByteBuffer.wrap( rawData );
fut = remoteEndpoint.se... | [
"public",
"static",
"void",
"sendAsynchronously",
"(",
"Message",
"message",
",",
"RemoteEndpoint",
"remoteEndpoint",
")",
"throws",
"IOException",
"{",
"Future",
"<",
"Void",
">",
"fut",
"=",
"null",
";",
"Exception",
"exception",
"=",
"null",
";",
"try",
"{"... | Sends a message asynchronously to a remote end point.
<p>
Asynchronous sending is necessary since we may have several threads that
use the same messaging client. Blocking sending may result in issues such
as #598.
</p>
@param message the message to send
@param remoteEndpoint the remote end-point
@throws IOException if... | [
"Sends",
"a",
"message",
"asynchronously",
"to",
"a",
"remote",
"end",
"point",
".",
"<p",
">",
"Asynchronous",
"sending",
"is",
"necessary",
"since",
"we",
"may",
"have",
"several",
"threads",
"that",
"use",
"the",
"same",
"messaging",
"client",
".",
"Block... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-http/src/main/java/net/roboconf/messaging/http/internal/HttpUtils.java#L86-L115 |
randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/ForkedJvmInfo.java | ForkedJvmInfo.decodeStreams | public void decodeStreams(List<IEvent> events, Writer sysout, Writer syserr) throws IOException {
"""
Filter through events looking for sysouts and syserrs and decode them
into a character streams. If both {@link Writer} arguments are the same object
the streams will be combined.
"""
int lineBuffer = 160... | java | public void decodeStreams(List<IEvent> events, Writer sysout, Writer syserr) throws IOException {
int lineBuffer = 160;
WriterOutputStream stdout = new WriterOutputStream(sysout, getCharset(), lineBuffer, true);
WriterOutputStream stderr = new WriterOutputStream(syserr, getCharset(), lineBuffer, true);
... | [
"public",
"void",
"decodeStreams",
"(",
"List",
"<",
"IEvent",
">",
"events",
",",
"Writer",
"sysout",
",",
"Writer",
"syserr",
")",
"throws",
"IOException",
"{",
"int",
"lineBuffer",
"=",
"160",
";",
"WriterOutputStream",
"stdout",
"=",
"new",
"WriterOutputSt... | Filter through events looking for sysouts and syserrs and decode them
into a character streams. If both {@link Writer} arguments are the same object
the streams will be combined. | [
"Filter",
"through",
"events",
"looking",
"for",
"sysouts",
"and",
"syserrs",
"and",
"decode",
"them",
"into",
"a",
"character",
"streams",
".",
"If",
"both",
"{"
] | train | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/ForkedJvmInfo.java#L131-L156 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.cosineDistance | public SDVariable cosineDistance(String name, SDVariable x, SDVariable y, int... dimensions) {
"""
Cosine distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:<br>
out = 1.0 - cosineSimilarity(x,y)<br>
See {@link #cosineSimilarity(String, SD... | java | public SDVariable cosineDistance(String name, SDVariable x, SDVariable y, int... dimensions) {
validateNumerical("cosine distance", x, y);
SDVariable result = f().cosineDistance(x, y, dimensions);
return updateVariableNameAndReference(result, name);
} | [
"public",
"SDVariable",
"cosineDistance",
"(",
"String",
"name",
",",
"SDVariable",
"x",
",",
"SDVariable",
"y",
",",
"int",
"...",
"dimensions",
")",
"{",
"validateNumerical",
"(",
"\"cosine distance\"",
",",
"x",
",",
"y",
")",
";",
"SDVariable",
"result",
... | Cosine distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:<br>
out = 1.0 - cosineSimilarity(x,y)<br>
See {@link #cosineSimilarity(String, SDVariable, SDVariable, int...)}
@param name Name of the output variable
@param x Input varia... | [
"Cosine",
"distance",
"reduction",
"operation",
".",
"The",
"output",
"contains",
"the",
"cosine",
"distance",
"for",
"each",
"tensor",
"/",
"subset",
"along",
"the",
"specified",
"dimensions",
":",
"<br",
">",
"out",
"=",
"1",
".",
"0",
"-",
"cosineSimilari... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L655-L659 |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/validation/AbstractSoapAttachmentValidator.java | AbstractSoapAttachmentValidator.validateAttachmentContentType | protected void validateAttachmentContentType(SoapAttachment receivedAttachment, SoapAttachment controlAttachment) {
"""
Validating SOAP attachment content type.
@param receivedAttachment
@param controlAttachment
"""
//in case contentType was not set in test case, skip validation
if (!StringUt... | java | protected void validateAttachmentContentType(SoapAttachment receivedAttachment, SoapAttachment controlAttachment) {
//in case contentType was not set in test case, skip validation
if (!StringUtils.hasText(controlAttachment.getContentType())) { return; }
if (receivedAttachment.getContent... | [
"protected",
"void",
"validateAttachmentContentType",
"(",
"SoapAttachment",
"receivedAttachment",
",",
"SoapAttachment",
"controlAttachment",
")",
"{",
"//in case contentType was not set in test case, skip validation",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"contr... | Validating SOAP attachment content type.
@param receivedAttachment
@param controlAttachment | [
"Validating",
"SOAP",
"attachment",
"content",
"type",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/validation/AbstractSoapAttachmentValidator.java#L134-L156 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/parallel/ParallelIterate.java | ParallelIterate.newPooledExecutor | public static ExecutorService newPooledExecutor(int newPoolSize, String poolName, boolean useDaemonThreads) {
"""
Returns a brand new ExecutorService using the specified poolName with the specified maximum thread pool size. The
same poolName may be used more than once resulting in multiple pools with the same nam... | java | public static ExecutorService newPooledExecutor(int newPoolSize, String poolName, boolean useDaemonThreads)
{
return new ThreadPoolExecutor(
newPoolSize,
newPoolSize,
0L,
TimeUnit.MILLISECONDS,
new SynchronousQueue<Runnable>(),
... | [
"public",
"static",
"ExecutorService",
"newPooledExecutor",
"(",
"int",
"newPoolSize",
",",
"String",
"poolName",
",",
"boolean",
"useDaemonThreads",
")",
"{",
"return",
"new",
"ThreadPoolExecutor",
"(",
"newPoolSize",
",",
"newPoolSize",
",",
"0L",
",",
"TimeUnit",... | Returns a brand new ExecutorService using the specified poolName with the specified maximum thread pool size. The
same poolName may be used more than once resulting in multiple pools with the same name.
<p>
The pool will be initialised with newPoolSize threads. If that number of threads are in use and another thread
i... | [
"Returns",
"a",
"brand",
"new",
"ExecutorService",
"using",
"the",
"specified",
"poolName",
"with",
"the",
"specified",
"maximum",
"thread",
"pool",
"size",
".",
"The",
"same",
"poolName",
"may",
"be",
"used",
"more",
"than",
"once",
"resulting",
"in",
"multip... | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/parallel/ParallelIterate.java#L1344-L1354 |
nathanmarz/dfs-datastores | dfs-datastores/src/main/java/com/backtype/hadoop/pail/Pail.java | Pail.copyAppend | public void copyAppend(Pail p, CopyArgs args) throws IOException {
"""
Copy append will copy all the files from p into this pail. Appending maintains the
structure that was present in p.
"""
args = new CopyArgs(args);
if(args.renameMode==null) args.renameMode = RenameMode.ALWAYS_RENAME;
... | java | public void copyAppend(Pail p, CopyArgs args) throws IOException {
args = new CopyArgs(args);
if(args.renameMode==null) args.renameMode = RenameMode.ALWAYS_RENAME;
boolean formatsSame = checkCombineValidity(p, args);
String sourceQual = getQualifiedRoot(p);
String destQual = get... | [
"public",
"void",
"copyAppend",
"(",
"Pail",
"p",
",",
"CopyArgs",
"args",
")",
"throws",
"IOException",
"{",
"args",
"=",
"new",
"CopyArgs",
"(",
"args",
")",
";",
"if",
"(",
"args",
".",
"renameMode",
"==",
"null",
")",
"args",
".",
"renameMode",
"="... | Copy append will copy all the files from p into this pail. Appending maintains the
structure that was present in p. | [
"Copy",
"append",
"will",
"copy",
"all",
"the",
"files",
"from",
"p",
"into",
"this",
"pail",
".",
"Appending",
"maintains",
"the",
"structure",
"that",
"was",
"present",
"in",
"p",
"."
] | train | https://github.com/nathanmarz/dfs-datastores/blob/ad2ce6d1ef748bab8444e81fa1617ab5e8b1a43e/dfs-datastores/src/main/java/com/backtype/hadoop/pail/Pail.java#L411-L423 |
Netflix/spectator | spectator-api/src/main/java/com/netflix/spectator/impl/matcher/Optimizer.java | Optimizer.convertRepeatedAnyCharSeqToIndexOf | static Matcher convertRepeatedAnyCharSeqToIndexOf(Matcher matcher) {
"""
If a char sequence is preceded by a repeated any match, then replace with an
IndexOfMatcher. The index of operation seems to be optimized by the JDK and is
much faster. Example: {@code ".*foo" => indexOf("foo")}.
"""
if (matcher ins... | java | static Matcher convertRepeatedAnyCharSeqToIndexOf(Matcher matcher) {
if (matcher instanceof ZeroOrMoreMatcher) {
ZeroOrMoreMatcher zm1 = matcher.as();
Matcher prefix = PatternUtils.getPrefix(zm1.next());
if (zm1.repeated() instanceof AnyMatcher && prefix instanceof CharSeqMatcher) {
String... | [
"static",
"Matcher",
"convertRepeatedAnyCharSeqToIndexOf",
"(",
"Matcher",
"matcher",
")",
"{",
"if",
"(",
"matcher",
"instanceof",
"ZeroOrMoreMatcher",
")",
"{",
"ZeroOrMoreMatcher",
"zm1",
"=",
"matcher",
".",
"as",
"(",
")",
";",
"Matcher",
"prefix",
"=",
"Pa... | If a char sequence is preceded by a repeated any match, then replace with an
IndexOfMatcher. The index of operation seems to be optimized by the JDK and is
much faster. Example: {@code ".*foo" => indexOf("foo")}. | [
"If",
"a",
"char",
"sequence",
"is",
"preceded",
"by",
"a",
"repeated",
"any",
"match",
"then",
"replace",
"with",
"an",
"IndexOfMatcher",
".",
"The",
"index",
"of",
"operation",
"seems",
"to",
"be",
"optimized",
"by",
"the",
"JDK",
"and",
"is",
"much",
... | train | https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-api/src/main/java/com/netflix/spectator/impl/matcher/Optimizer.java#L489-L500 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/equals/EqualsHelper.java | EqualsHelper.equalsAsList | public static boolean equalsAsList (@Nullable final Object aObj1, @Nullable final Object aObj2) {
"""
This is a sanity method that first calls
{@link CollectionHelper#getAsList(Object)} on both objects an than calls
{@link #equalsCollectionOnly(Collection, Collection)} on the collections.
This means that callin... | java | public static boolean equalsAsList (@Nullable final Object aObj1, @Nullable final Object aObj2)
{
// Same object - check first
if (identityEqual (aObj1, aObj2))
return true;
// Is only one value null?
if (aObj1 == null || aObj2 == null)
return false;
// Convert to a collection
fi... | [
"public",
"static",
"boolean",
"equalsAsList",
"(",
"@",
"Nullable",
"final",
"Object",
"aObj1",
",",
"@",
"Nullable",
"final",
"Object",
"aObj2",
")",
"{",
"// Same object - check first",
"if",
"(",
"identityEqual",
"(",
"aObj1",
",",
"aObj2",
")",
")",
"retu... | This is a sanity method that first calls
{@link CollectionHelper#getAsList(Object)} on both objects an than calls
{@link #equalsCollectionOnly(Collection, Collection)} on the collections.
This means that calling this method with the String array ["a", "b"] and
the List<String> ("a", "b") will result in a return v... | [
"This",
"is",
"a",
"sanity",
"method",
"that",
"first",
"calls",
"{",
"@link",
"CollectionHelper#getAsList",
"(",
"Object",
")",
"}",
"on",
"both",
"objects",
"an",
"than",
"calls",
"{",
"@link",
"#equalsCollectionOnly",
"(",
"Collection",
"Collection",
")",
"... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/equals/EqualsHelper.java#L457-L473 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.