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 |
|---|---|---|---|---|---|---|---|---|---|---|
hawtio/hawtio | hawtio-log/src/main/java/io/hawt/log/support/Objects.java | Objects.compare | @SuppressWarnings("unchecked")
public static int compare(Object a, Object b) {
"""
A helper method for performing an ordered comparison on the objects
handling nulls and objects which do not handle sorting gracefully
@param a the first object
@param b the second object
"""
if (a == b) {
... | java | @SuppressWarnings("unchecked")
public static int compare(Object a, Object b) {
if (a == b) {
return 0;
}
if (a == null) {
return -1;
}
if (b == null) {
return 1;
}
if (a instanceof Comparable) {
Comparable compar... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"int",
"compare",
"(",
"Object",
"a",
",",
"Object",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"b",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"a",
"==",
"null",
")",
"{",
"ret... | A helper method for performing an ordered comparison on the objects
handling nulls and objects which do not handle sorting gracefully
@param a the first object
@param b the second object | [
"A",
"helper",
"method",
"for",
"performing",
"an",
"ordered",
"comparison",
"on",
"the",
"objects",
"handling",
"nulls",
"and",
"objects",
"which",
"do",
"not",
"handle",
"sorting",
"gracefully"
] | train | https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-log/src/main/java/io/hawt/log/support/Objects.java#L26-L46 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.sameArgument | public static Matcher<? super MethodInvocationTree> sameArgument(
final int index1, final int index2) {
"""
Matches a {@link MethodInvocation} when the arguments at the two given indices are both the
same variable, as determined by {@link ASTHelpers#sameVariable}.
@param index1 the index of the first act... | java | public static Matcher<? super MethodInvocationTree> sameArgument(
final int index1, final int index2) {
return new Matcher<MethodInvocationTree>() {
@Override
public boolean matches(MethodInvocationTree methodInvocationTree, VisitorState state) {
List<? extends ExpressionTree> args = metho... | [
"public",
"static",
"Matcher",
"<",
"?",
"super",
"MethodInvocationTree",
">",
"sameArgument",
"(",
"final",
"int",
"index1",
",",
"final",
"int",
"index2",
")",
"{",
"return",
"new",
"Matcher",
"<",
"MethodInvocationTree",
">",
"(",
")",
"{",
"@",
"Override... | Matches a {@link MethodInvocation} when the arguments at the two given indices are both the
same variable, as determined by {@link ASTHelpers#sameVariable}.
@param index1 the index of the first actual parameter to test
@param index2 the index of the second actual parameter to test
@throws IndexOutOfBoundsException if ... | [
"Matches",
"a",
"{",
"@link",
"MethodInvocation",
"}",
"when",
"the",
"arguments",
"at",
"the",
"two",
"given",
"indices",
"are",
"both",
"the",
"same",
"variable",
"as",
"determined",
"by",
"{",
"@link",
"ASTHelpers#sameVariable",
"}",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L739-L748 |
orbisgis/h2gis | postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java | JtsBinaryParser.parseGeometry | protected Geometry parseGeometry(ValueGetter data, int srid, boolean inheritSrid) {
"""
Parse data from the given {@link org.postgis.binary.ValueGetter} into a JTS
{@link org.locationtech.jts.geom.Geometry} with the given SRID.
@param data {@link org.postgis.binary.ValueGetter} to parse.
@param srid SRID to g... | java | protected Geometry parseGeometry(ValueGetter data, int srid, boolean inheritSrid) {
byte endian = data.getByte();
if (endian != data.endian) {
throw new IllegalArgumentException("Endian inconsistency!");
} else {
int typeword = data.getInt();
int realtype = ty... | [
"protected",
"Geometry",
"parseGeometry",
"(",
"ValueGetter",
"data",
",",
"int",
"srid",
",",
"boolean",
"inheritSrid",
")",
"{",
"byte",
"endian",
"=",
"data",
".",
"getByte",
"(",
")",
";",
"if",
"(",
"endian",
"!=",
"data",
".",
"endian",
")",
"{",
... | Parse data from the given {@link org.postgis.binary.ValueGetter} into a JTS
{@link org.locationtech.jts.geom.Geometry} with the given SRID.
@param data {@link org.postgis.binary.ValueGetter} to parse.
@param srid SRID to give to the parsed geometry (different of the inherited SRID).
@param inheritSrid Make the new {@l... | [
"Parse",
"data",
"from",
"the",
"given",
"{",
"@link",
"org",
".",
"postgis",
".",
"binary",
".",
"ValueGetter",
"}",
"into",
"a",
"JTS",
"{",
"@link",
"org",
".",
"locationtech",
".",
"jts",
".",
"geom",
".",
"Geometry",
"}",
"with",
"the",
"given",
... | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java#L105-L156 |
mike706574/java-map-support | src/main/java/fun/mike/map/alpha/Get.java | Get.populatedString | public static <T> String populatedString(Map<String, T> map, String key) {
"""
Validates that the value from {@code map} for the given {@code key} is a
populated string. Returns the value when valid; otherwise, throws an
{@code IllegalArgumentException}.
@param map A map
@param key A key
@param <T> The type o... | java | public static <T> String populatedString(Map<String, T> map, String key) {
return populatedStringOfType(map, key, "string");
} | [
"public",
"static",
"<",
"T",
">",
"String",
"populatedString",
"(",
"Map",
"<",
"String",
",",
"T",
">",
"map",
",",
"String",
"key",
")",
"{",
"return",
"populatedStringOfType",
"(",
"map",
",",
"key",
",",
"\"string\"",
")",
";",
"}"
] | Validates that the value from {@code map} for the given {@code key} is a
populated string. Returns the value when valid; otherwise, throws an
{@code IllegalArgumentException}.
@param map A map
@param key A key
@param <T> The type of value
@return The string value
@throws java.util.NoSuchElementException if the required... | [
"Validates",
"that",
"the",
"value",
"from",
"{"
] | train | https://github.com/mike706574/java-map-support/blob/7cb09f34c24adfaca73ad25a3c3e05abec72eafe/src/main/java/fun/mike/map/alpha/Get.java#L71-L73 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/IcmpFailureDetectorConfig.java | IcmpFailureDetectorConfig.setIntervalMilliseconds | public IcmpFailureDetectorConfig setIntervalMilliseconds(int intervalMilliseconds) {
"""
Sets the time in milliseconds between each ping
This value can not be smaller than 1000 milliseconds
@param intervalMilliseconds the interval millis between each ping
@return this {@link IcmpFailureDetectorConfig} instanc... | java | public IcmpFailureDetectorConfig setIntervalMilliseconds(int intervalMilliseconds) {
if (intervalMilliseconds < MIN_INTERVAL_MILLIS) {
throw new ConfigurationException(format("Interval can't be set to less than %d milliseconds.", MIN_INTERVAL_MILLIS));
}
this.intervalMilliseconds = ... | [
"public",
"IcmpFailureDetectorConfig",
"setIntervalMilliseconds",
"(",
"int",
"intervalMilliseconds",
")",
"{",
"if",
"(",
"intervalMilliseconds",
"<",
"MIN_INTERVAL_MILLIS",
")",
"{",
"throw",
"new",
"ConfigurationException",
"(",
"format",
"(",
"\"Interval can't be set to... | Sets the time in milliseconds between each ping
This value can not be smaller than 1000 milliseconds
@param intervalMilliseconds the interval millis between each ping
@return this {@link IcmpFailureDetectorConfig} instance | [
"Sets",
"the",
"time",
"in",
"milliseconds",
"between",
"each",
"ping",
"This",
"value",
"can",
"not",
"be",
"smaller",
"than",
"1000",
"milliseconds"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/IcmpFailureDetectorConfig.java#L115-L122 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/net/www/MessageHeader.java | MessageHeader.set | public synchronized void set(int i, String k, String v) {
"""
Overwrite the previous key/val pair at location 'i'
with the new k/v. If the index didn't exist before
the key/val is simply tacked onto the end.
"""
grow();
if (i < 0) {
return;
} else if (i >= nkeys) {
... | java | public synchronized void set(int i, String k, String v) {
grow();
if (i < 0) {
return;
} else if (i >= nkeys) {
add(k, v);
} else {
keys[i] = k;
values[i] = v;
}
} | [
"public",
"synchronized",
"void",
"set",
"(",
"int",
"i",
",",
"String",
"k",
",",
"String",
"v",
")",
"{",
"grow",
"(",
")",
";",
"if",
"(",
"i",
"<",
"0",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"i",
">=",
"nkeys",
")",
"{",
"add",... | Overwrite the previous key/val pair at location 'i'
with the new k/v. If the index didn't exist before
the key/val is simply tacked onto the end. | [
"Overwrite",
"the",
"previous",
"key",
"/",
"val",
"pair",
"at",
"location",
"i",
"with",
"the",
"new",
"k",
"/",
"v",
".",
"If",
"the",
"index",
"didn",
"t",
"exist",
"before",
"the",
"key",
"/",
"val",
"is",
"simply",
"tacked",
"onto",
"the",
"end"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/net/www/MessageHeader.java#L327-L337 |
tomgibara/bits | src/main/java/com/tomgibara/bits/Bits.java | Bits.toStore | public static BitStore toStore(int size, Random random, float probability) {
"""
Creates a mutable {@link BitStore} initialized with random bit values.
@param size
the capacity, in bits, of the new {@link BitStore}
@param random
a source of randomness
@param probability
a number between 0 and 1 inclusive, ... | java | public static BitStore toStore(int size, Random random, float probability) {
return preferredType.random(size, random, probability);
} | [
"public",
"static",
"BitStore",
"toStore",
"(",
"int",
"size",
",",
"Random",
"random",
",",
"float",
"probability",
")",
"{",
"return",
"preferredType",
".",
"random",
"(",
"size",
",",
"random",
",",
"probability",
")",
";",
"}"
] | Creates a mutable {@link BitStore} initialized with random bit values.
@param size
the capacity, in bits, of the new {@link BitStore}
@param random
a source of randomness
@param probability
a number between 0 and 1 inclusive, being the independent
probability that a bit is set
@return a new mutable {@link BitStore} in... | [
"Creates",
"a",
"mutable",
"{",
"@link",
"BitStore",
"}",
"initialized",
"with",
"random",
"bit",
"values",
"."
] | train | https://github.com/tomgibara/bits/blob/56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97/src/main/java/com/tomgibara/bits/Bits.java#L303-L305 |
unbescape/unbescape | src/main/java/org/unbescape/xml/XmlEscape.java | XmlEscape.escapeXml11 | public static void escapeXml11(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform an XML 1.1 level 2 (markup-significant and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 2</em> ... | java | public static void escapeXml11(final String text, final Writer writer)
throws IOException {
escapeXml(text, writer, XmlEscapeSymbols.XML11_SYMBOLS,
XmlEscapeType.CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA,
XmlEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT)... | [
"public",
"static",
"void",
"escapeXml11",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeXml",
"(",
"text",
",",
"writer",
",",
"XmlEscapeSymbols",
".",
"XML11_SYMBOLS",
",",
"XmlEscapeType",
".",
"... | <p>
Perform an XML 1.1 level 2 (markup-significant and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 2</em> means this method will escape:
</p>
<ul>
<li>The five markup-significant characters: <tt><</tt>, <tt>></tt>, <tt... | [
"<p",
">",
"Perform",
"an",
"XML",
"1",
".",
"1",
"level",
"2",
"(",
"markup",
"-",
"significant",
"and",
"all",
"non",
"-",
"ASCII",
"chars",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/xml/XmlEscape.java#L916-L921 |
apache/groovy | src/main/groovy/groovy/util/Node.java | Node.depthFirst | public void depthFirst(Map<String, Object> options, Closure c) {
"""
Provides a collection of all the nodes in the tree
using a depth-first traversal.
A boolean 'preorder' options is supported.
@param options map containing options
@param c the closure to run for each node (a one or two parameter can be used... | java | public void depthFirst(Map<String, Object> options, Closure c) {
boolean preorder = Boolean.valueOf(options.get("preorder").toString());
if (preorder) callClosureForNode(c, this, 1);
depthFirstRest(preorder, 2, c);
if (!preorder) callClosureForNode(c, this, 1);
} | [
"public",
"void",
"depthFirst",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
",",
"Closure",
"c",
")",
"{",
"boolean",
"preorder",
"=",
"Boolean",
".",
"valueOf",
"(",
"options",
".",
"get",
"(",
"\"preorder\"",
")",
".",
"toString",
"(",
... | Provides a collection of all the nodes in the tree
using a depth-first traversal.
A boolean 'preorder' options is supported.
@param options map containing options
@param c the closure to run for each node (a one or two parameter can be used; if one parameter is given the
closure will be passed the node, for a two para... | [
"Provides",
"a",
"collection",
"of",
"all",
"the",
"nodes",
"in",
"the",
"tree",
"using",
"a",
"depth",
"-",
"first",
"traversal",
".",
"A",
"boolean",
"preorder",
"options",
"is",
"supported",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L609-L614 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/ItemUtils.java | ItemUtils.toItem | public static Item toItem(Map<String, AttributeValue> item) {
"""
Returns an <code>Item</code> given the low level item information;
or null if the input is null;
"""
if (item == null) {
return null;
}
return Item.fromMap(toSimpleMapValue(item));
} | java | public static Item toItem(Map<String, AttributeValue> item) {
if (item == null) {
return null;
}
return Item.fromMap(toSimpleMapValue(item));
} | [
"public",
"static",
"Item",
"toItem",
"(",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
"item",
")",
"{",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"Item",
".",
"fromMap",
"(",
"toSimpleMapValue",
"(",
"item"... | Returns an <code>Item</code> given the low level item information;
or null if the input is null; | [
"Returns",
"an",
"<code",
">",
"Item<",
"/",
"code",
">",
"given",
"the",
"low",
"level",
"item",
"information",
";",
"or",
"null",
"if",
"the",
"input",
"is",
"null",
";"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/ItemUtils.java#L49-L54 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.getFieldValue | @SuppressWarnings("unchecked")
public static <T> T getFieldValue(Object object, String fieldName) {
"""
Get instance or class field value. Retrieve named field value from given instance; if <code>object</code> argument
is a {@link Class} retrieve class static field.
@param object instance or class to retrie... | java | @SuppressWarnings("unchecked")
public static <T> T getFieldValue(Object object, String fieldName)
{
if(object instanceof Class<?>) {
return getFieldValue(null, (Class<?>)object, fieldName, null, false);
}
Class<?> clazz = object.getClass();
try {
Field f = clazz.getDeclaredFiel... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getFieldValue",
"(",
"Object",
"object",
",",
"String",
"fieldName",
")",
"{",
"if",
"(",
"object",
"instanceof",
"Class",
"<",
"?",
">",
")",
"{",
"return",
"ge... | Get instance or class field value. Retrieve named field value from given instance; if <code>object</code> argument
is a {@link Class} retrieve class static field.
@param object instance or class to retrieve field value from,
@param fieldName field name.
@param <T> field value type.
@return instance or class field valu... | [
"Get",
"instance",
"or",
"class",
"field",
"value",
".",
"Retrieve",
"named",
"field",
"value",
"from",
"given",
"instance",
";",
"if",
"<code",
">",
"object<",
"/",
"code",
">",
"argument",
"is",
"a",
"{",
"@link",
"Class",
"}",
"retrieve",
"class",
"st... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L711-L730 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/LogManager.java | LogManager.getLogger | protected static Logger getLogger(final String fqcn, final String name) {
"""
Returns a Logger with the specified name.
@param fqcn The fully qualified class name of the class that this method is a member of.
@param name The logger name.
@return The Logger.
"""
return factory.getContext(fqcn, null... | java | protected static Logger getLogger(final String fqcn, final String name) {
return factory.getContext(fqcn, null, null, false).getLogger(name);
} | [
"protected",
"static",
"Logger",
"getLogger",
"(",
"final",
"String",
"fqcn",
",",
"final",
"String",
"name",
")",
"{",
"return",
"factory",
".",
"getContext",
"(",
"fqcn",
",",
"null",
",",
"null",
",",
"false",
")",
".",
"getLogger",
"(",
"name",
")",
... | Returns a Logger with the specified name.
@param fqcn The fully qualified class name of the class that this method is a member of.
@param name The logger name.
@return The Logger. | [
"Returns",
"a",
"Logger",
"with",
"the",
"specified",
"name",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/LogManager.java#L584-L586 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java | JenkinsServer.createFolder | public JenkinsServer createFolder(FolderJob folder, String jobName) throws IOException {
"""
Create a job on the server (in the given folder)
@param folder {@link FolderJob}
@param jobName name of the job.
@throws IOException in case of an error.
"""
return createFolder(folder, jobName, false);
... | java | public JenkinsServer createFolder(FolderJob folder, String jobName) throws IOException {
return createFolder(folder, jobName, false);
} | [
"public",
"JenkinsServer",
"createFolder",
"(",
"FolderJob",
"folder",
",",
"String",
"jobName",
")",
"throws",
"IOException",
"{",
"return",
"createFolder",
"(",
"folder",
",",
"jobName",
",",
"false",
")",
";",
"}"
] | Create a job on the server (in the given folder)
@param folder {@link FolderJob}
@param jobName name of the job.
@throws IOException in case of an error. | [
"Create",
"a",
"job",
"on",
"the",
"server",
"(",
"in",
"the",
"given",
"folder",
")"
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L478-L480 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/SoftDeleteHandler.java | SoftDeleteHandler.init | public void init(Record record, BaseField fldDeleteFlag) {
"""
Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
"""
m_fldDeleteFlag = fldDeleteFlag;
m_bFilterThisRecord = true;
super.init(record);
} | java | public void init(Record record, BaseField fldDeleteFlag)
{
m_fldDeleteFlag = fldDeleteFlag;
m_bFilterThisRecord = true;
super.init(record);
} | [
"public",
"void",
"init",
"(",
"Record",
"record",
",",
"BaseField",
"fldDeleteFlag",
")",
"{",
"m_fldDeleteFlag",
"=",
"fldDeleteFlag",
";",
"m_bFilterThisRecord",
"=",
"true",
";",
"super",
".",
"init",
"(",
"record",
")",
";",
"}"
] | Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()). | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/SoftDeleteHandler.java#L61-L66 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/sw/BaseStreamWriter.java | BaseStreamWriter.setProperty | @Override
public boolean setProperty(String name, Object value) {
"""
@param name Name of the property to set
@param value Value to set property to.
@return True, if the specified property was <b>succesfully</b>
set to specified value; false if its value was not changed
"""
/* Note: can not ca... | java | @Override
public boolean setProperty(String name, Object value)
{
/* Note: can not call local method, since it'll return false for
* recognized but non-mutable properties
*/
return mConfig.setProperty(name, value);
} | [
"@",
"Override",
"public",
"boolean",
"setProperty",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"/* Note: can not call local method, since it'll return false for\n * recognized but non-mutable properties\n */",
"return",
"mConfig",
".",
"setProperty",
... | @param name Name of the property to set
@param value Value to set property to.
@return True, if the specified property was <b>succesfully</b>
set to specified value; false if its value was not changed | [
"@param",
"name",
"Name",
"of",
"the",
"property",
"to",
"set",
"@param",
"value",
"Value",
"to",
"set",
"property",
"to",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sw/BaseStreamWriter.java#L950-L957 |
amzn/ion-java | src/com/amazon/ion/system/SimpleCatalog.java | SimpleCatalog.removeTable | public SymbolTable removeTable(String name, int version) {
"""
Removes a symbol table from this catalog.
@return the removed table, or <code>null</code> if this catalog has
no matching table.
"""
SymbolTable removed = null;
synchronized (myTablesByName)
{
TreeMap<Intege... | java | public SymbolTable removeTable(String name, int version)
{
SymbolTable removed = null;
synchronized (myTablesByName)
{
TreeMap<Integer,SymbolTable> versions =
myTablesByName.get(name);
if (versions != null)
{
synchronized (... | [
"public",
"SymbolTable",
"removeTable",
"(",
"String",
"name",
",",
"int",
"version",
")",
"{",
"SymbolTable",
"removed",
"=",
"null",
";",
"synchronized",
"(",
"myTablesByName",
")",
"{",
"TreeMap",
"<",
"Integer",
",",
"SymbolTable",
">",
"versions",
"=",
... | Removes a symbol table from this catalog.
@return the removed table, or <code>null</code> if this catalog has
no matching table. | [
"Removes",
"a",
"symbol",
"table",
"from",
"this",
"catalog",
"."
] | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/system/SimpleCatalog.java#L181-L205 |
unbescape/unbescape | src/main/java/org/unbescape/java/JavaEscape.java | JavaEscape.unescapeJava | public static void unescapeJava(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform a Java <strong>unescape</strong> operation on a <tt>String</tt> input, writing results
to a <tt>Writer</tt>.
</p>
<p>
No additional configuration arguments are required. Unescape operations... | java | public static void unescapeJava(final String text, final Writer writer)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (text == null) {
return;
}
if (text.indexOf('\\') <... | [
"public",
"static",
"void",
"unescapeJava",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument 'writer' ca... | <p>
Perform a Java <strong>unescape</strong> operation on a <tt>String</tt> input, writing results
to a <tt>Writer</tt>.
</p>
<p>
No additional configuration arguments are required. Unescape operations
will always perform <em>complete</em> Java unescape of SECs, u-based and octal escapes.
</p>
<p>
This method is <stron... | [
"<p",
">",
"Perform",
"a",
"Java",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Writer<",
"/",
"tt",
">",
".",
"<",
"/",
"p",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/java/JavaEscape.java#L878-L895 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/TransformProcess.java | TransformProcess.executeToSequence | public List<List<Writable>> executeToSequence(List<Writable> inputExample) {
"""
Execute a TransformProcess that starts with a single (non-sequence) record,
and converts it to a sequence record.
<b>NOTE</b>: This method has the following significant limitation:
if it contains a ConvertToSequence op,
it MUST be... | java | public List<List<Writable>> executeToSequence(List<Writable> inputExample){
return execute(inputExample, null).getRight();
} | [
"public",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
"executeToSequence",
"(",
"List",
"<",
"Writable",
">",
"inputExample",
")",
"{",
"return",
"execute",
"(",
"inputExample",
",",
"null",
")",
".",
"getRight",
"(",
")",
";",
"}"
] | Execute a TransformProcess that starts with a single (non-sequence) record,
and converts it to a sequence record.
<b>NOTE</b>: This method has the following significant limitation:
if it contains a ConvertToSequence op,
it MUST be using singleStepSequencesMode - see {@link ConvertToSequence} for details.<br>
This restr... | [
"Execute",
"a",
"TransformProcess",
"that",
"starts",
"with",
"a",
"single",
"(",
"non",
"-",
"sequence",
")",
"record",
"and",
"converts",
"it",
"to",
"a",
"sequence",
"record",
".",
"<b",
">",
"NOTE<",
"/",
"b",
">",
":",
"This",
"method",
"has",
"th... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/TransformProcess.java#L319-L321 |
thorntail/thorntail | core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/util/BootstrapUtil.java | BootstrapUtil.explodeJar | public static void explodeJar(JarFile jarFile, String destDir) throws IOException {
"""
Extracts a jar file into a target destination directory
@param jarFile
@param destDir
@throws IOException
"""
Enumeration<java.util.jar.JarEntry> enu = jarFile.entries();
while (enu.hasMoreElements()) {... | java | public static void explodeJar(JarFile jarFile, String destDir) throws IOException {
Enumeration<java.util.jar.JarEntry> enu = jarFile.entries();
while (enu.hasMoreElements()) {
JarEntry je = enu.nextElement();
File fl = new File(destDir, je.getName());
if (!fl.exists... | [
"public",
"static",
"void",
"explodeJar",
"(",
"JarFile",
"jarFile",
",",
"String",
"destDir",
")",
"throws",
"IOException",
"{",
"Enumeration",
"<",
"java",
".",
"util",
".",
"jar",
".",
"JarEntry",
">",
"enu",
"=",
"jarFile",
".",
"entries",
"(",
")",
... | Extracts a jar file into a target destination directory
@param jarFile
@param destDir
@throws IOException | [
"Extracts",
"a",
"jar",
"file",
"into",
"a",
"target",
"destination",
"directory"
] | train | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/util/BootstrapUtil.java#L43-L66 |
apache/incubator-druid | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java | FixedBucketsHistogram.writeByteBufferFull | private void writeByteBufferFull(ByteBuffer buf, boolean withHeader) {
"""
Helper method for toBytesFull
@param buf Destination buffer
@param withHeader If true, include the serialization header
"""
if (withHeader) {
writeByteBufferSerdeHeader(buf, FULL_ENCODING_MODE);
}
writeByteBufferC... | java | private void writeByteBufferFull(ByteBuffer buf, boolean withHeader)
{
if (withHeader) {
writeByteBufferSerdeHeader(buf, FULL_ENCODING_MODE);
}
writeByteBufferCommonFields(buf);
buf.asLongBuffer().put(histogram);
buf.position(buf.position() + Long.BYTES * histogram.length);
} | [
"private",
"void",
"writeByteBufferFull",
"(",
"ByteBuffer",
"buf",
",",
"boolean",
"withHeader",
")",
"{",
"if",
"(",
"withHeader",
")",
"{",
"writeByteBufferSerdeHeader",
"(",
"buf",
",",
"FULL_ENCODING_MODE",
")",
";",
"}",
"writeByteBufferCommonFields",
"(",
"... | Helper method for toBytesFull
@param buf Destination buffer
@param withHeader If true, include the serialization header | [
"Helper",
"method",
"for",
"toBytesFull"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java#L841-L851 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java | WSKeyStore.getKeyStore | public KeyStore getKeyStore(boolean reinitialize, boolean createIfNotPresent) throws Exception {
"""
Get the key store wrapped by this object.
@param reinitialize
@param createIfNotPresent
@return KeyStore
@throws Exception
"""
if (myKeyStore == null || reinitialize) {
myKeyStore = do... | java | public KeyStore getKeyStore(boolean reinitialize, boolean createIfNotPresent) throws Exception {
if (myKeyStore == null || reinitialize) {
myKeyStore = do_getKeyStore(reinitialize, createIfNotPresent);
}
return myKeyStore;
} | [
"public",
"KeyStore",
"getKeyStore",
"(",
"boolean",
"reinitialize",
",",
"boolean",
"createIfNotPresent",
")",
"throws",
"Exception",
"{",
"if",
"(",
"myKeyStore",
"==",
"null",
"||",
"reinitialize",
")",
"{",
"myKeyStore",
"=",
"do_getKeyStore",
"(",
"reinitiali... | Get the key store wrapped by this object.
@param reinitialize
@param createIfNotPresent
@return KeyStore
@throws Exception | [
"Get",
"the",
"key",
"store",
"wrapped",
"by",
"this",
"object",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L909-L915 |
headius/invokebinder | src/main/java/com/headius/invokebinder/SmartBinder.java | SmartBinder.foldVirtual | public SmartBinder foldVirtual(String newName, Lookup lookup, String method) {
"""
Acquire a virtual folding function from the first argument's class,
using the given name and Lookup. Pass all arguments to that function and
insert the resulting value as newName into the argument list.
@param newName the name ... | java | public SmartBinder foldVirtual(String newName, Lookup lookup, String method) {
Binder newBinder = binder.foldVirtual(lookup, method);
return new SmartBinder(this, signature().prependArg(newName, newBinder.type().parameterType(0)), newBinder);
} | [
"public",
"SmartBinder",
"foldVirtual",
"(",
"String",
"newName",
",",
"Lookup",
"lookup",
",",
"String",
"method",
")",
"{",
"Binder",
"newBinder",
"=",
"binder",
".",
"foldVirtual",
"(",
"lookup",
",",
"method",
")",
";",
"return",
"new",
"SmartBinder",
"(... | Acquire a virtual folding function from the first argument's class,
using the given name and Lookup. Pass all arguments to that function and
insert the resulting value as newName into the argument list.
@param newName the name of the new first argument where the fold
function's result will be passed
@param lookup the... | [
"Acquire",
"a",
"virtual",
"folding",
"function",
"from",
"the",
"first",
"argument",
"s",
"class",
"using",
"the",
"given",
"name",
"and",
"Lookup",
".",
"Pass",
"all",
"arguments",
"to",
"that",
"function",
"and",
"insert",
"the",
"resulting",
"value",
"as... | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L262-L265 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ManagedDatabasesInner.java | ManagedDatabasesInner.beginUpdateAsync | public Observable<ManagedDatabaseInner> beginUpdateAsync(String resourceGroupName, String managedInstanceName, String databaseName, ManagedDatabaseUpdate parameters) {
"""
Updates an existing database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value ... | java | public Observable<ManagedDatabaseInner> beginUpdateAsync(String resourceGroupName, String managedInstanceName, String databaseName, ManagedDatabaseUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, parameters).map(new Func1<ServiceResponse<Manag... | [
"public",
"Observable",
"<",
"ManagedDatabaseInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"String",
"databaseName",
",",
"ManagedDatabaseUpdate",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResp... | Updates an existing database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param managedInstanceName The name of the managed instance.
@param databaseName The name of the database.
@param parameters The... | [
"Updates",
"an",
"existing",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ManagedDatabasesInner.java#L984-L991 |
kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-controller/kie-server-controller-client/src/main/java/org/kie/server/controller/client/KieServerControllerClientFactory.java | KieServerControllerClientFactory.newWebSocketClient | public static KieServerControllerClient newWebSocketClient(final String controllerUrl,
final String login,
final String password) {
"""
Creates a new Kie Controller Client using Web Socket ... | java | public static KieServerControllerClient newWebSocketClient(final String controllerUrl,
final String login,
final String password) {
return new WebSocketKieServerControllerClient(controll... | [
"public",
"static",
"KieServerControllerClient",
"newWebSocketClient",
"(",
"final",
"String",
"controllerUrl",
",",
"final",
"String",
"login",
",",
"final",
"String",
"password",
")",
"{",
"return",
"new",
"WebSocketKieServerControllerClient",
"(",
"controllerUrl",
",... | Creates a new Kie Controller Client using Web Socket based service
@param controllerUrl the URL to the server (e.g.: "ws://localhost:8080/kie-server-controller/websocket/controller")
@param login user login
@param password user password
@return client instance | [
"Creates",
"a",
"new",
"Kie",
"Controller",
"Client",
"using",
"Web",
"Socket",
"based",
"service"
] | train | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-controller/kie-server-controller-client/src/main/java/org/kie/server/controller/client/KieServerControllerClientFactory.java#L92-L100 |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/common/lib/factory/AdsServiceClientFactory.java | AdsServiceClientFactory.createProxy | <T> T createProxy(Class<T> interfaceClass, C adsServiceClient) {
"""
Creates the proxy for the {@link AdsServiceClient}.
@param <T> the service type
@param adsServiceClient the client to proxy
@return the proxy
"""
Set<Class<?>> interfaces = Sets.newHashSet(adsServiceClient.getClass().getInterfaces())... | java | <T> T createProxy(Class<T> interfaceClass, C adsServiceClient) {
Set<Class<?>> interfaces = Sets.newHashSet(adsServiceClient.getClass().getInterfaces());
interfaces.add(interfaceClass);
Object proxy = Proxy.newProxyInstance(
adsServiceClient.getSoapClient().getClass().getClassLoader(),
inter... | [
"<",
"T",
">",
"T",
"createProxy",
"(",
"Class",
"<",
"T",
">",
"interfaceClass",
",",
"C",
"adsServiceClient",
")",
"{",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"interfaces",
"=",
"Sets",
".",
"newHashSet",
"(",
"adsServiceClient",
".",
"getClass",
"... | Creates the proxy for the {@link AdsServiceClient}.
@param <T> the service type
@param adsServiceClient the client to proxy
@return the proxy | [
"Creates",
"the",
"proxy",
"for",
"the",
"{",
"@link",
"AdsServiceClient",
"}",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/factory/AdsServiceClientFactory.java#L87-L94 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/RequiresCondition.java | RequiresCondition.processPostStartRequirements | private void processPostStartRequirements(ConditionContext context, AnnotationValue<Requires> requirements) {
"""
This method will run conditions that require all beans to be loaded. These conditions included "beans", "missingBeans" and custom conditions.
"""
processPreStartRequirements(context, requir... | java | private void processPostStartRequirements(ConditionContext context, AnnotationValue<Requires> requirements) {
processPreStartRequirements(context, requirements);
if (context.isFailing()) {
return;
}
if (!matchesPresenceOfBeans(context, requirements)) {
return;
... | [
"private",
"void",
"processPostStartRequirements",
"(",
"ConditionContext",
"context",
",",
"AnnotationValue",
"<",
"Requires",
">",
"requirements",
")",
"{",
"processPreStartRequirements",
"(",
"context",
",",
"requirements",
")",
";",
"if",
"(",
"context",
".",
"i... | This method will run conditions that require all beans to be loaded. These conditions included "beans", "missingBeans" and custom conditions. | [
"This",
"method",
"will",
"run",
"conditions",
"that",
"require",
"all",
"beans",
"to",
"be",
"loaded",
".",
"These",
"conditions",
"included",
"beans",
"missingBeans",
"and",
"custom",
"conditions",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/RequiresCondition.java#L173-L189 |
padrig64/ValidationFramework | validationframework-swing/src/main/java/com/google/code/validationframework/swing/decoration/support/TransparentToolTipDialog.java | TransparentToolTipDialog.setText | public void setText(String text) {
"""
Sets the text to be displayed as a tooltip.
@param text Text to be displayed
"""
// Only change if different
if (!ValueUtils.areEqual(text, toolTip.getTipText())) {
boolean wasVisible = isVisible();
if (wasVisible) {
... | java | public void setText(String text) {
// Only change if different
if (!ValueUtils.areEqual(text, toolTip.getTipText())) {
boolean wasVisible = isVisible();
if (wasVisible) {
setVisible(false);
}
toolTip.setTipText(text);
if (was... | [
"public",
"void",
"setText",
"(",
"String",
"text",
")",
"{",
"// Only change if different",
"if",
"(",
"!",
"ValueUtils",
".",
"areEqual",
"(",
"text",
",",
"toolTip",
".",
"getTipText",
"(",
")",
")",
")",
"{",
"boolean",
"wasVisible",
"=",
"isVisible",
... | Sets the text to be displayed as a tooltip.
@param text Text to be displayed | [
"Sets",
"the",
"text",
"to",
"be",
"displayed",
"as",
"a",
"tooltip",
"."
] | train | https://github.com/padrig64/ValidationFramework/blob/2dd3c7b3403993db366d24a927645f467ccd1dda/validationframework-swing/src/main/java/com/google/code/validationframework/swing/decoration/support/TransparentToolTipDialog.java#L359-L374 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/view/JspViewDeclarationLanguageBase.java | JspViewDeclarationLanguageBase.isViewBuilt | protected boolean isViewBuilt(FacesContext facesContext, UIViewRoot view) {
"""
Returns true if the given UIViewRoot has already been built via VDL.buildView().
This is necessary because legacy ViewHandler implementations return null on
getViewDeclarationLanguage() and thus VDL.buildView() is never called.
So w... | java | protected boolean isViewBuilt(FacesContext facesContext, UIViewRoot view)
{
return Boolean.TRUE.equals(facesContext.getAttributes().get(view));
} | [
"protected",
"boolean",
"isViewBuilt",
"(",
"FacesContext",
"facesContext",
",",
"UIViewRoot",
"view",
")",
"{",
"return",
"Boolean",
".",
"TRUE",
".",
"equals",
"(",
"facesContext",
".",
"getAttributes",
"(",
")",
".",
"get",
"(",
"view",
")",
")",
";",
"... | Returns true if the given UIViewRoot has already been built via VDL.buildView().
This is necessary because legacy ViewHandler implementations return null on
getViewDeclarationLanguage() and thus VDL.buildView() is never called.
So we have to check this in renderView() and, if it is false, we have to
call buildView() ma... | [
"Returns",
"true",
"if",
"the",
"given",
"UIViewRoot",
"has",
"already",
"been",
"built",
"via",
"VDL",
".",
"buildView",
"()",
".",
"This",
"is",
"necessary",
"because",
"legacy",
"ViewHandler",
"implementations",
"return",
"null",
"on",
"getViewDeclarationLangua... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/view/JspViewDeclarationLanguageBase.java#L390-L393 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/ActiveRecordPlugin.java | ActiveRecordPlugin.setPrimaryKey | public void setPrimaryKey(String tableName, String primaryKey) {
"""
当使用 create table 语句创建用于开发使用的数据表副本时,假如create table 中使用的
复合主键次序不同,那么MappingKitGeneretor 反射生成的复合主键次序也会不同。
而程序中类似于 model.deleteById(id1, id2) 方法中复合主键次序与需要与映射时的次序
保持一致,可以在MappingKit 映射完成以后通过调用此方法再次强制指定复合主键次序
<pre>
Example:
ActiveRecrodPlugin... | java | public void setPrimaryKey(String tableName, String primaryKey) {
for (Table table : tableList) {
if (table.getName().equalsIgnoreCase(tableName.trim())) {
table.setPrimaryKey(primaryKey);
}
}
} | [
"public",
"void",
"setPrimaryKey",
"(",
"String",
"tableName",
",",
"String",
"primaryKey",
")",
"{",
"for",
"(",
"Table",
"table",
":",
"tableList",
")",
"{",
"if",
"(",
"table",
".",
"getName",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"tableName",
".",
... | 当使用 create table 语句创建用于开发使用的数据表副本时,假如create table 中使用的
复合主键次序不同,那么MappingKitGeneretor 反射生成的复合主键次序也会不同。
而程序中类似于 model.deleteById(id1, id2) 方法中复合主键次序与需要与映射时的次序
保持一致,可以在MappingKit 映射完成以后通过调用此方法再次强制指定复合主键次序
<pre>
Example:
ActiveRecrodPlugin arp = new ActiveRecordPlugin(...);
_MappingKit.mapping(arp);
arp.setPrimaryKey("a... | [
"当使用",
"create",
"table",
"语句创建用于开发使用的数据表副本时,假如create",
"table",
"中使用的",
"复合主键次序不同,那么MappingKitGeneretor",
"反射生成的复合主键次序也会不同。"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/ActiveRecordPlugin.java#L205-L211 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEManager.java | CmsADEManager.getRecentList | public List<CmsContainerElementBean> getRecentList(CmsObject cms) throws CmsException {
"""
Returns the favorite list, or creates it if not available.<p>
@param cms the cms context
@return the favorite list
@throws CmsException if something goes wrong
"""
CmsUser user = cms.getRequestContext(... | java | public List<CmsContainerElementBean> getRecentList(CmsObject cms) throws CmsException {
CmsUser user = cms.getRequestContext().getCurrentUser();
Object obj = user.getAdditionalInfo(ADDINFO_ADE_RECENT_LIST);
List<CmsContainerElementBean> recentList = new ArrayList<CmsContainerElementBean>();
... | [
"public",
"List",
"<",
"CmsContainerElementBean",
">",
"getRecentList",
"(",
"CmsObject",
"cms",
")",
"throws",
"CmsException",
"{",
"CmsUser",
"user",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getCurrentUser",
"(",
")",
";",
"Object",
"obj",
"=",
... | Returns the favorite list, or creates it if not available.<p>
@param cms the cms context
@return the favorite list
@throws CmsException if something goes wrong | [
"Returns",
"the",
"favorite",
"list",
"or",
"creates",
"it",
"if",
"not",
"available",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L855-L882 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/IoFilterManager.java | IoFilterManager.installIoFilter_Task | public Task installIoFilter_Task(String vibUrl, ComputeResource compRes) throws AlreadyExists, InvalidArgument, RuntimeFault, RemoteException {
"""
Install an IO Filter on a compute resource. IO Filters can only be installed on a cluster.
@param vibUrl
- The URL that points to the IO Filter VIB package.
@para... | java | public Task installIoFilter_Task(String vibUrl, ComputeResource compRes) throws AlreadyExists, InvalidArgument, RuntimeFault, RemoteException {
return new Task(getServerConnection(), getVimService().installIoFilter_Task(getMOR(), vibUrl, compRes.getMOR()));
} | [
"public",
"Task",
"installIoFilter_Task",
"(",
"String",
"vibUrl",
",",
"ComputeResource",
"compRes",
")",
"throws",
"AlreadyExists",
",",
"InvalidArgument",
",",
"RuntimeFault",
",",
"RemoteException",
"{",
"return",
"new",
"Task",
"(",
"getServerConnection",
"(",
... | Install an IO Filter on a compute resource. IO Filters can only be installed on a cluster.
@param vibUrl
- The URL that points to the IO Filter VIB package.
@param compRes
- The compute resource to install the IO Filter on. "compRes" must be a cluster.
@return - This method returns a Task object with which to monitor ... | [
"Install",
"an",
"IO",
"Filter",
"on",
"a",
"compute",
"resource",
".",
"IO",
"Filters",
"can",
"only",
"be",
"installed",
"on",
"a",
"cluster",
"."
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/IoFilterManager.java#L69-L71 |
h2oai/h2o-2 | src/main/java/water/parser/XlsParser.java | XlsParser.guessSetup | public static PSetupGuess guessSetup(byte [] bits) {
"""
Try to parse the bits as svm light format, return SVMParser instance if the input is in svm light format, null otherwise.
@param bits
@return SVMLightPArser instance or null
"""
InputStream is = new ByteArrayInputStream(bits);
XlsParser p = new... | java | public static PSetupGuess guessSetup(byte [] bits){
InputStream is = new ByteArrayInputStream(bits);
XlsParser p = new XlsParser();
CustomInspectDataOut dout = new CustomInspectDataOut();
try{p.streamParse(is, dout);}catch(Exception e){}
return new PSetupGuess(new ParserSetup(ParserType.XLS,CsvParse... | [
"public",
"static",
"PSetupGuess",
"guessSetup",
"(",
"byte",
"[",
"]",
"bits",
")",
"{",
"InputStream",
"is",
"=",
"new",
"ByteArrayInputStream",
"(",
"bits",
")",
";",
"XlsParser",
"p",
"=",
"new",
"XlsParser",
"(",
")",
";",
"CustomInspectDataOut",
"dout"... | Try to parse the bits as svm light format, return SVMParser instance if the input is in svm light format, null otherwise.
@param bits
@return SVMLightPArser instance or null | [
"Try",
"to",
"parse",
"the",
"bits",
"as",
"svm",
"light",
"format",
"return",
"SVMParser",
"instance",
"if",
"the",
"input",
"is",
"in",
"svm",
"light",
"format",
"null",
"otherwise",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/parser/XlsParser.java#L49-L55 |
actframework/actframework | src/main/java/act/event/EventBus.java | EventBus.emitAsync | public EventBus emitAsync(EventObject event, Object... args) {
"""
Emit a event object with parameters and force all listeners to be called asynchronously.
@param event
the target event
@param args
the arguments passed in
@see #emit(EventObject, Object...)
"""
return _emitWithOnceBus(eventContex... | java | public EventBus emitAsync(EventObject event, Object... args) {
return _emitWithOnceBus(eventContextAsync(event, args));
} | [
"public",
"EventBus",
"emitAsync",
"(",
"EventObject",
"event",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"_emitWithOnceBus",
"(",
"eventContextAsync",
"(",
"event",
",",
"args",
")",
")",
";",
"}"
] | Emit a event object with parameters and force all listeners to be called asynchronously.
@param event
the target event
@param args
the arguments passed in
@see #emit(EventObject, Object...) | [
"Emit",
"a",
"event",
"object",
"with",
"parameters",
"and",
"force",
"all",
"listeners",
"to",
"be",
"called",
"asynchronously",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/event/EventBus.java#L1035-L1037 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tfloat/Scs_lusol.java | Scs_lusol.cs_lusol | public static boolean cs_lusol(int order, Scs A, float[] b, float tol) {
"""
Solves Ax=b, where A is square and nonsingular. b overwritten with
solution. Partial pivoting if tol = 1.f
@param order
ordering method to use (0 to 3)
@param A
column-compressed matrix
@param b
size n, b on input, x on output
@... | java | public static boolean cs_lusol(int order, Scs A, float[] b, float tol) {
float[] x;
Scss S;
Scsn N;
int n;
boolean ok;
if (!Scs_util.CS_CSC(A) || b == null)
return (false); /* check inputs */
n = A.n;
S = Scs_sqr.cs_sqr(order, A, false... | [
"public",
"static",
"boolean",
"cs_lusol",
"(",
"int",
"order",
",",
"Scs",
"A",
",",
"float",
"[",
"]",
"b",
",",
"float",
"tol",
")",
"{",
"float",
"[",
"]",
"x",
";",
"Scss",
"S",
";",
"Scsn",
"N",
";",
"int",
"n",
";",
"boolean",
"ok",
";",... | Solves Ax=b, where A is square and nonsingular. b overwritten with
solution. Partial pivoting if tol = 1.f
@param order
ordering method to use (0 to 3)
@param A
column-compressed matrix
@param b
size n, b on input, x on output
@param tol
partial pivoting tolerance
@return true if successful, false on error | [
"Solves",
"Ax",
"=",
"b",
"where",
"A",
"is",
"square",
"and",
"nonsingular",
".",
"b",
"overwritten",
"with",
"solution",
".",
"Partial",
"pivoting",
"if",
"tol",
"=",
"1",
".",
"f"
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tfloat/Scs_lusol.java#L53-L73 |
liferay/com-liferay-commerce | commerce-notification-api/src/main/java/com/liferay/commerce/notification/model/CommerceNotificationTemplateWrapper.java | CommerceNotificationTemplateWrapper.setSubject | @Override
public void setSubject(String subject, java.util.Locale locale) {
"""
Sets the localized subject of this commerce notification template in the language.
@param subject the localized subject of this commerce notification template
@param locale the locale of the language
"""
_commerceNotificatio... | java | @Override
public void setSubject(String subject, java.util.Locale locale) {
_commerceNotificationTemplate.setSubject(subject, locale);
} | [
"@",
"Override",
"public",
"void",
"setSubject",
"(",
"String",
"subject",
",",
"java",
".",
"util",
".",
"Locale",
"locale",
")",
"{",
"_commerceNotificationTemplate",
".",
"setSubject",
"(",
"subject",
",",
"locale",
")",
";",
"}"
] | Sets the localized subject of this commerce notification template in the language.
@param subject the localized subject of this commerce notification template
@param locale the locale of the language | [
"Sets",
"the",
"localized",
"subject",
"of",
"this",
"commerce",
"notification",
"template",
"in",
"the",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-api/src/main/java/com/liferay/commerce/notification/model/CommerceNotificationTemplateWrapper.java#L968-L971 |
haifengl/smile | plot/src/main/java/smile/swing/table/DefaultTableHeaderCellRenderer.java | DefaultTableHeaderCellRenderer.getSortKey | @SuppressWarnings("rawtypes")
protected SortKey getSortKey(JTable table, int column) {
"""
Returns the current sort key, or null if the column is unsorted.
@param table the table
@param column the column index
@return the SortKey, or null if the column is unsorted
"""
RowSorter rowSorter = tab... | java | @SuppressWarnings("rawtypes")
protected SortKey getSortKey(JTable table, int column) {
RowSorter rowSorter = table.getRowSorter();
if (rowSorter == null) {
return null;
}
List sortedColumns = rowSorter.getSortKeys();
if (!sortedColumns.isEmpty()) {
re... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"protected",
"SortKey",
"getSortKey",
"(",
"JTable",
"table",
",",
"int",
"column",
")",
"{",
"RowSorter",
"rowSorter",
"=",
"table",
".",
"getRowSorter",
"(",
")",
";",
"if",
"(",
"rowSorter",
"==",
"null",... | Returns the current sort key, or null if the column is unsorted.
@param table the table
@param column the column index
@return the SortKey, or null if the column is unsorted | [
"Returns",
"the",
"current",
"sort",
"key",
"or",
"null",
"if",
"the",
"column",
"is",
"unsorted",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/plot/src/main/java/smile/swing/table/DefaultTableHeaderCellRenderer.java#L122-L134 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.data_setCookie | public boolean data_setCookie(Integer userId, CharSequence cookieName, CharSequence cookieValue, Long expiresTimestamp, CharSequence path)
throws FacebookException, IOException {
"""
Sets a cookie for a given user and application.
@param userId The user for whom this cookie needs to be set
@param cookieName ... | java | public boolean data_setCookie(Integer userId, CharSequence cookieName, CharSequence cookieValue, Long expiresTimestamp, CharSequence path)
throws FacebookException, IOException {
if (null == userId || 0 >= userId)
throw new IllegalArgumentException("userId should be provided.");
if (null == cookieNam... | [
"public",
"boolean",
"data_setCookie",
"(",
"Integer",
"userId",
",",
"CharSequence",
"cookieName",
",",
"CharSequence",
"cookieValue",
",",
"Long",
"expiresTimestamp",
",",
"CharSequence",
"path",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"if",
"... | Sets a cookie for a given user and application.
@param userId The user for whom this cookie needs to be set
@param cookieName Name of the cookie.
@param cookieValue Value of the cookie.
@param expiresTimestamp Time stamp when the cookie should expire. If not specified, the cookie never expires.
@return true if cookie w... | [
"Sets",
"a",
"cookie",
"for",
"a",
"given",
"user",
"and",
"application",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L2369-L2388 |
netty/netty | codec-dns/src/main/java/io/netty/handler/codec/dns/DatagramDnsQueryEncoder.java | DatagramDnsQueryEncoder.encodeHeader | private static void encodeHeader(DnsQuery query, ByteBuf buf) {
"""
Encodes the header that is always 12 bytes long.
@param query the query header being encoded
@param buf the buffer the encoded data should be written to
"""
buf.writeShort(query.id());
int flags = 0;
flags |= (que... | java | private static void encodeHeader(DnsQuery query, ByteBuf buf) {
buf.writeShort(query.id());
int flags = 0;
flags |= (query.opCode().byteValue() & 0xFF) << 14;
if (query.isRecursionDesired()) {
flags |= 1 << 8;
}
buf.writeShort(flags);
buf.writeShort(qu... | [
"private",
"static",
"void",
"encodeHeader",
"(",
"DnsQuery",
"query",
",",
"ByteBuf",
"buf",
")",
"{",
"buf",
".",
"writeShort",
"(",
"query",
".",
"id",
"(",
")",
")",
";",
"int",
"flags",
"=",
"0",
";",
"flags",
"|=",
"(",
"query",
".",
"opCode",
... | Encodes the header that is always 12 bytes long.
@param query the query header being encoded
@param buf the buffer the encoded data should be written to | [
"Encodes",
"the",
"header",
"that",
"is",
"always",
"12",
"bytes",
"long",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-dns/src/main/java/io/netty/handler/codec/dns/DatagramDnsQueryEncoder.java#L95-L107 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addErrorsFailedToStartJob | public FessMessages addErrorsFailedToStartJob(String property, String arg0) {
"""
Add the created action message for the key 'errors.failed_to_start_job' with parameters.
<pre>
message: Failed to start job {0}.
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 ... | java | public FessMessages addErrorsFailedToStartJob(String property, String arg0) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_failed_to_start_job, arg0));
return this;
} | [
"public",
"FessMessages",
"addErrorsFailedToStartJob",
"(",
"String",
"property",
",",
"String",
"arg0",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"ERRORS_failed_to_start_job",
",",
"arg0",
... | Add the created action message for the key 'errors.failed_to_start_job' with parameters.
<pre>
message: Failed to start job {0}.
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 for message. (NotNull)
@return this. (NotNull) | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"errors",
".",
"failed_to_start_job",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"Failed",
"to",
"start",
"job",
"{",
"0",
"}",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L1522-L1526 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.remoteGoto | public void remoteGoto(String filename, String name, float llx, float lly, float urx, float ury) {
"""
Implements a link to another document.
@param filename the filename for the remote document
@param name the name to jump to
@param llx the lower left x corner of the activation area
@param lly the lower left ... | java | public void remoteGoto(String filename, String name, float llx, float lly, float urx, float ury) {
pdf.remoteGoto(filename, name, llx, lly, urx, ury);
} | [
"public",
"void",
"remoteGoto",
"(",
"String",
"filename",
",",
"String",
"name",
",",
"float",
"llx",
",",
"float",
"lly",
",",
"float",
"urx",
",",
"float",
"ury",
")",
"{",
"pdf",
".",
"remoteGoto",
"(",
"filename",
",",
"name",
",",
"llx",
",",
"... | Implements a link to another document.
@param filename the filename for the remote document
@param name the name to jump to
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of the activation area
@param ury the upper ... | [
"Implements",
"a",
"link",
"to",
"another",
"document",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L2561-L2563 |
alkacon/opencms-core | src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBCmsUsers.java | CmsUpdateDBCmsUsers.writeAdditionalUserInfo | protected void writeAdditionalUserInfo(CmsSetupDb dbCon, String id, Map<String, Object> additionalInfo) {
"""
Writes the additional user infos to the database.<p>
@param dbCon the db connection interface
@param id the user id
@param additionalInfo the additional info of the user
"""
Iterator<Map.... | java | protected void writeAdditionalUserInfo(CmsSetupDb dbCon, String id, Map<String, Object> additionalInfo) {
Iterator<Map.Entry<String, Object>> entries = additionalInfo.entrySet().iterator();
while (entries.hasNext()) {
Map.Entry<String, Object> entry = entries.next();
if ((entry.... | [
"protected",
"void",
"writeAdditionalUserInfo",
"(",
"CmsSetupDb",
"dbCon",
",",
"String",
"id",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"additionalInfo",
")",
"{",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
">",
"entri... | Writes the additional user infos to the database.<p>
@param dbCon the db connection interface
@param id the user id
@param additionalInfo the additional info of the user | [
"Writes",
"the",
"additional",
"user",
"infos",
"to",
"the",
"database",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBCmsUsers.java#L349-L359 |
ginere/ginere-base | src/main/java/eu/ginere/base/util/exception/ExceptionUtils.java | ExceptionUtils.printStackTraceElement | public static void printStackTraceElement(StackTraceElement element,StringBuilder buffer) {
"""
IMprime un stacktrace element.
@param element el elemento a pintar
@param buffer el bufer donde pintar
"""
buffer.append(element.getClassName());
buffer.append('.');
buffer.append(element.getMethodName(... | java | public static void printStackTraceElement(StackTraceElement element,StringBuilder buffer){
buffer.append(element.getClassName());
buffer.append('.');
buffer.append(element.getMethodName());
buffer.append('(');
buffer.append(element.getFileName());
if (element.getLineNumber() > 0) {
buffer.append... | [
"public",
"static",
"void",
"printStackTraceElement",
"(",
"StackTraceElement",
"element",
",",
"StringBuilder",
"buffer",
")",
"{",
"buffer",
".",
"append",
"(",
"element",
".",
"getClassName",
"(",
")",
")",
";",
"buffer",
".",
"append",
"(",
"'",
"'",
")"... | IMprime un stacktrace element.
@param element el elemento a pintar
@param buffer el bufer donde pintar | [
"IMprime",
"un",
"stacktrace",
"element",
"."
] | train | https://github.com/ginere/ginere-base/blob/b1cc1c5834bd8a31df475c6f3fc0ee51273c5a24/src/main/java/eu/ginere/base/util/exception/ExceptionUtils.java#L78-L89 |
litsec/eidas-opensaml | opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/attributes/AttributeUtils.java | AttributeUtils.createAttribute | public static Attribute createAttribute(String name, String friendlyName, String nameFormat) {
"""
Utility method that creates an {@code Attribute} given its name, friendly name and name format.
@param name
the attribute name
@param friendlyName
the attribute friendly name (may be {@code null})
@param nameF... | java | public static Attribute createAttribute(String name, String friendlyName, String nameFormat) {
Attribute attribute = attributeBuilder.buildObject();
attribute.setName(name);
attribute.setFriendlyName(friendlyName);
attribute.setNameFormat(nameFormat);
return attribute;
} | [
"public",
"static",
"Attribute",
"createAttribute",
"(",
"String",
"name",
",",
"String",
"friendlyName",
",",
"String",
"nameFormat",
")",
"{",
"Attribute",
"attribute",
"=",
"attributeBuilder",
".",
"buildObject",
"(",
")",
";",
"attribute",
".",
"setName",
"(... | Utility method that creates an {@code Attribute} given its name, friendly name and name format.
@param name
the attribute name
@param friendlyName
the attribute friendly name (may be {@code null})
@param nameFormat
the name format
@return an {@code Attribute} object | [
"Utility",
"method",
"that",
"creates",
"an",
"{",
"@code",
"Attribute",
"}",
"given",
"its",
"name",
"friendly",
"name",
"and",
"name",
"format",
"."
] | train | https://github.com/litsec/eidas-opensaml/blob/522ba6dba433a9524cb8a02464cc3b087b47a2b7/opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/attributes/AttributeUtils.java#L52-L58 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.fat.common/src/com/ibm/ws/security/fat/common/utils/SecurityFatHttpUtils.java | SecurityFatHttpUtils.getHttpConnectionWithAnyResponseCode | public static HttpURLConnection getHttpConnectionWithAnyResponseCode(LibertyServer server, String path) throws IOException {
"""
This method creates a connection to a webpage and then returns the connection, it doesn't care what the response code is.
@param server
The liberty server that is hosting the URL
@p... | java | public static HttpURLConnection getHttpConnectionWithAnyResponseCode(LibertyServer server, String path) throws IOException {
int timeout = DEFAULT_TIMEOUT;
URL url = createURL(server, path);
HttpURLConnection con = getHttpConnection(url, timeout, HTTPRequestMethod.GET);
Log.info(Security... | [
"public",
"static",
"HttpURLConnection",
"getHttpConnectionWithAnyResponseCode",
"(",
"LibertyServer",
"server",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"int",
"timeout",
"=",
"DEFAULT_TIMEOUT",
";",
"URL",
"url",
"=",
"createURL",
"(",
"server",
"... | This method creates a connection to a webpage and then returns the connection, it doesn't care what the response code is.
@param server
The liberty server that is hosting the URL
@param path
The path to the URL with the output to test (excluding port and server information). For instance
"/someContextRoot/servlet1"
@r... | [
"This",
"method",
"creates",
"a",
"connection",
"to",
"a",
"webpage",
"and",
"then",
"returns",
"the",
"connection",
"it",
"doesn",
"t",
"care",
"what",
"the",
"response",
"code",
"is",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.fat.common/src/com/ibm/ws/security/fat/common/utils/SecurityFatHttpUtils.java#L42-L49 |
gallandarakhneorg/afc | advanced/bootique/bootique-synopsishelp/src/main/java/org/arakhne/afc/bootique/synopsishelp/help/SynopsisHelpGenerator.java | SynopsisHelpGenerator.printSynopsis | @SuppressWarnings("static-method")
protected void printSynopsis(HelpAppender out, String name, String argumentSynopsis) {
"""
Print the synopsis of the command.
@param out the output receiver.
@param name the name of the command.
@param argumentSynopsis the synopsis of the arguments.
"""
out.printSecti... | java | @SuppressWarnings("static-method")
protected void printSynopsis(HelpAppender out, String name, String argumentSynopsis) {
out.printSectionName(SYNOPSIS);
assert name != null;
if (Strings.isNullOrEmpty(argumentSynopsis)) {
out.printText(name, OPTION_SYNOPSIS);
} else {
out.printText(name, OPTION_SYNOPSI... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"void",
"printSynopsis",
"(",
"HelpAppender",
"out",
",",
"String",
"name",
",",
"String",
"argumentSynopsis",
")",
"{",
"out",
".",
"printSectionName",
"(",
"SYNOPSIS",
")",
";",
"assert",
"na... | Print the synopsis of the command.
@param out the output receiver.
@param name the name of the command.
@param argumentSynopsis the synopsis of the arguments. | [
"Print",
"the",
"synopsis",
"of",
"the",
"command",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/bootique/bootique-synopsishelp/src/main/java/org/arakhne/afc/bootique/synopsishelp/help/SynopsisHelpGenerator.java#L107-L118 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java | RunbookDraftsInner.undoEditAsync | public Observable<RunbookDraftUndoEditResultInner> undoEditAsync(String resourceGroupName, String automationAccountName, String runbookName) {
"""
Undo draft edit to last known published state identified by runbook name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The... | java | public Observable<RunbookDraftUndoEditResultInner> undoEditAsync(String resourceGroupName, String automationAccountName, String runbookName) {
return undoEditWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName).map(new Func1<ServiceResponse<RunbookDraftUndoEditResultInner>, RunbookDra... | [
"public",
"Observable",
"<",
"RunbookDraftUndoEditResultInner",
">",
"undoEditAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"runbookName",
")",
"{",
"return",
"undoEditWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Undo draft edit to last known published state identified by runbook name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param runbookName The runbook name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the... | [
"Undo",
"draft",
"edit",
"to",
"last",
"known",
"published",
"state",
"identified",
"by",
"runbook",
"name",
"."
] | 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/RunbookDraftsInner.java#L654-L661 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.updateContextDates | private void updateContextDates(CmsDbContext dbc, CmsResource resource) {
"""
Updates the current users context dates with the given resource.<p>
This checks the date information of the resource based on
{@link CmsResource#getDateLastModified()} as well as
{@link CmsResource#getDateReleased()} and {@link CmsR... | java | private void updateContextDates(CmsDbContext dbc, CmsResource resource) {
CmsFlexRequestContextInfo info = dbc.getFlexRequestContextInfo();
if (info != null) {
info.updateFromResource(resource);
}
} | [
"private",
"void",
"updateContextDates",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
")",
"{",
"CmsFlexRequestContextInfo",
"info",
"=",
"dbc",
".",
"getFlexRequestContextInfo",
"(",
")",
";",
"if",
"(",
"info",
"!=",
"null",
")",
"{",
"info",
... | Updates the current users context dates with the given resource.<p>
This checks the date information of the resource based on
{@link CmsResource#getDateLastModified()} as well as
{@link CmsResource#getDateReleased()} and {@link CmsResource#getDateExpired()}.
The current users request context is updated with the the "l... | [
"Updates",
"the",
"current",
"users",
"context",
"dates",
"with",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L11882-L11888 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/CatalogUtil.java | CatalogUtil.getCatalogFromZK | public static CatalogAndDeployment getCatalogFromZK(ZooKeeper zk)
throws KeeperException, InterruptedException {
"""
Retrieve the catalog and deployment configuration from zookeeper.
NOTE: In general, people who want the catalog and/or deployment should
be getting it from the current CatalogContext, ... | java | public static CatalogAndDeployment getCatalogFromZK(ZooKeeper zk)
throws KeeperException, InterruptedException {
ByteBuffer catalogDeploymentBytes =
ByteBuffer.wrap(zk.getData(VoltZK.catalogbytes, false, null));
int version = catalogDeploymentBytes.getInt();
long genI... | [
"public",
"static",
"CatalogAndDeployment",
"getCatalogFromZK",
"(",
"ZooKeeper",
"zk",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"ByteBuffer",
"catalogDeploymentBytes",
"=",
"ByteBuffer",
".",
"wrap",
"(",
"zk",
".",
"getData",
"(",
"VoltZK"... | Retrieve the catalog and deployment configuration from zookeeper.
NOTE: In general, people who want the catalog and/or deployment should
be getting it from the current CatalogContext, available from
VoltDB.instance(). This is primarily for startup and for use by
@UpdateCore. | [
"Retrieve",
"the",
"catalog",
"and",
"deployment",
"configuration",
"from",
"zookeeper",
".",
"NOTE",
":",
"In",
"general",
"people",
"who",
"want",
"the",
"catalog",
"and",
"/",
"or",
"deployment",
"should",
"be",
"getting",
"it",
"from",
"the",
"current",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L2609-L2626 |
dasein-cloud/dasein-cloud-aws | src/main/java/org/dasein/cloud/aws/platform/RDS.java | RDS.revokeClassicDbSecurityGroup | private void revokeClassicDbSecurityGroup(String groupName, String sourceCidr) throws CloudException, InternalException {
"""
Use this to revoke access of security groups in EC2-Classic
@param groupName
@param sourceCidr
@throws CloudException
@throws InternalException
"""
Map<String,String> parame... | java | private void revokeClassicDbSecurityGroup(String groupName, String sourceCidr) throws CloudException, InternalException {
Map<String,String> parameters = getProvider().getStandardRdsParameters(getProvider().getContext(), REVOKE_DB_SECURITY_GROUP_INGRESS);
parameters.put("CIDRIP", sourceCidr);
p... | [
"private",
"void",
"revokeClassicDbSecurityGroup",
"(",
"String",
"groupName",
",",
"String",
"sourceCidr",
")",
"throws",
"CloudException",
",",
"InternalException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
"=",
"getProvider",
"(",
")",
".",
... | Use this to revoke access of security groups in EC2-Classic
@param groupName
@param sourceCidr
@throws CloudException
@throws InternalException | [
"Use",
"this",
"to",
"revoke",
"access",
"of",
"security",
"groups",
"in",
"EC2",
"-",
"Classic"
] | train | https://github.com/dasein-cloud/dasein-cloud-aws/blob/05098574197a1f573f77447cadc39a76bf00b99d/src/main/java/org/dasein/cloud/aws/platform/RDS.java#L1801-L1808 |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/util/Validate.java | Validate.notEmpty | public static void notEmpty(Map<?,?> map, String message) {
"""
<p>Validate that the specified argument map is neither <code>null</code>
nor a size of zero (no elements); otherwise throwing an exception
with the specified message.
<pre>Validate.notEmpty(myMap, "The map must not be empty");</pre>
@param map... | java | public static void notEmpty(Map<?,?> map, String message) {
if (map == null || map.size() == 0) {
throw new IllegalArgumentException(message);
}
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"String",
"message",
")",
"{",
"if",
"(",
"map",
"==",
"null",
"||",
"map",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentExcepti... | <p>Validate that the specified argument map is neither <code>null</code>
nor a size of zero (no elements); otherwise throwing an exception
with the specified message.
<pre>Validate.notEmpty(myMap, "The map must not be empty");</pre>
@param map the map to check
@param message the exception message if invalid
@throws I... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"map",
"is",
"neither",
"<code",
">",
"null<",
"/",
"code",
">",
"nor",
"a",
"size",
"of",
"zero",
"(",
"no",
"elements",
")",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
... | train | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/util/Validate.java#L282-L286 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.escapeUriQueryParam | public static String escapeUriQueryParam(final String text, final String encoding) {
"""
<p>
Perform am URI query parameter (name or value) <strong>escape</strong> operation
on a <tt>String</tt> input.
</p>
<p>
The following are the only allowed chars in an URI query parameter (will not be escaped):
</p>
<u... | java | public static String escapeUriQueryParam(final String text, final String encoding) {
if (encoding == null) {
throw new IllegalArgumentException("Argument 'encoding' cannot be null");
}
return UriEscapeUtil.escape(text, UriEscapeUtil.UriEscapeType.QUERY_PARAM, encoding);
} | [
"public",
"static",
"String",
"escapeUriQueryParam",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"encoding",
")",
"{",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument 'encoding' cannot be null\"... | <p>
Perform am URI query parameter (name or value) <strong>escape</strong> operation
on a <tt>String</tt> input.
</p>
<p>
The following are the only allowed chars in an URI query parameter (will not be escaped):
</p>
<ul>
<li><tt>A-Z a-z 0-9</tt></li>
<li><tt>- . _ ~</tt></li>
<li><tt>! $ ' ( ) * , ;</tt></li>
<li><tt>... | [
"<p",
">",
"Perform",
"am",
"URI",
"query",
"parameter",
"(",
"name",
"or",
"value",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L327-L332 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/p3/TableReader.java | TableReader.readPage | private void readPage(byte[] buffer, Table table) {
"""
Reads data from a single page of the database file.
@param buffer page from the database file
@param table Table instance
"""
int magicNumber = getShort(buffer, 0);
if (magicNumber == 0x4400)
{
//System.out.println(ByteArray... | java | private void readPage(byte[] buffer, Table table)
{
int magicNumber = getShort(buffer, 0);
if (magicNumber == 0x4400)
{
//System.out.println(ByteArrayHelper.hexdump(buffer, 0, 6, true, 16, ""));
int recordSize = m_definition.getRecordSize();
RowValidator rowValidator = m_... | [
"private",
"void",
"readPage",
"(",
"byte",
"[",
"]",
"buffer",
",",
"Table",
"table",
")",
"{",
"int",
"magicNumber",
"=",
"getShort",
"(",
"buffer",
",",
"0",
")",
";",
"if",
"(",
"magicNumber",
"==",
"0x4400",
")",
"{",
"//System.out.println(ByteArrayHe... | Reads data from a single page of the database file.
@param buffer page from the database file
@param table Table instance | [
"Reads",
"data",
"from",
"a",
"single",
"page",
"of",
"the",
"database",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/p3/TableReader.java#L108-L142 |
samskivert/pythagoras | src/main/java/pythagoras/d/Transforms.java | Transforms.multiply | public static <T extends Transform> T multiply (
double m00, double m01, double m10, double m11, double tx, double ty, AffineTransform b, T into) {
"""
Multiplies the supplied two affine transforms, storing the result in {@code into}. {@code
into} may refer to the same instance as {@code b}.
@return {@co... | java | public static <T extends Transform> T multiply (
double m00, double m01, double m10, double m11, double tx, double ty, AffineTransform b, T into) {
return multiply(m00, m01, m10, m11, tx, ty, b.m00, b.m01, b.m10, b.m11, b.tx, b.ty, into);
} | [
"public",
"static",
"<",
"T",
"extends",
"Transform",
">",
"T",
"multiply",
"(",
"double",
"m00",
",",
"double",
"m01",
",",
"double",
"m10",
",",
"double",
"m11",
",",
"double",
"tx",
",",
"double",
"ty",
",",
"AffineTransform",
"b",
",",
"T",
"into",... | Multiplies the supplied two affine transforms, storing the result in {@code into}. {@code
into} may refer to the same instance as {@code b}.
@return {@code into} for chaining. | [
"Multiplies",
"the",
"supplied",
"two",
"affine",
"transforms",
"storing",
"the",
"result",
"in",
"{"
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Transforms.java#L54-L57 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addSummaryComment | public void addSummaryComment(Element element, List<? extends DocTree> firstSentenceTags, Content htmltree) {
"""
Adds the summary content.
@param element the Element for which the summary will be generated
@param firstSentenceTags the first sentence tags for the doc
@param htmltree the documentation tree to ... | java | public void addSummaryComment(Element element, List<? extends DocTree> firstSentenceTags, Content htmltree) {
addCommentTags(element, firstSentenceTags, false, true, htmltree);
} | [
"public",
"void",
"addSummaryComment",
"(",
"Element",
"element",
",",
"List",
"<",
"?",
"extends",
"DocTree",
">",
"firstSentenceTags",
",",
"Content",
"htmltree",
")",
"{",
"addCommentTags",
"(",
"element",
",",
"firstSentenceTags",
",",
"false",
",",
"true",
... | Adds the summary content.
@param element the Element for which the summary will be generated
@param firstSentenceTags the first sentence tags for the doc
@param htmltree the documentation tree to which the summary will be added | [
"Adds",
"the",
"summary",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L1669-L1671 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/VoiceApi.java | VoiceApi.singleStepTransfer | public ApiSuccessResponse singleStepTransfer(String id, SingleStepTransferData singleStepTransferData) throws ApiException {
"""
Transfer a call in a single step
Perform a single-step transfer to the specified destination.
@param id The connection ID of the call to transfer. (required)
@param singleStepTransfer... | java | public ApiSuccessResponse singleStepTransfer(String id, SingleStepTransferData singleStepTransferData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = singleStepTransferWithHttpInfo(id, singleStepTransferData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"singleStepTransfer",
"(",
"String",
"id",
",",
"SingleStepTransferData",
"singleStepTransferData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"singleStepTransferWithHttpInfo",
"(",
"id",
... | Transfer a call in a single step
Perform a single-step transfer to the specified destination.
@param id The connection ID of the call to transfer. (required)
@param singleStepTransferData (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the res... | [
"Transfer",
"a",
"call",
"in",
"a",
"single",
"step",
"Perform",
"a",
"single",
"-",
"step",
"transfer",
"to",
"the",
"specified",
"destination",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/VoiceApi.java#L4347-L4350 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java | HttpUtils.executePost | public static HttpResponse executePost(final String url,
final String basicAuthUsername,
final String basicAuthPassword,
final String entity) {
"""
Execute post http response.
@param ... | java | public static HttpResponse executePost(final String url,
final String basicAuthUsername,
final String basicAuthPassword,
final String entity) {
return executePost(url, basicAuthUserna... | [
"public",
"static",
"HttpResponse",
"executePost",
"(",
"final",
"String",
"url",
",",
"final",
"String",
"basicAuthUsername",
",",
"final",
"String",
"basicAuthPassword",
",",
"final",
"String",
"entity",
")",
"{",
"return",
"executePost",
"(",
"url",
",",
"bas... | Execute post http response.
@param url the url
@param basicAuthUsername the basic auth username
@param basicAuthPassword the basic auth password
@param entity the json entity
@return the http response | [
"Execute",
"post",
"http",
"response",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java#L309-L314 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FieldScopeUtil.java | FieldScopeUtil.fieldNumbersFunction | static Function<Optional<Descriptor>, String> fieldNumbersFunction(
final String fmt, final Iterable<Integer> fieldNumbers) {
"""
Returns a function which translates integer field numbers into field names using the Descriptor
if available.
@param fmt Format string that must contain exactly one '%s' and n... | java | static Function<Optional<Descriptor>, String> fieldNumbersFunction(
final String fmt, final Iterable<Integer> fieldNumbers) {
return new Function<Optional<Descriptor>, String>() {
@Override
public String apply(Optional<Descriptor> optDescriptor) {
return resolveFieldNumbers(optDescriptor, ... | [
"static",
"Function",
"<",
"Optional",
"<",
"Descriptor",
">",
",",
"String",
">",
"fieldNumbersFunction",
"(",
"final",
"String",
"fmt",
",",
"final",
"Iterable",
"<",
"Integer",
">",
"fieldNumbers",
")",
"{",
"return",
"new",
"Function",
"<",
"Optional",
"... | Returns a function which translates integer field numbers into field names using the Descriptor
if available.
@param fmt Format string that must contain exactly one '%s' and no other format parameters. | [
"Returns",
"a",
"function",
"which",
"translates",
"integer",
"field",
"numbers",
"into",
"field",
"names",
"using",
"the",
"Descriptor",
"if",
"available",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FieldScopeUtil.java#L36-L44 |
tvesalainen/util | util/src/main/java/org/vesalainen/bean/BeanHelper.java | BeanHelper.getAnnotation | public static final <T extends Annotation> T getAnnotation(Object bean, String property, Class<T> annotationClass) {
"""
Returns property annotation.
@param <T>
@param bean
@param property
@param annotationClass
@return
"""
return (T) doFor(
bean,
property,
... | java | public static final <T extends Annotation> T getAnnotation(Object bean, String property, Class<T> annotationClass)
{
return (T) doFor(
bean,
property,
null,
(Object a, int i)->{Object o=Array.get(a, i);return o!=null?o.getClass().getAnnotation(annotati... | [
"public",
"static",
"final",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"getAnnotation",
"(",
"Object",
"bean",
",",
"String",
"property",
",",
"Class",
"<",
"T",
">",
"annotationClass",
")",
"{",
"return",
"(",
"T",
")",
"doFor",
"(",
"bean",
",",
"... | Returns property annotation.
@param <T>
@param bean
@param property
@param annotationClass
@return | [
"Returns",
"property",
"annotation",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/bean/BeanHelper.java#L337-L347 |
CloudSlang/cs-actions | cs-commons/src/main/java/io/cloudslang/content/utils/NumberUtilities.java | NumberUtilities.isValidInt | public static boolean isValidInt(@Nullable final String integerStr, final int lowerBound, final int upperBound) {
"""
Given an integer string, it checks if it's a valid integer (base on apaches NumberUtils.createInteger) and if
it's between the lowerBound and upperBound (including the lowerBound and excluding the... | java | public static boolean isValidInt(@Nullable final String integerStr, final int lowerBound, final int upperBound) {
return isValidInt(integerStr, lowerBound, upperBound, true, false);
} | [
"public",
"static",
"boolean",
"isValidInt",
"(",
"@",
"Nullable",
"final",
"String",
"integerStr",
",",
"final",
"int",
"lowerBound",
",",
"final",
"int",
"upperBound",
")",
"{",
"return",
"isValidInt",
"(",
"integerStr",
",",
"lowerBound",
",",
"upperBound",
... | Given an integer string, it checks if it's a valid integer (base on apaches NumberUtils.createInteger) and if
it's between the lowerBound and upperBound (including the lowerBound and excluding the upperBound).
@param integerStr the integer string to check
@param lowerBound the lower bound of the interval
@param upperB... | [
"Given",
"an",
"integer",
"string",
"it",
"checks",
"if",
"it",
"s",
"a",
"valid",
"integer",
"(",
"base",
"on",
"apaches",
"NumberUtils",
".",
"createInteger",
")",
"and",
"if",
"it",
"s",
"between",
"the",
"lowerBound",
"and",
"upperBound",
"(",
"includi... | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-commons/src/main/java/io/cloudslang/content/utils/NumberUtilities.java#L130-L132 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/clustering/CBLOF.java | CBLOF.computeCBLOFs | private void computeCBLOFs(Relation<O> relation, NumberVectorDistanceFunction<? super O> distance, WritableDoubleDataStore cblofs, DoubleMinMax cblofMinMax, List<? extends Cluster<MeanModel>> largeClusters, List<? extends Cluster<MeanModel>> smallClusters) {
"""
Compute the CBLOF scores for all the data.
@param... | java | private void computeCBLOFs(Relation<O> relation, NumberVectorDistanceFunction<? super O> distance, WritableDoubleDataStore cblofs, DoubleMinMax cblofMinMax, List<? extends Cluster<MeanModel>> largeClusters, List<? extends Cluster<MeanModel>> smallClusters) {
List<NumberVector> largeClusterMeans = new ArrayList<>(la... | [
"private",
"void",
"computeCBLOFs",
"(",
"Relation",
"<",
"O",
">",
"relation",
",",
"NumberVectorDistanceFunction",
"<",
"?",
"super",
"O",
">",
"distance",
",",
"WritableDoubleDataStore",
"cblofs",
",",
"DoubleMinMax",
"cblofMinMax",
",",
"List",
"<",
"?",
"ex... | Compute the CBLOF scores for all the data.
@param relation Data to process
@param distance The distance function
@param cblofs CBLOF scores
@param cblofMinMax Minimum/maximum score tracker
@param largeClusters Large clusters output
@param smallClusters Small clusters output | [
"Compute",
"the",
"CBLOF",
"scores",
"for",
"all",
"the",
"data",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/clustering/CBLOF.java#L223-L242 |
mcaserta/spring-crypto-utils | src/main/java/com/springcryptoutils/core/cipher/symmetric/CiphererWithStaticKeyImpl.java | CiphererWithStaticKeyImpl.setInitializationVector | public void setInitializationVector(String initializationVector) {
"""
A base64 encoded representation of the raw byte array containing the
initialization vector.
@param initializationVector the initialization vector
@throws SymmetricEncryptionException on runtime errors
"""
try {
this.initialization... | java | public void setInitializationVector(String initializationVector) {
try {
this.initializationVectorSpec = new IvParameterSpec(Base64.decodeBase64(initializationVector.getBytes("UTF-8")));
} catch (UnsupportedEncodingException e) {
throw new SymmetricEncryptionException("UTF-8 is an unsupported encoding on this... | [
"public",
"void",
"setInitializationVector",
"(",
"String",
"initializationVector",
")",
"{",
"try",
"{",
"this",
".",
"initializationVectorSpec",
"=",
"new",
"IvParameterSpec",
"(",
"Base64",
".",
"decodeBase64",
"(",
"initializationVector",
".",
"getBytes",
"(",
"... | A base64 encoded representation of the raw byte array containing the
initialization vector.
@param initializationVector the initialization vector
@throws SymmetricEncryptionException on runtime errors | [
"A",
"base64",
"encoded",
"representation",
"of",
"the",
"raw",
"byte",
"array",
"containing",
"the",
"initialization",
"vector",
"."
] | train | https://github.com/mcaserta/spring-crypto-utils/blob/1dbf6211542fb1e3f9297941d691e7e89cc72c46/src/main/java/com/springcryptoutils/core/cipher/symmetric/CiphererWithStaticKeyImpl.java#L90-L96 |
actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/mailbox/Mailbox.java | Mailbox.scheduleOnce | public void scheduleOnce(Envelope envelope, long time) {
"""
Send envelope once at time
@param envelope envelope
@param time time
"""
if (envelope.getMailbox() != this) {
throw new RuntimeException("envelope.mailbox != this mailbox");
}
envelopes.putEnvelopeOnce(env... | java | public void scheduleOnce(Envelope envelope, long time) {
if (envelope.getMailbox() != this) {
throw new RuntimeException("envelope.mailbox != this mailbox");
}
envelopes.putEnvelopeOnce(envelope, time, comparator);
} | [
"public",
"void",
"scheduleOnce",
"(",
"Envelope",
"envelope",
",",
"long",
"time",
")",
"{",
"if",
"(",
"envelope",
".",
"getMailbox",
"(",
")",
"!=",
"this",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"envelope.mailbox != this mailbox\"",
")",
";",... | Send envelope once at time
@param envelope envelope
@param time time | [
"Send",
"envelope",
"once",
"at",
"time"
] | train | https://github.com/actorapp/droidkit-actors/blob/fdb72fcfdd1c5e54a970f203a33a71fa54344217/actors/src/main/java/com/droidkit/actors/mailbox/Mailbox.java#L50-L56 |
alkacon/opencms-core | src/org/opencms/db/CmsAliasManager.java | CmsAliasManager.hasPermissionsForMassEdit | public boolean hasPermissionsForMassEdit(CmsObject cms, String siteRoot) {
"""
Checks whether the current user has permissions for mass editing the alias table.<p>
@param cms the current CMS context
@param siteRoot the site root to check
@return true if the user from the CMS context is allowed to mass edit th... | java | public boolean hasPermissionsForMassEdit(CmsObject cms, String siteRoot) {
String originalSiteRoot = cms.getRequestContext().getSiteRoot();
try {
cms.getRequestContext().setSiteRoot(siteRoot);
return OpenCms.getRoleManager().hasRoleForResource(cms, CmsRole.ADMINISTRATOR, "/... | [
"public",
"boolean",
"hasPermissionsForMassEdit",
"(",
"CmsObject",
"cms",
",",
"String",
"siteRoot",
")",
"{",
"String",
"originalSiteRoot",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getSiteRoot",
"(",
")",
";",
"try",
"{",
"cms",
".",
"getRequest... | Checks whether the current user has permissions for mass editing the alias table.<p>
@param cms the current CMS context
@param siteRoot the site root to check
@return true if the user from the CMS context is allowed to mass edit the alias table | [
"Checks",
"whether",
"the",
"current",
"user",
"has",
"permissions",
"for",
"mass",
"editing",
"the",
"alias",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsAliasManager.java#L185-L195 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/crdt/CRDTReplicationMigrationService.java | CRDTReplicationMigrationService.onShutdown | @Override
public boolean onShutdown(long timeout, TimeUnit unit) {
"""
Attempts to replicate only the unreplicated CRDT state to any non-local
member in the cluster. The state may be unreplicated because the CRDT
state has been changed (via mutation or merge with an another CRDT) but
has not yet been dissem... | java | @Override
public boolean onShutdown(long timeout, TimeUnit unit) {
if (nodeEngine.getLocalMember().isLiteMember()) {
return true;
}
long timeoutNanos = unit.toNanos(timeout);
for (CRDTReplicationAwareService service : getReplicationServices()) {
service.prepar... | [
"@",
"Override",
"public",
"boolean",
"onShutdown",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"if",
"(",
"nodeEngine",
".",
"getLocalMember",
"(",
")",
".",
"isLiteMember",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"long",
"timeout... | Attempts to replicate only the unreplicated CRDT state to any non-local
member in the cluster. The state may be unreplicated because the CRDT
state has been changed (via mutation or merge with an another CRDT) but
has not yet been disseminated through the usual replication mechanism
to any member.
This method will iter... | [
"Attempts",
"to",
"replicate",
"only",
"the",
"unreplicated",
"CRDT",
"state",
"to",
"any",
"non",
"-",
"local",
"member",
"in",
"the",
"cluster",
".",
"The",
"state",
"may",
"be",
"unreplicated",
"because",
"the",
"CRDT",
"state",
"has",
"been",
"changed",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/crdt/CRDTReplicationMigrationService.java#L125-L149 |
UrielCh/ovh-java-sdk | ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java | ApiOvhHorizonView.serviceName_domainTrust_domainTrustId_addChildDomain_POST | public OvhTask serviceName_domainTrust_domainTrustId_addChildDomain_POST(String serviceName, Long domainTrustId, String activeDirectoryIP, String domain, String passphrase, String serviceAccountPassword) throws IOException {
"""
Add a child domain for this domain.
REST: POST /horizonView/{serviceName}/domainTru... | java | public OvhTask serviceName_domainTrust_domainTrustId_addChildDomain_POST(String serviceName, Long domainTrustId, String activeDirectoryIP, String domain, String passphrase, String serviceAccountPassword) throws IOException {
String qPath = "/horizonView/{serviceName}/domainTrust/{domainTrustId}/addChildDomain";
Str... | [
"public",
"OvhTask",
"serviceName_domainTrust_domainTrustId_addChildDomain_POST",
"(",
"String",
"serviceName",
",",
"Long",
"domainTrustId",
",",
"String",
"activeDirectoryIP",
",",
"String",
"domain",
",",
"String",
"passphrase",
",",
"String",
"serviceAccountPassword",
"... | Add a child domain for this domain.
REST: POST /horizonView/{serviceName}/domainTrust/{domainTrustId}/addChildDomain
@param domain [required] Name of your private domain
@param serviceAccountPassword [required] Password of the horizonUI service account
@param activeDirectoryIP [required] IP of your Active Directory
@p... | [
"Add",
"a",
"child",
"domain",
"for",
"this",
"domain",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java#L273-L283 |
weld/core | impl/src/main/java/org/jboss/weld/contexts/unbound/DependentContextImpl.java | DependentContextImpl.get | public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
"""
Overridden method always creating a new instance
@param contextual The bean to create
@param creationalContext The creation context
"""
if (!isActive()) {
throw new ContextNotActiveException();
... | java | public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
if (!isActive()) {
throw new ContextNotActiveException();
}
if (creationalContext != null) {
T instance = contextual.create(creationalContext);
if (creationalContext instanceo... | [
"public",
"<",
"T",
">",
"T",
"get",
"(",
"Contextual",
"<",
"T",
">",
"contextual",
",",
"CreationalContext",
"<",
"T",
">",
"creationalContext",
")",
"{",
"if",
"(",
"!",
"isActive",
"(",
")",
")",
"{",
"throw",
"new",
"ContextNotActiveException",
"(",... | Overridden method always creating a new instance
@param contextual The bean to create
@param creationalContext The creation context | [
"Overridden",
"method",
"always",
"creating",
"a",
"new",
"instance"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/contexts/unbound/DependentContextImpl.java#L65-L78 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/CalendarAstronomer.java | CalendarAstronomer.trueAnomaly | private double trueAnomaly(double meanAnomaly, double eccentricity) {
"""
Find the "true anomaly" (longitude) of an object from
its mean anomaly and the eccentricity of its orbit. This uses
an iterative solution to Kepler's equation.
@param meanAnomaly The object's longitude calculated as if it were in
a ... | java | private double trueAnomaly(double meanAnomaly, double eccentricity)
{
// First, solve Kepler's equation iteratively
// Duffett-Smith, p.90
double delta;
double E = meanAnomaly;
do {
delta = E - eccentricity * Math.sin(E) - meanAnomaly;
E = E - delta / ... | [
"private",
"double",
"trueAnomaly",
"(",
"double",
"meanAnomaly",
",",
"double",
"eccentricity",
")",
"{",
"// First, solve Kepler's equation iteratively",
"// Duffett-Smith, p.90",
"double",
"delta",
";",
"double",
"E",
"=",
"meanAnomaly",
";",
"do",
"{",
"delta",
"=... | Find the "true anomaly" (longitude) of an object from
its mean anomaly and the eccentricity of its orbit. This uses
an iterative solution to Kepler's equation.
@param meanAnomaly The object's longitude calculated as if it were in
a regular, circular orbit, measured in radians
from the point of perigee.
@param ecce... | [
"Find",
"the",
"true",
"anomaly",
"(",
"longitude",
")",
"of",
"an",
"object",
"from",
"its",
"mean",
"anomaly",
"and",
"the",
"eccentricity",
"of",
"its",
"orbit",
".",
"This",
"uses",
"an",
"iterative",
"solution",
"to",
"Kepler",
"s",
"equation",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/CalendarAstronomer.java#L1369-L1383 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.isNumericTensor | public SDVariable isNumericTensor(String name, SDVariable x) {
"""
Is the director a numeric tensor? In the current version of ND4J/SameDiff, this always returns true/1
@param name Output variable name
@param x Input variable
@return Scalar variable with value 1
"""
SDVariable result = f().isNu... | java | public SDVariable isNumericTensor(String name, SDVariable x) {
SDVariable result = f().isNumericTensor(x);
return updateVariableNameAndReference(result, name);
} | [
"public",
"SDVariable",
"isNumericTensor",
"(",
"String",
"name",
",",
"SDVariable",
"x",
")",
"{",
"SDVariable",
"result",
"=",
"f",
"(",
")",
".",
"isNumericTensor",
"(",
"x",
")",
";",
"return",
"updateVariableNameAndReference",
"(",
"result",
",",
"name",
... | Is the director a numeric tensor? In the current version of ND4J/SameDiff, this always returns true/1
@param name Output variable name
@param x Input variable
@return Scalar variable with value 1 | [
"Is",
"the",
"director",
"a",
"numeric",
"tensor?",
"In",
"the",
"current",
"version",
"of",
"ND4J",
"/",
"SameDiff",
"this",
"always",
"returns",
"true",
"/",
"1"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L797-L800 |
azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java | HadoopConfigurationInjector.getConfFile | public static File getConfFile(Props props, String workingDir, String fileName) {
"""
Resolve the location of the file containing the configuration file.
@param props The Azkaban properties
@param workingDir The Azkaban job working directory
@param fileName The desired configuration file name
"""
File... | java | public static File getConfFile(Props props, String workingDir, String fileName) {
File jobDir = new File(workingDir, getDirName(props));
if (!jobDir.exists()) {
jobDir.mkdir();
}
return new File(jobDir, fileName);
} | [
"public",
"static",
"File",
"getConfFile",
"(",
"Props",
"props",
",",
"String",
"workingDir",
",",
"String",
"fileName",
")",
"{",
"File",
"jobDir",
"=",
"new",
"File",
"(",
"workingDir",
",",
"getDirName",
"(",
"props",
")",
")",
";",
"if",
"(",
"!",
... | Resolve the location of the file containing the configuration file.
@param props The Azkaban properties
@param workingDir The Azkaban job working directory
@param fileName The desired configuration file name | [
"Resolve",
"the",
"location",
"of",
"the",
"file",
"containing",
"the",
"configuration",
"file",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java#L154-L160 |
samskivert/samskivert | src/main/java/com/samskivert/swing/util/MenuUtil.java | MenuUtil.addMenuItem | public static JMenuItem addMenuItem (
ActionListener l, JMenu menu, String name) {
"""
Adds a new menu item to the menu with the specified name.
@param l the action listener.
@param menu the menu to add the item to.
@param name the item name.
@return the new menu item.
"""
return addMen... | java | public static JMenuItem addMenuItem (
ActionListener l, JMenu menu, String name)
{
return addMenuItem(l, menu, name, null, null);
} | [
"public",
"static",
"JMenuItem",
"addMenuItem",
"(",
"ActionListener",
"l",
",",
"JMenu",
"menu",
",",
"String",
"name",
")",
"{",
"return",
"addMenuItem",
"(",
"l",
",",
"menu",
",",
"name",
",",
"null",
",",
"null",
")",
";",
"}"
] | Adds a new menu item to the menu with the specified name.
@param l the action listener.
@param menu the menu to add the item to.
@param name the item name.
@return the new menu item. | [
"Adds",
"a",
"new",
"menu",
"item",
"to",
"the",
"menu",
"with",
"the",
"specified",
"name",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/MenuUtil.java#L99-L103 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/KeyRange.java | KeyRange.openOpen | public static KeyRange openOpen(Key start, Key end) {
"""
Returns a key range from {@code start} exclusive to {@code end} exclusive.
"""
return new KeyRange(checkNotNull(start), Endpoint.OPEN, checkNotNull(end), Endpoint.OPEN);
} | java | public static KeyRange openOpen(Key start, Key end) {
return new KeyRange(checkNotNull(start), Endpoint.OPEN, checkNotNull(end), Endpoint.OPEN);
} | [
"public",
"static",
"KeyRange",
"openOpen",
"(",
"Key",
"start",
",",
"Key",
"end",
")",
"{",
"return",
"new",
"KeyRange",
"(",
"checkNotNull",
"(",
"start",
")",
",",
"Endpoint",
".",
"OPEN",
",",
"checkNotNull",
"(",
"end",
")",
",",
"Endpoint",
".",
... | Returns a key range from {@code start} exclusive to {@code end} exclusive. | [
"Returns",
"a",
"key",
"range",
"from",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/KeyRange.java#L162-L164 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/util/SymbolTable.java | SymbolTable.calcHash | @SuppressWarnings("cast")
public static int calcHash(char[] buffer, int start, int len) {
"""
Implementation of a hashing method for variable length
Strings. Most of the time intention is that this calculation
is done by caller during parsing, not here; however, sometimes
it needs to be done for parsed "Str... | java | @SuppressWarnings("cast")
public static int calcHash(char[] buffer, int start, int len) {
int hash = (int) buffer[start];
for (int i = 1; i < len; ++i) {
hash = (hash * 31) + (int) buffer[start+i];
}
return hash;
} | [
"@",
"SuppressWarnings",
"(",
"\"cast\"",
")",
"public",
"static",
"int",
"calcHash",
"(",
"char",
"[",
"]",
"buffer",
",",
"int",
"start",
",",
"int",
"len",
")",
"{",
"int",
"hash",
"=",
"(",
"int",
")",
"buffer",
"[",
"start",
"]",
";",
"for",
"... | Implementation of a hashing method for variable length
Strings. Most of the time intention is that this calculation
is done by caller during parsing, not here; however, sometimes
it needs to be done for parsed "String" too.
@param len Length of String; has to be at least 1 (caller guarantees
this pre-condition) | [
"Implementation",
"of",
"a",
"hashing",
"method",
"for",
"variable",
"length",
"Strings",
".",
"Most",
"of",
"the",
"time",
"intention",
"is",
"that",
"this",
"calculation",
"is",
"done",
"by",
"caller",
"during",
"parsing",
"not",
"here",
";",
"however",
"s... | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/SymbolTable.java#L558-L565 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.buildSelectExplorerFileEntries | public String buildSelectExplorerFileEntries(String htmlAttributes) {
"""
Builds the html for the explorer number of entries per page select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the explorer number of entries per page select box
"""
... | java | public String buildSelectExplorerFileEntries(String htmlAttributes) {
String emptyOption = OpenCms.getWorkplaceManager().getDefaultUserSettings().getExplorerFileEntryOptions();
if (CmsStringUtil.isEmptyOrWhitespaceOnly(emptyOption)) {
emptyOption = "50,100,200,300,400,500";
}
... | [
"public",
"String",
"buildSelectExplorerFileEntries",
"(",
"String",
"htmlAttributes",
")",
"{",
"String",
"emptyOption",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getDefaultUserSettings",
"(",
")",
".",
"getExplorerFileEntryOptions",
"(",
")",
";",
... | Builds the html for the explorer number of entries per page select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the explorer number of entries per page select box | [
"Builds",
"the",
"html",
"for",
"the",
"explorer",
"number",
"of",
"entries",
"per",
"page",
"select",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L681-L705 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.toXml | @Deprecated
public String toXml(int spaces, boolean declaration, String... attributeNames) {
"""
Generates a XML document from content of this model.
@param spaces by how many spaces to indent.
@param declaration true to include XML declaration at the top
@param attributeNames list of attributes to includ... | java | @Deprecated
public String toXml(int spaces, boolean declaration, String... attributeNames) {
return toXml(spaces > 0, declaration, attributeNames);
} | [
"@",
"Deprecated",
"public",
"String",
"toXml",
"(",
"int",
"spaces",
",",
"boolean",
"declaration",
",",
"String",
"...",
"attributeNames",
")",
"{",
"return",
"toXml",
"(",
"spaces",
">",
"0",
",",
"declaration",
",",
"attributeNames",
")",
";",
"}"
] | Generates a XML document from content of this model.
@param spaces by how many spaces to indent.
@param declaration true to include XML declaration at the top
@param attributeNames list of attributes to include. No arguments == include all attributes.
@return generated XML.
@deprecated use {@link #toXml(boolean, bool... | [
"Generates",
"a",
"XML",
"document",
"from",
"content",
"of",
"this",
"model",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L1021-L1024 |
datacleaner/AnalyzerBeans | env/berkeleydb/src/main/java/org/eobjects/analyzer/storage/BerkeleyDbStorageProvider.java | BerkeleyDbStorageProvider.cleanDirectory | public void cleanDirectory() {
"""
Cleans the parent directory of this storage provider. This action will
delete all previous collection storages made in this directory, and thus
it should only be invoked either before any collections has been made or
when all collections are ensured to be unused.
"""
Fil... | java | public void cleanDirectory() {
File[] directories = _parentDirectory.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.startsWith(DIRECTORY_PREFIX);
}
});
for (File directory : directories) {
delete(directory);
}
} | [
"public",
"void",
"cleanDirectory",
"(",
")",
"{",
"File",
"[",
"]",
"directories",
"=",
"_parentDirectory",
".",
"listFiles",
"(",
"new",
"FilenameFilter",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"File",
"dir",
",",
"String",
"... | Cleans the parent directory of this storage provider. This action will
delete all previous collection storages made in this directory, and thus
it should only be invoked either before any collections has been made or
when all collections are ensured to be unused. | [
"Cleans",
"the",
"parent",
"directory",
"of",
"this",
"storage",
"provider",
".",
"This",
"action",
"will",
"delete",
"all",
"previous",
"collection",
"storages",
"made",
"in",
"this",
"directory",
"and",
"thus",
"it",
"should",
"only",
"be",
"invoked",
"eithe... | train | https://github.com/datacleaner/AnalyzerBeans/blob/f82dae080d80d2a647b706a5fb22b3ea250613b3/env/berkeleydb/src/main/java/org/eobjects/analyzer/storage/BerkeleyDbStorageProvider.java#L94-L104 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java | TrackerMeanShiftComaniciu2003.initialize | public void initialize( T image , RectangleRotate_F32 initial ) {
"""
Specifies the initial image to learn the target description
@param image Image
@param initial Initial image which contains the target
"""
this.region.set(initial);
calcHistogram.computeHistogram(image,initial);
System.arraycopy(calcH... | java | public void initialize( T image , RectangleRotate_F32 initial ) {
this.region.set(initial);
calcHistogram.computeHistogram(image,initial);
System.arraycopy(calcHistogram.getHistogram(),0,keyHistogram,0,keyHistogram.length);
this.minimumWidth = initial.width*minimumSizeRatio;
} | [
"public",
"void",
"initialize",
"(",
"T",
"image",
",",
"RectangleRotate_F32",
"initial",
")",
"{",
"this",
".",
"region",
".",
"set",
"(",
"initial",
")",
";",
"calcHistogram",
".",
"computeHistogram",
"(",
"image",
",",
"initial",
")",
";",
"System",
"."... | Specifies the initial image to learn the target description
@param image Image
@param initial Initial image which contains the target | [
"Specifies",
"the",
"initial",
"image",
"to",
"learn",
"the",
"target",
"description"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java#L141-L147 |
johnkil/Android-RobotoTextView | robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java | RobotoTypefaces.setUpTypeface | public static void setUpTypeface(@NonNull TextView textView, @NonNull Context context, @Nullable AttributeSet attrs) {
"""
Set up typeface for TextView from the attributes.
@param textView The roboto text view
@param context The context the widget is running in, through which it can
access the current theme,... | java | public static void setUpTypeface(@NonNull TextView textView, @NonNull Context context, @Nullable AttributeSet attrs) {
Typeface typeface;
if (attrs != null) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView);
try {
typeface = obtain... | [
"public",
"static",
"void",
"setUpTypeface",
"(",
"@",
"NonNull",
"TextView",
"textView",
",",
"@",
"NonNull",
"Context",
"context",
",",
"@",
"Nullable",
"AttributeSet",
"attrs",
")",
"{",
"Typeface",
"typeface",
";",
"if",
"(",
"attrs",
"!=",
"null",
")",
... | Set up typeface for TextView from the attributes.
@param textView The roboto text view
@param context The context the widget is running in, through which it can
access the current theme, resources, etc.
@param attrs The attributes of the XML tag that is inflating the widget. | [
"Set",
"up",
"typeface",
"for",
"TextView",
"from",
"the",
"attributes",
"."
] | train | https://github.com/johnkil/Android-RobotoTextView/blob/1341602f16c08057dddd193411e7dab96f963b77/robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java#L504-L517 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/CalendarPanel.java | CalendarPanel.addWeekdayLabels | private void addWeekdayLabels() {
"""
addWeekdayLabels, This adds a set of 7 weekday labels to the calendar panel. The text of
these labels is set with locale sensitive weekday names each time that the calendar is
redrawn.
This function should not depend on any settings variables.
"""
weekdayLabel... | java | private void addWeekdayLabels() {
weekdayLabels = new ArrayList<JLabel>();
int weekdayLabelRowY = constantFirstWeekdayLabelCell.y;
int weekdayLabelWidthInCells = 1;
int weekdayLabelHeightInCells = 3;
for (int i = 0; i < 7; ++i) {
int weekdayLabelColumnX = (i + constan... | [
"private",
"void",
"addWeekdayLabels",
"(",
")",
"{",
"weekdayLabels",
"=",
"new",
"ArrayList",
"<",
"JLabel",
">",
"(",
")",
";",
"int",
"weekdayLabelRowY",
"=",
"constantFirstWeekdayLabelCell",
".",
"y",
";",
"int",
"weekdayLabelWidthInCells",
"=",
"1",
";",
... | addWeekdayLabels, This adds a set of 7 weekday labels to the calendar panel. The text of
these labels is set with locale sensitive weekday names each time that the calendar is
redrawn.
This function should not depend on any settings variables. | [
"addWeekdayLabels",
"This",
"adds",
"a",
"set",
"of",
"7",
"weekday",
"labels",
"to",
"the",
"calendar",
"panel",
".",
"The",
"text",
"of",
"these",
"labels",
"is",
"set",
"with",
"locale",
"sensitive",
"weekday",
"names",
"each",
"time",
"that",
"the",
"c... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/CalendarPanel.java#L417-L435 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/RegularFile.java | RegularFile.copyBlocksTo | void copyBlocksTo(RegularFile target, int count) {
"""
Copies the last {@code count} blocks from this file to the end of the given target file.
"""
int start = blockCount - count;
int targetEnd = target.blockCount + count;
target.expandIfNecessary(targetEnd);
System.arraycopy(this.blocks, star... | java | void copyBlocksTo(RegularFile target, int count) {
int start = blockCount - count;
int targetEnd = target.blockCount + count;
target.expandIfNecessary(targetEnd);
System.arraycopy(this.blocks, start, target.blocks, target.blockCount, count);
target.blockCount = targetEnd;
} | [
"void",
"copyBlocksTo",
"(",
"RegularFile",
"target",
",",
"int",
"count",
")",
"{",
"int",
"start",
"=",
"blockCount",
"-",
"count",
";",
"int",
"targetEnd",
"=",
"target",
".",
"blockCount",
"+",
"count",
";",
"target",
".",
"expandIfNecessary",
"(",
"ta... | Copies the last {@code count} blocks from this file to the end of the given target file. | [
"Copies",
"the",
"last",
"{"
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L97-L104 |
bbottema/simple-java-mail | modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageHelper.java | MimeMessageHelper.setHeaders | static void setHeaders(final Email email, final Message message)
throws UnsupportedEncodingException, MessagingException {
"""
Sets all headers on the {@link Message} instance. Since we're not using a high-level JavaMail method, the JavaMail library says we need to do
some encoding and 'folding' manually, to g... | java | static void setHeaders(final Email email, final Message message)
throws UnsupportedEncodingException, MessagingException {
// add headers (for raw message headers we need to 'fold' them using MimeUtility
for (final Map.Entry<String, String> header : email.getHeaders().entrySet()) {
final String headerName = h... | [
"static",
"void",
"setHeaders",
"(",
"final",
"Email",
"email",
",",
"final",
"Message",
"message",
")",
"throws",
"UnsupportedEncodingException",
",",
"MessagingException",
"{",
"// add headers (for raw message headers we need to 'fold' them using MimeUtility",
"for",
"(",
"... | Sets all headers on the {@link Message} instance. Since we're not using a high-level JavaMail method, the JavaMail library says we need to do
some encoding and 'folding' manually, to get the value right for the headers (see {@link MimeUtility}.
<p>
Furthermore sets the notification flags <code>Disposition-Notification-... | [
"Sets",
"all",
"headers",
"on",
"the",
"{",
"@link",
"Message",
"}",
"instance",
".",
"Since",
"we",
"re",
"not",
"using",
"a",
"high",
"-",
"level",
"JavaMail",
"method",
"the",
"JavaMail",
"library",
"says",
"we",
"need",
"to",
"do",
"some",
"encoding"... | train | https://github.com/bbottema/simple-java-mail/blob/b03635328aeecd525e35eddfef8f5b9a184559d8/modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageHelper.java#L193-L214 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/values/JcCollection.java | JcCollection.get | @SuppressWarnings("unchecked")
public T get(int index) {
"""
<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>access the element of the collection at the given index, return a <b>JcProperty</b></i></div>
<br/>
"""
T r... | java | @SuppressWarnings("unchecked")
public T get(int index) {
T ret;
if (JcRelation.class.equals(type)) {
ret = (T) new JcRelation(null, this, OPERATOR.Collection.GET);
} else if (JcNode.class.equals(type)) {
ret = (T) new JcNode(null, this, OPERATOR.Collection.GET);
} else {
ret = (T) new JcValue(null, th... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"get",
"(",
"int",
"index",
")",
"{",
"T",
"ret",
";",
"if",
"(",
"JcRelation",
".",
"class",
".",
"equals",
"(",
"type",
")",
")",
"{",
"ret",
"=",
"(",
"T",
")",
"new",
"JcRelatio... | <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>access the element of the collection at the given index, return a <b>JcProperty</b></i></div>
<br/> | [
"<div",
"color",
"=",
"red",
"style",
"=",
"font",
"-",
"size",
":",
"24px",
";",
"color",
":",
"red",
">",
"<b",
">",
"<i",
">",
"<u",
">",
"JCYPHER<",
"/",
"u",
">",
"<",
"/",
"i",
">",
"<",
"/",
"b",
">",
"<",
"/",
"div",
">",
"<div",
... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/JcCollection.java#L111-L124 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java | SdkUtils.concatStringWithDelimiter | public static String concatStringWithDelimiter(String[] strings, String delimiter) {
"""
Utility method to create a large String with the given delimiter.
@param strings Strings to concatenate.
@param delimiter The delimiter to use to put between each string item.
@return a large string with all items separ... | java | public static String concatStringWithDelimiter(String[] strings, String delimiter) {
StringBuilder sbr = new StringBuilder();
int size = strings.length;
for (int i = 0; i < size - 1; i++) {
sbr.append(strings[i]).append(delimiter);
}
sbr.append(strings[size - 1]);
... | [
"public",
"static",
"String",
"concatStringWithDelimiter",
"(",
"String",
"[",
"]",
"strings",
",",
"String",
"delimiter",
")",
"{",
"StringBuilder",
"sbr",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"size",
"=",
"strings",
".",
"length",
";",
"for",... | Utility method to create a large String with the given delimiter.
@param strings Strings to concatenate.
@param delimiter The delimiter to use to put between each string item.
@return a large string with all items separated by given delimiter. | [
"Utility",
"method",
"to",
"create",
"a",
"large",
"String",
"with",
"the",
"given",
"delimiter",
"."
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L290-L298 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/searchindex/CmsSearchIndexList.java | CmsSearchIndexList.fillDetailIndexSource | private void fillDetailIndexSource(CmsListItem item, String detailId) {
"""
Fills details of the index source into the given item. <p>
@param item the list item to fill
@param detailId the id for the detail to fill
"""
StringBuffer html = new StringBuffer();
// search for the corresponding... | java | private void fillDetailIndexSource(CmsListItem item, String detailId) {
StringBuffer html = new StringBuffer();
// search for the corresponding A_CmsSearchIndex:
I_CmsSearchIndex idx = OpenCms.getSearchManager().getIndex((String)item.get(LIST_COLUMN_NAME));
html.append("<ul>\n");
... | [
"private",
"void",
"fillDetailIndexSource",
"(",
"CmsListItem",
"item",
",",
"String",
"detailId",
")",
"{",
"StringBuffer",
"html",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"// search for the corresponding A_CmsSearchIndex:",
"I_CmsSearchIndex",
"idx",
"=",
"OpenCms"... | Fills details of the index source into the given item. <p>
@param item the list item to fill
@param detailId the id for the detail to fill | [
"Fills",
"details",
"of",
"the",
"index",
"source",
"into",
"the",
"given",
"item",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/searchindex/CmsSearchIndexList.java#L641-L682 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionLoader.java | MapTileCollisionLoader.loadCollisionGroups | private void loadCollisionGroups(MapTileCollision mapCollision, Media groupsConfig) {
"""
Load the collision groups. All previous groups will be cleared.
@param mapCollision The map tile collision owner.
@param groupsConfig The configuration collision groups file.
"""
Verbose.info(INFO_LOAD_GROUPS... | java | private void loadCollisionGroups(MapTileCollision mapCollision, Media groupsConfig)
{
Verbose.info(INFO_LOAD_GROUPS, groupsConfig.getFile().getPath());
this.groupsConfig = groupsConfig;
final Xml nodeGroups = new Xml(groupsConfig);
final CollisionGroupConfig config = Collision... | [
"private",
"void",
"loadCollisionGroups",
"(",
"MapTileCollision",
"mapCollision",
",",
"Media",
"groupsConfig",
")",
"{",
"Verbose",
".",
"info",
"(",
"INFO_LOAD_GROUPS",
",",
"groupsConfig",
".",
"getFile",
"(",
")",
".",
"getPath",
"(",
")",
")",
";",
"this... | Load the collision groups. All previous groups will be cleared.
@param mapCollision The map tile collision owner.
@param groupsConfig The configuration collision groups file. | [
"Load",
"the",
"collision",
"groups",
".",
"All",
"previous",
"groups",
"will",
"be",
"cleared",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionLoader.java#L217-L225 |
jenkinsci/jenkins | core/src/main/java/jenkins/scm/SCMCheckoutStrategy.java | SCMCheckoutStrategy.preCheckout | public void preCheckout(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {
"""
Performs the pre checkout step.
This method is called by the {@link Executor} that's carrying out the build.
@param build
Build being in progress. Never null.
@param l... | java | public void preCheckout(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {
AbstractProject<?, ?> project = build.getProject();
if (project instanceof BuildableItemWithBuildWrappers) {
BuildableItemWithBuildWrappers biwbw = (Buil... | [
"public",
"void",
"preCheckout",
"(",
"AbstractBuild",
"<",
"?",
",",
"?",
">",
"build",
",",
"Launcher",
"launcher",
",",
"BuildListener",
"listener",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"AbstractProject",
"<",
"?",
",",
"?",
">",
... | Performs the pre checkout step.
This method is called by the {@link Executor} that's carrying out the build.
@param build
Build being in progress. Never null.
@param launcher
Allows you to launch process on the node where the build is actually running. Never null.
@param listener
Allows you to write to console output... | [
"Performs",
"the",
"pre",
"checkout",
"step",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/scm/SCMCheckoutStrategy.java#L71-L78 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerHandlerImpl.java | TransformerHandlerImpl.elementDecl | public void elementDecl(String name, String model) throws SAXException {
"""
Report an element type declaration.
<p>The content model will consist of the string "EMPTY", the
string "ANY", or a parenthesised group, optionally followed
by an occurrence indicator. The model will be normalized so
that all white... | java | public void elementDecl(String name, String model) throws SAXException
{
if (DEBUG)
System.out.println("TransformerHandlerImpl#elementDecl: " + name + ", "
+ model);
if (null != m_declHandler)
{
m_declHandler.elementDecl(name, model);
}
} | [
"public",
"void",
"elementDecl",
"(",
"String",
"name",
",",
"String",
"model",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"DEBUG",
")",
"System",
".",
"out",
".",
"println",
"(",
"\"TransformerHandlerImpl#elementDecl: \"",
"+",
"name",
"+",
"\", \"",
"+",... | Report an element type declaration.
<p>The content model will consist of the string "EMPTY", the
string "ANY", or a parenthesised group, optionally followed
by an occurrence indicator. The model will be normalized so
that all whitespace is removed,and will include the enclosing
parentheses.</p>
@param name The eleme... | [
"Report",
"an",
"element",
"type",
"declaration",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerHandlerImpl.java#L935-L946 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/URLMatchingUtils.java | URLMatchingUtils.getLongestUrlPattern | public static String getLongestUrlPattern(String firstUrlPattern, String secondUrlPattern) {
"""
Determine the longest URL pattern.
@param firstUrlPattern
@param secondUrlPattern
@return the longest url pattern
"""
if (secondUrlPattern == null || (firstUrlPattern != null &&
firstUrlPat... | java | public static String getLongestUrlPattern(String firstUrlPattern, String secondUrlPattern) {
if (secondUrlPattern == null || (firstUrlPattern != null &&
firstUrlPattern.length() >= secondUrlPattern.length())) {
return firstUrlPattern;
} else {
return secondUrlPattern;... | [
"public",
"static",
"String",
"getLongestUrlPattern",
"(",
"String",
"firstUrlPattern",
",",
"String",
"secondUrlPattern",
")",
"{",
"if",
"(",
"secondUrlPattern",
"==",
"null",
"||",
"(",
"firstUrlPattern",
"!=",
"null",
"&&",
"firstUrlPattern",
".",
"length",
"(... | Determine the longest URL pattern.
@param firstUrlPattern
@param secondUrlPattern
@return the longest url pattern | [
"Determine",
"the",
"longest",
"URL",
"pattern",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/URLMatchingUtils.java#L27-L34 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java | ManagedClustersInner.createOrUpdate | public ManagedClusterInner createOrUpdate(String resourceGroupName, String resourceName, ManagedClusterInner parameters) {
"""
Creates or updates a managed cluster.
Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version.
@param resourceGroupName The name of the ... | java | public ManagedClusterInner createOrUpdate(String resourceGroupName, String resourceName, ManagedClusterInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().last().body();
} | [
"public",
"ManagedClusterInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ManagedClusterInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",",
... | Creates or updates a managed cluster.
Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param parameters Parameters supplied to the Create or Up... | [
"Creates",
"or",
"updates",
"a",
"managed",
"cluster",
".",
"Creates",
"or",
"updates",
"a",
"managed",
"cluster",
"with",
"the",
"specified",
"configuration",
"for",
"agents",
"and",
"Kubernetes",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java#L634-L636 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/preview/util/CmsRectangle.java | CmsRectangle.constrainNum | private static double constrainNum(double min, double size, double h) {
"""
Helper method to constrain a number inside a given interval.<p>
If the number is inside the given range, it will be returned unchanged, otherwise either the maximum
or minimum of the range is returned depending on on which side the val... | java | private static double constrainNum(double min, double size, double h) {
if (h < min) {
return min;
}
if (h >= (min + size)) {
return (min + size) - 1;
}
return h;
} | [
"private",
"static",
"double",
"constrainNum",
"(",
"double",
"min",
",",
"double",
"size",
",",
"double",
"h",
")",
"{",
"if",
"(",
"h",
"<",
"min",
")",
"{",
"return",
"min",
";",
"}",
"if",
"(",
"h",
">=",
"(",
"min",
"+",
"size",
")",
")",
... | Helper method to constrain a number inside a given interval.<p>
If the number is inside the given range, it will be returned unchanged, otherwise either the maximum
or minimum of the range is returned depending on on which side the value lies.
@param min the minimum value
@param size the difference between maximum an... | [
"Helper",
"method",
"to",
"constrain",
"a",
"number",
"inside",
"a",
"given",
"interval",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/util/CmsRectangle.java#L105-L114 |
Wikidata/Wikidata-Toolkit | wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/StatementUpdate.java | StatementUpdate.performEdit | public StatementDocument performEdit(WbEditingAction action, boolean editAsBot, String summary)
throws IOException, MediaWikiApiErrorException {
"""
Performs the update, selecting the appropriate API action depending on
the nature of the change.
@return the new document after update with the API
@throws Me... | java | public StatementDocument performEdit(WbEditingAction action, boolean editAsBot, String summary)
throws IOException, MediaWikiApiErrorException {
if (isEmptyEdit()) {
return currentDocument;
} else if (toDelete.isEmpty() && getUpdatedStatements().size() == 1) {
// we can use "wbsetclaim" because we only hav... | [
"public",
"StatementDocument",
"performEdit",
"(",
"WbEditingAction",
"action",
",",
"boolean",
"editAsBot",
",",
"String",
"summary",
")",
"throws",
"IOException",
",",
"MediaWikiApiErrorException",
"{",
"if",
"(",
"isEmptyEdit",
"(",
")",
")",
"{",
"return",
"cu... | Performs the update, selecting the appropriate API action depending on
the nature of the change.
@return the new document after update with the API
@throws MediaWikiApiErrorException
@throws IOException | [
"Performs",
"the",
"update",
"selecting",
"the",
"appropriate",
"API",
"action",
"depending",
"on",
"the",
"nature",
"of",
"the",
"change",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/StatementUpdate.java#L208-L245 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.listRecipients | public Recipients listRecipients(String accountId, String envelopeId) throws ApiException {
"""
Gets the status of recipients for an envelope.
Retrieves the status of all recipients in a single envelope and identifies the current recipient in the routing list. The `currentRoutingOrder` property of the... | java | public Recipients listRecipients(String accountId, String envelopeId) throws ApiException {
return listRecipients(accountId, envelopeId, null);
} | [
"public",
"Recipients",
"listRecipients",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
")",
"throws",
"ApiException",
"{",
"return",
"listRecipients",
"(",
"accountId",
",",
"envelopeId",
",",
"null",
")",
";",
"}"
] | Gets the status of recipients for an envelope.
Retrieves the status of all recipients in a single envelope and identifies the current recipient in the routing list. The `currentRoutingOrder` property of the response contains the `routingOrder` value of the current recipient indicating that the env... | [
"Gets",
"the",
"status",
"of",
"recipients",
"for",
"an",
"envelope",
".",
"Retrieves",
"the",
"status",
"of",
"all",
"recipients",
"in",
"a",
"single",
"envelope",
"and",
"identifies",
"the",
"current",
"recipient",
"in",
"the",
"routing",
"list",
".",
"The... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L3736-L3738 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WPanelRenderer.java | WPanelRenderer.renderChildren | private void renderChildren(final WPanel panel, final WebXmlRenderContext renderContext) {
"""
Paints the children contained within the panel. This defers rendering to a layout renderer (if available).
@param panel the panel to paint.
@param renderContext the RenderContext to paint to.
"""
LayoutManager ... | java | private void renderChildren(final WPanel panel, final WebXmlRenderContext renderContext) {
LayoutManager layout = panel.getLayout();
Renderer layoutRenderer = null;
if (layout != null) {
layoutRenderer = new RendererFactoryImpl().getRenderer(layout.getClass());
}
if (layoutRenderer == null) {
renderCo... | [
"private",
"void",
"renderChildren",
"(",
"final",
"WPanel",
"panel",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"LayoutManager",
"layout",
"=",
"panel",
".",
"getLayout",
"(",
")",
";",
"Renderer",
"layoutRenderer",
"=",
"null",
";",
"if",
... | Paints the children contained within the panel. This defers rendering to a layout renderer (if available).
@param panel the panel to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"children",
"contained",
"within",
"the",
"panel",
".",
"This",
"defers",
"rendering",
"to",
"a",
"layout",
"renderer",
"(",
"if",
"available",
")",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WPanelRenderer.java#L150-L165 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java | FeatureOverlayQuery.buildMapClickMessage | public String buildMapClickMessage(LatLng latLng, View view, GoogleMap map) {
"""
Perform a query based upon the map click location and build a info message
@param latLng location
@param view view
@param map Google Map
@return information message on what was clicked, or null
"""
return build... | java | public String buildMapClickMessage(LatLng latLng, View view, GoogleMap map) {
return buildMapClickMessage(latLng, view, map, null);
} | [
"public",
"String",
"buildMapClickMessage",
"(",
"LatLng",
"latLng",
",",
"View",
"view",
",",
"GoogleMap",
"map",
")",
"{",
"return",
"buildMapClickMessage",
"(",
"latLng",
",",
"view",
",",
"map",
",",
"null",
")",
";",
"}"
] | Perform a query based upon the map click location and build a info message
@param latLng location
@param view view
@param map Google Map
@return information message on what was clicked, or null | [
"Perform",
"a",
"query",
"based",
"upon",
"the",
"map",
"click",
"location",
"and",
"build",
"a",
"info",
"message"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java#L342-L344 |
xebialabs/overcast | src/main/java/com/xebialabs/overcast/support/libvirt/LibvirtUtil.java | LibvirtUtil.findVolume | public static StorageVol findVolume(Connect connection, String path) throws LibvirtException {
"""
Look up a disk image's {@link StorageVol} in the {@link StoragePool}s attached to connection.
"""
log.debug("Looking up StorageVolume for path '{}'", path);
for (String s : connection.listStorageP... | java | public static StorageVol findVolume(Connect connection, String path) throws LibvirtException {
log.debug("Looking up StorageVolume for path '{}'", path);
for (String s : connection.listStoragePools()) {
StoragePool sp = connection.storagePoolLookupByName(s);
for (String v : sp.li... | [
"public",
"static",
"StorageVol",
"findVolume",
"(",
"Connect",
"connection",
",",
"String",
"path",
")",
"throws",
"LibvirtException",
"{",
"log",
".",
"debug",
"(",
"\"Looking up StorageVolume for path '{}'\"",
",",
"path",
")",
";",
"for",
"(",
"String",
"s",
... | Look up a disk image's {@link StorageVol} in the {@link StoragePool}s attached to connection. | [
"Look",
"up",
"a",
"disk",
"image",
"s",
"{"
] | train | https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/libvirt/LibvirtUtil.java#L40-L53 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/DocumentationUtils.java | DocumentationUtils.createLinkToServiceDocumentation | public static String createLinkToServiceDocumentation(Metadata metadata, ShapeModel shapeModel) {
"""
Create the HTML for a link to the operation/shape core AWS docs site
@param metadata the UID for the service from that services metadata
@param shapeModel the model of the shape
@return a '@see also' HTML ... | java | public static String createLinkToServiceDocumentation(Metadata metadata, ShapeModel shapeModel) {
return isRequestResponseOrModel(shapeModel) ? createLinkToServiceDocumentation(metadata, shapeModel.getDocumentationShapeName()) : "";
} | [
"public",
"static",
"String",
"createLinkToServiceDocumentation",
"(",
"Metadata",
"metadata",
",",
"ShapeModel",
"shapeModel",
")",
"{",
"return",
"isRequestResponseOrModel",
"(",
"shapeModel",
")",
"?",
"createLinkToServiceDocumentation",
"(",
"metadata",
",",
"shapeMod... | Create the HTML for a link to the operation/shape core AWS docs site
@param metadata the UID for the service from that services metadata
@param shapeModel the model of the shape
@return a '@see also' HTML link to the doc | [
"Create",
"the",
"HTML",
"for",
"a",
"link",
"to",
"the",
"operation",
"/",
"shape",
"core",
"AWS",
"docs",
"site"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/DocumentationUtils.java#L148-L150 |
Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java | RangeUtils.mergeTokenRanges | static List<DeepTokenRange> mergeTokenRanges(Map<String, Iterable<Comparable>> tokens,
final Session session,
final IPartitioner p) {
"""
Merges the list of tokens for each cluster machine to a single list of token ra... | java | static List<DeepTokenRange> mergeTokenRanges(Map<String, Iterable<Comparable>> tokens,
final Session session,
final IPartitioner p) {
final Iterable<Comparable> allRanges = Ordering.natural().sortedCopy(concat(toke... | [
"static",
"List",
"<",
"DeepTokenRange",
">",
"mergeTokenRanges",
"(",
"Map",
"<",
"String",
",",
"Iterable",
"<",
"Comparable",
">",
">",
"tokens",
",",
"final",
"Session",
"session",
",",
"final",
"IPartitioner",
"p",
")",
"{",
"final",
"Iterable",
"<",
... | Merges the list of tokens for each cluster machine to a single list of token ranges.
@param tokens the map of tokens for each cluster machine.
@param session the connection to the cluster.
@param p the partitioner used in the cluster.
@return the merged lists of tokens transformed to DeepTokenRange(s). The retu... | [
"Merges",
"the",
"list",
"of",
"tokens",
"for",
"each",
"cluster",
"machine",
"to",
"a",
"single",
"list",
"of",
"token",
"ranges",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java#L106-L122 |
junit-team/junit4 | src/main/java/junit/framework/Assert.java | Assert.assertEquals | static public void assertEquals(String message, int expected, int actual) {
"""
Asserts that two ints are equal. If they are not
an AssertionFailedError is thrown with the given message.
"""
assertEquals(message, Integer.valueOf(expected), Integer.valueOf(actual));
} | java | static public void assertEquals(String message, int expected, int actual) {
assertEquals(message, Integer.valueOf(expected), Integer.valueOf(actual));
} | [
"static",
"public",
"void",
"assertEquals",
"(",
"String",
"message",
",",
"int",
"expected",
",",
"int",
"actual",
")",
"{",
"assertEquals",
"(",
"message",
",",
"Integer",
".",
"valueOf",
"(",
"expected",
")",
",",
"Integer",
".",
"valueOf",
"(",
"actual... | Asserts that two ints are equal. If they are not
an AssertionFailedError is thrown with the given message. | [
"Asserts",
"that",
"two",
"ints",
"are",
"equal",
".",
"If",
"they",
"are",
"not",
"an",
"AssertionFailedError",
"is",
"thrown",
"with",
"the",
"given",
"message",
"."
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/junit/framework/Assert.java#L233-L235 |
cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomTetrahedralLigandPlacer3D.java | AtomTetrahedralLigandPlacer3D.getSpatproduct | public double getSpatproduct(Vector3d a, Vector3d b, Vector3d c) {
"""
Gets the spatproduct of three vectors.
@param a vector a
@param b vector b
@param c vector c
@return double value of the spatproduct
"""
return (c.x * (b.y * a.z - b.z * a.y) + c.y * (b.z * a.x - b.x * a.z) + c.z * (b... | java | public double getSpatproduct(Vector3d a, Vector3d b, Vector3d c) {
return (c.x * (b.y * a.z - b.z * a.y) + c.y * (b.z * a.x - b.x * a.z) + c.z * (b.x * a.y - b.y * a.x));
} | [
"public",
"double",
"getSpatproduct",
"(",
"Vector3d",
"a",
",",
"Vector3d",
"b",
",",
"Vector3d",
"c",
")",
"{",
"return",
"(",
"c",
".",
"x",
"*",
"(",
"b",
".",
"y",
"*",
"a",
".",
"z",
"-",
"b",
".",
"z",
"*",
"a",
".",
"y",
")",
"+",
"... | Gets the spatproduct of three vectors.
@param a vector a
@param b vector b
@param c vector c
@return double value of the spatproduct | [
"Gets",
"the",
"spatproduct",
"of",
"three",
"vectors",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomTetrahedralLigandPlacer3D.java#L774-L776 |
avarabyeu/jashing | jashing/src/main/java/com/github/avarabyeu/jashing/utils/StringUtils.java | StringUtils.substringBefore | public static String substringBefore(final String str, final String separator) {
"""
Returns substring before provided string
@param str String to be truncated
@param separator Separator
@return Null of initial string is Null, empty if provided string is empty, otherwise substring before
"""
... | java | public static String substringBefore(final String str, final String separator) {
if (Strings.isNullOrEmpty(str)) {
return str;
}
final int pos = str.indexOf(separator);
if (pos == -1) {
return str;
}
return str.substring(0, pos);
} | [
"public",
"static",
"String",
"substringBefore",
"(",
"final",
"String",
"str",
",",
"final",
"String",
"separator",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"str",
")",
")",
"{",
"return",
"str",
";",
"}",
"final",
"int",
"pos",
"=",
... | Returns substring before provided string
@param str String to be truncated
@param separator Separator
@return Null of initial string is Null, empty if provided string is empty, otherwise substring before | [
"Returns",
"substring",
"before",
"provided",
"string"
] | train | https://github.com/avarabyeu/jashing/blob/fcc6ec67e2663eb1dde8cbacff5e660ca717cbc8/jashing/src/main/java/com/github/avarabyeu/jashing/utils/StringUtils.java#L22-L31 |
google/closure-compiler | src/com/google/javascript/jscomp/parsing/JsDocInfoParser.java | JsDocInfoParser.extractSingleLineBlock | private ExtractionInfo extractSingleLineBlock() {
"""
Extracts the text found on the current line starting at token. Note that
token = token.info; should be called after this method is used to update
the token properly in the parser.
@return The extraction information.
"""
// Get the current starting... | java | private ExtractionInfo extractSingleLineBlock() {
// Get the current starting point.
stream.update();
int lineno = stream.getLineno();
int charno = stream.getCharno() + 1;
String line = getRemainingJSDocLine().trim();
// Record the textual description.
if (line.length() > 0) {
jsdoc... | [
"private",
"ExtractionInfo",
"extractSingleLineBlock",
"(",
")",
"{",
"// Get the current starting point.",
"stream",
".",
"update",
"(",
")",
";",
"int",
"lineno",
"=",
"stream",
".",
"getLineno",
"(",
")",
";",
"int",
"charno",
"=",
"stream",
".",
"getCharno",... | Extracts the text found on the current line starting at token. Note that
token = token.info; should be called after this method is used to update
the token properly in the parser.
@return The extraction information. | [
"Extracts",
"the",
"text",
"found",
"on",
"the",
"current",
"line",
"starting",
"at",
"token",
".",
"Note",
"that",
"token",
"=",
"token",
".",
"info",
";",
"should",
"be",
"called",
"after",
"this",
"method",
"is",
"used",
"to",
"update",
"the",
"token"... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/JsDocInfoParser.java#L1679-L1695 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.