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 |
|---|---|---|---|---|---|---|---|---|---|---|
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArrayPageFile.java | OnDiskArrayPageFile.writePage | @Override
public void writePage(int pageID, P page) {
"""
Write page to disk.
@param pageID page id
@param page the page which has to be written to disk
"""
if (page.isDirty()) {
try {
countWrite();
byte[] array = pageToByteArray(page);
file.getRecordBuffer(pageID).put(a... | java | @Override
public void writePage(int pageID, P page) {
if (page.isDirty()) {
try {
countWrite();
byte[] array = pageToByteArray(page);
file.getRecordBuffer(pageID).put(array);
page.setDirty(false);
} catch (IOException e) {
throw new RuntimeException(e);
}
... | [
"@",
"Override",
"public",
"void",
"writePage",
"(",
"int",
"pageID",
",",
"P",
"page",
")",
"{",
"if",
"(",
"page",
".",
"isDirty",
"(",
")",
")",
"{",
"try",
"{",
"countWrite",
"(",
")",
";",
"byte",
"[",
"]",
"array",
"=",
"pageToByteArray",
"("... | Write page to disk.
@param pageID page id
@param page the page which has to be written to disk | [
"Write",
"page",
"to",
"disk",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArrayPageFile.java#L144-L156 |
xiancloud/xian | xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/gelf/intern/ConfigurationSupport.java | ConfigurationSupport.setDynamicMdcFields | public static void setDynamicMdcFields(String spec, GelfMessageAssembler gelfMessageAssembler) {
"""
Set the dynamic MDC fields.
@param spec field, .*FieldSuffix, fieldPrefix.*
@param gelfMessageAssembler the {@link GelfMessageAssembler}.
"""
if (null != spec) {
String[] fields = spec.s... | java | public static void setDynamicMdcFields(String spec, GelfMessageAssembler gelfMessageAssembler) {
if (null != spec) {
String[] fields = spec.split(MULTI_VALUE_DELIMITTER);
for (String field : fields) {
gelfMessageAssembler.addField(new DynamicMdcMessageField(field.trim())... | [
"public",
"static",
"void",
"setDynamicMdcFields",
"(",
"String",
"spec",
",",
"GelfMessageAssembler",
"gelfMessageAssembler",
")",
"{",
"if",
"(",
"null",
"!=",
"spec",
")",
"{",
"String",
"[",
"]",
"fields",
"=",
"spec",
".",
"split",
"(",
"MULTI_VALUE_DELIM... | Set the dynamic MDC fields.
@param spec field, .*FieldSuffix, fieldPrefix.*
@param gelfMessageAssembler the {@link GelfMessageAssembler}. | [
"Set",
"the",
"dynamic",
"MDC",
"fields",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/gelf/intern/ConfigurationSupport.java#L61-L69 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/base/Strings.java | Strings.countToken | @SuppressWarnings("ConstantConditions")
@Beta
public static int countToken(@Nullable String target, String token) {
"""
Returns the number of times the token appears in the target.
@param token Token value to be counted.
@param target Target value to count tokens in.
@return the number of tokens.
""... | java | @SuppressWarnings("ConstantConditions")
@Beta
public static int countToken(@Nullable String target, String token) {
checkArgument(token != null && !token.isEmpty(), "Expected non-empty token, got: '%s'", token);
if (isNullOrEmpty(target)) {
return 0;
}
int count = 0... | [
"@",
"SuppressWarnings",
"(",
"\"ConstantConditions\"",
")",
"@",
"Beta",
"public",
"static",
"int",
"countToken",
"(",
"@",
"Nullable",
"String",
"target",
",",
"String",
"token",
")",
"{",
"checkArgument",
"(",
"token",
"!=",
"null",
"&&",
"!",
"token",
".... | Returns the number of times the token appears in the target.
@param token Token value to be counted.
@param target Target value to count tokens in.
@return the number of tokens. | [
"Returns",
"the",
"number",
"of",
"times",
"the",
"token",
"appears",
"in",
"the",
"target",
"."
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/base/Strings.java#L25-L41 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java | UnicodeSet.containsNone | public boolean containsNone(int start, int end) {
"""
Returns true if this set contains none of the characters
of the given range.
@param start first character, inclusive, of the range
@param end last character, inclusive, of the range
@return true if the test condition is met
"""
if (start < MIN_V... | java | public boolean containsNone(int start, int end) {
if (start < MIN_VALUE || start > MAX_VALUE) {
throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(start, 6));
}
if (end < MIN_VALUE || end > MAX_VALUE) {
throw new IllegalArgumentException("Invalid cod... | [
"public",
"boolean",
"containsNone",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"start",
"<",
"MIN_VALUE",
"||",
"start",
">",
"MAX_VALUE",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid code point U+\"",
"+",
"Utility"... | Returns true if this set contains none of the characters
of the given range.
@param start first character, inclusive, of the range
@param end last character, inclusive, of the range
@return true if the test condition is met | [
"Returns",
"true",
"if",
"this",
"set",
"contains",
"none",
"of",
"the",
"characters",
"of",
"the",
"given",
"range",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java#L1993-L2005 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Project.java | Project.getTotalDone | public Double getTotalDone(WorkitemFilter filter, boolean includeChildProjects) {
"""
Retrieves the total done for all workitems in this project optionally
filtered.
@param filter Criteria to filter workitems on.
@param includeChildProjects If true, include open sub projects, otherwise
only inc... | java | public Double getTotalDone(WorkitemFilter filter, boolean includeChildProjects) {
filter = (filter != null) ? filter : new WorkitemFilter();
return getRollup("Workitems", "Actuals.Value", filter,
includeChildProjects);
} | [
"public",
"Double",
"getTotalDone",
"(",
"WorkitemFilter",
"filter",
",",
"boolean",
"includeChildProjects",
")",
"{",
"filter",
"=",
"(",
"filter",
"!=",
"null",
")",
"?",
"filter",
":",
"new",
"WorkitemFilter",
"(",
")",
";",
"return",
"getRollup",
"(",
"\... | Retrieves the total done for all workitems in this project optionally
filtered.
@param filter Criteria to filter workitems on.
@param includeChildProjects If true, include open sub projects, otherwise
only include this project.
@return total done for selected workitems. | [
"Retrieves",
"the",
"total",
"done",
"for",
"all",
"workitems",
"in",
"this",
"project",
"optionally",
"filtered",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Project.java#L1155-L1160 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java | DefaultApplicationObjectConfigurer.configureIcon | protected void configureIcon(IconConfigurable configurable, String objectName) {
"""
Sets the icon of the given object. The icon is loaded from this
instance's {@link IconSource} using a key in the format
<pre>
<objectName>.icon
</pre>
If the icon source cannot find an icon under that key, the objec... | java | protected void configureIcon(IconConfigurable configurable, String objectName) {
Assert.notNull(configurable, "configurable");
Assert.notNull(objectName, "objectName");
Icon icon = loadIcon(objectName, ICON_KEY);
if (icon != null) {
configurable.setIcon(icon);
}
} | [
"protected",
"void",
"configureIcon",
"(",
"IconConfigurable",
"configurable",
",",
"String",
"objectName",
")",
"{",
"Assert",
".",
"notNull",
"(",
"configurable",
",",
"\"configurable\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"objectName",
",",
"\"objectName\... | Sets the icon of the given object. The icon is loaded from this
instance's {@link IconSource} using a key in the format
<pre>
<objectName>.icon
</pre>
If the icon source cannot find an icon under that key, the object's icon
will be set to null.
@param configurable The object to be configured. Must not be null.... | [
"Sets",
"the",
"icon",
"of",
"the",
"given",
"object",
".",
"The",
"icon",
"is",
"loaded",
"from",
"this",
"instance",
"s",
"{",
"@link",
"IconSource",
"}",
"using",
"a",
"key",
"in",
"the",
"format"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java#L525-L534 |
Appendium/objectlabkit | utils/src/main/java/net/objectlab/kit/util/BooleanUtil.java | BooleanUtil.ifTrue | public static boolean ifTrue(final Boolean bool, final Runnable runnable) {
"""
If the boolean is not null and true, call the runnable/FunctionalInterface (depends on JDK8+)
@param bool
@param runnable
@return true if run
@since 1.4.0
"""
if (isTrue(bool)) {
runnable.run();
... | java | public static boolean ifTrue(final Boolean bool, final Runnable runnable) {
if (isTrue(bool)) {
runnable.run();
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"ifTrue",
"(",
"final",
"Boolean",
"bool",
",",
"final",
"Runnable",
"runnable",
")",
"{",
"if",
"(",
"isTrue",
"(",
"bool",
")",
")",
"{",
"runnable",
".",
"run",
"(",
")",
";",
"return",
"true",
";",
"}",
"return",
"f... | If the boolean is not null and true, call the runnable/FunctionalInterface (depends on JDK8+)
@param bool
@param runnable
@return true if run
@since 1.4.0 | [
"If",
"the",
"boolean",
"is",
"not",
"null",
"and",
"true",
"call",
"the",
"runnable",
"/",
"FunctionalInterface",
"(",
"depends",
"on",
"JDK8",
"+",
")"
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils/src/main/java/net/objectlab/kit/util/BooleanUtil.java#L46-L52 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/duration/Period.java | Period.moreThan | public static Period moreThan(float count, TimeUnit unit) {
"""
Constructs a Period representing a duration more than
count units extending into the past.
@param count the number of units. must be non-negative
@param unit the unit
@return the new Period
"""
checkCount(count);
return new Period(ETim... | java | public static Period moreThan(float count, TimeUnit unit) {
checkCount(count);
return new Period(ETimeLimit.MT, false, count, unit);
} | [
"public",
"static",
"Period",
"moreThan",
"(",
"float",
"count",
",",
"TimeUnit",
"unit",
")",
"{",
"checkCount",
"(",
"count",
")",
";",
"return",
"new",
"Period",
"(",
"ETimeLimit",
".",
"MT",
",",
"false",
",",
"count",
",",
"unit",
")",
";",
"}"
] | Constructs a Period representing a duration more than
count units extending into the past.
@param count the number of units. must be non-negative
@param unit the unit
@return the new Period | [
"Constructs",
"a",
"Period",
"representing",
"a",
"duration",
"more",
"than",
"count",
"units",
"extending",
"into",
"the",
"past",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/duration/Period.java#L55-L58 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseXcsrgeamNnz | public static int cusparseXcsrgeamNnz(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
int nnzA,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA,
cusparseMatDescr descrB,
int nnzB,
Pointer csrSortedRowPtr... | java | public static int cusparseXcsrgeamNnz(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
int nnzA,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA,
cusparseMatDescr descrB,
int nnzB,
Pointer csrSortedRowPtr... | [
"public",
"static",
"int",
"cusparseXcsrgeamNnz",
"(",
"cusparseHandle",
"handle",
",",
"int",
"m",
",",
"int",
"n",
",",
"cusparseMatDescr",
"descrA",
",",
"int",
"nnzA",
",",
"Pointer",
"csrSortedRowPtrA",
",",
"Pointer",
"csrSortedColIndA",
",",
"cusparseMatDes... | Description: Compute sparse - sparse matrix addition of matrices
stored in CSR format | [
"Description",
":",
"Compute",
"sparse",
"-",
"sparse",
"matrix",
"addition",
"of",
"matrices",
"stored",
"in",
"CSR",
"format"
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L10086-L10103 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java | CodeGenerator.getAccessByField | protected String getAccessByField(String target, Field field, Class<?> cls) {
"""
get field access code.
@param target target instance name
@param field java field instance
@param cls mapped class
@return full field access java code
"""
if (field.getModifiers() == Modifier.PUBLIC) {
r... | java | protected String getAccessByField(String target, Field field, Class<?> cls) {
if (field.getModifiers() == Modifier.PUBLIC) {
return target + ClassHelper.PACKAGE_SEPARATOR + field.getName();
}
// check if has getter method
String getter;
if ("boolean".equalsIgnoreCase(... | [
"protected",
"String",
"getAccessByField",
"(",
"String",
"target",
",",
"Field",
"field",
",",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"if",
"(",
"field",
".",
"getModifiers",
"(",
")",
"==",
"Modifier",
".",
"PUBLIC",
")",
"{",
"return",
"target",
"... | get field access code.
@param target target instance name
@param field java field instance
@param cls mapped class
@return full field access java code | [
"get",
"field",
"access",
"code",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java#L584-L615 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java | HashtableOnDisk.doRehash | private void doRehash(int new_table_size)
throws IOException,
EOFException,
FileManagerException,
ClassNotFoundException,
HashtableOnDiskException {
"""
Double the size of the hash table -
The variable rehashInPr... | java | private void doRehash(int new_table_size)
throws IOException,
EOFException,
FileManagerException,
ClassNotFoundException,
HashtableOnDiskException {
//
// Acquire the lock to prevent iteration while doubl... | [
"private",
"void",
"doRehash",
"(",
"int",
"new_table_size",
")",
"throws",
"IOException",
",",
"EOFException",
",",
"FileManagerException",
",",
"ClassNotFoundException",
",",
"HashtableOnDiskException",
"{",
"//",
"// Acquire the lock to prevent iteration while doubling",
"... | Double the size of the hash table -
The variable rehashInProgress is set to non-0 on disk to indicate
that rehashing is in progress. We use rehashInProgress to temporarily
hold the hash bucket in the new table while chaining the old one in.
So rehashInProgress is either 0 (rehash done), 1 (rehash in progress),
or some... | [
"Double",
"the",
"size",
"of",
"the",
"hash",
"table",
"-"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java#L2768-L2799 |
weld/core | impl/src/main/java/org/jboss/weld/util/bytecode/BytecodeUtils.java | BytecodeUtils.pushClassType | public static void pushClassType(CodeAttribute b, String classType) {
"""
Pushes a class type onto the stack from the string representation This can
also handle primitives
@param b the bytecode
@param classType the type descriptor for the class or primitive to push.
This will accept both the java.lan... | java | public static void pushClassType(CodeAttribute b, String classType) {
if (classType.length() != 1) {
if (classType.startsWith("L") && classType.endsWith(";")) {
classType = classType.substring(1, classType.length() - 1);
}
b.loadClass(classType);
} els... | [
"public",
"static",
"void",
"pushClassType",
"(",
"CodeAttribute",
"b",
",",
"String",
"classType",
")",
"{",
"if",
"(",
"classType",
".",
"length",
"(",
")",
"!=",
"1",
")",
"{",
"if",
"(",
"classType",
".",
"startsWith",
"(",
"\"L\"",
")",
"&&",
"cla... | Pushes a class type onto the stack from the string representation This can
also handle primitives
@param b the bytecode
@param classType the type descriptor for the class or primitive to push.
This will accept both the java.lang.Object form and the
Ljava/lang/Object; form | [
"Pushes",
"a",
"class",
"type",
"onto",
"the",
"stack",
"from",
"the",
"string",
"representation",
"This",
"can",
"also",
"handle",
"primitives"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/bytecode/BytecodeUtils.java#L85-L122 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/POIUtils.java | POIUtils.setCellValueAsDate | public static void setCellValueAsDate(Cell cell, Date date, boolean dateStart1904) {
"""
セルに日時を設定する。
<p>1900年1月0日となる経過時間指定の場合は、POIのバグにより設定できあいため、数値として設定する。</p>
@param cell 設定するセル
@param date セルに設定する日時
@param dateStart1904 1904年始まりの設定のシートかどうか
"""
ArgUtils.notNull(cell, "cell");
ArgUtil... | java | public static void setCellValueAsDate(Cell cell, Date date, boolean dateStart1904) {
ArgUtils.notNull(cell, "cell");
ArgUtils.notNull(date, "date");
if(dateStart1904) {
// 1904年始まりの場合は、そのまま設定する
cell.setCellValue(date);
} else {
long time... | [
"public",
"static",
"void",
"setCellValueAsDate",
"(",
"Cell",
"cell",
",",
"Date",
"date",
",",
"boolean",
"dateStart1904",
")",
"{",
"ArgUtils",
".",
"notNull",
"(",
"cell",
",",
"\"cell\"",
")",
";",
"ArgUtils",
".",
"notNull",
"(",
"date",
",",
"\"date... | セルに日時を設定する。
<p>1900年1月0日となる経過時間指定の場合は、POIのバグにより設定できあいため、数値として設定する。</p>
@param cell 設定するセル
@param date セルに設定する日時
@param dateStart1904 1904年始まりの設定のシートかどうか | [
"セルに日時を設定する。",
"<p",
">",
"1900年1月0日となる経過時間指定の場合は、POIのバグにより設定できあいため、数値として設定する。<",
"/",
"p",
">"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/POIUtils.java#L1122-L1147 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java | IntegralImageOps.block_unsafe | public static int block_unsafe(GrayS32 integral , int x0 , int y0 , int x1 , int y1 ) {
"""
<p>
Computes the value of a block inside an integral image without bounds checking. The block is
defined as follows: x0 < x ≤ x1 and y0 < y ≤ y1.
</p>
@param integral Integral image.
@param x0 Lower boun... | java | public static int block_unsafe(GrayS32 integral , int x0 , int y0 , int x1 , int y1 )
{
return ImplIntegralImageOps.block_unsafe(integral, x0, y0, x1, y1);
} | [
"public",
"static",
"int",
"block_unsafe",
"(",
"GrayS32",
"integral",
",",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"return",
"ImplIntegralImageOps",
".",
"block_unsafe",
"(",
"integral",
",",
"x0",
",",
"y0",
",",
... | <p>
Computes the value of a block inside an integral image without bounds checking. The block is
defined as follows: x0 < x ≤ x1 and y0 < y ≤ y1.
</p>
@param integral Integral image.
@param x0 Lower bound of the block. Exclusive.
@param y0 Lower bound of the block. Exclusive.
@param x1 Upper bound of th... | [
"<p",
">",
"Computes",
"the",
"value",
"of",
"a",
"block",
"inside",
"an",
"integral",
"image",
"without",
"bounds",
"checking",
".",
"The",
"block",
"is",
"defined",
"as",
"follows",
":",
"x0",
"<",
";",
"x",
"&le",
";",
"x1",
"and",
"y0",
"<",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java#L408-L411 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/TextBox.java | TextBox.setCaretPosition | public synchronized TextBox setCaretPosition(int line, int column) {
"""
Moves the text caret position to a new position in the {@link TextBox}. For single-line {@link TextBox}:es, the
line component is not used. If one of the positions are out of bounds, it is automatically set back into range.
@param line Whic... | java | public synchronized TextBox setCaretPosition(int line, int column) {
if(line < 0) {
line = 0;
}
else if(line >= lines.size()) {
line = lines.size() - 1;
}
if(column < 0) {
column = 0;
}
else if(column > lines.get(line).length())... | [
"public",
"synchronized",
"TextBox",
"setCaretPosition",
"(",
"int",
"line",
",",
"int",
"column",
")",
"{",
"if",
"(",
"line",
"<",
"0",
")",
"{",
"line",
"=",
"0",
";",
"}",
"else",
"if",
"(",
"line",
">=",
"lines",
".",
"size",
"(",
")",
")",
... | Moves the text caret position to a new position in the {@link TextBox}. For single-line {@link TextBox}:es, the
line component is not used. If one of the positions are out of bounds, it is automatically set back into range.
@param line Which line inside the {@link TextBox} to move the caret to (0 being the first line),... | [
"Moves",
"the",
"text",
"caret",
"position",
"to",
"a",
"new",
"position",
"in",
"the",
"{"
] | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/TextBox.java#L291-L306 |
vkostyukov/la4j | src/main/java/org/la4j/vector/SparseVector.java | SparseVector.fromMap | public static SparseVector fromMap(Map<Integer, ? extends Number> map, int length) {
"""
Creates new {@link SparseVector} from given index-value map
@param map
@return
"""
return CompressedVector.fromMap(map, length);
} | java | public static SparseVector fromMap(Map<Integer, ? extends Number> map, int length) {
return CompressedVector.fromMap(map, length);
} | [
"public",
"static",
"SparseVector",
"fromMap",
"(",
"Map",
"<",
"Integer",
",",
"?",
"extends",
"Number",
">",
"map",
",",
"int",
"length",
")",
"{",
"return",
"CompressedVector",
".",
"fromMap",
"(",
"map",
",",
"length",
")",
";",
"}"
] | Creates new {@link SparseVector} from given index-value map
@param map
@return | [
"Creates",
"new",
"{",
"@link",
"SparseVector",
"}",
"from",
"given",
"index",
"-",
"value",
"map"
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/vector/SparseVector.java#L143-L145 |
foundation-runtime/logging | logging-log4j/src/main/java/com/cisco/oss/foundation/logging/LoggingHelper.java | LoggingHelper.trace | public static void trace(final Logger logger, final String format, final Throwable throwable, final Object... params) {
"""
Enable logging using String.format internally only if debug level is
enabled.
@param logger
the logger that will be used to log the message
@param format
the format string (the templat... | java | public static void trace(final Logger logger, final String format, final Throwable throwable, final Object... params) {
trace(logger, format, throwable, null, params);
} | [
"public",
"static",
"void",
"trace",
"(",
"final",
"Logger",
"logger",
",",
"final",
"String",
"format",
",",
"final",
"Throwable",
"throwable",
",",
"final",
"Object",
"...",
"params",
")",
"{",
"trace",
"(",
"logger",
",",
"format",
",",
"throwable",
","... | Enable logging using String.format internally only if debug level is
enabled.
@param logger
the logger that will be used to log the message
@param format
the format string (the template string)
@param throwable
a throwable object that holds the throable information
@param params
the parameters to be formatted into it ... | [
"Enable",
"logging",
"using",
"String",
".",
"format",
"internally",
"only",
"if",
"debug",
"level",
"is",
"enabled",
"."
] | train | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-log4j/src/main/java/com/cisco/oss/foundation/logging/LoggingHelper.java#L139-L141 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataManager.java | VariantMetadataManager.addCohort | public void addCohort(Cohort cohort, String studyId) {
"""
Add a cohort to a given variant study metadata (from study ID).
@param cohort Cohort to add
@param studyId Study ID
"""
// Sanity check
if (cohort == null || StringUtils.isEmpty(cohort.getId())) {
logger.error("Coho... | java | public void addCohort(Cohort cohort, String studyId) {
// Sanity check
if (cohort == null || StringUtils.isEmpty(cohort.getId())) {
logger.error("Cohort (or its ID) is null or empty.");
return;
}
VariantStudyMetadata variantStudyMetadata = getVariantStudyMetadata... | [
"public",
"void",
"addCohort",
"(",
"Cohort",
"cohort",
",",
"String",
"studyId",
")",
"{",
"// Sanity check",
"if",
"(",
"cohort",
"==",
"null",
"||",
"StringUtils",
".",
"isEmpty",
"(",
"cohort",
".",
"getId",
"(",
")",
")",
")",
"{",
"logger",
".",
... | Add a cohort to a given variant study metadata (from study ID).
@param cohort Cohort to add
@param studyId Study ID | [
"Add",
"a",
"cohort",
"to",
"a",
"given",
"variant",
"study",
"metadata",
"(",
"from",
"study",
"ID",
")",
"."
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataManager.java#L400-L423 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/mimetype/MimeTypeDetectors.java | MimeTypeDetectors.createDetectorFor | public static MimeTypeDetector createDetectorFor(String mimeTypeDetectionConfig, Environment environment) {
"""
Returns a new mime type detector implementation based on
the repository {@link org.modeshape.jcr.RepositoryConfiguration.FieldName#MIMETYPE_DETECTION} configuration
@param mimeTypeDetectionConfig a {... | java | public static MimeTypeDetector createDetectorFor(String mimeTypeDetectionConfig, Environment environment) {
switch (mimeTypeDetectionConfig.toLowerCase()) {
case RepositoryConfiguration.FieldValue.MIMETYPE_DETECTION_CONTENT: {
return TIKA_AVAILABLE ? new TikaContentDetector(environme... | [
"public",
"static",
"MimeTypeDetector",
"createDetectorFor",
"(",
"String",
"mimeTypeDetectionConfig",
",",
"Environment",
"environment",
")",
"{",
"switch",
"(",
"mimeTypeDetectionConfig",
".",
"toLowerCase",
"(",
")",
")",
"{",
"case",
"RepositoryConfiguration",
".",
... | Returns a new mime type detector implementation based on
the repository {@link org.modeshape.jcr.RepositoryConfiguration.FieldName#MIMETYPE_DETECTION} configuration
@param mimeTypeDetectionConfig a {@code String}, may not be null
@param environment an {@link Environment} instance specific to a repository
@return a {@l... | [
"Returns",
"a",
"new",
"mime",
"type",
"detector",
"implementation",
"based",
"on",
"the",
"repository",
"{",
"@link",
"org",
".",
"modeshape",
".",
"jcr",
".",
"RepositoryConfiguration",
".",
"FieldName#MIMETYPE_DETECTION",
"}",
"configuration"
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/mimetype/MimeTypeDetectors.java#L65-L80 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/HsqlLinkedList.java | HsqlLinkedList.add | public boolean add(Object element) {
"""
Appends <code>element</code> to the end of this list.
@return true
"""
last.next = new Node(element, null);
last = last.next;
elementCount++;
return true;
} | java | public boolean add(Object element) {
last.next = new Node(element, null);
last = last.next;
elementCount++;
return true;
} | [
"public",
"boolean",
"add",
"(",
"Object",
"element",
")",
"{",
"last",
".",
"next",
"=",
"new",
"Node",
"(",
"element",
",",
"null",
")",
";",
"last",
"=",
"last",
".",
"next",
";",
"elementCount",
"++",
";",
"return",
"true",
";",
"}"
] | Appends <code>element</code> to the end of this list.
@return true | [
"Appends",
"<code",
">",
"element<",
"/",
"code",
">",
"to",
"the",
"end",
"of",
"this",
"list",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/HsqlLinkedList.java#L126-L134 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFRule.java | NFRule.prefixLength | private int prefixLength(String str, String prefix) {
"""
Used by stripPrefix() to match characters. If lenient parse mode
is off, this just calls startsWith(). If lenient parse mode is on,
this function uses CollationElementIterators to match characters in
the strings (only primary-order differences are sign... | java | private int prefixLength(String str, String prefix) {
// if we're looking for an empty prefix, it obviously matches
// zero characters. Just go ahead and return 0.
if (prefix.length() == 0) {
return 0;
}
RbnfLenientScanner scanner = formatter.getLenientScanner();
... | [
"private",
"int",
"prefixLength",
"(",
"String",
"str",
",",
"String",
"prefix",
")",
"{",
"// if we're looking for an empty prefix, it obviously matches",
"// zero characters. Just go ahead and return 0.",
"if",
"(",
"prefix",
".",
"length",
"(",
")",
"==",
"0",
")",
... | Used by stripPrefix() to match characters. If lenient parse mode
is off, this just calls startsWith(). If lenient parse mode is on,
this function uses CollationElementIterators to match characters in
the strings (only primary-order differences are significant in
determining whether there's a match).
@param str The st... | [
"Used",
"by",
"stripPrefix",
"()",
"to",
"match",
"characters",
".",
"If",
"lenient",
"parse",
"mode",
"is",
"off",
"this",
"just",
"calls",
"startsWith",
"()",
".",
"If",
"lenient",
"parse",
"mode",
"is",
"on",
"this",
"function",
"uses",
"CollationElementI... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFRule.java#L1234-L1252 |
intel/jndn-utils | src/main/java/com/intel/jndn/utils/impl/KeyChainFactory.java | KeyChainFactory.configureKeyChain | public static KeyChain configureKeyChain(Name deviceName) throws net.named_data.jndn.security.SecurityException {
"""
Build and configure an NDN {@link KeyChain} from the file system; looks in the ~/.ndn folder for keys and
identity SQLite DB.
@param deviceName the identity of the device; this identity will be... | java | public static KeyChain configureKeyChain(Name deviceName) throws net.named_data.jndn.security.SecurityException {
// access key chain in ~/.ndn; creates if necessary
PrivateKeyStorage keyStorage = new FilePrivateKeyStorage();
IdentityStorage identityStorage = new BasicIdentityStorage();
... | [
"public",
"static",
"KeyChain",
"configureKeyChain",
"(",
"Name",
"deviceName",
")",
"throws",
"net",
".",
"named_data",
".",
"jndn",
".",
"security",
".",
"SecurityException",
"{",
"// access key chain in ~/.ndn; creates if necessary\r",
"PrivateKeyStorage",
"keyStorage",
... | Build and configure an NDN {@link KeyChain} from the file system; looks in the ~/.ndn folder for keys and
identity SQLite DB.
@param deviceName the identity of the device; this identity will be created if it does not exist
@return a configured {@link KeyChain}
@throws net.named_data.jndn.security.SecurityException if ... | [
"Build",
"and",
"configure",
"an",
"NDN",
"{",
"@link",
"KeyChain",
"}",
"from",
"the",
"file",
"system",
";",
"looks",
"in",
"the",
"~",
"/",
".",
"ndn",
"folder",
"for",
"keys",
"and",
"identity",
"SQLite",
"DB",
"."
] | train | https://github.com/intel/jndn-utils/blob/7f670b259484c35d51a6c5acce5715b0573faedd/src/main/java/com/intel/jndn/utils/impl/KeyChainFactory.java#L49-L67 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/RESTSteps.java | RESTSteps.saveValueInDataOutputProvider | @Conditioned
@Et("Je sauvegarde la valeur de cette API REST '(.*)' '(.*)' '(.*)' dans '(.*)' du fournisseur de données en sortie[\\.|\\?]")
@And("I save the value of REST API '(.*)' '(.*)' '(.*)' in '(.*)' column of data output provider[\\.|\\?]")
public void saveValueInDataOutputProvider(String method, Str... | java | @Conditioned
@Et("Je sauvegarde la valeur de cette API REST '(.*)' '(.*)' '(.*)' dans '(.*)' du fournisseur de données en sortie[\\.|\\?]")
@And("I save the value of REST API '(.*)' '(.*)' '(.*)' in '(.*)' column of data output provider[\\.|\\?]")
public void saveValueInDataOutputProvider(String method, Str... | [
"@",
"Conditioned",
"@",
"Et",
"(",
"\"Je sauvegarde la valeur de cette API REST '(.*)' '(.*)' '(.*)' dans '(.*)' du fournisseur de données en sortie[\\\\.|\\\\?]\")",
"",
"@",
"And",
"(",
"\"I save the value of REST API '(.*)' '(.*)' '(.*)' in '(.*)' column of data output provider[\\\\.|\\\\?]\... | Save result of REST API in dataOutputProvider if all 'expected' parameters equals 'actual' parameters in conditions.
@param method
GET or POST
@param pageKey
is the key of page (example: GOOGLE_HOME)
@param uri
end of the url
@param targetColumn
Target column (in data output provider) to save retrieved value.
@param c... | [
"Save",
"result",
"of",
"REST",
"API",
"in",
"dataOutputProvider",
"if",
"all",
"expected",
"parameters",
"equals",
"actual",
"parameters",
"in",
"conditions",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/RESTSteps.java#L98-L117 |
alkacon/opencms-core | src/org/opencms/util/CmsHtmlConverter.java | CmsHtmlConverter.convertToStringSilent | public String convertToStringSilent(byte[] htmlInput) {
"""
Converts the given HTML code according to the settings of this converter.<p>
If an any error occurs during the conversion process, the original input is returned unmodified.<p>
@param htmlInput HTML input stored in an array of bytes
@return strin... | java | public String convertToStringSilent(byte[] htmlInput) {
try {
return convertToString(htmlInput);
} catch (Exception e) {
if (LOG.isWarnEnabled()) {
LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e);
}
try {... | [
"public",
"String",
"convertToStringSilent",
"(",
"byte",
"[",
"]",
"htmlInput",
")",
"{",
"try",
"{",
"return",
"convertToString",
"(",
"htmlInput",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"if",
"(",
"LOG",
".",
"isWarnEnabled",
"(",
")... | Converts the given HTML code according to the settings of this converter.<p>
If an any error occurs during the conversion process, the original input is returned unmodified.<p>
@param htmlInput HTML input stored in an array of bytes
@return string containing the converted HTML | [
"Converts",
"the",
"given",
"HTML",
"code",
"according",
"to",
"the",
"settings",
"of",
"this",
"converter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsHtmlConverter.java#L313-L330 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.sendSingleTextByAdmin | public SendMessageResult sendSingleTextByAdmin(String targetId, String fromId, MessageBody body)
throws APIConnectionException, APIRequestException {
"""
Send single text message by admin
@param targetId target user's id
@param fromId sender's id
@param body message body, include text and extra(if n... | java | public SendMessageResult sendSingleTextByAdmin(String targetId, String fromId, MessageBody body)
throws APIConnectionException, APIRequestException {
return sendMessage(_sendVersion, "single", targetId, "admin",fromId, MessageType.TEXT, body);
} | [
"public",
"SendMessageResult",
"sendSingleTextByAdmin",
"(",
"String",
"targetId",
",",
"String",
"fromId",
",",
"MessageBody",
"body",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"sendMessage",
"(",
"_sendVersion",
",",
"\"single... | Send single text message by admin
@param targetId target user's id
@param fromId sender's id
@param body message body, include text and extra(if needed).
@return return msg_id
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Send",
"single",
"text",
"message",
"by",
"admin"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L472-L475 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/RevisionPair.java | RevisionPair.containsIgnoreCase | private boolean containsIgnoreCase(List<String> stringlist, String match) {
"""
Checks if a list of string contains a String while ignoring case
@param stringlist a list of string
@param match the string to look for
@return true, if the list contains the string, false else
"""
for (String s : stringlis... | java | private boolean containsIgnoreCase(List<String> stringlist, String match) {
for (String s : stringlist) {
if (s.equalsIgnoreCase(match)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"containsIgnoreCase",
"(",
"List",
"<",
"String",
">",
"stringlist",
",",
"String",
"match",
")",
"{",
"for",
"(",
"String",
"s",
":",
"stringlist",
")",
"{",
"if",
"(",
"s",
".",
"equalsIgnoreCase",
"(",
"match",
")",
")",
"{",
"... | Checks if a list of string contains a String while ignoring case
@param stringlist a list of string
@param match the string to look for
@return true, if the list contains the string, false else | [
"Checks",
"if",
"a",
"list",
"of",
"string",
"contains",
"a",
"String",
"while",
"ignoring",
"case"
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/RevisionPair.java#L154-L161 |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/singleobjective/evolutionstrategy/util/CMAESUtils.java | CMAESUtils.tred2 | public static void tred2(int n, double v[][], double d[], double e[]) {
"""
Symmetric Householder reduction to tridiagonal form, taken from JAMA package.
"""
// This is derived from the Algol procedures tred2 by
// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
// Auto. Comp., Vol.ii-Lin... | java | public static void tred2(int n, double v[][], double d[], double e[]) {
// This is derived from the Algol procedures tred2 by
// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
// Fortran subroutine in EISPACK.
System.arraycopy... | [
"public",
"static",
"void",
"tred2",
"(",
"int",
"n",
",",
"double",
"v",
"[",
"]",
"[",
"]",
",",
"double",
"d",
"[",
"]",
",",
"double",
"e",
"[",
"]",
")",
"{",
"// This is derived from the Algol procedures tred2 by",
"// Bowdler, Martin, Reinsch, and Wilki... | Symmetric Householder reduction to tridiagonal form, taken from JAMA package. | [
"Symmetric",
"Householder",
"reduction",
"to",
"tridiagonal",
"form",
"taken",
"from",
"JAMA",
"package",
"."
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/singleobjective/evolutionstrategy/util/CMAESUtils.java#L12-L51 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java | PactDslJsonArray.valueFromProviderState | public PactDslJsonArray valueFromProviderState(String expression, Object example) {
"""
Adds an element that will have it's value injected from the provider state
@param expression Expression to be evaluated from the provider state
@param example Example value to be used in the consumer test
"""
generato... | java | public PactDslJsonArray valueFromProviderState(String expression, Object example) {
generators.addGenerator(Category.BODY, rootPath + appendArrayIndex(0), new ProviderStateGenerator(expression));
body.put(example);
return this;
} | [
"public",
"PactDslJsonArray",
"valueFromProviderState",
"(",
"String",
"expression",
",",
"Object",
"example",
")",
"{",
"generators",
".",
"addGenerator",
"(",
"Category",
".",
"BODY",
",",
"rootPath",
"+",
"appendArrayIndex",
"(",
"0",
")",
",",
"new",
"Provid... | Adds an element that will have it's value injected from the provider state
@param expression Expression to be evaluated from the provider state
@param example Example value to be used in the consumer test | [
"Adds",
"an",
"element",
"that",
"will",
"have",
"it",
"s",
"value",
"injected",
"from",
"the",
"provider",
"state"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java#L1234-L1238 |
joniles/mpxj | src/main/java/net/sf/mpxj/common/EnumHelper.java | EnumHelper.createTypeArray | public static final <E extends Enum<E>> E[] createTypeArray(Class<E> c) {
"""
Creates a lookup array based on the "value" associated with an MpxjEnum.
@param <E> target enumeration
@param c enumeration class
@return lookup array
"""
return createTypeArray(c, 0);
} | java | public static final <E extends Enum<E>> E[] createTypeArray(Class<E> c)
{
return createTypeArray(c, 0);
} | [
"public",
"static",
"final",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
">",
"E",
"[",
"]",
"createTypeArray",
"(",
"Class",
"<",
"E",
">",
"c",
")",
"{",
"return",
"createTypeArray",
"(",
"c",
",",
"0",
")",
";",
"}"
] | Creates a lookup array based on the "value" associated with an MpxjEnum.
@param <E> target enumeration
@param c enumeration class
@return lookup array | [
"Creates",
"a",
"lookup",
"array",
"based",
"on",
"the",
"value",
"associated",
"with",
"an",
"MpxjEnum",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/common/EnumHelper.java#L43-L46 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.orderBy | @Nonnull
public Query orderBy(@Nonnull FieldPath fieldPath, @Nonnull Direction direction) {
"""
Creates and returns a new Query that's additionally sorted by the specified field, optionally
in descending order instead of ascending.
@param fieldPath The field to sort by.
@param direction The direction to sor... | java | @Nonnull
public Query orderBy(@Nonnull FieldPath fieldPath, @Nonnull Direction direction) {
Preconditions.checkState(
options.startCursor == null && options.endCursor == null,
"Cannot specify an orderBy() constraint after calling startAt(), "
+ "startAfter(), endBefore() or endAt().");... | [
"@",
"Nonnull",
"public",
"Query",
"orderBy",
"(",
"@",
"Nonnull",
"FieldPath",
"fieldPath",
",",
"@",
"Nonnull",
"Direction",
"direction",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"options",
".",
"startCursor",
"==",
"null",
"&&",
"options",
".",
... | Creates and returns a new Query that's additionally sorted by the specified field, optionally
in descending order instead of ascending.
@param fieldPath The field to sort by.
@param direction The direction to sort.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"that",
"s",
"additionally",
"sorted",
"by",
"the",
"specified",
"field",
"optionally",
"in",
"descending",
"order",
"instead",
"of",
"ascending",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L658-L669 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/IntuitResponseDeserializerHelper.java | IntuitResponseDeserializerHelper.invokeFeature | protected void invokeFeature(String featureSwitch, Feature feature ) {
"""
Executes feature if switch setting is on
@param featureSwitch
@param feature
"""
if(Config.getBooleanProperty(featureSwitch,true)) {
feature.execute();
}
} | java | protected void invokeFeature(String featureSwitch, Feature feature ) {
if(Config.getBooleanProperty(featureSwitch,true)) {
feature.execute();
}
} | [
"protected",
"void",
"invokeFeature",
"(",
"String",
"featureSwitch",
",",
"Feature",
"feature",
")",
"{",
"if",
"(",
"Config",
".",
"getBooleanProperty",
"(",
"featureSwitch",
",",
"true",
")",
")",
"{",
"feature",
".",
"execute",
"(",
")",
";",
"}",
"}"
... | Executes feature if switch setting is on
@param featureSwitch
@param feature | [
"Executes",
"feature",
"if",
"switch",
"setting",
"is",
"on"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/IntuitResponseDeserializerHelper.java#L52-L56 |
h2oai/h2o-2 | src/main/java/water/parser/SVMLightParser.java | SVMLightParser.guessSetup | public static PSetupGuess guessSetup(byte [] bytes) {
"""
Try to parse the bytes as svm light format, return SVMParser instance if the input is in svm light format, null otherwise.
@param bytes
@return SVMLightPArser instance or null
"""
// find the last eof
int i = bytes.length-1;
while(i > 0 &&... | java | public static PSetupGuess guessSetup(byte [] bytes){
// find the last eof
int i = bytes.length-1;
while(i > 0 && bytes[i] != '\n')--i;
assert i >= 0;
InputStream is = new ByteArrayInputStream(Arrays.copyOf(bytes,i));
SVMLightParser p = new SVMLightParser(new ParserSetup(ParserType.SVMLight, CsvP... | [
"public",
"static",
"PSetupGuess",
"guessSetup",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"// find the last eof",
"int",
"i",
"=",
"bytes",
".",
"length",
"-",
"1",
";",
"while",
"(",
"i",
">",
"0",
"&&",
"bytes",
"[",
"i",
"]",
"!=",
"'",
"'",
")... | Try to parse the bytes as svm light format, return SVMParser instance if the input is in svm light format, null otherwise.
@param bytes
@return SVMLightPArser instance or null | [
"Try",
"to",
"parse",
"the",
"bytes",
"as",
"svm",
"light",
"format",
"return",
"SVMParser",
"instance",
"if",
"the",
"input",
"is",
"in",
"svm",
"light",
"format",
"null",
"otherwise",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/parser/SVMLightParser.java#L52-L62 |
GerdHolz/TOVAL | src/de/invation/code/toval/graphic/diagrams/panels/ScatterChartPanel.java | ScatterChartPanel.getPointFor | protected Point getPointFor(int index) {
"""
Determines the point coordinates for a given value-vector on the base of the maintained dimensions.<br>
Given two dimensions X and Y with values x1,...,xn and y1,...,yn this method just returns a point
P(xi,yi) which matches the desired behavior of a standard 2-dimens... | java | protected Point getPointFor(int index) {
return new Point(getXFor(diagram.getValue(ValueDimension.X, index)), getYFor(diagram.getValue(ValueDimension.Y, index)));
} | [
"protected",
"Point",
"getPointFor",
"(",
"int",
"index",
")",
"{",
"return",
"new",
"Point",
"(",
"getXFor",
"(",
"diagram",
".",
"getValue",
"(",
"ValueDimension",
".",
"X",
",",
"index",
")",
")",
",",
"getYFor",
"(",
"diagram",
".",
"getValue",
"(",
... | Determines the point coordinates for a given value-vector on the base of the maintained dimensions.<br>
Given two dimensions X and Y with values x1,...,xn and y1,...,yn this method just returns a point
P(xi,yi) which matches the desired behavior of a standard 2-dimensional diagrams such as graph-plots.<br>
For changing... | [
"Determines",
"the",
"point",
"coordinates",
"for",
"a",
"given",
"value",
"-",
"vector",
"on",
"the",
"base",
"of",
"the",
"maintained",
"dimensions",
".",
"<br",
">",
"Given",
"two",
"dimensions",
"X",
"and",
"Y",
"with",
"values",
"x1",
"...",
"xn",
"... | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/diagrams/panels/ScatterChartPanel.java#L428-L430 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/internal/core/C4BlobStore.java | C4BlobStore.getContents | public FLSliceResult getContents(C4BlobKey blobKey) throws LiteCoreException {
"""
Reads the entire contents of a blob into memory. Caller is responsible for freeing it.
"""
return new FLSliceResult(getContents(handle, blobKey.getHandle()));
} | java | public FLSliceResult getContents(C4BlobKey blobKey) throws LiteCoreException {
return new FLSliceResult(getContents(handle, blobKey.getHandle()));
} | [
"public",
"FLSliceResult",
"getContents",
"(",
"C4BlobKey",
"blobKey",
")",
"throws",
"LiteCoreException",
"{",
"return",
"new",
"FLSliceResult",
"(",
"getContents",
"(",
"handle",
",",
"blobKey",
".",
"getHandle",
"(",
")",
")",
")",
";",
"}"
] | Reads the entire contents of a blob into memory. Caller is responsible for freeing it. | [
"Reads",
"the",
"entire",
"contents",
"of",
"a",
"blob",
"into",
"memory",
".",
"Caller",
"is",
"responsible",
"for",
"freeing",
"it",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/internal/core/C4BlobStore.java#L101-L103 |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/BeanJsonDeserializerCreator.java | BeanJsonDeserializerCreator.buildNewInstanceMethodForDefaultConstructor | private void buildNewInstanceMethodForDefaultConstructor( MethodSpec.Builder newInstanceMethodBuilder, MethodSpec createMethod ) {
"""
Generate the instance builder class body for a default constructor. We directly instantiate the bean at the builder creation and we
set the properties to it
@param newInstanceM... | java | private void buildNewInstanceMethodForDefaultConstructor( MethodSpec.Builder newInstanceMethodBuilder, MethodSpec createMethod ) {
newInstanceMethodBuilder.addStatement( "return new $T($N(), bufferedProperties)",
parameterizedName( Instance.class, beanInfo.getType() ), createMethod );
} | [
"private",
"void",
"buildNewInstanceMethodForDefaultConstructor",
"(",
"MethodSpec",
".",
"Builder",
"newInstanceMethodBuilder",
",",
"MethodSpec",
"createMethod",
")",
"{",
"newInstanceMethodBuilder",
".",
"addStatement",
"(",
"\"return new $T($N(), bufferedProperties)\"",
",",
... | Generate the instance builder class body for a default constructor. We directly instantiate the bean at the builder creation and we
set the properties to it
@param newInstanceMethodBuilder builder for the
{@link InstanceBuilder#newInstance(JsonReader, JsonDeserializationContext, JsonDeserializerParameters, Map, Map)}
... | [
"Generate",
"the",
"instance",
"builder",
"class",
"body",
"for",
"a",
"default",
"constructor",
".",
"We",
"directly",
"instantiate",
"the",
"bean",
"at",
"the",
"builder",
"creation",
"and",
"we",
"set",
"the",
"properties",
"to",
"it"
] | train | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/BeanJsonDeserializerCreator.java#L282-L285 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.prepareROI | public static ROI prepareROI( Geometry roi, AffineTransform mt2d ) throws Exception {
"""
Utility method for transforming a geometry ROI into the raster space, using the provided affine transformation.
@param roi a {@link Geometry} in model space.
@param mt2d an {@link AffineTransform} that maps from raster to... | java | public static ROI prepareROI( Geometry roi, AffineTransform mt2d ) throws Exception {
// transform the geometry to raster space so that we can use it as a ROI source
Geometry rasterSpaceGeometry = JTS.transform(roi, new AffineTransform2D(mt2d.createInverse()));
// simplify the geometry so that ... | [
"public",
"static",
"ROI",
"prepareROI",
"(",
"Geometry",
"roi",
",",
"AffineTransform",
"mt2d",
")",
"throws",
"Exception",
"{",
"// transform the geometry to raster space so that we can use it as a ROI source",
"Geometry",
"rasterSpaceGeometry",
"=",
"JTS",
".",
"transform"... | Utility method for transforming a geometry ROI into the raster space, using the provided affine transformation.
@param roi a {@link Geometry} in model space.
@param mt2d an {@link AffineTransform} that maps from raster to model space. This is already referred to the pixel corner.
@return a {@link ROI} suitable for usi... | [
"Utility",
"method",
"for",
"transforming",
"a",
"geometry",
"ROI",
"into",
"the",
"raster",
"space",
"using",
"the",
"provided",
"affine",
"transformation",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L1281-L1291 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.copyFromTo | public static void copyFromTo(Object from, Object to, String... fieldNames) {
"""
Copy from to.
@param from the from
@param to the to
@param fieldNames the field names
"""
for (String field : fieldNames) {
copyFromTo(from, to, field);
}
} | java | public static void copyFromTo(Object from, Object to, String... fieldNames) {
for (String field : fieldNames) {
copyFromTo(from, to, field);
}
} | [
"public",
"static",
"void",
"copyFromTo",
"(",
"Object",
"from",
",",
"Object",
"to",
",",
"String",
"...",
"fieldNames",
")",
"{",
"for",
"(",
"String",
"field",
":",
"fieldNames",
")",
"{",
"copyFromTo",
"(",
"from",
",",
"to",
",",
"field",
")",
";"... | Copy from to.
@param from the from
@param to the to
@param fieldNames the field names | [
"Copy",
"from",
"to",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L254-L258 |
facebookarchive/hadoop-20 | src/contrib/benchmark/src/java/org/apache/hadoop/hdfs/StructureGenerator.java | StructureGenerator.genDirStructure | private INode genDirStructure(String rootName, int maxDepth) {
"""
Generate a directory tree rooted at <code>rootName</code>
The number of subtree is in the range of [minWidth, maxWidth].
The maximum depth of each subtree is in the range of
[2*maxDepth/3, maxDepth].
"""
INode root = new INode(rootName);... | java | private INode genDirStructure(String rootName, int maxDepth) {
INode root = new INode(rootName);
if (maxDepth>0) {
maxDepth--;
int minDepth = maxDepth*2/3;
// Figure out the number of subdirectories to generate
int numOfSubDirs = minWidth + r.nextInt(maxWidth-minWidth+1);
// Expan... | [
"private",
"INode",
"genDirStructure",
"(",
"String",
"rootName",
",",
"int",
"maxDepth",
")",
"{",
"INode",
"root",
"=",
"new",
"INode",
"(",
"rootName",
")",
";",
"if",
"(",
"maxDepth",
">",
"0",
")",
"{",
"maxDepth",
"--",
";",
"int",
"minDepth",
"=... | Generate a directory tree rooted at <code>rootName</code>
The number of subtree is in the range of [minWidth, maxWidth].
The maximum depth of each subtree is in the range of
[2*maxDepth/3, maxDepth]. | [
"Generate",
"a",
"directory",
"tree",
"rooted",
"at",
"<code",
">",
"rootName<",
"/",
"code",
">",
"The",
"number",
"of",
"subtree",
"is",
"in",
"the",
"range",
"of",
"[",
"minWidth",
"maxWidth",
"]",
".",
"The",
"maximum",
"depth",
"of",
"each",
"subtre... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/benchmark/src/java/org/apache/hadoop/hdfs/StructureGenerator.java#L235-L252 |
Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/CpCommand.java | CpCommand.preserveAttributes | private void preserveAttributes(AlluxioURI srcPath, AlluxioURI dstPath)
throws IOException, AlluxioException {
"""
Preserves attributes from the source file to the target file.
@param srcPath the source path
@param dstPath the destination path in the Alluxio filesystem
"""
if (mPreservePermission... | java | private void preserveAttributes(AlluxioURI srcPath, AlluxioURI dstPath)
throws IOException, AlluxioException {
if (mPreservePermissions) {
URIStatus srcStatus = mFileSystem.getStatus(srcPath);
mFileSystem.setAttribute(dstPath, SetAttributePOptions.newBuilder()
.setOwner(srcStatus.getOwne... | [
"private",
"void",
"preserveAttributes",
"(",
"AlluxioURI",
"srcPath",
",",
"AlluxioURI",
"dstPath",
")",
"throws",
"IOException",
",",
"AlluxioException",
"{",
"if",
"(",
"mPreservePermissions",
")",
"{",
"URIStatus",
"srcStatus",
"=",
"mFileSystem",
".",
"getStatu... | Preserves attributes from the source file to the target file.
@param srcPath the source path
@param dstPath the destination path in the Alluxio filesystem | [
"Preserves",
"attributes",
"from",
"the",
"source",
"file",
"to",
"the",
"target",
"file",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/CpCommand.java#L557-L568 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java | AttributesImpl.setType | public void setType (int index, String type) {
"""
Set the type of a specific attribute.
@param index The index of the attribute (zero-based).
@param type The attribute's type.
@exception java.lang.ArrayIndexOutOfBoundsException When the
supplied index does not point to an attribute
in the list.
"""
... | java | public void setType (int index, String type)
{
if (index >= 0 && index < length) {
data[index*5+3] = type;
} else {
badIndex(index);
}
} | [
"public",
"void",
"setType",
"(",
"int",
"index",
",",
"String",
"type",
")",
"{",
"if",
"(",
"index",
">=",
"0",
"&&",
"index",
"<",
"length",
")",
"{",
"data",
"[",
"index",
"*",
"5",
"+",
"3",
"]",
"=",
"type",
";",
"}",
"else",
"{",
"badInd... | Set the type of a specific attribute.
@param index The index of the attribute (zero-based).
@param type The attribute's type.
@exception java.lang.ArrayIndexOutOfBoundsException When the
supplied index does not point to an attribute
in the list. | [
"Set",
"the",
"type",
"of",
"a",
"specific",
"attribute",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java#L525-L532 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/sequences/FeatureFactory.java | FeatureFactory.addAllInterningAndSuffixing | @SuppressWarnings( {
"""
Makes more complete feature names out of partial feature names, by
adding a suffix to the String feature name, adding results to an
accumulator
@param accumulator The output features are added here
@param addend The base set of features
@param suffix The suffix added to each feature... | java | @SuppressWarnings({"MethodMayBeStatic"})
protected void addAllInterningAndSuffixing(Collection<String> accumulator, Collection<String> addend, String suffix) {
boolean nonNullSuffix = suffix != null && ! "".equals(suffix);
if (nonNullSuffix) {
suffix = '|' + suffix;
}
// boolean intern2 = ... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"MethodMayBeStatic\"",
"}",
")",
"protected",
"void",
"addAllInterningAndSuffixing",
"(",
"Collection",
"<",
"String",
">",
"accumulator",
",",
"Collection",
"<",
"String",
">",
"addend",
",",
"String",
"suffix",
")",
"{",
"b... | Makes more complete feature names out of partial feature names, by
adding a suffix to the String feature name, adding results to an
accumulator
@param accumulator The output features are added here
@param addend The base set of features
@param suffix The suffix added to each feature in the addend set | [
"Makes",
"more",
"complete",
"feature",
"names",
"out",
"of",
"partial",
"feature",
"names",
"by",
"adding",
"a",
"suffix",
"to",
"the",
"String",
"feature",
"name",
"adding",
"results",
"to",
"an",
"accumulator"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/sequences/FeatureFactory.java#L92-L108 |
phax/peppol-directory | peppol-directory-indexer/src/main/java/com/helger/pd/indexer/storage/PDStorageManager.java | PDStorageManager.searchAtomic | public void searchAtomic (@Nonnull final Query aQuery, @Nonnull final Collector aCollector) throws IOException {
"""
Search all documents matching the passed query and pass the result on to
the provided {@link Consumer}.
@param aQuery
Query to execute. May not be <code>null</code>-
@param aCollector
The Luc... | java | public void searchAtomic (@Nonnull final Query aQuery, @Nonnull final Collector aCollector) throws IOException
{
ValueEnforcer.notNull (aQuery, "Query");
ValueEnforcer.notNull (aCollector, "Collector");
m_aLucene.readLockedAtomic ( () -> {
final IndexSearcher aSearcher = m_aLucene.getSearcher ();
... | [
"public",
"void",
"searchAtomic",
"(",
"@",
"Nonnull",
"final",
"Query",
"aQuery",
",",
"@",
"Nonnull",
"final",
"Collector",
"aCollector",
")",
"throws",
"IOException",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aQuery",
",",
"\"Query\"",
")",
";",
"ValueEnf... | Search all documents matching the passed query and pass the result on to
the provided {@link Consumer}.
@param aQuery
Query to execute. May not be <code>null</code>-
@param aCollector
The Lucene collector to be used. May not be <code>null</code>.
@throws IOException
On Lucene error
@see #getAllDocuments(Query,int) | [
"Search",
"all",
"documents",
"matching",
"the",
"passed",
"query",
"and",
"pass",
"the",
"result",
"on",
"to",
"the",
"provided",
"{",
"@link",
"Consumer",
"}",
"."
] | train | https://github.com/phax/peppol-directory/blob/98da26da29fb7178371d6b029516cbf01be223fb/peppol-directory-indexer/src/main/java/com/helger/pd/indexer/storage/PDStorageManager.java#L402-L423 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jwtsso_fat/fat/src/com/ibm/ws/security/jwtsso/fat/utils/CommonExpectations.java | CommonExpectations.successfullyReachedProtectedResourceWithJwtCookie | public static Expectations successfullyReachedProtectedResourceWithJwtCookie(String testAction, String protectedUrl, String username, String issuerRegex) {
"""
Sets expectations that will check:
<ol>
<li>Successfully reached the specified URL
<li>Response text includes JWT cookie and principal information
</ol... | java | public static Expectations successfullyReachedProtectedResourceWithJwtCookie(String testAction, String protectedUrl, String username, String issuerRegex) {
Expectations expectations = new Expectations();
expectations.addExpectations(successfullyReachedUrl(testAction, protectedUrl));
expectations... | [
"public",
"static",
"Expectations",
"successfullyReachedProtectedResourceWithJwtCookie",
"(",
"String",
"testAction",
",",
"String",
"protectedUrl",
",",
"String",
"username",
",",
"String",
"issuerRegex",
")",
"{",
"Expectations",
"expectations",
"=",
"new",
"Expectation... | Sets expectations that will check:
<ol>
<li>Successfully reached the specified URL
<li>Response text includes JWT cookie and principal information
</ol> | [
"Sets",
"expectations",
"that",
"will",
"check",
":",
"<ol",
">",
"<li",
">",
"Successfully",
"reached",
"the",
"specified",
"URL",
"<li",
">",
"Response",
"text",
"includes",
"JWT",
"cookie",
"and",
"principal",
"information",
"<",
"/",
"ol",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jwtsso_fat/fat/src/com/ibm/ws/security/jwtsso/fat/utils/CommonExpectations.java#L42-L48 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/res/XResourceBundle.java | XResourceBundle.loadResourceBundle | public static final XResourceBundle loadResourceBundle(
String className, Locale locale) throws MissingResourceException {
"""
Return a named ResourceBundle for a particular locale. This method mimics the behavior
of ResourceBundle.getBundle().
@param className Name of local-specific subclass.
@par... | java | public static final XResourceBundle loadResourceBundle(
String className, Locale locale) throws MissingResourceException
{
String suffix = getResourceSuffix(locale);
//System.out.println("resource " + className + suffix);
try
{
// first try with the given locale
String r... | [
"public",
"static",
"final",
"XResourceBundle",
"loadResourceBundle",
"(",
"String",
"className",
",",
"Locale",
"locale",
")",
"throws",
"MissingResourceException",
"{",
"String",
"suffix",
"=",
"getResourceSuffix",
"(",
"locale",
")",
";",
"//System.out.println(\"reso... | Return a named ResourceBundle for a particular locale. This method mimics the behavior
of ResourceBundle.getBundle().
@param className Name of local-specific subclass.
@param locale the locale to prefer when searching for the bundle | [
"Return",
"a",
"named",
"ResourceBundle",
"for",
"a",
"particular",
"locale",
".",
"This",
"method",
"mimics",
"the",
"behavior",
"of",
"ResourceBundle",
".",
"getBundle",
"()",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/res/XResourceBundle.java#L56-L89 |
OrienteerBAP/wicket-orientdb | wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/query/filter/FilterCriteriaType.java | FilterCriteriaType.createAndRegister | public static FilterCriteriaType createAndRegister(String name, boolean collection, boolean map) {
"""
Create and register {@link FilterCriteriaType}
@param name name of current {@link FilterCriteriaType}
@param collection if true - {@link FilterCriteriaType} include {@link IModel} with {@link Collection}
@par... | java | public static FilterCriteriaType createAndRegister(String name, boolean collection, boolean map) {
FilterCriteriaType type = create(name, collection, map);
register(type);
return type;
} | [
"public",
"static",
"FilterCriteriaType",
"createAndRegister",
"(",
"String",
"name",
",",
"boolean",
"collection",
",",
"boolean",
"map",
")",
"{",
"FilterCriteriaType",
"type",
"=",
"create",
"(",
"name",
",",
"collection",
",",
"map",
")",
";",
"register",
... | Create and register {@link FilterCriteriaType}
@param name name of current {@link FilterCriteriaType}
@param collection if true - {@link FilterCriteriaType} include {@link IModel} with {@link Collection}
@param map d
@return new {@link FilterCriteriaType}
@throws IllegalStateException if {@link FilterCriteriaType} with... | [
"Create",
"and",
"register",
"{"
] | train | https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/query/filter/FilterCriteriaType.java#L99-L103 |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.parseAttributes | private Map<String, String> parseAttributes() throws IOException {
"""
Parses attributes as a Map, used in both parseWebIdentitySessionContext and parseSessionContext
@return attributes for either session context or web identity session context
@throws IOException
"""
if (jsonParser.nextToken() != ... | java | private Map<String, String> parseAttributes() throws IOException {
if (jsonParser.nextToken() != JsonToken.START_OBJECT) {
throw new JsonParseException("Not a Attributes object", jsonParser.getCurrentLocation());
}
Map<String, String> attributes = new HashMap<>();
while (js... | [
"private",
"Map",
"<",
"String",
",",
"String",
">",
"parseAttributes",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"jsonParser",
".",
"nextToken",
"(",
")",
"!=",
"JsonToken",
".",
"START_OBJECT",
")",
"{",
"throw",
"new",
"JsonParseException",
"(",
... | Parses attributes as a Map, used in both parseWebIdentitySessionContext and parseSessionContext
@return attributes for either session context or web identity session context
@throws IOException | [
"Parses",
"attributes",
"as",
"a",
"Map",
"used",
"in",
"both",
"parseWebIdentitySessionContext",
"and",
"parseSessionContext"
] | train | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L497-L511 |
jenetics/jenetics | jenetics/src/main/java/io/jenetics/CharacterChromosome.java | CharacterChromosome.of | public static CharacterChromosome of(
final String alleles,
final CharSeq validChars
) {
"""
Create a new chromosome from the given genes (given as string).
@param alleles the character genes.
@param validChars the valid characters.
@return a new {@code CharacterChromosome} with the given parameter
@thr... | java | public static CharacterChromosome of(
final String alleles,
final CharSeq validChars
) {
final IntRef index = new IntRef();
final Supplier<CharacterGene> geneFactory = () -> CharacterGene.of(
alleles.charAt(index.value++), validChars
);
final ISeq<CharacterGene> genes =
MSeq.<CharacterGene>ofLength(... | [
"public",
"static",
"CharacterChromosome",
"of",
"(",
"final",
"String",
"alleles",
",",
"final",
"CharSeq",
"validChars",
")",
"{",
"final",
"IntRef",
"index",
"=",
"new",
"IntRef",
"(",
")",
";",
"final",
"Supplier",
"<",
"CharacterGene",
">",
"geneFactory",... | Create a new chromosome from the given genes (given as string).
@param alleles the character genes.
@param validChars the valid characters.
@return a new {@code CharacterChromosome} with the given parameter
@throws IllegalArgumentException if the genes string is empty. | [
"Create",
"a",
"new",
"chromosome",
"from",
"the",
"given",
"genes",
"(",
"given",
"as",
"string",
")",
"."
] | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics/src/main/java/io/jenetics/CharacterChromosome.java#L303-L318 |
jenkinsci/jenkins | core/src/main/java/jenkins/security/apitoken/ApiTokenStore.java | ApiTokenStore.generateNewToken | public synchronized @Nonnull TokenUuidAndPlainValue generateNewToken(@Nonnull String name) {
"""
Create a new token with the given name and return it id and secret value.
Result meant to be sent / displayed and then discarded.
"""
// 16x8=128bit worth of randomness, using brute-force you need on avera... | java | public synchronized @Nonnull TokenUuidAndPlainValue generateNewToken(@Nonnull String name) {
// 16x8=128bit worth of randomness, using brute-force you need on average 2^127 tries (~10^37)
byte[] random = new byte[16];
RANDOM.nextBytes(random);
String secretValue = Util.toHexString(random... | [
"public",
"synchronized",
"@",
"Nonnull",
"TokenUuidAndPlainValue",
"generateNewToken",
"(",
"@",
"Nonnull",
"String",
"name",
")",
"{",
"// 16x8=128bit worth of randomness, using brute-force you need on average 2^127 tries (~10^37)",
"byte",
"[",
"]",
"random",
"=",
"new",
"... | Create a new token with the given name and return it id and secret value.
Result meant to be sent / displayed and then discarded. | [
"Create",
"a",
"new",
"token",
"with",
"the",
"given",
"name",
"and",
"return",
"it",
"id",
"and",
"secret",
"value",
".",
"Result",
"meant",
"to",
"be",
"sent",
"/",
"displayed",
"and",
"then",
"discarded",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/apitoken/ApiTokenStore.java#L175-L191 |
xetorthio/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | BinaryJedis.setbit | @Override
public Boolean setbit(final byte[] key, final long offset, final boolean value) {
"""
Sets or clears the bit at offset in the string value stored at key
@param key
@param offset
@param value
@return
"""
checkIsInMultiOrPipeline();
client.setbit(key, offset, value);
return client.get... | java | @Override
public Boolean setbit(final byte[] key, final long offset, final boolean value) {
checkIsInMultiOrPipeline();
client.setbit(key, offset, value);
return client.getIntegerReply() == 1;
} | [
"@",
"Override",
"public",
"Boolean",
"setbit",
"(",
"final",
"byte",
"[",
"]",
"key",
",",
"final",
"long",
"offset",
",",
"final",
"boolean",
"value",
")",
"{",
"checkIsInMultiOrPipeline",
"(",
")",
";",
"client",
".",
"setbit",
"(",
"key",
",",
"offse... | Sets or clears the bit at offset in the string value stored at key
@param key
@param offset
@param value
@return | [
"Sets",
"or",
"clears",
"the",
"bit",
"at",
"offset",
"in",
"the",
"string",
"value",
"stored",
"at",
"key"
] | train | https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L3202-L3207 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/inf/BeliefPropagation.java | BeliefPropagation.smartResidual | private double smartResidual(VarTensor message, VarTensor newMessage, int edge) {
"""
Returns the "converged" residual for constant messages, and the actual residual otherwise.
"""
// This is intentionally NOT the semiring zero.
return CachingBpSchedule.isConstantMsg(edge, fg) ? 0.0 : getResidu... | java | private double smartResidual(VarTensor message, VarTensor newMessage, int edge) {
// This is intentionally NOT the semiring zero.
return CachingBpSchedule.isConstantMsg(edge, fg) ? 0.0 : getResidual(message, newMessage);
} | [
"private",
"double",
"smartResidual",
"(",
"VarTensor",
"message",
",",
"VarTensor",
"newMessage",
",",
"int",
"edge",
")",
"{",
"// This is intentionally NOT the semiring zero.",
"return",
"CachingBpSchedule",
".",
"isConstantMsg",
"(",
"edge",
",",
"fg",
")",
"?",
... | Returns the "converged" residual for constant messages, and the actual residual otherwise. | [
"Returns",
"the",
"converged",
"residual",
"for",
"constant",
"messages",
"and",
"the",
"actual",
"residual",
"otherwise",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/inf/BeliefPropagation.java#L471-L474 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationsInner.java | AnnotationsInner.listAsync | public Observable<List<AnnotationInner>> listAsync(String resourceGroupName, String resourceName, String start, String end) {
"""
Gets the list of annotations for a component for given time range.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights ... | java | public Observable<List<AnnotationInner>> listAsync(String resourceGroupName, String resourceName, String start, String end) {
return listWithServiceResponseAsync(resourceGroupName, resourceName, start, end).map(new Func1<ServiceResponse<List<AnnotationInner>>, List<AnnotationInner>>() {
@Override
... | [
"public",
"Observable",
"<",
"List",
"<",
"AnnotationInner",
">",
">",
"listAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"String",
"start",
",",
"String",
"end",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceG... | Gets the list of annotations for a component for given time range.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param start The start time to query from for annotations, cannot be older than 90 days from current date.
@param end ... | [
"Gets",
"the",
"list",
"of",
"annotations",
"for",
"a",
"component",
"for",
"given",
"time",
"range",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationsInner.java#L119-L126 |
VoltDB/voltdb | src/frontend/org/voltdb/jni/ExecutionEngineJNI.java | ExecutionEngineJNI.coreUpdateCatalog | @Override
public void coreUpdateCatalog(long timestamp, boolean isStreamUpdate, final String catalogDiffs) throws EEException {
"""
Provide a catalog diff and a new catalog version and update the
engine's catalog.
"""
LOG.trace("Loading Application Catalog...");
int errorCode = 0;
... | java | @Override
public void coreUpdateCatalog(long timestamp, boolean isStreamUpdate, final String catalogDiffs) throws EEException {
LOG.trace("Loading Application Catalog...");
int errorCode = 0;
errorCode = nativeUpdateCatalog(pointer, timestamp, isStreamUpdate, getStringBytes(catalogDiffs));
... | [
"@",
"Override",
"public",
"void",
"coreUpdateCatalog",
"(",
"long",
"timestamp",
",",
"boolean",
"isStreamUpdate",
",",
"final",
"String",
"catalogDiffs",
")",
"throws",
"EEException",
"{",
"LOG",
".",
"trace",
"(",
"\"Loading Application Catalog...\"",
")",
";",
... | Provide a catalog diff and a new catalog version and update the
engine's catalog. | [
"Provide",
"a",
"catalog",
"diff",
"and",
"a",
"new",
"catalog",
"version",
"and",
"update",
"the",
"engine",
"s",
"catalog",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jni/ExecutionEngineJNI.java#L348-L354 |
knowm/XChange | xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/v2/service/CoinbaseMarketDataServiceRaw.java | CoinbaseMarketDataServiceRaw.getCoinbaseSpotRate | public CoinbasePrice getCoinbaseSpotRate(Currency base, Currency counter) throws IOException {
"""
Unauthenticated resource that tells you the current price of one unit. This is usually
somewhere in between the buy and sell price, current to within a few minutes.
@param pair The currency pair.
@return The pri... | java | public CoinbasePrice getCoinbaseSpotRate(Currency base, Currency counter) throws IOException {
return coinbase.getSpotRate(Coinbase.CB_VERSION_VALUE, base + "-" + counter).getData();
} | [
"public",
"CoinbasePrice",
"getCoinbaseSpotRate",
"(",
"Currency",
"base",
",",
"Currency",
"counter",
")",
"throws",
"IOException",
"{",
"return",
"coinbase",
".",
"getSpotRate",
"(",
"Coinbase",
".",
"CB_VERSION_VALUE",
",",
"base",
"+",
"\"-\"",
"+",
"counter",... | Unauthenticated resource that tells you the current price of one unit. This is usually
somewhere in between the buy and sell price, current to within a few minutes.
@param pair The currency pair.
@return The price in the desired {@code currency} for one unit.
@throws IOException
@see <a
href="https://developers.coinba... | [
"Unauthenticated",
"resource",
"that",
"tells",
"you",
"the",
"current",
"price",
"of",
"one",
"unit",
".",
"This",
"is",
"usually",
"somewhere",
"in",
"between",
"the",
"buy",
"and",
"sell",
"price",
"current",
"to",
"within",
"a",
"few",
"minutes",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/v2/service/CoinbaseMarketDataServiceRaw.java#L73-L76 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.readResource | public CmsResource readResource(CmsDbContext dbc, CmsUUID structureID, CmsResourceFilter filter)
throws CmsDataAccessException {
"""
Reads a resource from the VFS, using the specified resource filter.<p>
@param dbc the current database context
@param structureID the structure id of the resource to read
@p... | java | public CmsResource readResource(CmsDbContext dbc, CmsUUID structureID, CmsResourceFilter filter)
throws CmsDataAccessException {
CmsUUID projectId = getProjectIdForContext(dbc);
// please note: the filter will be applied in the security manager later
CmsResource resource = getVfsDriver(dbc)... | [
"public",
"CmsResource",
"readResource",
"(",
"CmsDbContext",
"dbc",
",",
"CmsUUID",
"structureID",
",",
"CmsResourceFilter",
"filter",
")",
"throws",
"CmsDataAccessException",
"{",
"CmsUUID",
"projectId",
"=",
"getProjectIdForContext",
"(",
"dbc",
")",
";",
"// pleas... | Reads a resource from the VFS, using the specified resource filter.<p>
@param dbc the current database context
@param structureID the structure id of the resource to read
@param filter the resource filter to use while reading
@return the resource that was read
@throws CmsDataAccessException if something goes wrong
... | [
"Reads",
"a",
"resource",
"from",
"the",
"VFS",
"using",
"the",
"specified",
"resource",
"filter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L7645-L7657 |
haraldk/TwelveMonkeys | common/common-io/src/main/java/com/twelvemonkeys/io/FileUtil.java | FileUtil.copyDir | private static boolean copyDir(File pFrom, File pTo, boolean pOverWrite) throws IOException {
"""
Copies a directory recursively. If the destination folder does not exist,
it is created
@param pFrom the source directory
@param pTo the destination directory
@param pOverWrite {@code true} if we should allow ov... | java | private static boolean copyDir(File pFrom, File pTo, boolean pOverWrite) throws IOException {
if (pTo.exists() && !pTo.isDirectory()) {
throw new IOException("A directory may only be copied to another directory, not to a file");
}
pTo.mkdirs(); // mkdir?
boolean allOkay... | [
"private",
"static",
"boolean",
"copyDir",
"(",
"File",
"pFrom",
",",
"File",
"pTo",
",",
"boolean",
"pOverWrite",
")",
"throws",
"IOException",
"{",
"if",
"(",
"pTo",
".",
"exists",
"(",
")",
"&&",
"!",
"pTo",
".",
"isDirectory",
"(",
")",
")",
"{",
... | Copies a directory recursively. If the destination folder does not exist,
it is created
@param pFrom the source directory
@param pTo the destination directory
@param pOverWrite {@code true} if we should allow overwrting existing files
@return {@code true} if all files were copied sucessfully
@throws IOException if {@c... | [
"Copies",
"a",
"directory",
"recursively",
".",
"If",
"the",
"destination",
"folder",
"does",
"not",
"exist",
"it",
"is",
"created"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/FileUtil.java#L282-L296 |
apache/predictionio-sdk-java | client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java | EventClient.deleteItem | public String deleteItem(String iid)
throws ExecutionException, InterruptedException, IOException {
"""
Deletes a item. Event time is recorded as the time when the function is called.
@param iid ID of the item
@return ID of this event
"""
return deleteItem(iid, new DateTime());
} | java | public String deleteItem(String iid)
throws ExecutionException, InterruptedException, IOException {
return deleteItem(iid, new DateTime());
} | [
"public",
"String",
"deleteItem",
"(",
"String",
"iid",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
",",
"IOException",
"{",
"return",
"deleteItem",
"(",
"iid",
",",
"new",
"DateTime",
"(",
")",
")",
";",
"}"
] | Deletes a item. Event time is recorded as the time when the function is called.
@param iid ID of the item
@return ID of this event | [
"Deletes",
"a",
"item",
".",
"Event",
"time",
"is",
"recorded",
"as",
"the",
"time",
"when",
"the",
"function",
"is",
"called",
"."
] | train | https://github.com/apache/predictionio-sdk-java/blob/16052c96b136340c175c3f9c2692e720850df219/client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java#L599-L602 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEManager.java | CmsADEManager.getDetailPage | public String getDetailPage(CmsObject cms, String pageRootPath, String originPath, String targetDetailPage) {
"""
Gets the detail page for a content element.<p>
@param cms the CMS context
@param pageRootPath the element's root path
@param originPath the path in which the the detail page is being requested
@p... | java | public String getDetailPage(CmsObject cms, String pageRootPath, String originPath, String targetDetailPage) {
boolean online = isOnline(cms);
String resType = getCacheState(online).getParentFolderType(pageRootPath);
if (resType == null) {
return null;
}
if ((targetDe... | [
"public",
"String",
"getDetailPage",
"(",
"CmsObject",
"cms",
",",
"String",
"pageRootPath",
",",
"String",
"originPath",
",",
"String",
"targetDetailPage",
")",
"{",
"boolean",
"online",
"=",
"isOnline",
"(",
"cms",
")",
";",
"String",
"resType",
"=",
"getCac... | Gets the detail page for a content element.<p>
@param cms the CMS context
@param pageRootPath the element's root path
@param originPath the path in which the the detail page is being requested
@param targetDetailPage the target detail page to use
@return the detail page for the content element | [
"Gets",
"the",
"detail",
"page",
"for",
"a",
"content",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L442-L467 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/FaxClientSpiProxyImpl.java | FaxClientSpiProxyImpl.invokeInterceptorsImpl | protected void invokeInterceptorsImpl(FaxClientSpiProxyEventType eventType,Method method,Object[] arguments,Object output,Throwable throwable) {
"""
This function invokes the interceptor for the given event.
@param eventType
The event type
@param method
The method invoked
@param arguments
The method ... | java | protected void invokeInterceptorsImpl(FaxClientSpiProxyEventType eventType,Method method,Object[] arguments,Object output,Throwable throwable)
{
//get interceptors
FaxClientSpiInterceptor[] interceptors=this.getFaxClientSpiInterceptors();
//get interceptors amount
int amount... | [
"protected",
"void",
"invokeInterceptorsImpl",
"(",
"FaxClientSpiProxyEventType",
"eventType",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"arguments",
",",
"Object",
"output",
",",
"Throwable",
"throwable",
")",
"{",
"//get interceptors",
"FaxClientSpiInterceptor... | This function invokes the interceptor for the given event.
@param eventType
The event type
@param method
The method invoked
@param arguments
The method arguments
@param output
The method output
@param throwable
The throwable while invoking the method | [
"This",
"function",
"invokes",
"the",
"interceptor",
"for",
"the",
"given",
"event",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/FaxClientSpiProxyImpl.java#L132-L160 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/DiscreteDistributions.java | DiscreteDistributions.binomialCdf | public static double binomialCdf(int k, double p, int n) {
"""
Returns the cumulative probability of k of a specific number of tries n and probability p
@param k
@param p
@param n
@return
"""
if(k<0 || p<0 || n<1) {
throw new IllegalArgumentException("All the parameters must be posit... | java | public static double binomialCdf(int k, double p, int n) {
if(k<0 || p<0 || n<1) {
throw new IllegalArgumentException("All the parameters must be positive and n larger than 1.");
}
k = Math.min(k, n);
double probabilitySum = approxBinomialCdf(k,p,n);
... | [
"public",
"static",
"double",
"binomialCdf",
"(",
"int",
"k",
",",
"double",
"p",
",",
"int",
"n",
")",
"{",
"if",
"(",
"k",
"<",
"0",
"||",
"p",
"<",
"0",
"||",
"n",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"All the p... | Returns the cumulative probability of k of a specific number of tries n and probability p
@param k
@param p
@param n
@return | [
"Returns",
"the",
"cumulative",
"probability",
"of",
"k",
"of",
"a",
"specific",
"number",
"of",
"tries",
"n",
"and",
"probability",
"p"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/DiscreteDistributions.java#L106-L116 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/format/DateTimeFormatter.java | DateTimeFormatter.parseBest | public TemporalAccessor parseBest(CharSequence text, TemporalQuery<?>... types) {
"""
Fully parses the text producing an object of one of the specified types.
<p>
This parse method is convenient for use when the parser can handle optional elements.
For example, a pattern of 'yyyy[-MM[-dd]]' can be fully parsed ... | java | public TemporalAccessor parseBest(CharSequence text, TemporalQuery<?>... types) {
Jdk8Methods.requireNonNull(text, "text");
Jdk8Methods.requireNonNull(types, "types");
if (types.length < 2) {
throw new IllegalArgumentException("At least two types must be specified");
}
... | [
"public",
"TemporalAccessor",
"parseBest",
"(",
"CharSequence",
"text",
",",
"TemporalQuery",
"<",
"?",
">",
"...",
"types",
")",
"{",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"text",
",",
"\"text\"",
")",
";",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"typ... | Fully parses the text producing an object of one of the specified types.
<p>
This parse method is convenient for use when the parser can handle optional elements.
For example, a pattern of 'yyyy[-MM[-dd]]' can be fully parsed to a {@code LocalDate},
or partially parsed to a {@code YearMonth} or a {@code Year}.
The type... | [
"Fully",
"parses",
"the",
"text",
"producing",
"an",
"object",
"of",
"one",
"of",
"the",
"specified",
"types",
".",
"<p",
">",
"This",
"parse",
"method",
"is",
"convenient",
"for",
"use",
"when",
"the",
"parser",
"can",
"handle",
"optional",
"elements",
".... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/format/DateTimeFormatter.java#L1529-L1550 |
vkostyukov/la4j | src/main/java/org/la4j/Matrix.java | Matrix.setColumn | public void setColumn(int j, Vector column) {
"""
Copies given {@code column} into the specified column of this matrix.
@param j the column index
@param column the column represented as vector
"""
if (rows != column.length()) {
fail("Wrong vector length: " + column.length() + ". Should ... | java | public void setColumn(int j, Vector column) {
if (rows != column.length()) {
fail("Wrong vector length: " + column.length() + ". Should be: " + rows + ".");
}
for (int i = 0; i < column.length(); i++) {
set(i, j, column.get(i));
}
} | [
"public",
"void",
"setColumn",
"(",
"int",
"j",
",",
"Vector",
"column",
")",
"{",
"if",
"(",
"rows",
"!=",
"column",
".",
"length",
"(",
")",
")",
"{",
"fail",
"(",
"\"Wrong vector length: \"",
"+",
"column",
".",
"length",
"(",
")",
"+",
"\". Should ... | Copies given {@code column} into the specified column of this matrix.
@param j the column index
@param column the column represented as vector | [
"Copies",
"given",
"{",
"@code",
"column",
"}",
"into",
"the",
"specified",
"column",
"of",
"this",
"matrix",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrix.java#L1030-L1038 |
fracpete/multisearch-weka-package | src/main/java/weka/core/setupgenerator/FunctionSpaceDimension.java | FunctionSpaceDimension.subdimension | public FunctionSpaceDimension subdimension(int left, int right) {
"""
returns a sub-dimension with the same type/step/list, but different borders.
@param left the left index
@param right the right index
@return the sub-dimension
"""
return new FunctionSpaceDimension((Double) getValue(left), (Double)... | java | public FunctionSpaceDimension subdimension(int left, int right) {
return new FunctionSpaceDimension((Double) getValue(left), (Double) getValue(right), getStep(), getLabel());
} | [
"public",
"FunctionSpaceDimension",
"subdimension",
"(",
"int",
"left",
",",
"int",
"right",
")",
"{",
"return",
"new",
"FunctionSpaceDimension",
"(",
"(",
"Double",
")",
"getValue",
"(",
"left",
")",
",",
"(",
"Double",
")",
"getValue",
"(",
"right",
")",
... | returns a sub-dimension with the same type/step/list, but different borders.
@param left the left index
@param right the right index
@return the sub-dimension | [
"returns",
"a",
"sub",
"-",
"dimension",
"with",
"the",
"same",
"type",
"/",
"step",
"/",
"list",
"but",
"different",
"borders",
"."
] | train | https://github.com/fracpete/multisearch-weka-package/blob/756fcf343e7cc9fd3844c99a0e1e828368f393d0/src/main/java/weka/core/setupgenerator/FunctionSpaceDimension.java#L147-L149 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/utils/WidgetUtil.java | WidgetUtil.getPremadeWidgetHtml | public static String getPremadeWidgetHtml(String guildId, WidgetTheme theme, int width, int height) {
"""
Gets the pre-made HTML Widget for the specified guild using the specified
settings. The widget will only display correctly if the guild in question
has the Widget enabled. Additionally, this method can be us... | java | public static String getPremadeWidgetHtml(String guildId, WidgetTheme theme, int width, int height)
{
Checks.notNull(guildId, "GuildId");
Checks.notNull(theme, "WidgetTheme");
Checks.notNegative(width, "Width");
Checks.notNegative(height, "Height");
return String.format(WIDGE... | [
"public",
"static",
"String",
"getPremadeWidgetHtml",
"(",
"String",
"guildId",
",",
"WidgetTheme",
"theme",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Checks",
".",
"notNull",
"(",
"guildId",
",",
"\"GuildId\"",
")",
";",
"Checks",
".",
"notNull"... | Gets the pre-made HTML Widget for the specified guild using the specified
settings. The widget will only display correctly if the guild in question
has the Widget enabled. Additionally, this method can be used independently
of being on the guild in question.
@param guildId
the guild ID
@param theme
the theme, light ... | [
"Gets",
"the",
"pre",
"-",
"made",
"HTML",
"Widget",
"for",
"the",
"specified",
"guild",
"using",
"the",
"specified",
"settings",
".",
"The",
"widget",
"will",
"only",
"display",
"correctly",
"if",
"the",
"guild",
"in",
"question",
"has",
"the",
"Widget",
... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/WidgetUtil.java#L129-L136 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java | ExecutionEnvironment.createLocalEnvironment | private static LocalEnvironment createLocalEnvironment(Configuration configuration, int defaultParallelism) {
"""
Creates a {@link LocalEnvironment} which is used for executing Flink jobs.
@param configuration to start the {@link LocalEnvironment} with
@param defaultParallelism to initialize the {@link LocalEn... | java | private static LocalEnvironment createLocalEnvironment(Configuration configuration, int defaultParallelism) {
final LocalEnvironment localEnvironment = new LocalEnvironment(configuration);
if (defaultParallelism > 0) {
localEnvironment.setParallelism(defaultParallelism);
}
return localEnvironment;
} | [
"private",
"static",
"LocalEnvironment",
"createLocalEnvironment",
"(",
"Configuration",
"configuration",
",",
"int",
"defaultParallelism",
")",
"{",
"final",
"LocalEnvironment",
"localEnvironment",
"=",
"new",
"LocalEnvironment",
"(",
"configuration",
")",
";",
"if",
"... | Creates a {@link LocalEnvironment} which is used for executing Flink jobs.
@param configuration to start the {@link LocalEnvironment} with
@param defaultParallelism to initialize the {@link LocalEnvironment} with
@return {@link LocalEnvironment} | [
"Creates",
"a",
"{",
"@link",
"LocalEnvironment",
"}",
"which",
"is",
"used",
"for",
"executing",
"Flink",
"jobs",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java#L1149-L1157 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/Config.java | Config.setReliableTopicConfigs | public Config setReliableTopicConfigs(Map<String, ReliableTopicConfig> reliableTopicConfigs) {
"""
Sets the map of reliable topic configurations, mapped by config name.
The config name may be a pattern with which the configuration will be
obtained in the future.
@param reliableTopicConfigs the reliable topic ... | java | public Config setReliableTopicConfigs(Map<String, ReliableTopicConfig> reliableTopicConfigs) {
this.reliableTopicConfigs.clear();
this.reliableTopicConfigs.putAll(reliableTopicConfigs);
for (Entry<String, ReliableTopicConfig> entry : reliableTopicConfigs.entrySet()) {
entry.getValue(... | [
"public",
"Config",
"setReliableTopicConfigs",
"(",
"Map",
"<",
"String",
",",
"ReliableTopicConfig",
">",
"reliableTopicConfigs",
")",
"{",
"this",
".",
"reliableTopicConfigs",
".",
"clear",
"(",
")",
";",
"this",
".",
"reliableTopicConfigs",
".",
"putAll",
"(",
... | Sets the map of reliable topic configurations, mapped by config name.
The config name may be a pattern with which the configuration will be
obtained in the future.
@param reliableTopicConfigs the reliable topic configuration map to set
@return this config instance | [
"Sets",
"the",
"map",
"of",
"reliable",
"topic",
"configurations",
"mapped",
"by",
"config",
"name",
".",
"The",
"config",
"name",
"may",
"be",
"a",
"pattern",
"with",
"which",
"the",
"configuration",
"will",
"be",
"obtained",
"in",
"the",
"future",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/Config.java#L1746-L1753 |
hageldave/ImagingKit | ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/Fourier.java | Fourier.horizontalInverseTransform | public static ColorImg horizontalInverseTransform(ColorImg target, ComplexImg fourier, int channel) {
"""
Executes row wise inverse Fourier transforms of the specified {@link ComplexImg}.
A 1-dimensional Fourier transform is done for each row of the ComplexImg.
The resulting transforms will be stored in the spec... | java | public static ColorImg horizontalInverseTransform(ColorImg target, ComplexImg fourier, int channel) {
Dimension dim = fourier.getDimension();
// if no target was specified create a new one
if(target == null) {
target = new ColorImg(dim, channel==ColorImg.channel_a);
}
// continue sanity checks
sanityChec... | [
"public",
"static",
"ColorImg",
"horizontalInverseTransform",
"(",
"ColorImg",
"target",
",",
"ComplexImg",
"fourier",
",",
"int",
"channel",
")",
"{",
"Dimension",
"dim",
"=",
"fourier",
".",
"getDimension",
"(",
")",
";",
"// if no target was specified create a new ... | Executes row wise inverse Fourier transforms of the specified {@link ComplexImg}.
A 1-dimensional Fourier transform is done for each row of the ComplexImg.
The resulting transforms will be stored in the specified channel of the specified target {@link ColorImg}.
If target is null, a new ColorImg is created.
@param targ... | [
"Executes",
"row",
"wise",
"inverse",
"Fourier",
"transforms",
"of",
"the",
"specified",
"{",
"@link",
"ComplexImg",
"}",
".",
"A",
"1",
"-",
"dimensional",
"Fourier",
"transform",
"is",
"done",
"for",
"each",
"row",
"of",
"the",
"ComplexImg",
".",
"The",
... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/Fourier.java#L261-L288 |
EdwardRaff/JSAT | JSAT/src/jsat/utils/ListUtils.java | ListUtils.addRange | public static void addRange(Collection<Integer> c, int start, int to, int step) {
"""
Adds values into the given collection using integer in the specified range and step size.
If the <tt>start</tt> value is greater or equal to the <tt>to</tt> value, nothing will
be added to the collection.
@param c the collec... | java | public static void addRange(Collection<Integer> c, int start, int to, int step)
{
if(step <= 0)
throw new RuntimeException("Would create an infinite loop");
for(int i = start; i < to; i+= step)
c.add(i);
} | [
"public",
"static",
"void",
"addRange",
"(",
"Collection",
"<",
"Integer",
">",
"c",
",",
"int",
"start",
",",
"int",
"to",
",",
"int",
"step",
")",
"{",
"if",
"(",
"step",
"<=",
"0",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"Would create an infin... | Adds values into the given collection using integer in the specified range and step size.
If the <tt>start</tt> value is greater or equal to the <tt>to</tt> value, nothing will
be added to the collection.
@param c the collection to add to
@param start the first value to add, inclusive
@param to the last value to add, ... | [
"Adds",
"values",
"into",
"the",
"given",
"collection",
"using",
"integer",
"in",
"the",
"specified",
"range",
"and",
"step",
"size",
".",
"If",
"the",
"<tt",
">",
"start<",
"/",
"tt",
">",
"value",
"is",
"greater",
"or",
"equal",
"to",
"the",
"<tt",
"... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/ListUtils.java#L133-L140 |
threerings/narya | core/src/main/java/com/threerings/crowd/server/LocationManager.java | LocationManager.moveTo | public PlaceConfig moveTo (BodyObject source, int placeOid)
throws InvocationException {
"""
Moves the specified body from whatever location they currently occupy to the location
identified by the supplied place oid.
@return the config object for the new location.
@exception InvocationException thro... | java | public PlaceConfig moveTo (BodyObject source, int placeOid)
throws InvocationException
{
// make sure the place in question actually exists
PlaceManager pmgr = _plreg.getPlaceManager(placeOid);
if (pmgr == null) {
log.info("Requested to move to non-existent place", "who",... | [
"public",
"PlaceConfig",
"moveTo",
"(",
"BodyObject",
"source",
",",
"int",
"placeOid",
")",
"throws",
"InvocationException",
"{",
"// make sure the place in question actually exists",
"PlaceManager",
"pmgr",
"=",
"_plreg",
".",
"getPlaceManager",
"(",
"placeOid",
")",
... | Moves the specified body from whatever location they currently occupy to the location
identified by the supplied place oid.
@return the config object for the new location.
@exception InvocationException thrown if the move was not successful for some reason
(which will be communicated as an error code in the exception... | [
"Moves",
"the",
"specified",
"body",
"from",
"whatever",
"location",
"they",
"currently",
"occupy",
"to",
"the",
"location",
"identified",
"by",
"the",
"supplied",
"place",
"oid",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/LocationManager.java#L81-L141 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVector.java | ConcatVector.setSparseComponent | public void setSparseComponent(int component, int index, double value) {
"""
Sets a single component of the concat vector value as a sparse, one hot value.
@param component the index of the component to set
@param index the index of the vector to one-hot
@param value the value of that index
"""
... | java | public void setSparseComponent(int component, int index, double value) {
if (component >= pointers.length) {
increaseSizeTo(component + 1);
}
double[] sparseInfo = new double[2];
sparseInfo[0] = index;
sparseInfo[1] = value;
pointers[component] = sparseInfo;
sparse[component] = true;
... | [
"public",
"void",
"setSparseComponent",
"(",
"int",
"component",
",",
"int",
"index",
",",
"double",
"value",
")",
"{",
"if",
"(",
"component",
">=",
"pointers",
".",
"length",
")",
"{",
"increaseSizeTo",
"(",
"component",
"+",
"1",
")",
";",
"}",
"doubl... | Sets a single component of the concat vector value as a sparse, one hot value.
@param component the index of the component to set
@param index the index of the vector to one-hot
@param value the value of that index | [
"Sets",
"a",
"single",
"component",
"of",
"the",
"concat",
"vector",
"value",
"as",
"a",
"sparse",
"one",
"hot",
"value",
"."
] | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVector.java#L103-L113 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_hubic_services_domain_details_GET | public OvhAsyncTask<OvhHubicDetailsResponse> packName_hubic_services_domain_details_GET(String packName, String domain) throws IOException {
"""
Details associated to a voucher
REST: GET /pack/xdsl/{packName}/hubic/services/{domain}/details
@param packName [required] The internal name of your pack
@param doma... | java | public OvhAsyncTask<OvhHubicDetailsResponse> packName_hubic_services_domain_details_GET(String packName, String domain) throws IOException {
String qPath = "/pack/xdsl/{packName}/hubic/services/{domain}/details";
StringBuilder sb = path(qPath, packName, domain);
String resp = exec(qPath, "GET", sb.toString(), nul... | [
"public",
"OvhAsyncTask",
"<",
"OvhHubicDetailsResponse",
">",
"packName_hubic_services_domain_details_GET",
"(",
"String",
"packName",
",",
"String",
"domain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/pack/xdsl/{packName}/hubic/services/{domain}/details\"... | Details associated to a voucher
REST: GET /pack/xdsl/{packName}/hubic/services/{domain}/details
@param packName [required] The internal name of your pack
@param domain [required] | [
"Details",
"associated",
"to",
"a",
"voucher"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L1083-L1088 |
percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java | ViewUtils.appendText | public static void appendText(TextView view, String toAppend) {
"""
Append given text String to the provided view (one of TextView or EditText).
@param view View to update.
@param toAppend String text.
"""
String currentText = getText(view);
view.setText(currentText + toAppend);
} | java | public static void appendText(TextView view, String toAppend) {
String currentText = getText(view);
view.setText(currentText + toAppend);
} | [
"public",
"static",
"void",
"appendText",
"(",
"TextView",
"view",
",",
"String",
"toAppend",
")",
"{",
"String",
"currentText",
"=",
"getText",
"(",
"view",
")",
";",
"view",
".",
"setText",
"(",
"currentText",
"+",
"toAppend",
")",
";",
"}"
] | Append given text String to the provided view (one of TextView or EditText).
@param view View to update.
@param toAppend String text. | [
"Append",
"given",
"text",
"String",
"to",
"the",
"provided",
"view",
"(",
"one",
"of",
"TextView",
"or",
"EditText",
")",
"."
] | train | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java#L130-L133 |
JOML-CI/JOML | src/org/joml/Intersectiond.java | Intersectiond.intersectSphereSphere | public static boolean intersectSphereSphere(Vector3dc centerA, double radiusSquaredA, Vector3dc centerB, double radiusSquaredB, Vector4d centerAndRadiusOfIntersectionCircle) {
"""
Test whether the one sphere with center <code>centerA</code> and square radius <code>radiusSquaredA</code> intersects the other
sphere... | java | public static boolean intersectSphereSphere(Vector3dc centerA, double radiusSquaredA, Vector3dc centerB, double radiusSquaredB, Vector4d centerAndRadiusOfIntersectionCircle) {
return intersectSphereSphere(centerA.x(), centerA.y(), centerA.z(), radiusSquaredA, centerB.x(), centerB.y(), centerB.z(), radiusSquared... | [
"public",
"static",
"boolean",
"intersectSphereSphere",
"(",
"Vector3dc",
"centerA",
",",
"double",
"radiusSquaredA",
",",
"Vector3dc",
"centerB",
",",
"double",
"radiusSquaredB",
",",
"Vector4d",
"centerAndRadiusOfIntersectionCircle",
")",
"{",
"return",
"intersectSphere... | Test whether the one sphere with center <code>centerA</code> and square radius <code>radiusSquaredA</code> intersects the other
sphere with center <code>centerB</code> and square radius <code>radiusSquaredB</code>, and store the center of the circle of
intersection in the <code>(x, y, z)</code> components of the suppli... | [
"Test",
"whether",
"the",
"one",
"sphere",
"with",
"center",
"<code",
">",
"centerA<",
"/",
"code",
">",
"and",
"square",
"radius",
"<code",
">",
"radiusSquaredA<",
"/",
"code",
">",
"intersects",
"the",
"other",
"sphere",
"with",
"center",
"<code",
">",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectiond.java#L805-L807 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java | EJSContainer.preInvoke | public EnterpriseBean preInvoke(EJSWrapperBase wrapper,
int methodId,
EJSDeployedSupport s,
EJBMethodInfoImpl methodInfo) throws RemoteException {
"""
This method is called LinkTargetHelper.getLink when PM w... | java | public EnterpriseBean preInvoke(EJSWrapperBase wrapper,
int methodId,
EJSDeployedSupport s,
EJBMethodInfoImpl methodInfo) throws RemoteException {
s.methodId = methodId; //130230 d140003.19
s.ivW... | [
"public",
"EnterpriseBean",
"preInvoke",
"(",
"EJSWrapperBase",
"wrapper",
",",
"int",
"methodId",
",",
"EJSDeployedSupport",
"s",
",",
"EJBMethodInfoImpl",
"methodInfo",
")",
"throws",
"RemoteException",
"{",
"s",
".",
"methodId",
"=",
"methodId",
";",
"//130230 d1... | This method is called LinkTargetHelper.getLink when PM wants to provide
AccessIntent to use for ejbLink processing.
When this method is called, the methodId should be in the negative range to
indicate this is a special method with the method signature passed in. This
method signature is then used to create the EJSMetho... | [
"This",
"method",
"is",
"called",
"LinkTargetHelper",
".",
"getLink",
"when",
"PM",
"wants",
"to",
"provide",
"AccessIntent",
"to",
"use",
"for",
"ejbLink",
"processing",
".",
"When",
"this",
"method",
"is",
"called",
"the",
"methodId",
"should",
"be",
"in",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java#L2670-L2679 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.isSubtypesUnchecked | public boolean isSubtypesUnchecked(List<Type> ts, List<Type> ss, Warner warn) {
"""
Are corresponding elements of ts subtypes of ss, allowing
unchecked conversions? If lists are of different length,
return false.
"""
while (ts.tail != null && ss.tail != null
/*inlined: ts.nonEmpty() &... | java | public boolean isSubtypesUnchecked(List<Type> ts, List<Type> ss, Warner warn) {
while (ts.tail != null && ss.tail != null
/*inlined: ts.nonEmpty() && ss.nonEmpty()*/ &&
isSubtypeUnchecked(ts.head, ss.head, warn)) {
ts = ts.tail;
ss = ss.tail;
}
... | [
"public",
"boolean",
"isSubtypesUnchecked",
"(",
"List",
"<",
"Type",
">",
"ts",
",",
"List",
"<",
"Type",
">",
"ss",
",",
"Warner",
"warn",
")",
"{",
"while",
"(",
"ts",
".",
"tail",
"!=",
"null",
"&&",
"ss",
".",
"tail",
"!=",
"null",
"/*inlined: t... | Are corresponding elements of ts subtypes of ss, allowing
unchecked conversions? If lists are of different length,
return false. | [
"Are",
"corresponding",
"elements",
"of",
"ts",
"subtypes",
"of",
"ss",
"allowing",
"unchecked",
"conversions?",
"If",
"lists",
"are",
"of",
"different",
"length",
"return",
"false",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L942-L951 |
bbottema/outlook-message-parser | src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java | OutlookMessageParser.parseAttachment | private void parseAttachment(final DirectoryEntry dir, final OutlookMessage msg)
throws IOException {
"""
Creates an {@link OutlookAttachment} object based on
the given directory entry. The entry may either
point to an attached file or to an
attached .msg file, which will be added
as a {@link OutlookMsgAtta... | java | private void parseAttachment(final DirectoryEntry dir, final OutlookMessage msg)
throws IOException {
final OutlookFileAttachment attachment = new OutlookFileAttachment();
// iterate through all document entries
for (final Iterator<?> iter = dir.getEntries(); iter.hasNext(); ) {
final Entry entry = (Entry... | [
"private",
"void",
"parseAttachment",
"(",
"final",
"DirectoryEntry",
"dir",
",",
"final",
"OutlookMessage",
"msg",
")",
"throws",
"IOException",
"{",
"final",
"OutlookFileAttachment",
"attachment",
"=",
"new",
"OutlookFileAttachment",
"(",
")",
";",
"// iterate throu... | Creates an {@link OutlookAttachment} object based on
the given directory entry. The entry may either
point to an attached file or to an
attached .msg file, which will be added
as a {@link OutlookMsgAttachment} object instead.
@param dir The directory entry containing the attachment document entry and some other docume... | [
"Creates",
"an",
"{",
"@link",
"OutlookAttachment",
"}",
"object",
"based",
"on",
"the",
"given",
"directory",
"entry",
".",
"The",
"entry",
"may",
"either",
"point",
"to",
"an",
"attached",
"file",
"or",
"to",
"an",
"attached",
".",
"msg",
"file",
"which"... | train | https://github.com/bbottema/outlook-message-parser/blob/ea7d59da33c8a62dfc2e0aa64d2f8f7c903ccb0e/src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java#L564-L596 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/Envelope2D.java | Envelope2D.queryCorners | public void queryCorners(Point2D[] corners) {
"""
Queries corners into a given array. The array length must be at least
4. Starts from the lower left corner and goes clockwise.
@param corners The array of four points.
"""
if ((corners == null) || (corners.length < 4))
throw new IllegalArgumentException(... | java | public void queryCorners(Point2D[] corners) {
if ((corners == null) || (corners.length < 4))
throw new IllegalArgumentException();
if (corners[0] != null)
corners[0].setCoords(xmin, ymin);
else
corners[0] = new Point2D(xmin, ymin);
if (corners[1] != null)
corners[1].setCoords(xmin, ymax);
else
... | [
"public",
"void",
"queryCorners",
"(",
"Point2D",
"[",
"]",
"corners",
")",
"{",
"if",
"(",
"(",
"corners",
"==",
"null",
")",
"||",
"(",
"corners",
".",
"length",
"<",
"4",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"if",
"... | Queries corners into a given array. The array length must be at least
4. Starts from the lower left corner and goes clockwise.
@param corners The array of four points. | [
"Queries",
"corners",
"into",
"a",
"given",
"array",
".",
"The",
"array",
"length",
"must",
"be",
"at",
"least",
"4",
".",
"Starts",
"from",
"the",
"lower",
"left",
"corner",
"and",
"goes",
"clockwise",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/Envelope2D.java#L386-L408 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/extendedIdentifiers/ExtendedIdentifiers.java | ExtendedIdentifiers.createExtendedIdentifier | public static Identity createExtendedIdentifier(String namespaceUri, String namespacePrefix, String identifierName,
String attributeValue) {
"""
Creates an Extended Identifier; uses an empty string for the administrativeDomain attribute.
@param namespaceUri
URI of the namespace of the inner XML of the Exten... | java | public static Identity createExtendedIdentifier(String namespaceUri, String namespacePrefix, String identifierName,
String attributeValue) {
return createExtendedIdentifier(namespaceUri, namespacePrefix, identifierName, attributeValue, "");
} | [
"public",
"static",
"Identity",
"createExtendedIdentifier",
"(",
"String",
"namespaceUri",
",",
"String",
"namespacePrefix",
",",
"String",
"identifierName",
",",
"String",
"attributeValue",
")",
"{",
"return",
"createExtendedIdentifier",
"(",
"namespaceUri",
",",
"name... | Creates an Extended Identifier; uses an empty string for the administrativeDomain attribute.
@param namespaceUri
URI of the namespace of the inner XML of the Extended Identifier
@param namespacePrefix
prefix of the namespace of the inner XML of the Extended Identifier
@param identifierName
the name value of the Extend... | [
"Creates",
"an",
"Extended",
"Identifier",
";",
"uses",
"an",
"empty",
"string",
"for",
"the",
"administrativeDomain",
"attribute",
"."
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/extendedIdentifiers/ExtendedIdentifiers.java#L126-L129 |
icoloma/simpleds | src/main/java/org/simpleds/util/GenericCollectionTypeResolver.java | GenericCollectionTypeResolver.extractType | private static Class<?> extractType(
MethodParameter methodParam, Type type, Class<?> source, int typeIndex, int nestingLevel, int currentLevel) {
"""
Extract the generic type from the given Type object.
@param methodParam the method parameter specification
@param type the Type to check
@param source the sou... | java | private static Class<?> extractType(
MethodParameter methodParam, Type type, Class<?> source, int typeIndex, int nestingLevel, int currentLevel) {
Type resolvedType = type;
if (type instanceof TypeVariable && methodParam != null && methodParam.typeVariableMap != null) {
Type mappedType = methodParam.typeVari... | [
"private",
"static",
"Class",
"<",
"?",
">",
"extractType",
"(",
"MethodParameter",
"methodParam",
",",
"Type",
"type",
",",
"Class",
"<",
"?",
">",
"source",
",",
"int",
"typeIndex",
",",
"int",
"nestingLevel",
",",
"int",
"currentLevel",
")",
"{",
"Type"... | Extract the generic type from the given Type object.
@param methodParam the method parameter specification
@param type the Type to check
@param source the source collection/map Class<?> that we check
@param typeIndex the index of the actual type argument
@param nestingLevel the nesting level of the target type
@param c... | [
"Extract",
"the",
"generic",
"type",
"from",
"the",
"given",
"Type",
"object",
"."
] | train | https://github.com/icoloma/simpleds/blob/b07763df98b9375b764e625f617a6c78df4b068d/src/main/java/org/simpleds/util/GenericCollectionTypeResolver.java#L259-L279 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Conference.java | Conference.getConference | public static Conference getConference(final BandwidthClient client, final String id) throws Exception {
"""
Retrieves the conference information.
@param client the client
@param id the conference id.
@return id the conference id.
@throws IOException unexpected error.
"""
final String conferences... | java | public static Conference getConference(final BandwidthClient client, final String id) throws Exception {
final String conferencesUri = client.getUserResourceUri(BandwidthConstants.CONFERENCES_URI_PATH);
final String conferenceUri = StringUtils.join(new String[]{
conferencesUri,
... | [
"public",
"static",
"Conference",
"getConference",
"(",
"final",
"BandwidthClient",
"client",
",",
"final",
"String",
"id",
")",
"throws",
"Exception",
"{",
"final",
"String",
"conferencesUri",
"=",
"client",
".",
"getUserResourceUri",
"(",
"BandwidthConstants",
"."... | Retrieves the conference information.
@param client the client
@param id the conference id.
@return id the conference id.
@throws IOException unexpected error. | [
"Retrieves",
"the",
"conference",
"information",
"."
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Conference.java#L42-L50 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Duration.java | Duration.plus | private Duration plus(long secondsToAdd, long nanosToAdd) {
"""
Returns a copy of this duration with the specified duration added.
<p>
This instance is immutable and unaffected by this method call.
@param secondsToAdd the seconds to add, positive or negative
@param nanosToAdd the nanos to add, positive or ... | java | private Duration plus(long secondsToAdd, long nanosToAdd) {
if ((secondsToAdd | nanosToAdd) == 0) {
return this;
}
long epochSec = Math.addExact(seconds, secondsToAdd);
epochSec = Math.addExact(epochSec, nanosToAdd / NANOS_PER_SECOND);
nanosToAdd = nanosToAdd % NANOS_... | [
"private",
"Duration",
"plus",
"(",
"long",
"secondsToAdd",
",",
"long",
"nanosToAdd",
")",
"{",
"if",
"(",
"(",
"secondsToAdd",
"|",
"nanosToAdd",
")",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"long",
"epochSec",
"=",
"Math",
".",
"addExact",
... | Returns a copy of this duration with the specified duration added.
<p>
This instance is immutable and unaffected by this method call.
@param secondsToAdd the seconds to add, positive or negative
@param nanosToAdd the nanos to add, positive or negative
@return a {@code Duration} based on this duration with the specif... | [
"Returns",
"a",
"copy",
"of",
"this",
"duration",
"with",
"the",
"specified",
"duration",
"added",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Duration.java#L805-L814 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/ExcelUtils.java | ExcelUtils.readExcel2Objects | public <T> List<T> readExcel2Objects(String excelPath, Class<T> clazz, int offsetLine, int sheetIndex)
throws Excel4JException, IOException, InvalidFormatException {
"""
读取Excel操作基于注解映射成绑定的java对象
@param excelPath 待导出Excel的路径
@param clazz 待绑定的类(绑定属性注解{@link com.github.crab2died.annotation.Exce... | java | public <T> List<T> readExcel2Objects(String excelPath, Class<T> clazz, int offsetLine, int sheetIndex)
throws Excel4JException, IOException, InvalidFormatException {
return readExcel2Objects(excelPath, clazz, offsetLine, Integer.MAX_VALUE, sheetIndex);
} | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"readExcel2Objects",
"(",
"String",
"excelPath",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"int",
"offsetLine",
",",
"int",
"sheetIndex",
")",
"throws",
"Excel4JException",
",",
"IOException",
",",
"InvalidF... | 读取Excel操作基于注解映射成绑定的java对象
@param excelPath 待导出Excel的路径
@param clazz 待绑定的类(绑定属性注解{@link com.github.crab2died.annotation.ExcelField})
@param offsetLine Excel表头行(默认是0)
@param sheetIndex Sheet索引(默认0)
@param <T> 绑定的数据类
@return 返回转换为设置绑定的java对象集合
@throws Excel4JException 异常
@throws IOException ... | [
"读取Excel操作基于注解映射成绑定的java对象"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L173-L176 |
beanshell/beanshell | src/main/java/bsh/engine/BshScriptEngine.java | BshScriptEngine.invokeMethod | @Override
public Object invokeMethod(Object thiz, String name, Object... args) throws ScriptException, NoSuchMethodException {
"""
Calls a procedure compiled during a previous script execution, which is
retained in the state of the {@code ScriptEngine{@code .
@param name The name of the procedure to be cal... | java | @Override
public Object invokeMethod(Object thiz, String name, Object... args) throws ScriptException, NoSuchMethodException {
if (!(thiz instanceof bsh.This)) {
throw new ScriptException("Illegal object type: " + (null == thiz ? "null" : thiz.getClass()));
}
bsh.This bshObject ... | [
"@",
"Override",
"public",
"Object",
"invokeMethod",
"(",
"Object",
"thiz",
",",
"String",
"name",
",",
"Object",
"...",
"args",
")",
"throws",
"ScriptException",
",",
"NoSuchMethodException",
"{",
"if",
"(",
"!",
"(",
"thiz",
"instanceof",
"bsh",
".",
"This... | Calls a procedure compiled during a previous script execution, which is
retained in the state of the {@code ScriptEngine{@code .
@param name The name of the procedure to be called.
@param thiz If the procedure is a member of a class defined in the script
and thiz is an instance of that class returned by a previous ex... | [
"Calls",
"a",
"procedure",
"compiled",
"during",
"a",
"previous",
"script",
"execution",
"which",
"is",
"retained",
"in",
"the",
"state",
"of",
"the",
"{",
"@code",
"ScriptEngine",
"{",
"@code",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/engine/BshScriptEngine.java#L267-L287 |
RestComm/Restcomm-Connect | restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/security/PermissionEvaluator.java | PermissionEvaluator.secureLevelControlApplications | private AuthOutcome secureLevelControlApplications(Account operatedAccount, String applicationAccountSid,
UserIdentityContext userIdentityContext) {
"""
Uses the security policy applied by secureLevelControl(). See there for details.
DEPRECATED security policy:
Applies the following access contro... | java | private AuthOutcome secureLevelControlApplications(Account operatedAccount, String applicationAccountSid,
UserIdentityContext userIdentityContext) {
/*
// disabled strict policy that prevented access to sub-account applications
// operatingAccount and operatedAccount are not null at... | [
"private",
"AuthOutcome",
"secureLevelControlApplications",
"(",
"Account",
"operatedAccount",
",",
"String",
"applicationAccountSid",
",",
"UserIdentityContext",
"userIdentityContext",
")",
"{",
"/*\n // disabled strict policy that prevented access to sub-account applications\n\n... | Uses the security policy applied by secureLevelControl(). See there for details.
DEPRECATED security policy:
Applies the following access control rules
If an application Account Sid is given:
- If operatingAccount is the same as the operated account and application resource belongs to operated account too
acces is g... | [
"Uses",
"the",
"security",
"policy",
"applied",
"by",
"secureLevelControl",
"()",
".",
"See",
"there",
"for",
"details",
"."
] | train | https://github.com/RestComm/Restcomm-Connect/blob/2194dee4fc524cdfd0af77a218ba5f212f97f7c5/restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/security/PermissionEvaluator.java#L365-L384 |
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/ServerDnsAliasesInner.java | ServerDnsAliasesInner.beginAcquireAsync | public Observable<Void> beginAcquireAsync(String resourceGroupName, String serverName, String dnsAliasName, String oldServerDnsAliasId) {
"""
Acquires server DNS alias from another server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azur... | java | public Observable<Void> beginAcquireAsync(String resourceGroupName, String serverName, String dnsAliasName, String oldServerDnsAliasId) {
return beginAcquireWithServiceResponseAsync(resourceGroupName, serverName, dnsAliasName, oldServerDnsAliasId).map(new Func1<ServiceResponse<Void>, Void>() {
@Over... | [
"public",
"Observable",
"<",
"Void",
">",
"beginAcquireAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"dnsAliasName",
",",
"String",
"oldServerDnsAliasId",
")",
"{",
"return",
"beginAcquireWithServiceResponseAsync",
"(",
"resourc... | Acquires server DNS alias from another server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server that the alias is pointing to.
@param dnsAliasName The name of the ser... | [
"Acquires",
"server",
"DNS",
"alias",
"from",
"another",
"server",
"."
] | 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/ServerDnsAliasesInner.java#L945-L952 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ForkOperatorUtils.java | ForkOperatorUtils.getPropertyNameForBranch | public static String getPropertyNameForBranch(WorkUnitState workUnitState, String key) {
"""
Get a new property key from an original one based on the branch id. The method assumes the branch id specified by
the {@link ConfigurationKeys#FORK_BRANCH_ID_KEY} parameter in the given WorkUnitState. The fork id key spec... | java | public static String getPropertyNameForBranch(WorkUnitState workUnitState, String key) {
Preconditions.checkNotNull(workUnitState, "Cannot get a property from a null WorkUnit");
Preconditions.checkNotNull(key, "Cannot get a the value for a null key");
if (!workUnitState.contains(ConfigurationKeys.FORK_BRAN... | [
"public",
"static",
"String",
"getPropertyNameForBranch",
"(",
"WorkUnitState",
"workUnitState",
",",
"String",
"key",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"workUnitState",
",",
"\"Cannot get a property from a null WorkUnit\"",
")",
";",
"Preconditions",
"... | Get a new property key from an original one based on the branch id. The method assumes the branch id specified by
the {@link ConfigurationKeys#FORK_BRANCH_ID_KEY} parameter in the given WorkUnitState. The fork id key specifies
which fork this parameter belongs to. Note this method will only provide the aforementioned f... | [
"Get",
"a",
"new",
"property",
"key",
"from",
"an",
"original",
"one",
"based",
"on",
"the",
"branch",
"id",
".",
"The",
"method",
"assumes",
"the",
"branch",
"id",
"specified",
"by",
"the",
"{",
"@link",
"ConfigurationKeys#FORK_BRANCH_ID_KEY",
"}",
"parameter... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ForkOperatorUtils.java#L74-L83 |
netty/netty | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.writeAscii | public static int writeAscii(ByteBuf buf, CharSequence seq) {
"""
Encode a {@link CharSequence} in <a href="http://en.wikipedia.org/wiki/ASCII">ASCII</a> and write it
to a {@link ByteBuf}.
This method returns the actual number of bytes written.
"""
// ASCII uses 1 byte per char
final int le... | java | public static int writeAscii(ByteBuf buf, CharSequence seq) {
// ASCII uses 1 byte per char
final int len = seq.length();
if (seq instanceof AsciiString) {
AsciiString asciiString = (AsciiString) seq;
buf.writeBytes(asciiString.array(), asciiString.arrayOffset(), len);
... | [
"public",
"static",
"int",
"writeAscii",
"(",
"ByteBuf",
"buf",
",",
"CharSequence",
"seq",
")",
"{",
"// ASCII uses 1 byte per char",
"final",
"int",
"len",
"=",
"seq",
".",
"length",
"(",
")",
";",
"if",
"(",
"seq",
"instanceof",
"AsciiString",
")",
"{",
... | Encode a {@link CharSequence} in <a href="http://en.wikipedia.org/wiki/ASCII">ASCII</a> and write it
to a {@link ByteBuf}.
This method returns the actual number of bytes written. | [
"Encode",
"a",
"{",
"@link",
"CharSequence",
"}",
"in",
"<a",
"href",
"=",
"http",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"ASCII",
">",
"ASCII<",
"/",
"a",
">",
"and",
"write",
"it",
"to",
"a",
"{",
"@link",
"ByteBuf",
"... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L681-L709 |
mcdiae/kludje | kludje-core/src/main/java/uk/kludje/MetaConfig.java | MetaConfig.withShallowArraySupport | public MetaConfig withShallowArraySupport() {
"""
Alters the configuration to have basic array support.
Where a {@link Getter} returns an array the configuration will support shallow equality, hash code and to string
inspection to determine equivalence.
Refer to the following methods for base implementation det... | java | public MetaConfig withShallowArraySupport() {
return withObjectEqualsChecks(MetaPolicy::areEqualWithShallowArrayCheck, MetaPolicy::toHashcodeWithShallowArrayHandling)
.withObjectToString(MetaPolicy::toStringWithShallowArrayHandling);
} | [
"public",
"MetaConfig",
"withShallowArraySupport",
"(",
")",
"{",
"return",
"withObjectEqualsChecks",
"(",
"MetaPolicy",
"::",
"areEqualWithShallowArrayCheck",
",",
"MetaPolicy",
"::",
"toHashcodeWithShallowArrayHandling",
")",
".",
"withObjectToString",
"(",
"MetaPolicy",
... | Alters the configuration to have basic array support.
Where a {@link Getter} returns an array the configuration will support shallow equality, hash code and to string
inspection to determine equivalence.
Refer to the following methods for base implementation details:
{@link java.util.Arrays#equals(boolean[], boolean[])... | [
"Alters",
"the",
"configuration",
"to",
"have",
"basic",
"array",
"support",
".",
"Where",
"a",
"{",
"@link",
"Getter",
"}",
"returns",
"an",
"array",
"the",
"configuration",
"will",
"support",
"shallow",
"equality",
"hash",
"code",
"and",
"to",
"string",
"i... | train | https://github.com/mcdiae/kludje/blob/9ed80cd183ebf162708d5922d784f79ac3841dfc/kludje-core/src/main/java/uk/kludje/MetaConfig.java#L138-L141 |
sahan/ZombieLink | zombielink/src/main/java/com/lonepulse/zombielink/proxy/InvocationException.java | InvocationException.newInstance | public static InvocationException newInstance(InvocationContext context, HttpResponse response, Throwable rootCause) {
"""
<p>Creates a new instance of {@link InvocationException} with the {@link HttpResponse} (with
the failed status code) and the {@link InvocationContext} which resulted in this response, while
... | java | public static InvocationException newInstance(InvocationContext context, HttpResponse response, Throwable rootCause) {
if(rootCause instanceof InvocationException) {
return (InvocationException)rootCause;
}
return new InvocationException(context, response, rootCause);
} | [
"public",
"static",
"InvocationException",
"newInstance",
"(",
"InvocationContext",
"context",
",",
"HttpResponse",
"response",
",",
"Throwable",
"rootCause",
")",
"{",
"if",
"(",
"rootCause",
"instanceof",
"InvocationException",
")",
"{",
"return",
"(",
"InvocationEx... | <p>Creates a new instance of {@link InvocationException} with the {@link HttpResponse} (with
the failed status code) and the {@link InvocationContext} which resulted in this response, while
preserving the stacktrace. If the given root cause is already a {@link InvocationException},
it's returned as it is.<p>
@param co... | [
"<p",
">",
"Creates",
"a",
"new",
"instance",
"of",
"{",
"@link",
"InvocationException",
"}",
"with",
"the",
"{",
"@link",
"HttpResponse",
"}",
"(",
"with",
"the",
"failed",
"status",
"code",
")",
"and",
"the",
"{",
"@link",
"InvocationContext",
"}",
"whic... | train | https://github.com/sahan/ZombieLink/blob/a9971add56d4f6919a4a5e84c78e9220011d8982/zombielink/src/main/java/com/lonepulse/zombielink/proxy/InvocationException.java#L87-L95 |
eiichiro/acidhouse | acidhouse-appengine/src/main/java/org/eiichiro/acidhouse/appengine/Translation.java | Translation.toEntity | public static Entity toEntity(Lock lock, com.google.appengine.api.datastore.Key parent) {
"""
Translates Acid House {@code Lock} entity to Google App Engine Datastore
entity with the specified {@code Key} of parent.
@param lock Acid House {@code Lock} entity.
@param parent The {@code Key} of parent.
@return ... | java | public static Entity toEntity(Lock lock, com.google.appengine.api.datastore.Key parent) {
Entity entity = new Entity(LOCK_KIND, lock.id(), parent);
entity.setUnindexedProperty(TRANSACTION_PROPERTY, lock.transaction());
entity.setUnindexedProperty(TIMESTAMP_PROPERTY, lock.timestamp());
return entity;
} | [
"public",
"static",
"Entity",
"toEntity",
"(",
"Lock",
"lock",
",",
"com",
".",
"google",
".",
"appengine",
".",
"api",
".",
"datastore",
".",
"Key",
"parent",
")",
"{",
"Entity",
"entity",
"=",
"new",
"Entity",
"(",
"LOCK_KIND",
",",
"lock",
".",
"id"... | Translates Acid House {@code Lock} entity to Google App Engine Datastore
entity with the specified {@code Key} of parent.
@param lock Acid House {@code Lock} entity.
@param parent The {@code Key} of parent.
@return Google App Engine Datastore entity translated from Acid House
{@code Lock} entity. | [
"Translates",
"Acid",
"House",
"{",
"@code",
"Lock",
"}",
"entity",
"to",
"Google",
"App",
"Engine",
"Datastore",
"entity",
"with",
"the",
"specified",
"{",
"@code",
"Key",
"}",
"of",
"parent",
"."
] | train | https://github.com/eiichiro/acidhouse/blob/c50eaa0bb0f24abb46def4afa611f170637cdd62/acidhouse-appengine/src/main/java/org/eiichiro/acidhouse/appengine/Translation.java#L522-L527 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStore.java | MetricStore.getTaskMetricStore | public synchronized TaskMetricStore getTaskMetricStore(String jobID, String taskID) {
"""
Returns the {@link ComponentMetricStore} for the given job/task ID.
@param jobID job ID
@param taskID task ID
@return ComponentMetricStore for given IDs, or null if no store for the given arguments exists
"""
JobM... | java | public synchronized TaskMetricStore getTaskMetricStore(String jobID, String taskID) {
JobMetricStore job = jobID == null ? null : jobs.get(jobID);
if (job == null || taskID == null) {
return null;
}
return TaskMetricStore.unmodifiable(job.getTaskMetricStore(taskID));
} | [
"public",
"synchronized",
"TaskMetricStore",
"getTaskMetricStore",
"(",
"String",
"jobID",
",",
"String",
"taskID",
")",
"{",
"JobMetricStore",
"job",
"=",
"jobID",
"==",
"null",
"?",
"null",
":",
"jobs",
".",
"get",
"(",
"jobID",
")",
";",
"if",
"(",
"job... | Returns the {@link ComponentMetricStore} for the given job/task ID.
@param jobID job ID
@param taskID task ID
@return ComponentMetricStore for given IDs, or null if no store for the given arguments exists | [
"Returns",
"the",
"{",
"@link",
"ComponentMetricStore",
"}",
"for",
"the",
"given",
"job",
"/",
"task",
"ID",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStore.java#L129-L135 |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.hasSlotIsDoubleMetaphoneEqual | public boolean hasSlotIsDoubleMetaphoneEqual(final String slotName, final String value) {
"""
Checks if a slot is contained in the intent request and has a value which is a
phonetic sibling of the string given to this method. Double metaphone algorithm
is optimized for English language and in this case is used t... | java | public boolean hasSlotIsDoubleMetaphoneEqual(final String slotName, final String value) {
final String slotValue = getSlotValue(slotName);
return hasSlotNotBlank(slotName) && value != null &&
new DoubleMetaphone().isDoubleMetaphoneEqual(slotValue, value);
} | [
"public",
"boolean",
"hasSlotIsDoubleMetaphoneEqual",
"(",
"final",
"String",
"slotName",
",",
"final",
"String",
"value",
")",
"{",
"final",
"String",
"slotValue",
"=",
"getSlotValue",
"(",
"slotName",
")",
";",
"return",
"hasSlotNotBlank",
"(",
"slotName",
")",
... | Checks if a slot is contained in the intent request and has a value which is a
phonetic sibling of the string given to this method. Double metaphone algorithm
is optimized for English language and in this case is used to match slot value with
value given to this method.
@param slotName name of the slot to look after
@p... | [
"Checks",
"if",
"a",
"slot",
"is",
"contained",
"in",
"the",
"intent",
"request",
"and",
"has",
"a",
"value",
"which",
"is",
"a",
"phonetic",
"sibling",
"of",
"the",
"string",
"given",
"to",
"this",
"method",
".",
"Double",
"metaphone",
"algorithm",
"is",
... | train | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L138-L142 |
ef-labs/vertx-jersey | vertx-jersey/src/main/java/com/englishtown/vertx/guice/GuiceJerseyServer.java | GuiceJerseyServer.initBridge | protected void initBridge(ServiceLocator locator, Injector injector) {
"""
Initialize the hk2 bridge
@param locator the HK2 locator
@param injector the Guice injector
"""
// Set up bridge
GuiceBridge.getGuiceBridge().initializeGuiceBridge(locator);
GuiceIntoHK2Bridge guiceBridge =... | java | protected void initBridge(ServiceLocator locator, Injector injector) {
// Set up bridge
GuiceBridge.getGuiceBridge().initializeGuiceBridge(locator);
GuiceIntoHK2Bridge guiceBridge = locator.getService(GuiceIntoHK2Bridge.class);
guiceBridge.bridgeGuiceInjector(injector);
injectMu... | [
"protected",
"void",
"initBridge",
"(",
"ServiceLocator",
"locator",
",",
"Injector",
"injector",
")",
"{",
"// Set up bridge",
"GuiceBridge",
".",
"getGuiceBridge",
"(",
")",
".",
"initializeGuiceBridge",
"(",
"locator",
")",
";",
"GuiceIntoHK2Bridge",
"guiceBridge",... | Initialize the hk2 bridge
@param locator the HK2 locator
@param injector the Guice injector | [
"Initialize",
"the",
"hk2",
"bridge"
] | train | https://github.com/ef-labs/vertx-jersey/blob/733482a8a5afb1fb257c682b3767655e56f7a0fe/vertx-jersey/src/main/java/com/englishtown/vertx/guice/GuiceJerseyServer.java#L50-L66 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertyUtil.java | WarningPropertyUtil.pcToLocation | private static Location pcToLocation(ClassContext classContext, Method method, int pc) throws CFGBuilderException {
"""
Get a Location matching the given PC value. Because of JSR subroutines,
there may be multiple Locations referring to the given instruction. This
method simply returns one of them arbitrarily.
... | java | private static Location pcToLocation(ClassContext classContext, Method method, int pc) throws CFGBuilderException {
CFG cfg = classContext.getCFG(method);
for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
Location location = i.next();
if (location.getHandle().ge... | [
"private",
"static",
"Location",
"pcToLocation",
"(",
"ClassContext",
"classContext",
",",
"Method",
"method",
",",
"int",
"pc",
")",
"throws",
"CFGBuilderException",
"{",
"CFG",
"cfg",
"=",
"classContext",
".",
"getCFG",
"(",
"method",
")",
";",
"for",
"(",
... | Get a Location matching the given PC value. Because of JSR subroutines,
there may be multiple Locations referring to the given instruction. This
method simply returns one of them arbitrarily.
@param classContext
the ClassContext containing the method
@param method
the method
@param pc
a PC value of an instruction in t... | [
"Get",
"a",
"Location",
"matching",
"the",
"given",
"PC",
"value",
".",
"Because",
"of",
"JSR",
"subroutines",
"there",
"may",
"be",
"multiple",
"Locations",
"referring",
"to",
"the",
"given",
"instruction",
".",
"This",
"method",
"simply",
"returns",
"one",
... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/props/WarningPropertyUtil.java#L75-L84 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuGraphRemoveDependencies | public static int cuGraphRemoveDependencies(CUgraph hGraph, CUgraphNode from[], CUgraphNode to[], long numDependencies) {
"""
Removes dependency edges from a graph.<br>
<br>
The number of \p dependencies to be removed is defined by \p numDependencies.
Elements in \p from and \p to at corresponding indices defin... | java | public static int cuGraphRemoveDependencies(CUgraph hGraph, CUgraphNode from[], CUgraphNode to[], long numDependencies)
{
return checkResult(cuGraphRemoveDependenciesNative(hGraph, from, to, numDependencies));
} | [
"public",
"static",
"int",
"cuGraphRemoveDependencies",
"(",
"CUgraph",
"hGraph",
",",
"CUgraphNode",
"from",
"[",
"]",
",",
"CUgraphNode",
"to",
"[",
"]",
",",
"long",
"numDependencies",
")",
"{",
"return",
"checkResult",
"(",
"cuGraphRemoveDependenciesNative",
"... | Removes dependency edges from a graph.<br>
<br>
The number of \p dependencies to be removed is defined by \p numDependencies.
Elements in \p from and \p to at corresponding indices define a dependency.
Each node in \p from and \p to must belong to \p hGraph.<br>
<br>
If \p numDependencies is 0, elements in \p from and ... | [
"Removes",
"dependency",
"edges",
"from",
"a",
"graph",
".",
"<br",
">",
"<br",
">",
"The",
"number",
"of",
"\\",
"p",
"dependencies",
"to",
"be",
"removed",
"is",
"defined",
"by",
"\\",
"p",
"numDependencies",
".",
"Elements",
"in",
"\\",
"p",
"from",
... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L12880-L12883 |
strator-dev/greenpepper | greenpepper/greenpepper-server/src/main/java/com/greenpepper/server/GreenPepperServerServiceImpl.java | GreenPepperServerServiceImpl.getAllEnvironmentTypes | public List<EnvironmentType> getAllEnvironmentTypes() throws GreenPepperServerException {
"""
<p>getAllEnvironmentTypes.</p>
@inheritDoc NO NEEDS TO SECURE THIS
@return a {@link java.util.List} object.
@throws com.greenpepper.server.GreenPepperServerException if any.
"""
try {
sessionS... | java | public List<EnvironmentType> getAllEnvironmentTypes() throws GreenPepperServerException {
try {
sessionService.startSession();
List<EnvironmentType> envTypes = sutDao.getAllEnvironmentTypes();
log.debug("Retrieved All Environment Types number: " + envTypes.size());
... | [
"public",
"List",
"<",
"EnvironmentType",
">",
"getAllEnvironmentTypes",
"(",
")",
"throws",
"GreenPepperServerException",
"{",
"try",
"{",
"sessionService",
".",
"startSession",
"(",
")",
";",
"List",
"<",
"EnvironmentType",
">",
"envTypes",
"=",
"sutDao",
".",
... | <p>getAllEnvironmentTypes.</p>
@inheritDoc NO NEEDS TO SECURE THIS
@return a {@link java.util.List} object.
@throws com.greenpepper.server.GreenPepperServerException if any. | [
"<p",
">",
"getAllEnvironmentTypes",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-server/src/main/java/com/greenpepper/server/GreenPepperServerServiceImpl.java#L146-L160 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java | StructureTools.getAllNonHAtomArray | public static final Atom[] getAllNonHAtomArray(Structure s, boolean hetAtoms) {
"""
Returns and array of all non-Hydrogen atoms in the given Structure,
optionally including HET atoms or not. Waters are not included.
@param s
@param hetAtoms
if true HET atoms are included in array, if false they are not
@ret... | java | public static final Atom[] getAllNonHAtomArray(Structure s, boolean hetAtoms) {
AtomIterator iter = new AtomIterator(s);
return getAllNonHAtomArray(s, hetAtoms, iter);
} | [
"public",
"static",
"final",
"Atom",
"[",
"]",
"getAllNonHAtomArray",
"(",
"Structure",
"s",
",",
"boolean",
"hetAtoms",
")",
"{",
"AtomIterator",
"iter",
"=",
"new",
"AtomIterator",
"(",
"s",
")",
";",
"return",
"getAllNonHAtomArray",
"(",
"s",
",",
"hetAto... | Returns and array of all non-Hydrogen atoms in the given Structure,
optionally including HET atoms or not. Waters are not included.
@param s
@param hetAtoms
if true HET atoms are included in array, if false they are not
@return | [
"Returns",
"and",
"array",
"of",
"all",
"non",
"-",
"Hydrogen",
"atoms",
"in",
"the",
"given",
"Structure",
"optionally",
"including",
"HET",
"atoms",
"or",
"not",
".",
"Waters",
"are",
"not",
"included",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L674-L677 |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnConvolutionBiasActivationForward | public static int cudnnConvolutionBiasActivationForward(
cudnnHandle handle,
Pointer alpha1,
cudnnTensorDescriptor xDesc,
Pointer x,
cudnnFilterDescriptor wDesc,
Pointer w,
cudnnConvolutionDescriptor convDesc,
int algo,
Pointer workSpace,
... | java | public static int cudnnConvolutionBiasActivationForward(
cudnnHandle handle,
Pointer alpha1,
cudnnTensorDescriptor xDesc,
Pointer x,
cudnnFilterDescriptor wDesc,
Pointer w,
cudnnConvolutionDescriptor convDesc,
int algo,
Pointer workSpace,
... | [
"public",
"static",
"int",
"cudnnConvolutionBiasActivationForward",
"(",
"cudnnHandle",
"handle",
",",
"Pointer",
"alpha1",
",",
"cudnnTensorDescriptor",
"xDesc",
",",
"Pointer",
"x",
",",
"cudnnFilterDescriptor",
"wDesc",
",",
"Pointer",
"w",
",",
"cudnnConvolutionDesc... | Fused conv/bias/activation operation : y = Act( alpha1 * conv(x) + alpha2 * z + bias ) | [
"Fused",
"conv",
"/",
"bias",
"/",
"activation",
"operation",
":",
"y",
"=",
"Act",
"(",
"alpha1",
"*",
"conv",
"(",
"x",
")",
"+",
"alpha2",
"*",
"z",
"+",
"bias",
")"
] | train | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L1190-L1211 |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/AbstractDataSource.java | AbstractDataSource.onDowngrade | public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
"""
On downgrade.
@param db
the db
@param oldVersion
the old version
@param newVersion
the new version
"""
if (AbstractDataSource.this.options.databaseLifecycleHandler != null) {
AbstractDataSource.this.options.databaseLi... | java | public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
if (AbstractDataSource.this.options.databaseLifecycleHandler != null) {
AbstractDataSource.this.options.databaseLifecycleHandler.onUpdate(db, oldVersion, newVersion, false);
versionChanged = true;
}
} | [
"public",
"void",
"onDowngrade",
"(",
"SQLiteDatabase",
"db",
",",
"int",
"oldVersion",
",",
"int",
"newVersion",
")",
"{",
"if",
"(",
"AbstractDataSource",
".",
"this",
".",
"options",
".",
"databaseLifecycleHandler",
"!=",
"null",
")",
"{",
"AbstractDataSource... | On downgrade.
@param db
the db
@param oldVersion
the old version
@param newVersion
the new version | [
"On",
"downgrade",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/AbstractDataSource.java#L537-L542 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java | ConditionalCheck.notNaN | @Throws(IllegalNaNArgumentException.class)
public static void notNaN(final boolean condition, final double value, @Nullable final String name) {
"""
Ensures that a double argument is not NaN (not a number).
@see java.lang.Double#NaN
@param condition
condition must be {@code true}^ so that the check will be... | java | @Throws(IllegalNaNArgumentException.class)
public static void notNaN(final boolean condition, final double value, @Nullable final String name) {
if (condition) {
Check.notNaN(value, name);
}
} | [
"@",
"Throws",
"(",
"IllegalNaNArgumentException",
".",
"class",
")",
"public",
"static",
"void",
"notNaN",
"(",
"final",
"boolean",
"condition",
",",
"final",
"double",
"value",
",",
"@",
"Nullable",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"conditio... | Ensures that a double argument is not NaN (not a number).
@see java.lang.Double#NaN
@param condition
condition must be {@code true}^ so that the check will be performed
@param value
value which should not be NaN
@param name
name of object reference (in source code)
@throws IllegalNaNArgumentException
if the given ar... | [
"Ensures",
"that",
"a",
"double",
"argument",
"is",
"not",
"NaN",
"(",
"not",
"a",
"number",
")",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java#L1891-L1896 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.modifyInstancePassword | public void modifyInstancePassword(String instanceId, String adminPass) throws BceClientException {
"""
Modifying the password of the instance.
You can change the instance password only when the instance is Running or Stopped ,
otherwise,it's will get <code>409</code> errorCode.
This is an asynchronous inte... | java | public void modifyInstancePassword(String instanceId, String adminPass) throws BceClientException {
this.modifyInstancePassword(new ModifyInstancePasswordRequest()
.withInstanceId(instanceId).withAdminPass(adminPass));
} | [
"public",
"void",
"modifyInstancePassword",
"(",
"String",
"instanceId",
",",
"String",
"adminPass",
")",
"throws",
"BceClientException",
"{",
"this",
".",
"modifyInstancePassword",
"(",
"new",
"ModifyInstancePasswordRequest",
"(",
")",
".",
"withInstanceId",
"(",
"in... | Modifying the password of the instance.
You can change the instance password only when the instance is Running or Stopped ,
otherwise,it's will get <code>409</code> errorCode.
This is an asynchronous interface,
you can get the latest status by invoke {@link #getInstance(GetInstanceRequest)}
@param instanceId The id ... | [
"Modifying",
"the",
"password",
"of",
"the",
"instance",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L520-L523 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.