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 |
|---|---|---|---|---|---|---|---|---|---|---|
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.getPrintWriter | public static PrintWriter getPrintWriter(String path, String charset, boolean isAppend) throws IORuntimeException {
"""
获得一个打印写入对象,可以有print
@param path 输出路径,绝对路径
@param charset 字符集
@param isAppend 是否追加
@return 打印对象
@throws IORuntimeException IO异常
"""
return new PrintWriter(getWriter(path, charset, is... | java | public static PrintWriter getPrintWriter(String path, String charset, boolean isAppend) throws IORuntimeException {
return new PrintWriter(getWriter(path, charset, isAppend));
} | [
"public",
"static",
"PrintWriter",
"getPrintWriter",
"(",
"String",
"path",
",",
"String",
"charset",
",",
"boolean",
"isAppend",
")",
"throws",
"IORuntimeException",
"{",
"return",
"new",
"PrintWriter",
"(",
"getWriter",
"(",
"path",
",",
"charset",
",",
"isApp... | 获得一个打印写入对象,可以有print
@param path 输出路径,绝对路径
@param charset 字符集
@param isAppend 是否追加
@return 打印对象
@throws IORuntimeException IO异常 | [
"获得一个打印写入对象,可以有print"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2637-L2639 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/ComparatorCompat.java | ComparatorCompat.comparingDouble | @NotNull
public static <T> ComparatorCompat<T> comparingDouble(
@NotNull final ToDoubleFunction<? super T> keyExtractor) {
"""
Returns a comparator that uses a function that extracts
a {@code double} sort key to be compared.
@param <T> the type of the objects compared by the comparator
@param ... | java | @NotNull
public static <T> ComparatorCompat<T> comparingDouble(
@NotNull final ToDoubleFunction<? super T> keyExtractor) {
Objects.requireNonNull(keyExtractor);
return new ComparatorCompat<T>(new Comparator<T>() {
@Override
public int compare(T t1, T t2) {
... | [
"@",
"NotNull",
"public",
"static",
"<",
"T",
">",
"ComparatorCompat",
"<",
"T",
">",
"comparingDouble",
"(",
"@",
"NotNull",
"final",
"ToDoubleFunction",
"<",
"?",
"super",
"T",
">",
"keyExtractor",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"keyExtra... | Returns a comparator that uses a function that extracts
a {@code double} sort key to be compared.
@param <T> the type of the objects compared by the comparator
@param keyExtractor the function that extracts the sort key
@return a comparator
@throws NullPointerException if {@code keyExtractor} is null | [
"Returns",
"a",
"comparator",
"that",
"uses",
"a",
"function",
"that",
"extracts",
"a",
"{",
"@code",
"double",
"}",
"sort",
"key",
"to",
"be",
"compared",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/ComparatorCompat.java#L210-L223 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java | TransformerIdentityImpl.startDTD | public void startDTD(String name, String publicId, String systemId)
throws SAXException {
"""
Report the start of DTD declarations, if any.
<p>Any declarations are assumed to be in the internal subset
unless otherwise indicated by a {@link #startEntity startEntity}
event.</p>
<p>Note that the sta... | java | public void startDTD(String name, String publicId, String systemId)
throws SAXException
{
flushStartDoc();
if (null != m_resultLexicalHandler)
m_resultLexicalHandler.startDTD(name, publicId, systemId);
} | [
"public",
"void",
"startDTD",
"(",
"String",
"name",
",",
"String",
"publicId",
",",
"String",
"systemId",
")",
"throws",
"SAXException",
"{",
"flushStartDoc",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"m_resultLexicalHandler",
")",
"m_resultLexicalHandler",
".",
... | Report the start of DTD declarations, if any.
<p>Any declarations are assumed to be in the internal subset
unless otherwise indicated by a {@link #startEntity startEntity}
event.</p>
<p>Note that the start/endDTD events will appear within
the start/endDocument events from ContentHandler and
before the first startElem... | [
"Report",
"the",
"start",
"of",
"DTD",
"declarations",
"if",
"any",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java#L1219-L1225 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapElement.java | MapElement.boundsIntersects | @Pure
protected final boolean boundsIntersects(Shape2D<?, ?, ?, ?, ?, ? extends Rectangle2afp<?, ?, ?, ?, ?, ?>> rectangle) {
"""
Replies if the bounds of this element has an intersection
with the specified rectangle.
@param rectangle the rectangle.
@return <code>true</code> if this bounds is intersecting th... | java | @Pure
protected final boolean boundsIntersects(Shape2D<?, ?, ?, ?, ?, ? extends Rectangle2afp<?, ?, ?, ?, ?, ?>> rectangle) {
final Rectangle2d bounds = getBoundingBox();
assert bounds != null;
return bounds.intersects(rectangle);
} | [
"@",
"Pure",
"protected",
"final",
"boolean",
"boundsIntersects",
"(",
"Shape2D",
"<",
"?",
",",
"?",
",",
"?",
",",
"?",
",",
"?",
",",
"?",
"extends",
"Rectangle2afp",
"<",
"?",
",",
"?",
",",
"?",
",",
"?",
",",
"?",
",",
"?",
">",
">",
"rec... | Replies if the bounds of this element has an intersection
with the specified rectangle.
@param rectangle the rectangle.
@return <code>true</code> if this bounds is intersecting the specified area,
otherwise <code>false</code> | [
"Replies",
"if",
"the",
"bounds",
"of",
"this",
"element",
"has",
"an",
"intersection",
"with",
"the",
"specified",
"rectangle",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapElement.java#L455-L460 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/DateUtils.java | DateUtils.getFragmentInSeconds | @GwtIncompatible("incompatible method")
public static long getFragmentInSeconds(final Date date, final int fragment) {
"""
<p>Returns the number of seconds within the
fragment. All datefields greater than the fragment will be ignored.</p>
<p>Asking the seconds of any date will only return the number of sec... | java | @GwtIncompatible("incompatible method")
public static long getFragmentInSeconds(final Date date, final int fragment) {
return getFragment(date, fragment, TimeUnit.SECONDS);
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"long",
"getFragmentInSeconds",
"(",
"final",
"Date",
"date",
",",
"final",
"int",
"fragment",
")",
"{",
"return",
"getFragment",
"(",
"date",
",",
"fragment",
",",
"TimeUnit",
".",... | <p>Returns the number of seconds within the
fragment. All datefields greater than the fragment will be ignored.</p>
<p>Asking the seconds of any date will only return the number of seconds
of the current minute (resulting in a number between 0 and 59). This
method will retrieve the number of seconds for any fragment.
... | [
"<p",
">",
"Returns",
"the",
"number",
"of",
"seconds",
"within",
"the",
"fragment",
".",
"All",
"datefields",
"greater",
"than",
"the",
"fragment",
"will",
"be",
"ignored",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L1335-L1338 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/api/Table.java | Table.xTabCounts | public Table xTabCounts(String column1Name, String column2Name) {
"""
Returns a table with n by m + 1 cells. The first column contains labels, the other cells contains the counts for every unique
combination of values from the two specified columns in this table
"""
return CrossTab.counts(this, catego... | java | public Table xTabCounts(String column1Name, String column2Name) {
return CrossTab.counts(this, categoricalColumn(column1Name), categoricalColumn(column2Name));
} | [
"public",
"Table",
"xTabCounts",
"(",
"String",
"column1Name",
",",
"String",
"column2Name",
")",
"{",
"return",
"CrossTab",
".",
"counts",
"(",
"this",
",",
"categoricalColumn",
"(",
"column1Name",
")",
",",
"categoricalColumn",
"(",
"column2Name",
")",
")",
... | Returns a table with n by m + 1 cells. The first column contains labels, the other cells contains the counts for every unique
combination of values from the two specified columns in this table | [
"Returns",
"a",
"table",
"with",
"n",
"by",
"m",
"+",
"1",
"cells",
".",
"The",
"first",
"column",
"contains",
"labels",
"the",
"other",
"cells",
"contains",
"the",
"counts",
"for",
"every",
"unique",
"combination",
"of",
"values",
"from",
"the",
"two",
... | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/api/Table.java#L923-L925 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/Util.java | Util.numberToBytes | public static void numberToBytes(int number, byte[] buffer, int start, int length) {
"""
Writes a number to the specified byte array field, breaking it into its component bytes in big-endian order.
If the number is too large to fit in the specified number of bytes, only the low-order bytes are written.
@param ... | java | public static void numberToBytes(int number, byte[] buffer, int start, int length) {
for (int index = start + length - 1; index >= start; index--) {
buffer[index] = (byte)(number & 0xff);
number = number >> 8;
}
} | [
"public",
"static",
"void",
"numberToBytes",
"(",
"int",
"number",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"for",
"(",
"int",
"index",
"=",
"start",
"+",
"length",
"-",
"1",
";",
"index",
">=",
"start",
... | Writes a number to the specified byte array field, breaking it into its component bytes in big-endian order.
If the number is too large to fit in the specified number of bytes, only the low-order bytes are written.
@param number the number to be written to the array
@param buffer the buffer to which the number should ... | [
"Writes",
"a",
"number",
"to",
"the",
"specified",
"byte",
"array",
"field",
"breaking",
"it",
"into",
"its",
"component",
"bytes",
"in",
"big",
"-",
"endian",
"order",
".",
"If",
"the",
"number",
"is",
"too",
"large",
"to",
"fit",
"in",
"the",
"specifie... | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Util.java#L277-L282 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_12_01/implementation/BackupsInner.java | BackupsInner.triggerAsync | public Observable<Void> triggerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, BackupRequestResource parameters) {
"""
Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the operation, call GetP... | java | public Observable<Void> triggerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, BackupRequestResource parameters) {
return triggerWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters).m... | [
"public",
"Observable",
"<",
"Void",
">",
"triggerAsync",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
",",
"String",
"fabricName",
",",
"String",
"containerName",
",",
"String",
"protectedItemName",
",",
"BackupRequestResource",
"parameters",
")",
... | Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the operation, call GetProtectedItemOperationResult API.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.... | [
"Triggers",
"backup",
"for",
"specified",
"backed",
"up",
"item",
".",
"This",
"is",
"an",
"asynchronous",
"operation",
".",
"To",
"know",
"the",
"status",
"of",
"the",
"operation",
"call",
"GetProtectedItemOperationResult",
"API",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_12_01/implementation/BackupsInner.java#L109-L116 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/libcore/net/UriCodec.java | UriCodec.validateSimple | public static void validateSimple(String s, String legal)
throws URISyntaxException {
"""
Throws if {@code s} contains characters that are not letters, digits or
in {@code legal}.
"""
for (int i = 0; i < s.length(); i++) {
char ch = s.charAt(i);
if (!((ch >= 'a' && ... | java | public static void validateSimple(String s, String legal)
throws URISyntaxException {
for (int i = 0; i < s.length(); i++) {
char ch = s.charAt(i);
if (!((ch >= 'a' && ch <= 'z')
|| (ch >= 'A' && ch <= 'Z')
|| (ch >= '0' && ch <= '9')
... | [
"public",
"static",
"void",
"validateSimple",
"(",
"String",
"s",
",",
"String",
"legal",
")",
"throws",
"URISyntaxException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"char",
"ch... | Throws if {@code s} contains characters that are not letters, digits or
in {@code legal}. | [
"Throws",
"if",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/libcore/net/UriCodec.java#L73-L84 |
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/ManagedBackupShortTermRetentionPoliciesInner.java | ManagedBackupShortTermRetentionPoliciesInner.beginCreateOrUpdateAsync | public Observable<ManagedBackupShortTermRetentionPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String managedInstanceName, String databaseName, Integer retentionDays) {
"""
Updates a managed database's short term retention policy.
@param resourceGroupName The name of the resource group that co... | java | public Observable<ManagedBackupShortTermRetentionPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String managedInstanceName, String databaseName, Integer retentionDays) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, retentionDays).map(n... | [
"public",
"Observable",
"<",
"ManagedBackupShortTermRetentionPolicyInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"String",
"databaseName",
",",
"Integer",
"retentionDays",
")",
"{",
"return",
"beginCr... | Updates a managed database's short term retention policy.
@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 dat... | [
"Updates",
"a",
"managed",
"database",
"s",
"short",
"term",
"retention",
"policy",
"."
] | 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/ManagedBackupShortTermRetentionPoliciesInner.java#L480-L487 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/smile/ShanksAgentBayesianReasoningCapability.java | ShanksAgentBayesianReasoningCapability.addEvidences | public static void addEvidences(Network bn, Map<String, String> evidences)
throws ShanksException {
"""
Add a set of evidences to the Bayesian network to reason with it.
@param bn
@param evidences
map in format [nodeName, status] to set evidences in the
bayesian network
@throws ShanksException
... | java | public static void addEvidences(Network bn, Map<String, String> evidences)
throws ShanksException {
if (bn == null || evidences.isEmpty()) {
throw new ShanksException("Null parameter in addEvidences method.");
}
for (Entry<String, String> evidence : evidences.entrySet()) ... | [
"public",
"static",
"void",
"addEvidences",
"(",
"Network",
"bn",
",",
"Map",
"<",
"String",
",",
"String",
">",
"evidences",
")",
"throws",
"ShanksException",
"{",
"if",
"(",
"bn",
"==",
"null",
"||",
"evidences",
".",
"isEmpty",
"(",
")",
")",
"{",
"... | Add a set of evidences to the Bayesian network to reason with it.
@param bn
@param evidences
map in format [nodeName, status] to set evidences in the
bayesian network
@throws ShanksException | [
"Add",
"a",
"set",
"of",
"evidences",
"to",
"the",
"Bayesian",
"network",
"to",
"reason",
"with",
"it",
"."
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/smile/ShanksAgentBayesianReasoningCapability.java#L399-L408 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java | XpathUtils.asDate | public static Date asDate(String expression, Node node, XPath xpath)
throws XPathExpressionException {
"""
Same as {@link #asDate(String, Node)} but allows an xpath to be passed
in explicitly for reuse.
"""
String dateString = evaluateAsString(expression, node, xpath);
if (isEmptyS... | java | public static Date asDate(String expression, Node node, XPath xpath)
throws XPathExpressionException {
String dateString = evaluateAsString(expression, node, xpath);
if (isEmptyString(dateString)) return null;
try {
return DateUtils.parseISO8601Date(dateString);
... | [
"public",
"static",
"Date",
"asDate",
"(",
"String",
"expression",
",",
"Node",
"node",
",",
"XPath",
"xpath",
")",
"throws",
"XPathExpressionException",
"{",
"String",
"dateString",
"=",
"evaluateAsString",
"(",
"expression",
",",
"node",
",",
"xpath",
")",
"... | Same as {@link #asDate(String, Node)} but allows an xpath to be passed
in explicitly for reuse. | [
"Same",
"as",
"{"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java#L462-L473 |
zxing/zxing | core/src/main/java/com/google/zxing/qrcode/detector/Detector.java | Detector.calculateModuleSizeOneWay | private float calculateModuleSizeOneWay(ResultPoint pattern, ResultPoint otherPattern) {
"""
<p>Estimates module size based on two finder patterns -- it uses
{@link #sizeOfBlackWhiteBlackRunBothWays(int, int, int, int)} to figure the
width of each, measuring along the axis between their centers.</p>
"""
... | java | private float calculateModuleSizeOneWay(ResultPoint pattern, ResultPoint otherPattern) {
float moduleSizeEst1 = sizeOfBlackWhiteBlackRunBothWays((int) pattern.getX(),
(int) pattern.getY(),
(int) otherPattern.getX(),
(int) otherPattern.getY());
float moduleSizeEst2 = sizeOfBlackWhiteBlack... | [
"private",
"float",
"calculateModuleSizeOneWay",
"(",
"ResultPoint",
"pattern",
",",
"ResultPoint",
"otherPattern",
")",
"{",
"float",
"moduleSizeEst1",
"=",
"sizeOfBlackWhiteBlackRunBothWays",
"(",
"(",
"int",
")",
"pattern",
".",
"getX",
"(",
")",
",",
"(",
"int... | <p>Estimates module size based on two finder patterns -- it uses
{@link #sizeOfBlackWhiteBlackRunBothWays(int, int, int, int)} to figure the
width of each, measuring along the axis between their centers.</p> | [
"<p",
">",
"Estimates",
"module",
"size",
"based",
"on",
"two",
"finder",
"patterns",
"--",
"it",
"uses",
"{"
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/qrcode/detector/Detector.java#L241-L259 |
janus-project/guava.janusproject.io | guava/src/com/google/common/collect/SortedIterables.java | SortedIterables.hasSameComparator | public static boolean hasSameComparator(Comparator<?> comparator, Iterable<?> elements) {
"""
Returns {@code true} if {@code elements} is a sorted collection using an ordering equivalent
to {@code comparator}.
"""
checkNotNull(comparator);
checkNotNull(elements);
Comparator<?> comparator2;
if ... | java | public static boolean hasSameComparator(Comparator<?> comparator, Iterable<?> elements) {
checkNotNull(comparator);
checkNotNull(elements);
Comparator<?> comparator2;
if (elements instanceof SortedSet) {
comparator2 = comparator((SortedSet<?>) elements);
} else if (elements instanceof SortedIt... | [
"public",
"static",
"boolean",
"hasSameComparator",
"(",
"Comparator",
"<",
"?",
">",
"comparator",
",",
"Iterable",
"<",
"?",
">",
"elements",
")",
"{",
"checkNotNull",
"(",
"comparator",
")",
";",
"checkNotNull",
"(",
"elements",
")",
";",
"Comparator",
"<... | Returns {@code true} if {@code elements} is a sorted collection using an ordering equivalent
to {@code comparator}. | [
"Returns",
"{"
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/collect/SortedIterables.java#L37-L49 |
magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/LRUCache.java | LRUCache.getKeysSortedByValue | public List<K> getKeysSortedByValue( final Comparator<V> comparator ) {
"""
The keys sorted by the given value comparator.
@return the underlying set, see {@link LinkedHashMap#keySet()}.
"""
synchronized ( _map ) {
@SuppressWarnings( "unchecked" )
final
Entry<K, M... | java | public List<K> getKeysSortedByValue( final Comparator<V> comparator ) {
synchronized ( _map ) {
@SuppressWarnings( "unchecked" )
final
Entry<K, ManagedItem<V>>[] a = _map.entrySet().toArray( new Map.Entry[_map.size()] );
final Comparator<Entry<K, ManagedItem<V>>> ... | [
"public",
"List",
"<",
"K",
">",
"getKeysSortedByValue",
"(",
"final",
"Comparator",
"<",
"V",
">",
"comparator",
")",
"{",
"synchronized",
"(",
"_map",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"final",
"Entry",
"<",
"K",
",",
"Managed... | The keys sorted by the given value comparator.
@return the underlying set, see {@link LinkedHashMap#keySet()}. | [
"The",
"keys",
"sorted",
"by",
"the",
"given",
"value",
"comparator",
"."
] | train | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/LRUCache.java#L202-L218 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionValuePersistenceImpl.java | CPOptionValuePersistenceImpl.findByCPOptionId | @Override
public List<CPOptionValue> findByCPOptionId(long CPOptionId, int start,
int end, OrderByComparator<CPOptionValue> orderByComparator) {
"""
Returns an ordered range of all the cp option values where CPOptionId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code... | java | @Override
public List<CPOptionValue> findByCPOptionId(long CPOptionId, int start,
int end, OrderByComparator<CPOptionValue> orderByComparator) {
return findByCPOptionId(CPOptionId, start, end, orderByComparator, true);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPOptionValue",
">",
"findByCPOptionId",
"(",
"long",
"CPOptionId",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CPOptionValue",
">",
"orderByComparator",
")",
"{",
"return",
"findByCPOptionId",
... | Returns an ordered range of all the cp option values where CPOptionId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result i... | [
"Returns",
"an",
"ordered",
"range",
"of",
"all",
"the",
"cp",
"option",
"values",
"where",
"CPOptionId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionValuePersistenceImpl.java#L2564-L2568 |
google/closure-compiler | src/com/google/javascript/jscomp/SourceMapResolver.java | SourceMapResolver.getRelativePath | @Nullable
static SourceFile getRelativePath(String baseFilePath, String relativePath) {
"""
Returns the relative path, resolved relative to the base path, where the base path is
interpreted as a filename rather than a directory. E.g.: getRelativeTo("../foo/bar.js",
"baz/bam/qux.js") --> "baz/foo/bar.js"
""... | java | @Nullable
static SourceFile getRelativePath(String baseFilePath, String relativePath) {
return SourceFile.fromPath(
FileSystems.getDefault().getPath(baseFilePath).resolveSibling(relativePath).normalize(),
UTF_8);
} | [
"@",
"Nullable",
"static",
"SourceFile",
"getRelativePath",
"(",
"String",
"baseFilePath",
",",
"String",
"relativePath",
")",
"{",
"return",
"SourceFile",
".",
"fromPath",
"(",
"FileSystems",
".",
"getDefault",
"(",
")",
".",
"getPath",
"(",
"baseFilePath",
")"... | Returns the relative path, resolved relative to the base path, where the base path is
interpreted as a filename rather than a directory. E.g.: getRelativeTo("../foo/bar.js",
"baz/bam/qux.js") --> "baz/foo/bar.js" | [
"Returns",
"the",
"relative",
"path",
"resolved",
"relative",
"to",
"the",
"base",
"path",
"where",
"the",
"base",
"path",
"is",
"interpreted",
"as",
"a",
"filename",
"rather",
"than",
"a",
"directory",
".",
"E",
".",
"g",
".",
":",
"getRelativeTo",
"(",
... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/SourceMapResolver.java#L99-L104 |
grycap/coreutils | coreutils-common/src/main/java/es/upv/grycap/coreutils/common/config/Configurer.java | Configurer.loadConfig | public Config loadConfig(final @Nullable String confname, final String rootPath) {
"""
Loads and merges application configuration with default properties.
@param confname - optional configuration filename
@param rootPath - only load configuration properties underneath this path that this code
module owns and un... | java | public Config loadConfig(final @Nullable String confname, final String rootPath) {
// load configuration properties
Config config;
final String confname2 = trimToNull(confname);
if (confname2 != null) {
final ConfigParseOptions options = ConfigParseOptions.defaults().setAllowMissing(false);
final Config c... | [
"public",
"Config",
"loadConfig",
"(",
"final",
"@",
"Nullable",
"String",
"confname",
",",
"final",
"String",
"rootPath",
")",
"{",
"// load configuration properties",
"Config",
"config",
";",
"final",
"String",
"confname2",
"=",
"trimToNull",
"(",
"confname",
")... | Loads and merges application configuration with default properties.
@param confname - optional configuration filename
@param rootPath - only load configuration properties underneath this path that this code
module owns and understands
@return Configuration loaded from the provided filename or from default properties. | [
"Loads",
"and",
"merges",
"application",
"configuration",
"with",
"default",
"properties",
"."
] | train | https://github.com/grycap/coreutils/blob/e6db61dc50b49ea7276c0c29c7401204681a10c2/coreutils-common/src/main/java/es/upv/grycap/coreutils/common/config/Configurer.java#L51-L67 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/statistic/ProfilerTimerFilter.java | ProfilerTimerFilter.sessionOpened | @Override
public void sessionOpened(NextFilter nextFilter, IoSession session)
throws Exception {
"""
Profile a SessionOpened event. This method will gather the following
informations :
- the method duration
- the shortest execution time
- the slowest execution time
- the average execution time... | java | @Override
public void sessionOpened(NextFilter nextFilter, IoSession session)
throws Exception {
if (profileSessionOpened) {
long start = timeNow();
nextFilter.sessionOpened(session);
long end = timeNow();
sessionOpenedTimerWorker.addNewDuration(en... | [
"@",
"Override",
"public",
"void",
"sessionOpened",
"(",
"NextFilter",
"nextFilter",
",",
"IoSession",
"session",
")",
"throws",
"Exception",
"{",
"if",
"(",
"profileSessionOpened",
")",
"{",
"long",
"start",
"=",
"timeNow",
"(",
")",
";",
"nextFilter",
".",
... | Profile a SessionOpened event. This method will gather the following
informations :
- the method duration
- the shortest execution time
- the slowest execution time
- the average execution time
- the global number of calls
@param nextFilter The filter to call next
@param session The associated session | [
"Profile",
"a",
"SessionOpened",
"event",
".",
"This",
"method",
"will",
"gather",
"the",
"following",
"informations",
":",
"-",
"the",
"method",
"duration",
"-",
"the",
"shortest",
"execution",
"time",
"-",
"the",
"slowest",
"execution",
"time",
"-",
"the",
... | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/statistic/ProfilerTimerFilter.java#L414-L425 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/ReflectionUtils.java | ReflectionUtils.getField | public static Object getField(Field field, Object target) {
"""
Get the field represented by the supplied {@link Field field object} on the
specified {@link Object target object}. In accordance with {@link Field#get(Object)}
semantics, the returned value is automatically wrapped if the underlying field
has a pr... | java | public static Object getField(Field field, Object target) {
try {
return field.get(target);
} catch (IllegalAccessException e) {
throw new IllegalStateException("Could not access field: " + field, e);
}
} | [
"public",
"static",
"Object",
"getField",
"(",
"Field",
"field",
",",
"Object",
"target",
")",
"{",
"try",
"{",
"return",
"field",
".",
"get",
"(",
"target",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"e",
")",
"{",
"throw",
"new",
"IllegalSt... | Get the field represented by the supplied {@link Field field object} on the
specified {@link Object target object}. In accordance with {@link Field#get(Object)}
semantics, the returned value is automatically wrapped if the underlying field
has a primitive type.
@param field the field to get
@param target the target ob... | [
"Get",
"the",
"field",
"represented",
"by",
"the",
"supplied",
"{",
"@link",
"Field",
"field",
"object",
"}",
"on",
"the",
"specified",
"{",
"@link",
"Object",
"target",
"object",
"}",
".",
"In",
"accordance",
"with",
"{",
"@link",
"Field#get",
"(",
"Objec... | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/ReflectionUtils.java#L40-L46 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WSubordinateControlRenderer.java | WSubordinateControlRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given SubordinateControl.
@param component the SubordinateControl to paint.
@param renderContext the RenderContext to paint to.
"""
WSubordinateControl subordinate = (WSubordinateControl)... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WSubordinateControl subordinate = (WSubordinateControl) component;
XmlStringBuilder xml = renderContext.getWriter();
if (!subordinate.getRules().isEmpty()) {
int seq = 0;
for (Rule rule : subordinate.get... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WSubordinateControl",
"subordinate",
"=",
"(",
"WSubordinateControl",
")",
"component",
";",
"XmlStringBuilder",
"x... | Paints the given SubordinateControl.
@param component the SubordinateControl to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"SubordinateControl",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WSubordinateControlRenderer.java#L35-L51 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/iomanager/BlockChannelWriter.java | BlockChannelWriter.writeBlock | public void writeBlock(MemorySegment segment) throws IOException {
"""
Issues a asynchronous write request to the writer.
@param segment The segment to be written.
@throws IOException Thrown, when the writer encounters an I/O error. Due to the asynchronous nature of the
writer, the exception thrown here may h... | java | public void writeBlock(MemorySegment segment) throws IOException
{
// check the error state of this channel
checkErroneous();
// write the current buffer and get the next one
this.requestsNotReturned.incrementAndGet();
if (this.closed || this.requestQueue.isClosed()) {
// if we found ourselves closed a... | [
"public",
"void",
"writeBlock",
"(",
"MemorySegment",
"segment",
")",
"throws",
"IOException",
"{",
"// check the error state of this channel",
"checkErroneous",
"(",
")",
";",
"// write the current buffer and get the next one",
"this",
".",
"requestsNotReturned",
".",
"incre... | Issues a asynchronous write request to the writer.
@param segment The segment to be written.
@throws IOException Thrown, when the writer encounters an I/O error. Due to the asynchronous nature of the
writer, the exception thrown here may have been caused by an earlier write request. | [
"Issues",
"a",
"asynchronous",
"write",
"request",
"to",
"the",
"writer",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/iomanager/BlockChannelWriter.java#L64-L78 |
haifengl/smile | math/src/main/java/smile/math/Math.java | Math.JensenShannonDivergence | public static double JensenShannonDivergence(SparseArray x, double[] y) {
"""
Jensen-Shannon divergence JS(P||Q) = (KL(P||M) + KL(Q||M)) / 2, where
M = (P+Q)/2. The Jensen-Shannon divergence is a popular
method of measuring the similarity between two probability distributions.
It is also known as information ra... | java | public static double JensenShannonDivergence(SparseArray x, double[] y) {
if (x.isEmpty()) {
throw new IllegalArgumentException("List x is empty.");
}
Iterator<SparseArray.Entry> iter = x.iterator();
double js = 0.0;
while (iter.hasNext()) {
SparseArray.... | [
"public",
"static",
"double",
"JensenShannonDivergence",
"(",
"SparseArray",
"x",
",",
"double",
"[",
"]",
"y",
")",
"{",
"if",
"(",
"x",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"List x is empty.\"",
")",
";",
... | Jensen-Shannon divergence JS(P||Q) = (KL(P||M) + KL(Q||M)) / 2, where
M = (P+Q)/2. The Jensen-Shannon divergence is a popular
method of measuring the similarity between two probability distributions.
It is also known as information radius or total divergence to the average.
It is based on the Kullback-Leibler divergenc... | [
"Jensen",
"-",
"Shannon",
"divergence",
"JS",
"(",
"P||Q",
")",
"=",
"(",
"KL",
"(",
"P||M",
")",
"+",
"KL",
"(",
"Q||M",
"))",
"/",
"2",
"where",
"M",
"=",
"(",
"P",
"+",
"Q",
")",
"/",
"2",
".",
"The",
"Jensen",
"-",
"Shannon",
"divergence",
... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/Math.java#L2473-L2492 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpointStats.java | PendingCheckpointStats.reportFailedCheckpoint | void reportFailedCheckpoint(long failureTimestamp, @Nullable Throwable cause) {
"""
Reports a failed pending checkpoint.
@param failureTimestamp Timestamp of the failure.
@param cause Optional cause of the failure.
"""
FailedCheckpointStats failed = new FailedCheckpointStats(
checkpointId,
triggerT... | java | void reportFailedCheckpoint(long failureTimestamp, @Nullable Throwable cause) {
FailedCheckpointStats failed = new FailedCheckpointStats(
checkpointId,
triggerTimestamp,
props,
numberOfSubtasks,
new HashMap<>(taskStats),
currentNumAcknowledgedSubtasks,
currentStateSize,
currentAlignmentBuffere... | [
"void",
"reportFailedCheckpoint",
"(",
"long",
"failureTimestamp",
",",
"@",
"Nullable",
"Throwable",
"cause",
")",
"{",
"FailedCheckpointStats",
"failed",
"=",
"new",
"FailedCheckpointStats",
"(",
"checkpointId",
",",
"triggerTimestamp",
",",
"props",
",",
"numberOfS... | Reports a failed pending checkpoint.
@param failureTimestamp Timestamp of the failure.
@param cause Optional cause of the failure. | [
"Reports",
"a",
"failed",
"pending",
"checkpoint",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpointStats.java#L170-L185 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/ChecksumsManager.java | ChecksumsManager.initChecksumProps | private Properties initChecksumProps(Map<String, Set<String>> useOldChecksums) {
"""
Populates a new property file with the inputed checksum map and empty strings.
@param useOldChecksums a map of the old checksums
@return a new Properties object containing the old checksums as keys and "" as value
"""
... | java | private Properties initChecksumProps(Map<String, Set<String>> useOldChecksums) {
Properties checksumProps = new Properties();
for (Set<String> set : useOldChecksums.values()) {
for (String s : set) {
checksumProps.put(s, "");
}
}
return checksumPro... | [
"private",
"Properties",
"initChecksumProps",
"(",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"useOldChecksums",
")",
"{",
"Properties",
"checksumProps",
"=",
"new",
"Properties",
"(",
")",
";",
"for",
"(",
"Set",
"<",
"String",
">",
"set",... | Populates a new property file with the inputed checksum map and empty strings.
@param useOldChecksums a map of the old checksums
@return a new Properties object containing the old checksums as keys and "" as value | [
"Populates",
"a",
"new",
"property",
"file",
"with",
"the",
"inputed",
"checksum",
"map",
"and",
"empty",
"strings",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/ChecksumsManager.java#L181-L189 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java | BeanUtil.copyProperties | public static void copyProperties(Object source, Object target, String... ignoreProperties) {
"""
复制Bean对象属性<br>
限制类用于限制拷贝的属性,例如一个类我只想复制其父类的一些属性,就可以将editable设置为父类
@param source 源Bean对象
@param target 目标Bean对象
@param ignoreProperties 不拷贝的的属性列表
"""
copyProperties(source, target, CopyOptions.create().setI... | java | public static void copyProperties(Object source, Object target, String... ignoreProperties) {
copyProperties(source, target, CopyOptions.create().setIgnoreProperties(ignoreProperties));
} | [
"public",
"static",
"void",
"copyProperties",
"(",
"Object",
"source",
",",
"Object",
"target",
",",
"String",
"...",
"ignoreProperties",
")",
"{",
"copyProperties",
"(",
"source",
",",
"target",
",",
"CopyOptions",
".",
"create",
"(",
")",
".",
"setIgnoreProp... | 复制Bean对象属性<br>
限制类用于限制拷贝的属性,例如一个类我只想复制其父类的一些属性,就可以将editable设置为父类
@param source 源Bean对象
@param target 目标Bean对象
@param ignoreProperties 不拷贝的的属性列表 | [
"复制Bean对象属性<br",
">",
"限制类用于限制拷贝的属性,例如一个类我只想复制其父类的一些属性,就可以将editable设置为父类"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L594-L596 |
wildfly/wildfly-core | logging/src/main/java/org/jboss/as/logging/deployments/resources/LoggingConfigurationReadStepHandler.java | LoggingConfigurationReadStepHandler.addProperties | static void addProperties(final PropertyConfigurable configuration, final ModelNode model) {
"""
Adds properties to the model in key/value pairs.
@param configuration the configuration to get the properties from
@param model the model to update
"""
for (String name : configuration.getProper... | java | static void addProperties(final PropertyConfigurable configuration, final ModelNode model) {
for (String name : configuration.getPropertyNames()) {
setModelValue(model.get(name), configuration.getPropertyValueString(name));
}
} | [
"static",
"void",
"addProperties",
"(",
"final",
"PropertyConfigurable",
"configuration",
",",
"final",
"ModelNode",
"model",
")",
"{",
"for",
"(",
"String",
"name",
":",
"configuration",
".",
"getPropertyNames",
"(",
")",
")",
"{",
"setModelValue",
"(",
"model"... | Adds properties to the model in key/value pairs.
@param configuration the configuration to get the properties from
@param model the model to update | [
"Adds",
"properties",
"to",
"the",
"model",
"in",
"key",
"/",
"value",
"pairs",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/logging/src/main/java/org/jboss/as/logging/deployments/resources/LoggingConfigurationReadStepHandler.java#L77-L81 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/context/RpcInternalContext.java | RpcInternalContext.setRemoteAddress | public RpcInternalContext setRemoteAddress(String host, int port) {
"""
set remote address.
@param host the host
@param port the port
@return context remote address
"""
if (host == null) {
return this;
}
if (port < 0 || port > 0xFFFF) {
port = 0;
}
... | java | public RpcInternalContext setRemoteAddress(String host, int port) {
if (host == null) {
return this;
}
if (port < 0 || port > 0xFFFF) {
port = 0;
}
// 提前检查是否为空,防止createUnresolved抛出异常,损耗性能
this.remoteAddress = InetSocketAddress.createUnresolved(host... | [
"public",
"RpcInternalContext",
"setRemoteAddress",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"if",
"(",
"host",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"port",
"<",
"0",
"||",
"port",
">",
"0xFFFF",
")",
"{",
"port"... | set remote address.
@param host the host
@param port the port
@return context remote address | [
"set",
"remote",
"address",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/context/RpcInternalContext.java#L295-L305 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/comp/Infer.java | Infer.checkCompatibleUpperBounds | void checkCompatibleUpperBounds(UndetVar uv, InferenceContext inferenceContext) {
"""
Make sure that the upper bounds we got so far lead to a solvable inference
variable by making sure that a glb exists.
"""
List<Type> hibounds =
Type.filter(uv.getBounds(InferenceBound.UPPER), new Boun... | java | void checkCompatibleUpperBounds(UndetVar uv, InferenceContext inferenceContext) {
List<Type> hibounds =
Type.filter(uv.getBounds(InferenceBound.UPPER), new BoundFilter(inferenceContext));
Type hb = null;
if (hibounds.isEmpty())
hb = syms.objectType;
else if (h... | [
"void",
"checkCompatibleUpperBounds",
"(",
"UndetVar",
"uv",
",",
"InferenceContext",
"inferenceContext",
")",
"{",
"List",
"<",
"Type",
">",
"hibounds",
"=",
"Type",
".",
"filter",
"(",
"uv",
".",
"getBounds",
"(",
"InferenceBound",
".",
"UPPER",
")",
",",
... | Make sure that the upper bounds we got so far lead to a solvable inference
variable by making sure that a glb exists. | [
"Make",
"sure",
"that",
"the",
"upper",
"bounds",
"we",
"got",
"so",
"far",
"lead",
"to",
"a",
"solvable",
"inference",
"variable",
"by",
"making",
"sure",
"that",
"a",
"glb",
"exists",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/comp/Infer.java#L1071-L1083 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session/src/com/ibm/ws/session/SessionManager.java | SessionManager.createSession | public Object createSession(String id, int sessionVersion, Object correlator) {
"""
Method createSession
<p>
Called by the HTTPSessionManager in order to create a session. The id provided is in advisory capability only i.e.If there is another webapp that is using this id, then we
can
reuse it. If not we need t... | java | public Object createSession(String id, int sessionVersion, Object correlator) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
// LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName,
// "createSession", n... | [
"public",
"Object",
"createSession",
"(",
"String",
"id",
",",
"int",
"sessionVersion",
",",
"Object",
"correlator",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"Logging... | Method createSession
<p>
Called by the HTTPSessionManager in order to create a session. The id provided is in advisory capability only i.e.If there is another webapp that is using this id, then we
can
reuse it. If not we need to create a new one. If the session id is in use by another webapp, then we need to reuse the ... | [
"Method",
"createSession",
"<p",
">",
"Called",
"by",
"the",
"HTTPSessionManager",
"in",
"order",
"to",
"create",
"a",
"session",
".",
"The",
"id",
"provided",
"is",
"in",
"advisory",
"capability",
"only",
"i",
".",
"e",
".",
"If",
"there",
"is",
"another"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/session/SessionManager.java#L323-L349 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/attribute/FormItemList.java | FormItemList.insertBefore | public void insertBefore(String name, FormItem... newItem) {
"""
Insert a form item before the item with the specified name.
@param name name of the item before which to insert
@param newItem the item to insert
"""
int index = indexOf(name);
if (index >= 0) {
addAll(index, Arrays.asList(newItem));
... | java | public void insertBefore(String name, FormItem... newItem) {
int index = indexOf(name);
if (index >= 0) {
addAll(index, Arrays.asList(newItem));
}
} | [
"public",
"void",
"insertBefore",
"(",
"String",
"name",
",",
"FormItem",
"...",
"newItem",
")",
"{",
"int",
"index",
"=",
"indexOf",
"(",
"name",
")",
";",
"if",
"(",
"index",
">=",
"0",
")",
"{",
"addAll",
"(",
"index",
",",
"Arrays",
".",
"asList"... | Insert a form item before the item with the specified name.
@param name name of the item before which to insert
@param newItem the item to insert | [
"Insert",
"a",
"form",
"item",
"before",
"the",
"item",
"with",
"the",
"specified",
"name",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/FormItemList.java#L58-L63 |
TGIO/RNCryptorNative | jncryptor/src/main/java/org/cryptonode/jncryptor/AES256JNCryptor.java | AES256JNCryptor.decryptV2Data | private byte[] decryptV2Data(AES256v2Ciphertext aesCiphertext,
SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException {
"""
Decrypts data.
@param aesCiphertext
the ciphertext from the message
@param decryptionKey
the key to decrypt
@param hmacKey
the key to recalculate the HMAC
@return ... | java | private byte[] decryptV2Data(AES256v2Ciphertext aesCiphertext,
SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException {
try {
Mac mac = Mac.getInstance(HMAC_ALGORITHM);
mac.init(hmacKey);
byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC());
if (!arraysEqual(hma... | [
"private",
"byte",
"[",
"]",
"decryptV2Data",
"(",
"AES256v2Ciphertext",
"aesCiphertext",
",",
"SecretKey",
"decryptionKey",
",",
"SecretKey",
"hmacKey",
")",
"throws",
"CryptorException",
"{",
"try",
"{",
"Mac",
"mac",
"=",
"Mac",
".",
"getInstance",
"(",
"HMAC... | Decrypts data.
@param aesCiphertext
the ciphertext from the message
@param decryptionKey
the key to decrypt
@param hmacKey
the key to recalculate the HMAC
@return the decrypted data
@throws CryptorException
if a JCE error occurs | [
"Decrypts",
"data",
"."
] | train | https://github.com/TGIO/RNCryptorNative/blob/5209f10b988e4033c0b769a40b0d6cc99ea16af7/jncryptor/src/main/java/org/cryptonode/jncryptor/AES256JNCryptor.java#L200-L224 |
JodaOrg/joda-time | src/main/java/org/joda/time/Weeks.java | Weeks.weeksBetween | public static Weeks weeksBetween(ReadablePartial start, ReadablePartial end) {
"""
Creates a <code>Weeks</code> representing the number of whole weeks
between the two specified partial datetimes.
<p>
The two partials must contain the same fields, for example you can specify
two <code>LocalDate</code> objects.
... | java | public static Weeks weeksBetween(ReadablePartial start, ReadablePartial end) {
if (start instanceof LocalDate && end instanceof LocalDate) {
Chronology chrono = DateTimeUtils.getChronology(start.getChronology());
int weeks = chrono.weeks().getDifference(
((LocalDate... | [
"public",
"static",
"Weeks",
"weeksBetween",
"(",
"ReadablePartial",
"start",
",",
"ReadablePartial",
"end",
")",
"{",
"if",
"(",
"start",
"instanceof",
"LocalDate",
"&&",
"end",
"instanceof",
"LocalDate",
")",
"{",
"Chronology",
"chrono",
"=",
"DateTimeUtils",
... | Creates a <code>Weeks</code> representing the number of whole weeks
between the two specified partial datetimes.
<p>
The two partials must contain the same fields, for example you can specify
two <code>LocalDate</code> objects.
@param start the start partial date, must not be null
@param end the end partial date, mu... | [
"Creates",
"a",
"<code",
">",
"Weeks<",
"/",
"code",
">",
"representing",
"the",
"number",
"of",
"whole",
"weeks",
"between",
"the",
"two",
"specified",
"partial",
"datetimes",
".",
"<p",
">",
"The",
"two",
"partials",
"must",
"contain",
"the",
"same",
"fi... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Weeks.java#L117-L126 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java | ValueEnforcer.isBetweenInclusive | public static int isBetweenInclusive (final int nValue,
final String sName,
final int nLowerBoundInclusive,
final int nUpperBoundInclusive) {
"""
Check if
<code>nValue ≥ nLowerBoundInclusive ... | java | public static int isBetweenInclusive (final int nValue,
final String sName,
final int nLowerBoundInclusive,
final int nUpperBoundInclusive)
{
if (isEnabled ())
return isBetweenInclusive (n... | [
"public",
"static",
"int",
"isBetweenInclusive",
"(",
"final",
"int",
"nValue",
",",
"final",
"String",
"sName",
",",
"final",
"int",
"nLowerBoundInclusive",
",",
"final",
"int",
"nUpperBoundInclusive",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
")",
"return"... | Check if
<code>nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive</code>
@param nValue
Value
@param sName
Name
@param nLowerBoundInclusive
Lower bound
@param nUpperBoundInclusive
Upper bound
@return The value | [
"Check",
"if",
"<code",
">",
"nValue",
"&ge",
";",
"nLowerBoundInclusive",
"&",
";",
"&",
";",
"nValue",
"&le",
";",
"nUpperBoundInclusive<",
"/",
"code",
">"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java#L2277-L2285 |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.collapseAll | public static void collapseAll(JTree tree, boolean omitRoot) {
"""
Collapse all rows of the given tree
@param tree The tree
@param omitRoot Whether the root node should not be collapsed
"""
int rows = tree.getRowCount();
int limit = (omitRoot ? 1 : 0);
for (int i = rows - 1; i >=... | java | public static void collapseAll(JTree tree, boolean omitRoot)
{
int rows = tree.getRowCount();
int limit = (omitRoot ? 1 : 0);
for (int i = rows - 1; i >= limit; i--)
{
tree.collapseRow(i);
}
} | [
"public",
"static",
"void",
"collapseAll",
"(",
"JTree",
"tree",
",",
"boolean",
"omitRoot",
")",
"{",
"int",
"rows",
"=",
"tree",
".",
"getRowCount",
"(",
")",
";",
"int",
"limit",
"=",
"(",
"omitRoot",
"?",
"1",
":",
"0",
")",
";",
"for",
"(",
"i... | Collapse all rows of the given tree
@param tree The tree
@param omitRoot Whether the root node should not be collapsed | [
"Collapse",
"all",
"rows",
"of",
"the",
"given",
"tree"
] | train | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L163-L171 |
softindex/datakernel | core-http/src/main/java/io/datakernel/http/HttpServerConnection.java | HttpServerConnection.onHeader | @Override
protected void onHeader(HttpHeader header, byte[] array, int off, int len) throws ParseException {
"""
This method is called after receiving header. It sets its value to request.
@param header received header
"""
if (header == HttpHeaders.EXPECT) {
if (equalsLowerCaseAscii(EXPECT_100_CONTINU... | java | @Override
protected void onHeader(HttpHeader header, byte[] array, int off, int len) throws ParseException {
if (header == HttpHeaders.EXPECT) {
if (equalsLowerCaseAscii(EXPECT_100_CONTINUE, array, off, len)) {
socket.write(ByteBuf.wrapForReading(EXPECT_RESPONSE_CONTINUE));
}
}
if (request.headers.size... | [
"@",
"Override",
"protected",
"void",
"onHeader",
"(",
"HttpHeader",
"header",
",",
"byte",
"[",
"]",
"array",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"ParseException",
"{",
"if",
"(",
"header",
"==",
"HttpHeaders",
".",
"EXPECT",
")",
"{",
... | This method is called after receiving header. It sets its value to request.
@param header received header | [
"This",
"method",
"is",
"called",
"after",
"receiving",
"header",
".",
"It",
"sets",
"its",
"value",
"to",
"request",
"."
] | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-http/src/main/java/io/datakernel/http/HttpServerConnection.java#L201-L212 |
aws/aws-sdk-java | aws-java-sdk-mediatailor/src/main/java/com/amazonaws/services/mediatailor/model/PlaybackConfiguration.java | PlaybackConfiguration.withTags | public PlaybackConfiguration withTags(java.util.Map<String, String> tags) {
"""
<p>
The tags assigned to the playback configuration.
</p>
@param tags
The tags assigned to the playback configuration.
@return Returns a reference to this object so that method calls can be chained together.
"""
setT... | java | public PlaybackConfiguration withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"PlaybackConfiguration",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tags assigned to the playback configuration.
</p>
@param tags
The tags assigned to the playback configuration.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"tags",
"assigned",
"to",
"the",
"playback",
"configuration",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediatailor/src/main/java/com/amazonaws/services/mediatailor/model/PlaybackConfiguration.java#L560-L563 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/jsonrpc/HttpJsonRpcClient.java | HttpJsonRpcClient.doDelete | public RequestResponse doDelete(String url, Map<String, Object> headers,
Map<String, Object> urlParams) {
"""
Perform a DELETE request.
@param url
@param headers
@param urlParams
@return
"""
return doDelete(url, headers, urlParams, null);
} | java | public RequestResponse doDelete(String url, Map<String, Object> headers,
Map<String, Object> urlParams) {
return doDelete(url, headers, urlParams, null);
} | [
"public",
"RequestResponse",
"doDelete",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"urlParams",
")",
"{",
"return",
"doDelete",
"(",
"url",
",",
"headers",
",",
"urlPara... | Perform a DELETE request.
@param url
@param headers
@param urlParams
@return | [
"Perform",
"a",
"DELETE",
"request",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/jsonrpc/HttpJsonRpcClient.java#L264-L267 |
apereo/cas | core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/DefaultRegisteredServiceAccessStrategy.java | DefaultRegisteredServiceAccessStrategy.enoughRequiredAttributesAvailableToProcess | protected boolean enoughRequiredAttributesAvailableToProcess(final Map<String, Object> principalAttributes, final Map<String, Set<String>> requiredAttributes) {
"""
Enough required attributes available to process? Check collection sizes and determine
if we have enough data to move on.
@param principalAttribute... | java | protected boolean enoughRequiredAttributesAvailableToProcess(final Map<String, Object> principalAttributes, final Map<String, Set<String>> requiredAttributes) {
if (principalAttributes.isEmpty() && !requiredAttributes.isEmpty()) {
LOGGER.debug("No principal attributes are found to satisfy defined at... | [
"protected",
"boolean",
"enoughRequiredAttributesAvailableToProcess",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"principalAttributes",
",",
"final",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"requiredAttributes",
")",
"{",
"if",
"(... | Enough required attributes available to process? Check collection sizes and determine
if we have enough data to move on.
@param principalAttributes the principal attributes
@param requiredAttributes the required attributes
@return true /false | [
"Enough",
"required",
"attributes",
"available",
"to",
"process?",
"Check",
"collection",
"sizes",
"and",
"determine",
"if",
"we",
"have",
"enough",
"data",
"to",
"move",
"on",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/DefaultRegisteredServiceAccessStrategy.java#L242-L253 |
aerogear/aerogear-unifiedpush-server | push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/configuration/SenderConfigurationProvider.java | SenderConfigurationProvider.validateAndSanitizeConfiguration | private SenderConfiguration validateAndSanitizeConfiguration(VariantType type, SenderConfiguration configuration) {
"""
Validates that configuration is correct with regards to push networks limitations or implementation, etc.
"""
switch (type) {
case ANDROID:
if (configurati... | java | private SenderConfiguration validateAndSanitizeConfiguration(VariantType type, SenderConfiguration configuration) {
switch (type) {
case ANDROID:
if (configuration.batchSize() > 1000) {
logger.warn(String
.format("Sender configuration -... | [
"private",
"SenderConfiguration",
"validateAndSanitizeConfiguration",
"(",
"VariantType",
"type",
",",
"SenderConfiguration",
"configuration",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"ANDROID",
":",
"if",
"(",
"configuration",
".",
"batchSize",
"(",
")",
... | Validates that configuration is correct with regards to push networks limitations or implementation, etc. | [
"Validates",
"that",
"configuration",
"is",
"correct",
"with",
"regards",
"to",
"push",
"networks",
"limitations",
"or",
"implementation",
"etc",
"."
] | train | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/configuration/SenderConfigurationProvider.java#L73-L87 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java | BusItinerary.addBusHalt | boolean addBusHalt(BusItineraryHalt halt, int insertToIndex) {
"""
Add the given bus halt in this itinerary.
@param halt the halt.
@param insertToIndex the insertion index.
@return <code>true</code> if the addition was successful, <code>false</code>
otherwise.
"""
//set index for right ordering when ad... | java | boolean addBusHalt(BusItineraryHalt halt, int insertToIndex) {
//set index for right ordering when add to invalid list !
if (insertToIndex < 0) {
halt.setInvalidListIndex(this.insertionIndex);
} else {
halt.setInvalidListIndex(insertToIndex);
}
if (halt.isValidPrimitive()) {
ListUtil.addIfAbsent(thi... | [
"boolean",
"addBusHalt",
"(",
"BusItineraryHalt",
"halt",
",",
"int",
"insertToIndex",
")",
"{",
"//set index for right ordering when add to invalid list !",
"if",
"(",
"insertToIndex",
"<",
"0",
")",
"{",
"halt",
".",
"setInvalidListIndex",
"(",
"this",
".",
"inserti... | Add the given bus halt in this itinerary.
@param halt the halt.
@param insertToIndex the insertion index.
@return <code>true</code> if the addition was successful, <code>false</code>
otherwise. | [
"Add",
"the",
"given",
"bus",
"halt",
"in",
"this",
"itinerary",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L1127-L1151 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/metrics/spi/AbstractMetricsContext.java | AbstractMetricsContext.sum | private Number sum(Number a, Number b) {
"""
Adds two numbers, coercing the second to the type of the first.
"""
if (a instanceof Integer) {
return Integer.valueOf(a.intValue() + b.intValue());
}
else if (a instanceof Float) {
return new Float(a.floatValue() + b.floatValue());
... | java | private Number sum(Number a, Number b) {
if (a instanceof Integer) {
return Integer.valueOf(a.intValue() + b.intValue());
}
else if (a instanceof Float) {
return new Float(a.floatValue() + b.floatValue());
}
else if (a instanceof Short) {
return Short.valueOf((short)(a.shor... | [
"private",
"Number",
"sum",
"(",
"Number",
"a",
",",
"Number",
"b",
")",
"{",
"if",
"(",
"a",
"instanceof",
"Integer",
")",
"{",
"return",
"Integer",
".",
"valueOf",
"(",
"a",
".",
"intValue",
"(",
")",
"+",
"b",
".",
"intValue",
"(",
")",
")",
"... | Adds two numbers, coercing the second to the type of the first. | [
"Adds",
"two",
"numbers",
"coercing",
"the",
"second",
"to",
"the",
"type",
"of",
"the",
"first",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/spi/AbstractMetricsContext.java#L378-L399 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointSendConfiguration.java | EndpointSendConfiguration.withContext | public EndpointSendConfiguration withContext(java.util.Map<String, String> context) {
"""
A map of custom attributes to attributes to be attached to the message for this address. This payload is added to
the push notification's 'data.pinpoint' object or added to the email/sms delivery receipt event attributes.
... | java | public EndpointSendConfiguration withContext(java.util.Map<String, String> context) {
setContext(context);
return this;
} | [
"public",
"EndpointSendConfiguration",
"withContext",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"context",
")",
"{",
"setContext",
"(",
"context",
")",
";",
"return",
"this",
";",
"}"
] | A map of custom attributes to attributes to be attached to the message for this address. This payload is added to
the push notification's 'data.pinpoint' object or added to the email/sms delivery receipt event attributes.
@param context
A map of custom attributes to attributes to be attached to the message for this ad... | [
"A",
"map",
"of",
"custom",
"attributes",
"to",
"attributes",
"to",
"be",
"attached",
"to",
"the",
"message",
"for",
"this",
"address",
".",
"This",
"payload",
"is",
"added",
"to",
"the",
"push",
"notification",
"s",
"data",
".",
"pinpoint",
"object",
"or"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointSendConfiguration.java#L118-L121 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java | OverrideService.updateRepeatNumber | public void updateRepeatNumber(int id, Integer repeatNumber) {
"""
Update the repeat number for a given enabled override
@param id enabled override ID to update
@param repeatNumber updated value of repeat
"""
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.get... | java | public void updateRepeatNumber(int id, Integer repeatNumber) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
String queryString = "UPDATE " + Constants.DB_TABLE_ENABLED_OVERRIDE +
" SET " + Constants.ENABLED_OVERRIDES_REPEA... | [
"public",
"void",
"updateRepeatNumber",
"(",
"int",
"id",
",",
"Integer",
"repeatNumber",
")",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
".",
"getConnection",
"(",
")",
")",
"{",
"Str... | Update the repeat number for a given enabled override
@param id enabled override ID to update
@param repeatNumber updated value of repeat | [
"Update",
"the",
"repeat",
"number",
"for",
"a",
"given",
"enabled",
"override"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L208-L229 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsImageEditorForm.java | CmsImageEditorForm.fillContent | public void fillContent(CmsImageInfoBean imageInfo, CmsJSONMap imageAttributes, boolean initialFill) {
"""
Displays the provided image information.<p>
@param imageInfo the image information
@param imageAttributes the image attributes
@param initialFill flag to indicate that a new image has been selected
"... | java | public void fillContent(CmsImageInfoBean imageInfo, CmsJSONMap imageAttributes, boolean initialFill) {
m_initialImageAttributes = imageAttributes;
for (Entry<Attribute, I_CmsFormWidget> entry : m_fields.entrySet()) {
String val = imageAttributes.getString(entry.getKey().name());
... | [
"public",
"void",
"fillContent",
"(",
"CmsImageInfoBean",
"imageInfo",
",",
"CmsJSONMap",
"imageAttributes",
",",
"boolean",
"initialFill",
")",
"{",
"m_initialImageAttributes",
"=",
"imageAttributes",
";",
"for",
"(",
"Entry",
"<",
"Attribute",
",",
"I_CmsFormWidget"... | Displays the provided image information.<p>
@param imageInfo the image information
@param imageAttributes the image attributes
@param initialFill flag to indicate that a new image has been selected | [
"Displays",
"the",
"provided",
"image",
"information",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsImageEditorForm.java#L225-L245 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java | FileOperations.getFilePropertiesFromComputeNode | public FileProperties getFilePropertiesFromComputeNode(String poolId, String nodeId, String fileName) throws BatchErrorException, IOException {
"""
Gets information about a file on a compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId the ID of the compute node.
@param... | java | public FileProperties getFilePropertiesFromComputeNode(String poolId, String nodeId, String fileName) throws BatchErrorException, IOException {
return getFilePropertiesFromComputeNode(poolId, nodeId, fileName, null);
} | [
"public",
"FileProperties",
"getFilePropertiesFromComputeNode",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"String",
"fileName",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"return",
"getFilePropertiesFromComputeNode",
"(",
"poolId",
",",
... | Gets information about a file on a compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId the ID of the compute node.
@param fileName The name of the file to retrieve.
@return A {@link FileProperties} instance containing information about the file.
@throws BatchErrorException Exce... | [
"Gets",
"information",
"about",
"a",
"file",
"on",
"a",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java#L371-L373 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java | ShapeGenerator.createSliderThumbContinuous | public Shape createSliderThumbContinuous(final int x, final int y, final int diameter) {
"""
Return a path for a continuous slider thumb's concentric sections.
@param x the X coordinate of the upper-left corner of the section
@param y the Y coordinate of the upper-left corner of the section
@p... | java | public Shape createSliderThumbContinuous(final int x, final int y, final int diameter) {
return createEllipseInternal(x, y, diameter, diameter);
} | [
"public",
"Shape",
"createSliderThumbContinuous",
"(",
"final",
"int",
"x",
",",
"final",
"int",
"y",
",",
"final",
"int",
"diameter",
")",
"{",
"return",
"createEllipseInternal",
"(",
"x",
",",
"y",
",",
"diameter",
",",
"diameter",
")",
";",
"}"
] | Return a path for a continuous slider thumb's concentric sections.
@param x the X coordinate of the upper-left corner of the section
@param y the Y coordinate of the upper-left corner of the section
@param diameter the diameter of the section
@return a path representing the shape. | [
"Return",
"a",
"path",
"for",
"a",
"continuous",
"slider",
"thumb",
"s",
"concentric",
"sections",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L512-L514 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_portability_id_relaunch_GET | public OvhPortabilityFixErrorPossibleParameters billingAccount_portability_id_relaunch_GET(String billingAccount, Long id) throws IOException {
"""
Indicates whether or not error can be fixed and portability can be relaunched
REST: GET /telephony/{billingAccount}/portability/{id}/relaunch
@param billingAccount... | java | public OvhPortabilityFixErrorPossibleParameters billingAccount_portability_id_relaunch_GET(String billingAccount, Long id) throws IOException {
String qPath = "/telephony/{billingAccount}/portability/{id}/relaunch";
StringBuilder sb = path(qPath, billingAccount, id);
String resp = exec(qPath, "GET", sb.toString()... | [
"public",
"OvhPortabilityFixErrorPossibleParameters",
"billingAccount_portability_id_relaunch_GET",
"(",
"String",
"billingAccount",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/portability/{id}/relaunch\"",
";",
"St... | Indicates whether or not error can be fixed and portability can be relaunched
REST: GET /telephony/{billingAccount}/portability/{id}/relaunch
@param billingAccount [required] The name of your billingAccount
@param id [required] The ID of the portability | [
"Indicates",
"whether",
"or",
"not",
"error",
"can",
"be",
"fixed",
"and",
"portability",
"can",
"be",
"relaunched"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L330-L335 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePolynomialMath.java | QrCodePolynomialMath.encodeFormatBits | public static int encodeFormatBits(QrCode.ErrorLevel level , int mask ) {
"""
Encodes the format bits. BCH(15,5)
@param level Error correction level
@param mask The type of mask that is applied to the qr code
@return encoded bit field
"""
int message = (level.value << 3) | (mask & 0xFFFFFFF7);
message =... | java | public static int encodeFormatBits(QrCode.ErrorLevel level , int mask ) {
int message = (level.value << 3) | (mask & 0xFFFFFFF7);
message = message << 10;
return message ^ bitPolyModulus(message, FORMAT_GENERATOR,15,5);
} | [
"public",
"static",
"int",
"encodeFormatBits",
"(",
"QrCode",
".",
"ErrorLevel",
"level",
",",
"int",
"mask",
")",
"{",
"int",
"message",
"=",
"(",
"level",
".",
"value",
"<<",
"3",
")",
"|",
"(",
"mask",
"&",
"0xFFFFFFF7",
")",
";",
"message",
"=",
... | Encodes the format bits. BCH(15,5)
@param level Error correction level
@param mask The type of mask that is applied to the qr code
@return encoded bit field | [
"Encodes",
"the",
"format",
"bits",
".",
"BCH",
"(",
"15",
"5",
")"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePolynomialMath.java#L75-L79 |
wstrange/GoogleAuth | src/main/java/com/warrenstrange/googleauth/GoogleAuthenticatorQRGenerator.java | GoogleAuthenticatorQRGenerator.getOtpAuthURL | public static String getOtpAuthURL(String issuer,
String accountName,
GoogleAuthenticatorKey credentials) {
"""
Returns the URL of a Google Chart API call to generate a QR barcode to
be loaded into the Google Authenticator application. ... | java | public static String getOtpAuthURL(String issuer,
String accountName,
GoogleAuthenticatorKey credentials)
{
return String.format(
TOTP_URI_FORMAT,
internalURLEncode(getOtpAuthTotpURL(issuer, accoun... | [
"public",
"static",
"String",
"getOtpAuthURL",
"(",
"String",
"issuer",
",",
"String",
"accountName",
",",
"GoogleAuthenticatorKey",
"credentials",
")",
"{",
"return",
"String",
".",
"format",
"(",
"TOTP_URI_FORMAT",
",",
"internalURLEncode",
"(",
"getOtpAuthTotpURL",... | Returns the URL of a Google Chart API call to generate a QR barcode to
be loaded into the Google Authenticator application. The user scans this
bar code with the application on their smart phones or enters the
secret manually.
<p/>
The current implementation supports the following features:
<ul>
<li>Label, made up of ... | [
"Returns",
"the",
"URL",
"of",
"a",
"Google",
"Chart",
"API",
"call",
"to",
"generate",
"a",
"QR",
"barcode",
"to",
"be",
"loaded",
"into",
"the",
"Google",
"Authenticator",
"application",
".",
"The",
"user",
"scans",
"this",
"bar",
"code",
"with",
"the",
... | train | https://github.com/wstrange/GoogleAuth/blob/03f37333f8b3e411e10e63a7c85c4d2155929321/src/main/java/com/warrenstrange/googleauth/GoogleAuthenticatorQRGenerator.java#L136-L144 |
Waikato/moa | moa/src/main/java/moa/gui/visualization/GraphCanvas.java | GraphCanvas.addEvents | private void addEvents() {
"""
check if there are any new events in the event list and add them to the plot
"""
if (clusterEvents != null && clusterEvents.size() > eventCounter) {
ClusterEvent ev = clusterEvents.get(eventCounter);
eventCounter++;
JLabel eventMarker =... | java | private void addEvents() {
if (clusterEvents != null && clusterEvents.size() > eventCounter) {
ClusterEvent ev = clusterEvents.get(eventCounter);
eventCounter++;
JLabel eventMarker = new JLabel(ev.getType().substring(0, 1));
eventMarker.setPreferredSize(new Dimen... | [
"private",
"void",
"addEvents",
"(",
")",
"{",
"if",
"(",
"clusterEvents",
"!=",
"null",
"&&",
"clusterEvents",
".",
"size",
"(",
")",
">",
"eventCounter",
")",
"{",
"ClusterEvent",
"ev",
"=",
"clusterEvents",
".",
"get",
"(",
"eventCounter",
")",
";",
"... | check if there are any new events in the event list and add them to the plot | [
"check",
"if",
"there",
"are",
"any",
"new",
"events",
"in",
"the",
"event",
"list",
"and",
"add",
"them",
"to",
"the",
"plot"
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/gui/visualization/GraphCanvas.java#L203-L220 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/auth/DataResource.java | DataResource.fromName | public static DataResource fromName(String name) {
"""
Parses a data resource name into a DataResource instance.
@param name Name of the data resource.
@return DataResource instance matching the name.
"""
String[] parts = StringUtils.split(name, '/');
if (!parts[0].equals(ROOT_NAME) || par... | java | public static DataResource fromName(String name)
{
String[] parts = StringUtils.split(name, '/');
if (!parts[0].equals(ROOT_NAME) || parts.length > 3)
throw new IllegalArgumentException(String.format("%s is not a valid data resource name", name));
if (parts.length == 1)
... | [
"public",
"static",
"DataResource",
"fromName",
"(",
"String",
"name",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"StringUtils",
".",
"split",
"(",
"name",
",",
"'",
"'",
")",
";",
"if",
"(",
"!",
"parts",
"[",
"0",
"]",
".",
"equals",
"(",
"ROOT_... | Parses a data resource name into a DataResource instance.
@param name Name of the data resource.
@return DataResource instance matching the name. | [
"Parses",
"a",
"data",
"resource",
"name",
"into",
"a",
"DataResource",
"instance",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/DataResource.java#L105-L119 |
google/closure-compiler | src/com/google/javascript/jscomp/StrictModeCheck.java | StrictModeCheck.checkDelete | private static void checkDelete(NodeTraversal t, Node n) {
"""
Checks that variables, functions, and arguments are not deleted.
"""
if (n.getFirstChild().isName()) {
Var v = t.getScope().getVar(n.getFirstChild().getString());
if (v != null) {
t.report(n, DELETE_VARIABLE);
}
}
... | java | private static void checkDelete(NodeTraversal t, Node n) {
if (n.getFirstChild().isName()) {
Var v = t.getScope().getVar(n.getFirstChild().getString());
if (v != null) {
t.report(n, DELETE_VARIABLE);
}
}
} | [
"private",
"static",
"void",
"checkDelete",
"(",
"NodeTraversal",
"t",
",",
"Node",
"n",
")",
"{",
"if",
"(",
"n",
".",
"getFirstChild",
"(",
")",
".",
"isName",
"(",
")",
")",
"{",
"Var",
"v",
"=",
"t",
".",
"getScope",
"(",
")",
".",
"getVar",
... | Checks that variables, functions, and arguments are not deleted. | [
"Checks",
"that",
"variables",
"functions",
"and",
"arguments",
"are",
"not",
"deleted",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/StrictModeCheck.java#L165-L172 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java | ContinuousDistributions.betaCdf | public static double betaCdf(double x, double a, double b) {
"""
Calculates the probability from 0 to X under Beta Distribution
@param x
@param a
@param b
@return
"""
if(x<0 || a<=0 || b<=0) {
throw new IllegalArgumentException("All the parameters must be positive.");
}
... | java | public static double betaCdf(double x, double a, double b) {
if(x<0 || a<=0 || b<=0) {
throw new IllegalArgumentException("All the parameters must be positive.");
}
double Bcdf = 0.0;
if(x==0) {
return Bcdf;
}
else if (x>=1) {
... | [
"public",
"static",
"double",
"betaCdf",
"(",
"double",
"x",
",",
"double",
"a",
",",
"double",
"b",
")",
"{",
"if",
"(",
"x",
"<",
"0",
"||",
"a",
"<=",
"0",
"||",
"b",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"All t... | Calculates the probability from 0 to X under Beta Distribution
@param x
@param a
@param b
@return | [
"Calculates",
"the",
"probability",
"from",
"0",
"to",
"X",
"under",
"Beta",
"Distribution"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java#L213-L239 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/Approximation.java | Approximation.atan2 | public static double atan2(double y, double x) {
"""
Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).
This method computes the phase theta by computing an arc tangent of y/x in the range of -pi to pi.
@param y Y axis coordinate.
@param x X axis coo... | java | public static double atan2(double y, double x) {
double coeff_1 = 0.78539816339744830961566084581988;//Math.PI / 4d;
double coeff_2 = 3d * coeff_1;
double abs_y = Math.abs(y);
double angle;
if (x >= 0d) {
double r = (x - abs_y) / (x + abs_y);
angle ... | [
"public",
"static",
"double",
"atan2",
"(",
"double",
"y",
",",
"double",
"x",
")",
"{",
"double",
"coeff_1",
"=",
"0.78539816339744830961566084581988",
";",
"//Math.PI / 4d;\r",
"double",
"coeff_2",
"=",
"3d",
"*",
"coeff_1",
";",
"double",
"abs_y",
"=",
"Mat... | Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).
This method computes the phase theta by computing an arc tangent of y/x in the range of -pi to pi.
@param y Y axis coordinate.
@param x X axis coordinate.
@return The theta component of the point (r, theta) i... | [
"Returns",
"the",
"angle",
"theta",
"from",
"the",
"conversion",
"of",
"rectangular",
"coordinates",
"(",
"x",
"y",
")",
"to",
"polar",
"coordinates",
"(",
"r",
"theta",
")",
".",
"This",
"method",
"computes",
"the",
"phase",
"theta",
"by",
"computing",
"a... | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Approximation.java#L171-L184 |
relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/ApnsClientBuilder.java | ApnsClientBuilder.setApnsServer | public ApnsClientBuilder setApnsServer(final String hostname, final int port) {
"""
Sets the hostname and port of the server to which the client under construction will connect. Apple provides a
production and development environment, both of which listen for traffic on the default HTTPS port
({@value DEFAULT_AP... | java | public ApnsClientBuilder setApnsServer(final String hostname, final int port) {
this.apnsServerAddress = InetSocketAddress.createUnresolved(hostname, port);
return this;
} | [
"public",
"ApnsClientBuilder",
"setApnsServer",
"(",
"final",
"String",
"hostname",
",",
"final",
"int",
"port",
")",
"{",
"this",
".",
"apnsServerAddress",
"=",
"InetSocketAddress",
".",
"createUnresolved",
"(",
"hostname",
",",
"port",
")",
";",
"return",
"thi... | Sets the hostname and port of the server to which the client under construction will connect. Apple provides a
production and development environment, both of which listen for traffic on the default HTTPS port
({@value DEFAULT_APNS_PORT}) and an alternate port ({@value ALTERNATE_APNS_PORT}), which callers may use to wo... | [
"Sets",
"the",
"hostname",
"and",
"port",
"of",
"the",
"server",
"to",
"which",
"the",
"client",
"under",
"construction",
"will",
"connect",
".",
"Apple",
"provides",
"a",
"production",
"and",
"development",
"environment",
"both",
"of",
"which",
"listen",
"for... | train | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/ApnsClientBuilder.java#L164-L167 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/util/ThreadCpuStats.java | ThreadCpuStats.printThreadCpuUsages | public void printThreadCpuUsages(OutputStream out, CpuUsageComparator cmp) {
"""
Utility function that dumps the cpu usages for the threads to stdout. Output will be sorted
based on the 1-minute usage from highest to lowest.
@param out stream where output will be written
@param cmp order to use for the result... | java | public void printThreadCpuUsages(OutputStream out, CpuUsageComparator cmp) {
final PrintWriter writer = getPrintWriter(out);
final Map<String, Object> threadCpuUsages = getThreadCpuUsages(cmp);
writer.printf("Time: %s%n%n", new Date((Long) threadCpuUsages.get(CURRENT_TIME)));
final long uptimeMillis = ... | [
"public",
"void",
"printThreadCpuUsages",
"(",
"OutputStream",
"out",
",",
"CpuUsageComparator",
"cmp",
")",
"{",
"final",
"PrintWriter",
"writer",
"=",
"getPrintWriter",
"(",
"out",
")",
";",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"threadCpuUsages",... | Utility function that dumps the cpu usages for the threads to stdout. Output will be sorted
based on the 1-minute usage from highest to lowest.
@param out stream where output will be written
@param cmp order to use for the results | [
"Utility",
"function",
"that",
"dumps",
"the",
"cpu",
"usages",
"for",
"the",
"threads",
"to",
"stdout",
".",
"Output",
"will",
"be",
"sorted",
"based",
"on",
"the",
"1",
"-",
"minute",
"usage",
"from",
"highest",
"to",
"lowest",
"."
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/util/ThreadCpuStats.java#L282-L338 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.createGridGeometryGeneralParameter | public static GeneralParameterValue[] createGridGeometryGeneralParameter( int width, int height, double north, double south,
double east, double west, CoordinateReferenceSystem crs ) {
"""
Utility method to create read parameters for {@link GridCoverageReader}
@param width the needed number of colum... | java | public static GeneralParameterValue[] createGridGeometryGeneralParameter( int width, int height, double north, double south,
double east, double west, CoordinateReferenceSystem crs ) {
GeneralParameterValue[] readParams = new GeneralParameterValue[1];
Parameter<GridGeometry2D> readGG = new P... | [
"public",
"static",
"GeneralParameterValue",
"[",
"]",
"createGridGeometryGeneralParameter",
"(",
"int",
"width",
",",
"int",
"height",
",",
"double",
"north",
",",
"double",
"south",
",",
"double",
"east",
",",
"double",
"west",
",",
"CoordinateReferenceSystem",
... | Utility method to create read parameters for {@link GridCoverageReader}
@param width the needed number of columns.
@param height the needed number of columns.
@param north the northern boundary.
@param south the southern boundary.
@param east the eastern boundary.
@param west the western boundary.
@param crs the {@lin... | [
"Utility",
"method",
"to",
"create",
"read",
"parameters",
"for",
"{",
"@link",
"GridCoverageReader",
"}"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L623-L641 |
jurmous/etcd4j | src/main/java/mousio/etcd4j/security/SecurityContextBuilder.java | SecurityContextBuilder.forKeystore | public static SslContext forKeystore(String keystorePath, String keystorePassword, String keyManagerAlgorithm)
throws SecurityContextException {
"""
Builds SslContext using protected keystore file overriding default key manger algorithm. Adequate for non-mutual TLS connections.
@param keystorePath P... | java | public static SslContext forKeystore(String keystorePath, String keystorePassword, String keyManagerAlgorithm)
throws SecurityContextException {
try {
return forKeystore(new FileInputStream(keystorePath), keystorePassword, keyManagerAlgorithm);
} catch (Exception e) {
... | [
"public",
"static",
"SslContext",
"forKeystore",
"(",
"String",
"keystorePath",
",",
"String",
"keystorePassword",
",",
"String",
"keyManagerAlgorithm",
")",
"throws",
"SecurityContextException",
"{",
"try",
"{",
"return",
"forKeystore",
"(",
"new",
"FileInputStream",
... | Builds SslContext using protected keystore file overriding default key manger algorithm. Adequate for non-mutual TLS connections.
@param keystorePath Path for keystore file
@param keystorePassword Password for protected keystore file
@param keyManagerAlgorithm Algorithm for keyManager used to process keystorefile
@ret... | [
"Builds",
"SslContext",
"using",
"protected",
"keystore",
"file",
"overriding",
"default",
"key",
"manger",
"algorithm",
".",
"Adequate",
"for",
"non",
"-",
"mutual",
"TLS",
"connections",
"."
] | train | https://github.com/jurmous/etcd4j/blob/ffb1d574cf85bbab025dd566ce250f1860bbcbc7/src/main/java/mousio/etcd4j/security/SecurityContextBuilder.java#L41-L49 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/UsersApi.java | UsersApi.listAllSharesForUser | public DeviceSharingEnvelope listAllSharesForUser(String userId, String filter, Integer count, Integer offset) throws ApiException {
"""
Get User shares
Get User shares
@param userId User ID. (required)
@param filter filter (required)
@param count Desired count of items in the result set. (optional)
@param of... | java | public DeviceSharingEnvelope listAllSharesForUser(String userId, String filter, Integer count, Integer offset) throws ApiException {
ApiResponse<DeviceSharingEnvelope> resp = listAllSharesForUserWithHttpInfo(userId, filter, count, offset);
return resp.getData();
} | [
"public",
"DeviceSharingEnvelope",
"listAllSharesForUser",
"(",
"String",
"userId",
",",
"String",
"filter",
",",
"Integer",
"count",
",",
"Integer",
"offset",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"DeviceSharingEnvelope",
">",
"resp",
"=",
"listAl... | Get User shares
Get User shares
@param userId User ID. (required)
@param filter filter (required)
@param count Desired count of items in the result set. (optional)
@param offset Offset for pagination. (optional)
@return DeviceSharingEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot dese... | [
"Get",
"User",
"shares",
"Get",
"User",
"shares"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/UsersApi.java#L1056-L1059 |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/asserts/SeLionSoftAssert.java | SeLionSoftAssert.showAssertInfo | private void showAssertInfo(IAssert<?> assertCommand, AssertionError ex, boolean failedTest) {
"""
Shows a message in Reporter based on the assert result and also includes the stacktrace for failed assert.
@param assertCommand
The assert conditions for current test.
@param ex
An {@link AssertionError} in cas... | java | private void showAssertInfo(IAssert<?> assertCommand, AssertionError ex, boolean failedTest) {
ITestResult testResult = Reporter.getCurrentTestResult();
// Checks whether the soft assert was called in a TestNG test run or else within a Java application.
String methodName = "main";
if (t... | [
"private",
"void",
"showAssertInfo",
"(",
"IAssert",
"<",
"?",
">",
"assertCommand",
",",
"AssertionError",
"ex",
",",
"boolean",
"failedTest",
")",
"{",
"ITestResult",
"testResult",
"=",
"Reporter",
".",
"getCurrentTestResult",
"(",
")",
";",
"// Checks whether t... | Shows a message in Reporter based on the assert result and also includes the stacktrace for failed assert.
@param assertCommand
The assert conditions for current test.
@param ex
An {@link AssertionError} in case of failed assert, else null.
@param failedTest
A boolean {@code true} when the assert has failed. | [
"Shows",
"a",
"message",
"in",
"Reporter",
"based",
"on",
"the",
"assert",
"result",
"and",
"also",
"includes",
"the",
"stacktrace",
"for",
"failed",
"assert",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/asserts/SeLionSoftAssert.java#L71-L95 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcPreparedStatement.java | WSJdbcPreparedStatement.executeBatch | private Object executeBatch(Object implObject, Method method, Object[] args)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException,
SQLException {
"""
Invokes executeBatch and after closing any previous result sets and ensuring statement properti... | java | private Object executeBatch(Object implObject, Method method, Object[] args)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException,
SQLException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.is... | [
"private",
"Object",
"executeBatch",
"(",
"Object",
"implObject",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"IllegalAccessException",
",",
"IllegalArgumentException",
",",
"InvocationTargetException",
",",
"SQLException",
"{",
"final",
... | Invokes executeBatch and after closing any previous result sets and ensuring statement properties are up-to-date.
@param implObject the instance on which the operation is invoked.
@param method the method that is invoked.
@param args the parameters to the method.
@throws IllegalAccessException if the method is inacce... | [
"Invokes",
"executeBatch",
"and",
"after",
"closing",
"any",
"previous",
"result",
"sets",
"and",
"ensuring",
"statement",
"properties",
"are",
"up",
"-",
"to",
"-",
"date",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcPreparedStatement.java#L430-L453 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.getObject | public JSONObject getObject(String objectID, List<String> attributesToRetrieve, RequestOptions requestOptions) throws AlgoliaException {
"""
Get an object from this index
@param objectID the unique identifier of the object to retrieve
@param attributesToRetrieve contains the list of attributes to r... | java | public JSONObject getObject(String objectID, List<String> attributesToRetrieve, RequestOptions requestOptions) throws AlgoliaException {
try {
String params = encodeAttributes(attributesToRetrieve, true);
return client.getRequest("/1/indexes/" + encodedIndexName + "/" + URLEncoder.encode(objectID, "UTF-... | [
"public",
"JSONObject",
"getObject",
"(",
"String",
"objectID",
",",
"List",
"<",
"String",
">",
"attributesToRetrieve",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"try",
"{",
"String",
"params",
"=",
"encodeAttributes",
"(",
... | Get an object from this index
@param objectID the unique identifier of the object to retrieve
@param attributesToRetrieve contains the list of attributes to retrieve.
@param requestOptions Options to pass to this request | [
"Get",
"an",
"object",
"from",
"this",
"index"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L267-L274 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getElementMatching | @Pure
public static Element getElementMatching(Node document, XMLConstraint constraint, String... path) {
"""
Replies the node that corresponds to the specified path.
<p>The path is an ordered list of tag's names and ended by the name of
the desired node.
@param document is the XML document to explore.
@p... | java | @Pure
public static Element getElementMatching(Node document, XMLConstraint constraint, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
assert constraint != null : AssertMessages.notNullParameter(1);
return getElementMatching(document, constraint, true, path);
} | [
"@",
"Pure",
"public",
"static",
"Element",
"getElementMatching",
"(",
"Node",
"document",
",",
"XMLConstraint",
"constraint",
",",
"String",
"...",
"path",
")",
"{",
"assert",
"document",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
"0",
... | Replies the node that corresponds to the specified path.
<p>The path is an ordered list of tag's names and ended by the name of
the desired node.
@param document is the XML document to explore.
@param constraint is the constraint that the replied element must respect.
@param path is the list of names.
@return the nod... | [
"Replies",
"the",
"node",
"that",
"corresponds",
"to",
"the",
"specified",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L1441-L1446 |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java | RequestParam.getInt | public static int getInt(@NotNull ServletRequest request, @NotNull String param) {
"""
Returns a request parameter as integer.
@param request Request.
@param param Parameter name.
@return Parameter value or 0 if it does not exist or is not a number.
"""
return getInt(request, param, 0);
} | java | public static int getInt(@NotNull ServletRequest request, @NotNull String param) {
return getInt(request, param, 0);
} | [
"public",
"static",
"int",
"getInt",
"(",
"@",
"NotNull",
"ServletRequest",
"request",
",",
"@",
"NotNull",
"String",
"param",
")",
"{",
"return",
"getInt",
"(",
"request",
",",
"param",
",",
"0",
")",
";",
"}"
] | Returns a request parameter as integer.
@param request Request.
@param param Parameter name.
@return Parameter value or 0 if it does not exist or is not a number. | [
"Returns",
"a",
"request",
"parameter",
"as",
"integer",
"."
] | train | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java#L145-L147 |
indeedeng/util | io/src/main/java/com/indeed/util/io/Files.java | Files.isChanged | private static boolean isChanged(byte[] bytes, String filepath) throws IOException {
"""
Returns true iff the bytes in an array are different from the bytes
contained in the given file, or if the file does not exist.
"""
return isChanged(bytes, bytes.length, filepath);
} | java | private static boolean isChanged(byte[] bytes, String filepath) throws IOException {
return isChanged(bytes, bytes.length, filepath);
} | [
"private",
"static",
"boolean",
"isChanged",
"(",
"byte",
"[",
"]",
"bytes",
",",
"String",
"filepath",
")",
"throws",
"IOException",
"{",
"return",
"isChanged",
"(",
"bytes",
",",
"bytes",
".",
"length",
",",
"filepath",
")",
";",
"}"
] | Returns true iff the bytes in an array are different from the bytes
contained in the given file, or if the file does not exist. | [
"Returns",
"true",
"iff",
"the",
"bytes",
"in",
"an",
"array",
"are",
"different",
"from",
"the",
"bytes",
"contained",
"in",
"the",
"given",
"file",
"or",
"if",
"the",
"file",
"does",
"not",
"exist",
"."
] | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/io/src/main/java/com/indeed/util/io/Files.java#L368-L370 |
Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/HelpCommand.java | HelpCommand.printCommandInfo | public static void printCommandInfo(Command command, PrintWriter pw) {
"""
Prints the info about a command to the given print writer.
@param command command to print info
@param pw where to print the info
"""
String description =
String.format("%s: %s", command.getCommandName(), command.getDesc... | java | public static void printCommandInfo(Command command, PrintWriter pw) {
String description =
String.format("%s: %s", command.getCommandName(), command.getDescription());
int width = 80;
try {
width = TerminalFactory.get().getWidth();
} catch (Exception e) {
// In case the terminal fac... | [
"public",
"static",
"void",
"printCommandInfo",
"(",
"Command",
"command",
",",
"PrintWriter",
"pw",
")",
"{",
"String",
"description",
"=",
"String",
".",
"format",
"(",
"\"%s: %s\"",
",",
"command",
".",
"getCommandName",
"(",
")",
",",
"command",
".",
"ge... | Prints the info about a command to the given print writer.
@param command command to print info
@param pw where to print the info | [
"Prints",
"the",
"info",
"about",
"a",
"command",
"to",
"the",
"given",
"print",
"writer",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/HelpCommand.java#L46-L62 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/rpc/runner/XmlRpcRemoteRunner.java | XmlRpcRemoteRunner.runReference | @SuppressWarnings("unchecked")
public Reference runReference(Reference reference, String locale)
throws GreenPepperServerException {
"""
<p>runReference.</p>
@param reference a {@link com.greenpepper.server.domain.Reference} object.
@param locale a {@link java.lang.String} object.
@return a {@link com.gre... | java | @SuppressWarnings("unchecked")
public Reference runReference(Reference reference, String locale)
throws GreenPepperServerException
{
return xmlRpc.runReference(reference, locale, getIdentifier());
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Reference",
"runReference",
"(",
"Reference",
"reference",
",",
"String",
"locale",
")",
"throws",
"GreenPepperServerException",
"{",
"return",
"xmlRpc",
".",
"runReference",
"(",
"reference",
",",
"loca... | <p>runReference.</p>
@param reference a {@link com.greenpepper.server.domain.Reference} object.
@param locale a {@link java.lang.String} object.
@return a {@link com.greenpepper.server.domain.Reference} object.
@throws com.greenpepper.server.GreenPepperServerException if any. | [
"<p",
">",
"runReference",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/rpc/runner/XmlRpcRemoteRunner.java#L229-L234 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/jbeanbox/BeanBoxUtils.java | BeanBoxUtils.nameMatch | public static boolean nameMatch(String regex, String name) {
"""
A simple matcher for class and method name, only 1 * allowed <br/>
"*abc.ef" matches "any.abc.ef", "anymoreabc.ef" ... <br/>
"abc.ef*" matches "abc.efg", "abc.efg.hj" ... <br/>
"abc*def" matches "abcd.efg.ddef", "abcany*anydef"
"""
if (regex... | java | public static boolean nameMatch(String regex, String name) {
if (regex == null || regex.length() == 0 || name == null || name.length() == 0)
return false;
if ('*' == (regex.charAt(0))) {
return name.endsWith(regex.substring(1));
} else if (regex.endsWith("*")) {
return name.startsWith(regex.substring(0, ... | [
"public",
"static",
"boolean",
"nameMatch",
"(",
"String",
"regex",
",",
"String",
"name",
")",
"{",
"if",
"(",
"regex",
"==",
"null",
"||",
"regex",
".",
"length",
"(",
")",
"==",
"0",
"||",
"name",
"==",
"null",
"||",
"name",
".",
"length",
"(",
... | A simple matcher for class and method name, only 1 * allowed <br/>
"*abc.ef" matches "any.abc.ef", "anymoreabc.ef" ... <br/>
"abc.ef*" matches "abc.efg", "abc.efg.hj" ... <br/>
"abc*def" matches "abcd.efg.ddef", "abcany*anydef" | [
"A",
"simple",
"matcher",
"for",
"class",
"and",
"method",
"name",
"only",
"1",
"*",
"allowed",
"<br",
"/",
">",
"*",
"abc",
".",
"ef",
"matches",
"any",
".",
"abc",
".",
"ef",
"anymoreabc",
".",
"ef",
"...",
"<br",
"/",
">",
"abc",
".",
"ef",
"*... | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/jbeanbox/BeanBoxUtils.java#L326-L339 |
stripe/stripe-java | src/main/java/com/stripe/model/UsageRecord.java | UsageRecord.createOnSubscriptionItem | public static UsageRecord createOnSubscriptionItem(
String subscriptionItem, Map<String, Object> params, RequestOptions options)
throws StripeException {
"""
Creates a usage record for a specified subscription item and date, and fills it with a
quantity.
<p>Usage records provide <code>quantity</cod... | java | public static UsageRecord createOnSubscriptionItem(
String subscriptionItem, Map<String, Object> params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format(
"/v1/subscription_... | [
"public",
"static",
"UsageRecord",
"createOnSubscriptionItem",
"(",
"String",
"subscriptionItem",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"String",
"url",
"=",
"String",
".",... | Creates a usage record for a specified subscription item and date, and fills it with a
quantity.
<p>Usage records provide <code>quantity</code> information that Stripe uses to track how much a
customer is using your service. With usage information and the pricing model set up by the <a
href="https://stripe.com/docs/bi... | [
"Creates",
"a",
"usage",
"record",
"for",
"a",
"specified",
"subscription",
"item",
"and",
"date",
"and",
"fills",
"it",
"with",
"a",
"quantity",
"."
] | train | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/UsageRecord.java#L70-L81 |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.rollDays | public static java.sql.Date rollDays(java.util.Date startDate, int days) {
"""
Roll the days forward or backward.
@param startDate - The start date
@param days - Negative to rollbackwards.
"""
return rollDate(startDate, Calendar.DATE, days);
} | java | public static java.sql.Date rollDays(java.util.Date startDate, int days) {
return rollDate(startDate, Calendar.DATE, days);
} | [
"public",
"static",
"java",
".",
"sql",
".",
"Date",
"rollDays",
"(",
"java",
".",
"util",
".",
"Date",
"startDate",
",",
"int",
"days",
")",
"{",
"return",
"rollDate",
"(",
"startDate",
",",
"Calendar",
".",
"DATE",
",",
"days",
")",
";",
"}"
] | Roll the days forward or backward.
@param startDate - The start date
@param days - Negative to rollbackwards. | [
"Roll",
"the",
"days",
"forward",
"or",
"backward",
"."
] | train | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L202-L204 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ReplicationLinksInner.java | ReplicationLinksInner.failoverAllowDataLoss | public void failoverAllowDataLoss(String resourceGroupName, String serverName, String databaseName, String linkId) {
"""
Sets which replica database is primary by failing over from the current primary replica database. This operation might result in data loss.
@param resourceGroupName The name of the resource g... | java | public void failoverAllowDataLoss(String resourceGroupName, String serverName, String databaseName, String linkId) {
failoverAllowDataLossWithServiceResponseAsync(resourceGroupName, serverName, databaseName, linkId).toBlocking().last().body();
} | [
"public",
"void",
"failoverAllowDataLoss",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"linkId",
")",
"{",
"failoverAllowDataLossWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",... | Sets which replica database is primary by failing over from the current primary replica database. This operation might result in data loss.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName ... | [
"Sets",
"which",
"replica",
"database",
"is",
"primary",
"by",
"failing",
"over",
"from",
"the",
"current",
"primary",
"replica",
"database",
".",
"This",
"operation",
"might",
"result",
"in",
"data",
"loss",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ReplicationLinksInner.java#L480-L482 |
dkmfbk/knowledgestore | ks-core/src/main/java/eu/fbk/knowledgestore/data/XPath.java | XPath.asFunction | public final <T> Function<Object, List<T>> asFunction(final Class<T> resultClass) {
"""
Returns a function view of this {@code XPath} expression that produces a {@code List<T>}
result given an input object. If this {@code XPath} is lenient, evaluation of the function
will return an empty list on failure, rather ... | java | public final <T> Function<Object, List<T>> asFunction(final Class<T> resultClass) {
Preconditions.checkNotNull(resultClass);
return new Function<Object, List<T>>() {
@Override
public List<T> apply(@Nullable final Object object) {
Preconditions.checkNotNull(obje... | [
"public",
"final",
"<",
"T",
">",
"Function",
"<",
"Object",
",",
"List",
"<",
"T",
">",
">",
"asFunction",
"(",
"final",
"Class",
"<",
"T",
">",
"resultClass",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"resultClass",
")",
";",
"return",
"ne... | Returns a function view of this {@code XPath} expression that produces a {@code List<T>}
result given an input object. If this {@code XPath} is lenient, evaluation of the function
will return an empty list on failure, rather than throwing an
{@link IllegalArgumentException}.
@param resultClass
the {@code Class} object... | [
"Returns",
"a",
"function",
"view",
"of",
"this",
"{",
"@code",
"XPath",
"}",
"expression",
"that",
"produces",
"a",
"{",
"@code",
"List<T",
">",
"}",
"result",
"given",
"an",
"input",
"object",
".",
"If",
"this",
"{",
"@code",
"XPath",
"}",
"is",
"len... | train | https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-core/src/main/java/eu/fbk/knowledgestore/data/XPath.java#L826-L839 |
xebia/Xebium | src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java | SeleniumDriverFixture.startDriverOnUrl | public void startDriverOnUrl(final WebDriver webDriver, final String browserUrl) {
"""
<p><code>
| start driver | <i>$Driver</i> | on url | <i>http://localhost</i> |
</code></p>
@param webDriver a WebDriver instance
@param browserUrl
"""
setCommandProcessor(startWebDriverCommandProcessor(browserU... | java | public void startDriverOnUrl(final WebDriver webDriver, final String browserUrl) {
setCommandProcessor(startWebDriverCommandProcessor(browserUrl, webDriver));
setTimeoutOnSelenium();
LOG.debug("Started command processor");
} | [
"public",
"void",
"startDriverOnUrl",
"(",
"final",
"WebDriver",
"webDriver",
",",
"final",
"String",
"browserUrl",
")",
"{",
"setCommandProcessor",
"(",
"startWebDriverCommandProcessor",
"(",
"browserUrl",
",",
"webDriver",
")",
")",
";",
"setTimeoutOnSelenium",
"(",... | <p><code>
| start driver | <i>$Driver</i> | on url | <i>http://localhost</i> |
</code></p>
@param webDriver a WebDriver instance
@param browserUrl | [
"<p",
">",
"<code",
">",
"|",
"start",
"driver",
"|",
"<i",
">",
"$Driver<",
"/",
"i",
">",
"|",
"on",
"url",
"|",
"<i",
">",
"http",
":",
"//",
"localhost<",
"/",
"i",
">",
"|",
"<",
"/",
"code",
">",
"<",
"/",
"p",
">"
] | train | https://github.com/xebia/Xebium/blob/594f6d9e65622acdbd03dba0700b17645981da1f/src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java#L168-L172 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.setOutboundConnectionInfo | public void setOutboundConnectionInfo(Map<String, Object> connectionInfo) {
"""
Set the outbound connection info of this context to the input value.
@param connectionInfo
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setOutboundConnectionInfo");
... | java | public void setOutboundConnectionInfo(Map<String, Object> connectionInfo) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setOutboundConnectionInfo");
this.outboundConnectionInfo = connectionInfo;
} | [
"public",
"void",
"setOutboundConnectionInfo",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"connectionInfo",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",... | Set the outbound connection info of this context to the input value.
@param connectionInfo | [
"Set",
"the",
"outbound",
"connection",
"info",
"of",
"this",
"context",
"to",
"the",
"input",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L202-L206 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java | CPAttachmentFileEntryPersistenceImpl.removeByLtD_S | @Override
public void removeByLtD_S(Date displayDate, int status) {
"""
Removes all the cp attachment file entries where displayDate < ? and status = ? from the database.
@param displayDate the display date
@param status the status
"""
for (CPAttachmentFileEntry cpAttachmentFileEntry : findBy... | java | @Override
public void removeByLtD_S(Date displayDate, int status) {
for (CPAttachmentFileEntry cpAttachmentFileEntry : findByLtD_S(
displayDate, status, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpAttachmentFileEntry);
}
} | [
"@",
"Override",
"public",
"void",
"removeByLtD_S",
"(",
"Date",
"displayDate",
",",
"int",
"status",
")",
"{",
"for",
"(",
"CPAttachmentFileEntry",
"cpAttachmentFileEntry",
":",
"findByLtD_S",
"(",
"displayDate",
",",
"status",
",",
"QueryUtil",
".",
"ALL_POS",
... | Removes all the cp attachment file entries where displayDate < ? and status = ? from the database.
@param displayDate the display date
@param status the status | [
"Removes",
"all",
"the",
"cp",
"attachment",
"file",
"entries",
"where",
"displayDate",
"<",
";",
"?",
";",
"and",
"status",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java#L2536-L2542 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java | JSONObject.optDouble | public double optDouble(String name, double fallback) {
"""
Returns the value mapped by {@code name} if it exists and is a double or can be
coerced to a double. Returns {@code fallback} otherwise.
@param name the name of the property
@param fallback a fallback value
@return the value or {@code fallback}
""... | java | public double optDouble(String name, double fallback) {
Object object = opt(name);
Double result = JSON.toDouble(object);
return result != null ? result : fallback;
} | [
"public",
"double",
"optDouble",
"(",
"String",
"name",
",",
"double",
"fallback",
")",
"{",
"Object",
"object",
"=",
"opt",
"(",
"name",
")",
";",
"Double",
"result",
"=",
"JSON",
".",
"toDouble",
"(",
"object",
")",
";",
"return",
"result",
"!=",
"nu... | Returns the value mapped by {@code name} if it exists and is a double or can be
coerced to a double. Returns {@code fallback} otherwise.
@param name the name of the property
@param fallback a fallback value
@return the value or {@code fallback} | [
"Returns",
"the",
"value",
"mapped",
"by",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java#L465-L469 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedConnection.java | MemcachedConnection.enqueueOperation | public void enqueueOperation(final String key, final Operation o) {
"""
Enqueue the given {@link Operation} with the used key.
@param key the key to use.
@param o the {@link Operation} to enqueue.
"""
checkState();
StringUtils.validateKey(key, opFact instanceof BinaryOperationFactory);
addOpera... | java | public void enqueueOperation(final String key, final Operation o) {
checkState();
StringUtils.validateKey(key, opFact instanceof BinaryOperationFactory);
addOperation(key, o);
} | [
"public",
"void",
"enqueueOperation",
"(",
"final",
"String",
"key",
",",
"final",
"Operation",
"o",
")",
"{",
"checkState",
"(",
")",
";",
"StringUtils",
".",
"validateKey",
"(",
"key",
",",
"opFact",
"instanceof",
"BinaryOperationFactory",
")",
";",
"addOper... | Enqueue the given {@link Operation} with the used key.
@param key the key to use.
@param o the {@link Operation} to enqueue. | [
"Enqueue",
"the",
"given",
"{",
"@link",
"Operation",
"}",
"with",
"the",
"used",
"key",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedConnection.java#L1196-L1200 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/translate/Autoboxer.java | Autoboxer.unbox | private void unbox(Expression expr, PrimitiveType primitiveType) {
"""
Convert a wrapper class instance to a specified primitive equivalent.
"""
TypeElement boxedClass = findBoxedSuperclass(expr.getTypeMirror());
if (primitiveType == null && boxedClass != null) {
primitiveType = typeUtil.unboxedT... | java | private void unbox(Expression expr, PrimitiveType primitiveType) {
TypeElement boxedClass = findBoxedSuperclass(expr.getTypeMirror());
if (primitiveType == null && boxedClass != null) {
primitiveType = typeUtil.unboxedType(boxedClass.asType());
}
if (primitiveType == null) {
return;
}
... | [
"private",
"void",
"unbox",
"(",
"Expression",
"expr",
",",
"PrimitiveType",
"primitiveType",
")",
"{",
"TypeElement",
"boxedClass",
"=",
"findBoxedSuperclass",
"(",
"expr",
".",
"getTypeMirror",
"(",
")",
")",
";",
"if",
"(",
"primitiveType",
"==",
"null",
"&... | Convert a wrapper class instance to a specified primitive equivalent. | [
"Convert",
"a",
"wrapper",
"class",
"instance",
"to",
"a",
"specified",
"primitive",
"equivalent",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/translate/Autoboxer.java#L121-L135 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/color/ColorYuv.java | ColorYuv.rgbToYuv | public static void rgbToYuv( double r , double g , double b , double yuv[] ) {
"""
Conversion from RGB to YUV using same equations as Intel IPP.
"""
double y = yuv[0] = 0.299*r + 0.587*g + 0.114*b;
yuv[1] = 0.492*(b-y);
yuv[2] = 0.877*(r-y);
} | java | public static void rgbToYuv( double r , double g , double b , double yuv[] ) {
double y = yuv[0] = 0.299*r + 0.587*g + 0.114*b;
yuv[1] = 0.492*(b-y);
yuv[2] = 0.877*(r-y);
} | [
"public",
"static",
"void",
"rgbToYuv",
"(",
"double",
"r",
",",
"double",
"g",
",",
"double",
"b",
",",
"double",
"yuv",
"[",
"]",
")",
"{",
"double",
"y",
"=",
"yuv",
"[",
"0",
"]",
"=",
"0.299",
"*",
"r",
"+",
"0.587",
"*",
"g",
"+",
"0.114"... | Conversion from RGB to YUV using same equations as Intel IPP. | [
"Conversion",
"from",
"RGB",
"to",
"YUV",
"using",
"same",
"equations",
"as",
"Intel",
"IPP",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorYuv.java#L64-L68 |
op4j/op4j | src/main/java/org/op4j/functions/FnFunc.java | FnFunc.ifNullThenElse | public static final <T,R> Function<T,R> ifNullThenElse(
final Type<T> targetType,
final IFunction<? super T,R> thenFunction, final IFunction<? super T,R> elseFunction) {
"""
<p>
Builds a function that will execute the specified function <tt>thenFunction</tt>
only if the target object i... | java | public static final <T,R> Function<T,R> ifNullThenElse(
final Type<T> targetType,
final IFunction<? super T,R> thenFunction, final IFunction<? super T,R> elseFunction) {
return ifTrueThenElse(targetType, FnObject.isNull(), thenFunction, elseFunction);
} | [
"public",
"static",
"final",
"<",
"T",
",",
"R",
">",
"Function",
"<",
"T",
",",
"R",
">",
"ifNullThenElse",
"(",
"final",
"Type",
"<",
"T",
">",
"targetType",
",",
"final",
"IFunction",
"<",
"?",
"super",
"T",
",",
"R",
">",
"thenFunction",
",",
"... | <p>
Builds a function that will execute the specified function <tt>thenFunction</tt>
only if the target object is null, and will execute the specified function
<tt>elseFunction</tt> otherwise.
</p>
<p>
The built function can effectively change the target type (receive <tt>T</tt> and
return <tt>R</tt>) if both <tt>thenF... | [
"<p",
">",
"Builds",
"a",
"function",
"that",
"will",
"execute",
"the",
"specified",
"function",
"<tt",
">",
"thenFunction<",
"/",
"tt",
">",
"only",
"if",
"the",
"target",
"object",
"is",
"null",
"and",
"will",
"execute",
"the",
"specified",
"function",
"... | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnFunc.java#L198-L202 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/messages/Requests.java | Requests.createPublishUpdate | public static PublishUpdate createPublishUpdate(Identifier i1, Identifier i2,
Document md, MetadataLifetime lifetime) {
"""
Create a new {@link PublishUpdate} instance that is used to publish
metadata on a link between two {@link Identifier} instances with a specific
{@link MetadataLifetime}.
@param i1 the... | java | public static PublishUpdate createPublishUpdate(Identifier i1, Identifier i2,
Document md, MetadataLifetime lifetime) {
if (md == null) {
throw new NullPointerException("md not allowed to be null");
}
List<Document> list = new ArrayList<Document>(1);
list.add(md);
return createPublishUpdate(i1, i2, li... | [
"public",
"static",
"PublishUpdate",
"createPublishUpdate",
"(",
"Identifier",
"i1",
",",
"Identifier",
"i2",
",",
"Document",
"md",
",",
"MetadataLifetime",
"lifetime",
")",
"{",
"if",
"(",
"md",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
... | Create a new {@link PublishUpdate} instance that is used to publish
metadata on a link between two {@link Identifier} instances with a specific
{@link MetadataLifetime}.
@param i1 the first {@link Identifier} of the link
@param i2 the second {@link Identifier} of the link
@param md the metadata that shall be published... | [
"Create",
"a",
"new",
"{",
"@link",
"PublishUpdate",
"}",
"instance",
"that",
"is",
"used",
"to",
"publish",
"metadata",
"on",
"a",
"link",
"between",
"two",
"{",
"@link",
"Identifier",
"}",
"instances",
"with",
"a",
"specific",
"{",
"@link",
"MetadataLifeti... | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/messages/Requests.java#L375-L385 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/message/ReceiveQueueSession.java | ReceiveQueueSession.removeRemoteMessageFilter | public boolean removeRemoteMessageFilter(BaseMessageFilter messageFilter, boolean bFreeFilter) throws RemoteException {
"""
Remove this listener (called from remote).
@param messageFilter The message filter.
"""
Utility.getLogger().info("EJB removeMessageFilter filter: " + messageFilter);
Mess... | java | public boolean removeRemoteMessageFilter(BaseMessageFilter messageFilter, boolean bFreeFilter) throws RemoteException
{
Utility.getLogger().info("EJB removeMessageFilter filter: " + messageFilter);
MessageManager messageManager = ((Application)this.getTask().getApplication()).getMessageManager();
... | [
"public",
"boolean",
"removeRemoteMessageFilter",
"(",
"BaseMessageFilter",
"messageFilter",
",",
"boolean",
"bFreeFilter",
")",
"throws",
"RemoteException",
"{",
"Utility",
".",
"getLogger",
"(",
")",
".",
"info",
"(",
"\"EJB removeMessageFilter filter: \"",
"+",
"mess... | Remove this listener (called from remote).
@param messageFilter The message filter. | [
"Remove",
"this",
"listener",
"(",
"called",
"from",
"remote",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/message/ReceiveQueueSession.java#L184-L193 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.KumarJohnsonDivergence | public static double KumarJohnsonDivergence(double[] p, double[] q) {
"""
Gets the Kumar-Johnson divergence.
@param p P vector.
@param q Q vector.
@return The Kumar-Johnson divergence between p and q.
"""
double r = 0;
for (int i = 0; i < p.length; i++) {
if (p[i] != 0 && q[i] ... | java | public static double KumarJohnsonDivergence(double[] p, double[] q) {
double r = 0;
for (int i = 0; i < p.length; i++) {
if (p[i] != 0 && q[i] != 0) {
r += Math.pow(p[i] * p[i] - q[i] * q[i], 2) / 2 * Math.pow(p[i] * q[i], 1.5);
}
}
return r;
} | [
"public",
"static",
"double",
"KumarJohnsonDivergence",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"r",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length",
";",
"i",
"++",
")"... | Gets the Kumar-Johnson divergence.
@param p P vector.
@param q Q vector.
@return The Kumar-Johnson divergence between p and q. | [
"Gets",
"the",
"Kumar",
"-",
"Johnson",
"divergence",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L543-L551 |
RKumsher/utils | src/main/java/com/github/rkumsher/collection/IterableUtils.java | IterableUtils.randomFrom | public static <T> T randomFrom(Iterable<T> iterable, Collection<T> excludes) {
"""
Returns a random element from the given {@link Iterable} that's not in the values to exclude.
@param iterable {@link Iterable} to return random element from
@param excludes values to exclude
@param <T> the type of elements in t... | java | public static <T> T randomFrom(Iterable<T> iterable, Collection<T> excludes) {
checkArgument(!Iterables.isEmpty(iterable), "Iterable cannot be empty");
checkArgument(!containsAll(excludes, iterable), "Iterable only consists of the given excludes");
Iterable<T> copy = Lists.newArrayList(iterable);
Iterab... | [
"public",
"static",
"<",
"T",
">",
"T",
"randomFrom",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"Collection",
"<",
"T",
">",
"excludes",
")",
"{",
"checkArgument",
"(",
"!",
"Iterables",
".",
"isEmpty",
"(",
"iterable",
")",
",",
"\"Iterable canno... | Returns a random element from the given {@link Iterable} that's not in the values to exclude.
@param iterable {@link Iterable} to return random element from
@param excludes values to exclude
@param <T> the type of elements in the given iterable
@return random element from the given {@link Iterable} that's not in the v... | [
"Returns",
"a",
"random",
"element",
"from",
"the",
"given",
"{",
"@link",
"Iterable",
"}",
"that",
"s",
"not",
"in",
"the",
"values",
"to",
"exclude",
"."
] | train | https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/collection/IterableUtils.java#L57-L63 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/search/bingvideosearch/src/main/java/com/microsoft/azure/cognitiveservices/search/videosearch/implementation/BingVideosImpl.java | BingVideosImpl.searchWithServiceResponseAsync | public Observable<ServiceResponse<VideosModel>> searchWithServiceResponseAsync(String query, SearchOptionalParameter searchOptionalParameter) {
"""
The Video Search API lets you send a search query to Bing and get back a list of videos that are relevant to the search query. This section provides technical details ... | java | public Observable<ServiceResponse<VideosModel>> searchWithServiceResponseAsync(String query, SearchOptionalParameter searchOptionalParameter) {
if (query == null) {
throw new IllegalArgumentException("Parameter query is required and cannot be null.");
}
final String acceptLanguage = ... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"VideosModel",
">",
">",
"searchWithServiceResponseAsync",
"(",
"String",
"query",
",",
"SearchOptionalParameter",
"searchOptionalParameter",
")",
"{",
"if",
"(",
"query",
"==",
"null",
")",
"{",
"throw",
"new",
... | The Video Search API lets you send a search query to Bing and get back a list of videos that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request videos and the JSON response objects that contain them. For examples that show how to make... | [
"The",
"Video",
"Search",
"API",
"lets",
"you",
"send",
"a",
"search",
"query",
"to",
"Bing",
"and",
"get",
"back",
"a",
"list",
"of",
"videos",
"that",
"are",
"relevant",
"to",
"the",
"search",
"query",
".",
"This",
"section",
"provides",
"technical",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/search/bingvideosearch/src/main/java/com/microsoft/azure/cognitiveservices/search/videosearch/implementation/BingVideosImpl.java#L137-L161 |
jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/StringUtils.java | StringUtils.cleanupStr | public static String cleanupStr(String name, boolean allowDottedKeys) {
"""
Replaces all . and / with _ and removes all spaces and double/single quotes.
Chomps any trailing . or _ character.
@param allowDottedKeys whether we remove the dots or not.
"""
if (name == null) {
return null;
}
Pattern pa... | java | public static String cleanupStr(String name, boolean allowDottedKeys) {
if (name == null) {
return null;
}
Pattern pattern;
if (!allowDottedKeys) {
pattern = DOT_SLASH_UNDERSCORE_PAT;
} else {
pattern = SLASH_UNDERSCORE_PAT;
}
String clean = pattern.matcher(name).replaceAll("_");
clean = SPACE_... | [
"public",
"static",
"String",
"cleanupStr",
"(",
"String",
"name",
",",
"boolean",
"allowDottedKeys",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Pattern",
"pattern",
";",
"if",
"(",
"!",
"allowDottedKeys",
")",
"{",... | Replaces all . and / with _ and removes all spaces and double/single quotes.
Chomps any trailing . or _ character.
@param allowDottedKeys whether we remove the dots or not. | [
"Replaces",
"all",
".",
"and",
"/",
"with",
"_",
"and",
"removes",
"all",
"spaces",
"and",
"double",
"/",
"single",
"quotes",
".",
"Chomps",
"any",
"trailing",
".",
"or",
"_",
"character",
"."
] | train | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/StringUtils.java#L47-L62 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/nio/PacketIOHelper.java | PacketIOHelper.writeTo | public boolean writeTo(Packet packet, ByteBuffer dst) {
"""
Writes the packet data to the supplied {@code ByteBuffer}, up to the buffer's limit. If it returns {@code false},
it should be called again to write the remaining data.
@param dst the destination byte buffer
@return {@code true} if all the packet's d... | java | public boolean writeTo(Packet packet, ByteBuffer dst) {
if (!headerComplete) {
if (dst.remaining() < HEADER_SIZE) {
return false;
}
dst.put(VERSION);
dst.putChar(packet.getFlags());
dst.putInt(packet.getPartitionId());
size... | [
"public",
"boolean",
"writeTo",
"(",
"Packet",
"packet",
",",
"ByteBuffer",
"dst",
")",
"{",
"if",
"(",
"!",
"headerComplete",
")",
"{",
"if",
"(",
"dst",
".",
"remaining",
"(",
")",
"<",
"HEADER_SIZE",
")",
"{",
"return",
"false",
";",
"}",
"dst",
"... | Writes the packet data to the supplied {@code ByteBuffer}, up to the buffer's limit. If it returns {@code false},
it should be called again to write the remaining data.
@param dst the destination byte buffer
@return {@code true} if all the packet's data is now written out; {@code false} otherwise. | [
"Writes",
"the",
"packet",
"data",
"to",
"the",
"supplied",
"{",
"@code",
"ByteBuffer",
"}",
"up",
"to",
"the",
"buffer",
"s",
"limit",
".",
"If",
"it",
"returns",
"{",
"@code",
"false",
"}",
"it",
"should",
"be",
"called",
"again",
"to",
"write",
"the... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/nio/PacketIOHelper.java#L58-L78 |
apache/incubator-gobblin | gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/common/impl/InMemoryTopology.java | InMemoryTopology.getImportedBy | @Override
public Collection<ConfigKeyPath> getImportedBy(ConfigKeyPath configKey) {
"""
{@inheritDoc}.
<p>
If the result is already in cache, return the result.
Otherwise, delegate the functionality to the fallback object.
If the fallback did not support this operation, will build the entire topology of ... | java | @Override
public Collection<ConfigKeyPath> getImportedBy(ConfigKeyPath configKey) {
return getImportedBy(configKey, Optional.<Config>absent());
} | [
"@",
"Override",
"public",
"Collection",
"<",
"ConfigKeyPath",
">",
"getImportedBy",
"(",
"ConfigKeyPath",
"configKey",
")",
"{",
"return",
"getImportedBy",
"(",
"configKey",
",",
"Optional",
".",
"<",
"Config",
">",
"absent",
"(",
")",
")",
";",
"}"
] | {@inheritDoc}.
<p>
If the result is already in cache, return the result.
Otherwise, delegate the functionality to the fallback object.
If the fallback did not support this operation, will build the entire topology of the {@link org.apache.gobblin.config.store.api.ConfigStore}
using default breath first search.
</p> | [
"{",
"@inheritDoc",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/common/impl/InMemoryTopology.java#L149-L152 |
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java | XmlSchemaParser.getAttributeValueOrNull | public static String getAttributeValueOrNull(final Node elementNode, final String attrName) {
"""
Helper function that hides the null return from {@link org.w3c.dom.NamedNodeMap#getNamedItem(String)}
@param elementNode that could be null
@param attrName that is to be looked up
@return null or value of the ... | java | public static String getAttributeValueOrNull(final Node elementNode, final String attrName)
{
if (null == elementNode || null == elementNode.getAttributes())
{
return null;
}
final Node attrNode = elementNode.getAttributes().getNamedItemNS(null, attrName);
if (nu... | [
"public",
"static",
"String",
"getAttributeValueOrNull",
"(",
"final",
"Node",
"elementNode",
",",
"final",
"String",
"attrName",
")",
"{",
"if",
"(",
"null",
"==",
"elementNode",
"||",
"null",
"==",
"elementNode",
".",
"getAttributes",
"(",
")",
")",
"{",
"... | Helper function that hides the null return from {@link org.w3c.dom.NamedNodeMap#getNamedItem(String)}
@param elementNode that could be null
@param attrName that is to be looked up
@return null or value of the attribute | [
"Helper",
"function",
"that",
"hides",
"the",
"null",
"return",
"from",
"{",
"@link",
"org",
".",
"w3c",
".",
"dom",
".",
"NamedNodeMap#getNamedItem",
"(",
"String",
")",
"}"
] | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java#L320-L334 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformsInner.java | TransformsInner.getAsync | public Observable<TransformInner> getAsync(String resourceGroupName, String accountName, String transformName) {
"""
Get Transform.
Gets a Transform.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param transformName... | java | public Observable<TransformInner> getAsync(String resourceGroupName, String accountName, String transformName) {
return getWithServiceResponseAsync(resourceGroupName, accountName, transformName).map(new Func1<ServiceResponse<TransformInner>, TransformInner>() {
@Override
public Transform... | [
"public",
"Observable",
"<",
"TransformInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"transformName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"tra... | Get Transform.
Gets a Transform.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param transformName The Transform name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Tr... | [
"Get",
"Transform",
".",
"Gets",
"a",
"Transform",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformsInner.java#L399-L406 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java | ArrayUtil.join | public static String join(long[] array, CharSequence conjunction) {
"""
以 conjunction 为分隔符将数组转换为字符串
@param array 数组
@param conjunction 分隔符
@return 连接后的字符串
"""
if (null == array) {
return null;
}
final StringBuilder sb = new StringBuilder();
boolean isFirst = true;
for (long item : arr... | java | public static String join(long[] array, CharSequence conjunction) {
if (null == array) {
return null;
}
final StringBuilder sb = new StringBuilder();
boolean isFirst = true;
for (long item : array) {
if (isFirst) {
isFirst = false;
} else {
sb.append(conjunction);
}
sb.app... | [
"public",
"static",
"String",
"join",
"(",
"long",
"[",
"]",
"array",
",",
"CharSequence",
"conjunction",
")",
"{",
"if",
"(",
"null",
"==",
"array",
")",
"{",
"return",
"null",
";",
"}",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
... | 以 conjunction 为分隔符将数组转换为字符串
@param array 数组
@param conjunction 分隔符
@return 连接后的字符串 | [
"以",
"conjunction",
"为分隔符将数组转换为字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L2341-L2357 |
netty/netty | common/src/main/java/io/netty/util/internal/StringUtil.java | StringUtil.commonSuffixOfLength | public static boolean commonSuffixOfLength(String s, String p, int len) {
"""
Checks if two strings have the same suffix of specified length
@param s string
@param p string
@param len length of the common suffix
@return true if both s and p are not null and both have the same suffix. Otherwise - false
... | java | public static boolean commonSuffixOfLength(String s, String p, int len) {
return s != null && p != null && len >= 0 && s.regionMatches(s.length() - len, p, p.length() - len, len);
} | [
"public",
"static",
"boolean",
"commonSuffixOfLength",
"(",
"String",
"s",
",",
"String",
"p",
",",
"int",
"len",
")",
"{",
"return",
"s",
"!=",
"null",
"&&",
"p",
"!=",
"null",
"&&",
"len",
">=",
"0",
"&&",
"s",
".",
"regionMatches",
"(",
"s",
".",
... | Checks if two strings have the same suffix of specified length
@param s string
@param p string
@param len length of the common suffix
@return true if both s and p are not null and both have the same suffix. Otherwise - false | [
"Checks",
"if",
"two",
"strings",
"have",
"the",
"same",
"suffix",
"of",
"specified",
"length"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/StringUtil.java#L83-L85 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/HanLP.java | HanLP.extractWords | public static List<WordInfo> extractWords(String text, int size, boolean newWordsOnly) {
"""
提取词语(新词发现)
@param text 大文本
@param size 需要提取词语的数量
@param newWordsOnly 是否只提取词典中没有的词语
@return 一个词语列表
"""
NewWordDiscover discover = new NewWordDiscover(4, 0.0f, .5f, 100f, newWordsOnly);
... | java | public static List<WordInfo> extractWords(String text, int size, boolean newWordsOnly)
{
NewWordDiscover discover = new NewWordDiscover(4, 0.0f, .5f, 100f, newWordsOnly);
return discover.discover(text, size);
} | [
"public",
"static",
"List",
"<",
"WordInfo",
">",
"extractWords",
"(",
"String",
"text",
",",
"int",
"size",
",",
"boolean",
"newWordsOnly",
")",
"{",
"NewWordDiscover",
"discover",
"=",
"new",
"NewWordDiscover",
"(",
"4",
",",
"0.0f",
",",
".5f",
",",
"10... | 提取词语(新词发现)
@param text 大文本
@param size 需要提取词语的数量
@param newWordsOnly 是否只提取词典中没有的词语
@return 一个词语列表 | [
"提取词语(新词发现)"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/HanLP.java#L757-L761 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFrameworkImpl.java | ChannelFrameworkImpl.getChannelState | public synchronized RuntimeState getChannelState(String channelName, Chain chain) {
"""
Return the state of the input runtime channel.
@param channelName
@param chain
that includes this channel
@return state of channel, or -1 if the channel cannot be found.
"""
RuntimeState state = null;
... | java | public synchronized RuntimeState getChannelState(String channelName, Chain chain) {
RuntimeState state = null;
Channel channel = getRunningChannel(channelName, chain);
if (channel != null) {
ChannelContainer channelContainer = this.channelRunningMap.get(channel.getName());
... | [
"public",
"synchronized",
"RuntimeState",
"getChannelState",
"(",
"String",
"channelName",
",",
"Chain",
"chain",
")",
"{",
"RuntimeState",
"state",
"=",
"null",
";",
"Channel",
"channel",
"=",
"getRunningChannel",
"(",
"channelName",
",",
"chain",
")",
";",
"if... | Return the state of the input runtime channel.
@param channelName
@param chain
that includes this channel
@return state of channel, or -1 if the channel cannot be found. | [
"Return",
"the",
"state",
"of",
"the",
"input",
"runtime",
"channel",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFrameworkImpl.java#L4075-L4089 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getMetaPropertyValues | public static List<PropertyValue> getMetaPropertyValues(Object self) {
"""
Retrieves the list of {@link groovy.lang.MetaProperty} objects for 'self' and wraps it
in a list of {@link groovy.lang.PropertyValue} objects that additionally provide
the value for each property of 'self'.
@param self the receiver obj... | java | public static List<PropertyValue> getMetaPropertyValues(Object self) {
MetaClass metaClass = InvokerHelper.getMetaClass(self);
List<MetaProperty> mps = metaClass.getProperties();
List<PropertyValue> props = new ArrayList<PropertyValue>(mps.size());
for (MetaProperty mp : mps) {
... | [
"public",
"static",
"List",
"<",
"PropertyValue",
">",
"getMetaPropertyValues",
"(",
"Object",
"self",
")",
"{",
"MetaClass",
"metaClass",
"=",
"InvokerHelper",
".",
"getMetaClass",
"(",
"self",
")",
";",
"List",
"<",
"MetaProperty",
">",
"mps",
"=",
"metaClas... | Retrieves the list of {@link groovy.lang.MetaProperty} objects for 'self' and wraps it
in a list of {@link groovy.lang.PropertyValue} objects that additionally provide
the value for each property of 'self'.
@param self the receiver object
@return list of {@link groovy.lang.PropertyValue} objects
@see groovy.util.Expan... | [
"Retrieves",
"the",
"list",
"of",
"{",
"@link",
"groovy",
".",
"lang",
".",
"MetaProperty",
"}",
"objects",
"for",
"self",
"and",
"wraps",
"it",
"in",
"a",
"list",
"of",
"{",
"@link",
"groovy",
".",
"lang",
".",
"PropertyValue",
"}",
"objects",
"that",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L512-L520 |
google/closure-compiler | src/com/google/javascript/jscomp/JsMessageVisitor.java | JsMessageVisitor.parseMessageTextNode | private static void parseMessageTextNode(Builder builder, Node node)
throws MalformedException {
"""
Appends the message parts in a JS message value extracted from the given
text node.
@param builder the JS message builder to append parts to
@param node the node with string literal that contains the mes... | java | private static void parseMessageTextNode(Builder builder, Node node)
throws MalformedException {
String value = extractStringFromStringExprNode(node);
while (true) {
int phBegin = value.indexOf(PH_JS_PREFIX);
if (phBegin < 0) {
// Just a string literal
builder.appendStringPart... | [
"private",
"static",
"void",
"parseMessageTextNode",
"(",
"Builder",
"builder",
",",
"Node",
"node",
")",
"throws",
"MalformedException",
"{",
"String",
"value",
"=",
"extractStringFromStringExprNode",
"(",
"node",
")",
";",
"while",
"(",
"true",
")",
"{",
"int"... | Appends the message parts in a JS message value extracted from the given
text node.
@param builder the JS message builder to append parts to
@param node the node with string literal that contains the message text
@throws MalformedException if {@code value} contains a reference to
an unregistered placeholder | [
"Appends",
"the",
"message",
"parts",
"in",
"a",
"JS",
"message",
"value",
"extracted",
"from",
"the",
"given",
"text",
"node",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JsMessageVisitor.java#L817-L854 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java | DataFrameJoiner.fullOuter | public Table fullOuter(boolean allowDuplicateColumnNames, Table... tables) {
"""
Full outer join to the given tables assuming that they have a column of the name we're joining on
@param allowDuplicateColumnNames if {@code false} the join will fail if any columns other than the join column have the same name
if... | java | public Table fullOuter(boolean allowDuplicateColumnNames, Table... tables) {
Table joined = table;
for (Table currT : tables) {
joined = fullOuter(joined, currT, allowDuplicateColumnNames, columnNames);
}
return joined;
} | [
"public",
"Table",
"fullOuter",
"(",
"boolean",
"allowDuplicateColumnNames",
",",
"Table",
"...",
"tables",
")",
"{",
"Table",
"joined",
"=",
"table",
";",
"for",
"(",
"Table",
"currT",
":",
"tables",
")",
"{",
"joined",
"=",
"fullOuter",
"(",
"joined",
",... | Full outer join to the given tables assuming that they have a column of the name we're joining on
@param allowDuplicateColumnNames if {@code false} the join will fail if any columns other than the join column have the same name
if {@code true} the join will succeed and duplicate columns are renamed*
@param tables The ... | [
"Full",
"outer",
"join",
"to",
"the",
"given",
"tables",
"assuming",
"that",
"they",
"have",
"a",
"column",
"of",
"the",
"name",
"we",
"re",
"joining",
"on"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java#L352-L359 |
janus-project/guava.janusproject.io | guava/src/com/google/common/net/InetAddresses.java | InetAddresses.getTeredoInfo | public static TeredoInfo getTeredoInfo(Inet6Address ip) {
"""
Returns the Teredo information embedded in a Teredo address.
@param ip {@link Inet6Address} to be examined for embedded Teredo information
@return extracted {@code TeredoInfo}
@throws IllegalArgumentException if the argument is not a valid IPv6 Ter... | java | public static TeredoInfo getTeredoInfo(Inet6Address ip) {
Preconditions.checkArgument(isTeredoAddress(ip),
"Address '%s' is not a Teredo address.", toAddrString(ip));
byte[] bytes = ip.getAddress();
Inet4Address server = getInet4Address(Arrays.copyOfRange(bytes, 4, 8));
int flags = ByteStreams... | [
"public",
"static",
"TeredoInfo",
"getTeredoInfo",
"(",
"Inet6Address",
"ip",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"isTeredoAddress",
"(",
"ip",
")",
",",
"\"Address '%s' is not a Teredo address.\"",
",",
"toAddrString",
"(",
"ip",
")",
")",
";",
... | Returns the Teredo information embedded in a Teredo address.
@param ip {@link Inet6Address} to be examined for embedded Teredo information
@return extracted {@code TeredoInfo}
@throws IllegalArgumentException if the argument is not a valid IPv6 Teredo address | [
"Returns",
"the",
"Teredo",
"information",
"embedded",
"in",
"a",
"Teredo",
"address",
"."
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/net/InetAddresses.java#L693-L713 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/SparseBaseLevel1.java | SparseBaseLevel1.axpy | @Override
public void axpy(long n, double alpha, INDArray x, INDArray y) {
"""
Adds a scalar multiple of compressed sparse vector to a full-storage vector.
@param n The number of element
@param alpha
@param x a sparse vector
@param y a dense vector
"""
BaseSparseNDArray sparseX = (BaseSparseN... | java | @Override
public void axpy(long n, double alpha, INDArray x, INDArray y) {
BaseSparseNDArray sparseX = (BaseSparseNDArray) x;
DataBuffer pointers = sparseX.getVectorCoordinates();
switch (x.data().dataType()) {
case DOUBLE:
DefaultOpExecutioner.validateDataType(Da... | [
"@",
"Override",
"public",
"void",
"axpy",
"(",
"long",
"n",
",",
"double",
"alpha",
",",
"INDArray",
"x",
",",
"INDArray",
"y",
")",
"{",
"BaseSparseNDArray",
"sparseX",
"=",
"(",
"BaseSparseNDArray",
")",
"x",
";",
"DataBuffer",
"pointers",
"=",
"sparseX... | Adds a scalar multiple of compressed sparse vector to a full-storage vector.
@param n The number of element
@param alpha
@param x a sparse vector
@param y a dense vector | [
"Adds",
"a",
"scalar",
"multiple",
"of",
"compressed",
"sparse",
"vector",
"to",
"a",
"full",
"-",
"storage",
"vector",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/SparseBaseLevel1.java#L204-L227 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.