repo stringclasses 11
values | path stringlengths 41 234 | func_name stringlengths 5 78 | original_string stringlengths 71 14.1k | language stringclasses 1
value | code stringlengths 71 14.1k | code_tokens listlengths 22 2.65k | docstring stringlengths 2 5.35k | docstring_tokens listlengths 1 369 | sha stringclasses 11
values | url stringlengths 129 339 | partition stringclasses 1
value | summary stringlengths 7 175 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.sub | public static <T> List<T> sub(List<T> list, int start, int end) {
return sub(list, start, end, 1);
} | java | public static <T> List<T> sub(List<T> list, int start, int end) {
return sub(list, start, end, 1);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"sub",
"(",
"List",
"<",
"T",
">",
"list",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"sub",
"(",
"list",
",",
"start",
",",
"end",
",",
"1",
")",
";",
"}"
] | 截取集合的部分
@param <T> 集合元素类型
@param list 被截取的数组
@param start 开始位置(包含)
@param end 结束位置(不包含)
@return 截取后的数组,当开始位置超过最大时,返回空的List | [
"截取集合的部分"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L814-L816 | train | Returns a sub - list of the given list. | [
30522,
2270,
10763,
1026,
1056,
1028,
2862,
1026,
1056,
1028,
4942,
1006,
2862,
1026,
1056,
1028,
2862,
1010,
20014,
2707,
1010,
20014,
2203,
1007,
1063,
2709,
4942,
1006,
2862,
1010,
2707,
1010,
2203,
1010,
1015,
1007,
1025,
1065,
102,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java | DataStream.keyBy | public KeyedStream<T, Tuple> keyBy(String... fields) {
return keyBy(new Keys.ExpressionKeys<>(fields, getType()));
} | java | public KeyedStream<T, Tuple> keyBy(String... fields) {
return keyBy(new Keys.ExpressionKeys<>(fields, getType()));
} | [
"public",
"KeyedStream",
"<",
"T",
",",
"Tuple",
">",
"keyBy",
"(",
"String",
"...",
"fields",
")",
"{",
"return",
"keyBy",
"(",
"new",
"Keys",
".",
"ExpressionKeys",
"<>",
"(",
"fields",
",",
"getType",
"(",
")",
")",
")",
";",
"}"
] | Partitions the operator state of a {@link DataStream} using field expressions.
A field expression is either the name of a public field or a getter method with parentheses
of the {@link DataStream}'s underlying type. A dot can be used to drill
down into objects, as in {@code "field1.getInnerField2()" }.
@param fields
O... | [
"Partitions",
"the",
"operator",
"state",
"of",
"a",
"{",
"@link",
"DataStream",
"}",
"using",
"field",
"expressions",
".",
"A",
"field",
"expression",
"is",
"either",
"the",
"name",
"of",
"a",
"public",
"field",
"or",
"a",
"getter",
"method",
"with",
"par... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L336-L338 | train | Key by expression. | [
30522,
2270,
3145,
2098,
21422,
1026,
1056,
1010,
10722,
10814,
1028,
3145,
3762,
1006,
5164,
1012,
1012,
1012,
4249,
1007,
1063,
2709,
3145,
3762,
1006,
2047,
6309,
1012,
3670,
14839,
2015,
1026,
1028,
1006,
4249,
1010,
2131,
13874,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.getWriter | public static BufferedWriter getWriter(String path, String charsetName, boolean isAppend) throws IORuntimeException {
return getWriter(touch(path), Charset.forName(charsetName), isAppend);
} | java | public static BufferedWriter getWriter(String path, String charsetName, boolean isAppend) throws IORuntimeException {
return getWriter(touch(path), Charset.forName(charsetName), isAppend);
} | [
"public",
"static",
"BufferedWriter",
"getWriter",
"(",
"String",
"path",
",",
"String",
"charsetName",
",",
"boolean",
"isAppend",
")",
"throws",
"IORuntimeException",
"{",
"return",
"getWriter",
"(",
"touch",
"(",
"path",
")",
",",
"Charset",
".",
"forName",
... | 获得一个带缓存的写入对象
@param path 输出路径,绝对路径
@param charsetName 字符集
@param isAppend 是否追加
@return BufferedReader对象
@throws IORuntimeException IO异常 | [
"获得一个带缓存的写入对象"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2585-L2587 | train | Returns a BufferedWriter for writing to the specified file. | [
30522,
2270,
10763,
17698,
2098,
15994,
2131,
15994,
1006,
5164,
4130,
1010,
5164,
25869,
13462,
18442,
1010,
22017,
20898,
18061,
21512,
4859,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2709,
2131,
15994,
1006,
3543,
1006,
4130,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java | CheckpointCoordinator.abortPendingCheckpoints | public void abortPendingCheckpoints(CheckpointException exception) {
synchronized (lock) {
for (PendingCheckpoint p : pendingCheckpoints.values()) {
p.abort(exception.getCheckpointFailureReason());
}
pendingCheckpoints.clear();
}
} | java | public void abortPendingCheckpoints(CheckpointException exception) {
synchronized (lock) {
for (PendingCheckpoint p : pendingCheckpoints.values()) {
p.abort(exception.getCheckpointFailureReason());
}
pendingCheckpoints.clear();
}
} | [
"public",
"void",
"abortPendingCheckpoints",
"(",
"CheckpointException",
"exception",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"for",
"(",
"PendingCheckpoint",
"p",
":",
"pendingCheckpoints",
".",
"values",
"(",
")",
")",
"{",
"p",
".",
"abort",
"(",
... | Aborts all the pending checkpoints due to en exception.
@param exception The exception. | [
"Aborts",
"all",
"the",
"pending",
"checkpoints",
"due",
"to",
"en",
"exception",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L1264-L1272 | train | Aborts all pending checkpoints. | [
30522,
2270,
11675,
11113,
11589,
11837,
4667,
5403,
3600,
26521,
1006,
26520,
10288,
24422,
6453,
1007,
1063,
25549,
1006,
5843,
1007,
1063,
2005,
1006,
14223,
5403,
3600,
8400,
1052,
1024,
14223,
5403,
3600,
26521,
1012,
5300,
1006,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java | DefaultHeaders.copy | public DefaultHeaders<K, V, T> copy() {
DefaultHeaders<K, V, T> copy = new DefaultHeaders<K, V, T>(
hashingStrategy, valueConverter, nameValidator, entries.length);
copy.addImpl(this);
return copy;
} | java | public DefaultHeaders<K, V, T> copy() {
DefaultHeaders<K, V, T> copy = new DefaultHeaders<K, V, T>(
hashingStrategy, valueConverter, nameValidator, entries.length);
copy.addImpl(this);
return copy;
} | [
"public",
"DefaultHeaders",
"<",
"K",
",",
"V",
",",
"T",
">",
"copy",
"(",
")",
"{",
"DefaultHeaders",
"<",
"K",
",",
"V",
",",
"T",
">",
"copy",
"=",
"new",
"DefaultHeaders",
"<",
"K",
",",
"V",
",",
"T",
">",
"(",
"hashingStrategy",
",",
"valu... | Returns a deep copy of this instance. | [
"Returns",
"a",
"deep",
"copy",
"of",
"this",
"instance",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java#L1037-L1042 | train | Returns a copy of this instance. | [
30522,
2270,
12398,
4974,
2545,
1026,
1047,
1010,
1058,
1010,
1056,
1028,
6100,
1006,
1007,
1063,
12398,
4974,
2545,
1026,
1047,
1010,
1058,
1010,
1056,
1028,
6100,
1027,
2047,
12398,
4974,
2545,
1026,
1047,
1010,
1058,
1010,
1056,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/corpus/occurrence/TriaFrequency.java | TriaFrequency.create | public static TriaFrequency create(String first, char delimiter, String second, String third)
{
TriaFrequency triaFrequency = new TriaFrequency(first + delimiter + second + Occurrence.RIGHT + third);
triaFrequency.first = first;
triaFrequency.second = second;
triaFrequency.third = th... | java | public static TriaFrequency create(String first, char delimiter, String second, String third)
{
TriaFrequency triaFrequency = new TriaFrequency(first + delimiter + second + Occurrence.RIGHT + third);
triaFrequency.first = first;
triaFrequency.second = second;
triaFrequency.third = th... | [
"public",
"static",
"TriaFrequency",
"create",
"(",
"String",
"first",
",",
"char",
"delimiter",
",",
"String",
"second",
",",
"String",
"third",
")",
"{",
"TriaFrequency",
"triaFrequency",
"=",
"new",
"TriaFrequency",
"(",
"first",
"+",
"delimiter",
"+",
"sec... | 构造一个三阶接续,正向
@param first
@param second
@param third
@param delimiter 一般使用RIGHT!
@return | [
"构造一个三阶接续,正向"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/occurrence/TriaFrequency.java#L42-L50 | train | Create a TriaFrequency object from the given strings. | [
30522,
2270,
10763,
13012,
10354,
2890,
4226,
9407,
3443,
1006,
5164,
2034,
1010,
25869,
3972,
27605,
3334,
1010,
5164,
2117,
1010,
5164,
2353,
1007,
1063,
13012,
10354,
2890,
4226,
9407,
13012,
10354,
2890,
4226,
9407,
1027,
2047,
13012,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java | AutoConfigurationImportSelector.getAutoConfigurationEntry | protected AutoConfigurationEntry getAutoConfigurationEntry(
AutoConfigurationMetadata autoConfigurationMetadata,
AnnotationMetadata annotationMetadata) {
if (!isEnabled(annotationMetadata)) {
return EMPTY_ENTRY;
}
AnnotationAttributes attributes = getAttributes(annotationMetadata);
List<String> configu... | java | protected AutoConfigurationEntry getAutoConfigurationEntry(
AutoConfigurationMetadata autoConfigurationMetadata,
AnnotationMetadata annotationMetadata) {
if (!isEnabled(annotationMetadata)) {
return EMPTY_ENTRY;
}
AnnotationAttributes attributes = getAttributes(annotationMetadata);
List<String> configu... | [
"protected",
"AutoConfigurationEntry",
"getAutoConfigurationEntry",
"(",
"AutoConfigurationMetadata",
"autoConfigurationMetadata",
",",
"AnnotationMetadata",
"annotationMetadata",
")",
"{",
"if",
"(",
"!",
"isEnabled",
"(",
"annotationMetadata",
")",
")",
"{",
"return",
"EM... | Return the {@link AutoConfigurationEntry} based on the {@link AnnotationMetadata}
of the importing {@link Configuration @Configuration} class.
@param autoConfigurationMetadata the auto-configuration metadata
@param annotationMetadata the annotation metadata of the configuration class
@return the auto-configurations tha... | [
"Return",
"the",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java#L112-L128 | train | Gets the AutoConfigurationEntry for the given annotation metadata. | [
30522,
5123,
8285,
8663,
8873,
27390,
3370,
4765,
2854,
2131,
4887,
3406,
8663,
8873,
27390,
3370,
4765,
2854,
1006,
8285,
8663,
8873,
27390,
3370,
11368,
8447,
2696,
8285,
8663,
8873,
27390,
3370,
11368,
8447,
2696,
1010,
5754,
17287,
3508... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java | CountMinSketch.readFrom | public static CountMinSketch readFrom(byte[] bytes) throws IOException {
try (InputStream in = new ByteArrayInputStream(bytes)) {
return readFrom(in);
}
} | java | public static CountMinSketch readFrom(byte[] bytes) throws IOException {
try (InputStream in = new ByteArrayInputStream(bytes)) {
return readFrom(in);
}
} | [
"public",
"static",
"CountMinSketch",
"readFrom",
"(",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"try",
"(",
"InputStream",
"in",
"=",
"new",
"ByteArrayInputStream",
"(",
"bytes",
")",
")",
"{",
"return",
"readFrom",
"(",
"in",
")",
";"... | Reads in a {@link CountMinSketch} from a byte array. | [
"Reads",
"in",
"a",
"{"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java#L193-L197 | train | Read a CountMinSketch from the given byte array. | [
30522,
2270,
10763,
4175,
21266,
3489,
10649,
3191,
19699,
5358,
1006,
24880,
1031,
1033,
27507,
1007,
11618,
22834,
10288,
24422,
1063,
3046,
1006,
20407,
25379,
1999,
1027,
2047,
24880,
2906,
9447,
2378,
18780,
21422,
1006,
27507,
1007,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java | UnsafeInMemorySorter.free | public void free() {
if (consumer != null) {
if (array != null) {
consumer.freeArray(array);
}
array = null;
}
} | java | public void free() {
if (consumer != null) {
if (array != null) {
consumer.freeArray(array);
}
array = null;
}
} | [
"public",
"void",
"free",
"(",
")",
"{",
"if",
"(",
"consumer",
"!=",
"null",
")",
"{",
"if",
"(",
"array",
"!=",
"null",
")",
"{",
"consumer",
".",
"freeArray",
"(",
"array",
")",
";",
"}",
"array",
"=",
"null",
";",
"}",
"}"
] | Free the memory used by pointer array. | [
"Free",
"the",
"memory",
"used",
"by",
"pointer",
"array",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java#L165-L172 | train | Free the array. | [
30522,
2270,
11675,
2489,
1006,
1007,
1063,
2065,
1006,
7325,
999,
1027,
19701,
1007,
1063,
2065,
1006,
9140,
999,
1027,
19701,
1007,
1063,
7325,
1012,
2489,
2906,
9447,
1006,
9140,
1007,
1025,
1065,
9140,
1027,
19701,
1025,
1065,
1065,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/FlinkZooKeeperQuorumPeer.java | FlinkZooKeeperQuorumPeer.setRequiredProperties | private static void setRequiredProperties(Properties zkProps) {
// Set default client port
if (zkProps.getProperty("clientPort") == null) {
zkProps.setProperty("clientPort", String.valueOf(DEFAULT_ZOOKEEPER_CLIENT_PORT));
LOG.warn("No 'clientPort' configured. Set to '{}'.", DEFAULT_ZOOKEEPER_CLIENT_PORT);
... | java | private static void setRequiredProperties(Properties zkProps) {
// Set default client port
if (zkProps.getProperty("clientPort") == null) {
zkProps.setProperty("clientPort", String.valueOf(DEFAULT_ZOOKEEPER_CLIENT_PORT));
LOG.warn("No 'clientPort' configured. Set to '{}'.", DEFAULT_ZOOKEEPER_CLIENT_PORT);
... | [
"private",
"static",
"void",
"setRequiredProperties",
"(",
"Properties",
"zkProps",
")",
"{",
"// Set default client port",
"if",
"(",
"zkProps",
".",
"getProperty",
"(",
"\"clientPort\"",
")",
"==",
"null",
")",
"{",
"zkProps",
".",
"setProperty",
"(",
"\"clientP... | Sets required properties to reasonable defaults and logs it. | [
"Sets",
"required",
"properties",
"to",
"reasonable",
"defaults",
"and",
"logs",
"it",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/FlinkZooKeeperQuorumPeer.java#L139-L197 | train | Sets required properties to be used in the ZooKeeper server. | [
30522,
2797,
10763,
11675,
2275,
2890,
15549,
5596,
21572,
4842,
7368,
1006,
5144,
1062,
2243,
21572,
4523,
1007,
1063,
1013,
1013,
2275,
12398,
7396,
3417,
2065,
1006,
1062,
2243,
21572,
4523,
1012,
2131,
21572,
4842,
3723,
1006,
1000,
739... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/operators/DataSink.java | DataSink.sortLocalOutput | @Deprecated
@PublicEvolving
public DataSink<T> sortLocalOutput(int field, Order order) {
// get flat keys
Keys.ExpressionKeys<T> ek = new Keys.ExpressionKeys<>(field, this.type);
int[] flatKeys = ek.computeLogicalKeyPositions();
if (!Keys.ExpressionKeys.isSortKey(field, this.type)) {
throw new InvalidPro... | java | @Deprecated
@PublicEvolving
public DataSink<T> sortLocalOutput(int field, Order order) {
// get flat keys
Keys.ExpressionKeys<T> ek = new Keys.ExpressionKeys<>(field, this.type);
int[] flatKeys = ek.computeLogicalKeyPositions();
if (!Keys.ExpressionKeys.isSortKey(field, this.type)) {
throw new InvalidPro... | [
"@",
"Deprecated",
"@",
"PublicEvolving",
"public",
"DataSink",
"<",
"T",
">",
"sortLocalOutput",
"(",
"int",
"field",
",",
"Order",
"order",
")",
"{",
"// get flat keys",
"Keys",
".",
"ExpressionKeys",
"<",
"T",
">",
"ek",
"=",
"new",
"Keys",
".",
"Expres... | Sorts each local partition of a {@link org.apache.flink.api.java.tuple.Tuple} data set
on the specified field in the specified {@link Order} before it is emitted by the output format.
<p><b>Note: Only tuple data sets can be sorted using integer field indices.</b>
<p>The tuple data set can be sorted on multiple fields... | [
"Sorts",
"each",
"local",
"partition",
"of",
"a",
"{",
"@link",
"org",
".",
"apache",
".",
"flink",
".",
"api",
".",
"java",
".",
"tuple",
".",
"Tuple",
"}",
"data",
"set",
"on",
"the",
"specified",
"field",
"in",
"the",
"specified",
"{",
"@link",
"O... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/DataSink.java#L127-L158 | train | Sort the data sink by field and order | [
30522,
1030,
2139,
28139,
12921,
1030,
2270,
6777,
4747,
6455,
2270,
2951,
11493,
2243,
1026,
1056,
1028,
4066,
4135,
9289,
5833,
18780,
1006,
20014,
2492,
1010,
2344,
2344,
1007,
1063,
1013,
1013,
2131,
4257,
6309,
6309,
1012,
3670,
14839,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ftp/AbstractFtp.java | AbstractFtp.mkDirs | public void mkDirs(String dir) {
final String[] dirs = StrUtil.trim(dir).split("[\\\\/]+");
final String now = pwd();
if(dirs.length > 0 && StrUtil.isEmpty(dirs[0])) {
//首位为空,表示以/开头
this.cd(StrUtil.SLASH);
}
for (int i = 0; i < dirs.length; i++) {
if (StrUtil.isNotEmpty(dirs[i])) {
if ... | java | public void mkDirs(String dir) {
final String[] dirs = StrUtil.trim(dir).split("[\\\\/]+");
final String now = pwd();
if(dirs.length > 0 && StrUtil.isEmpty(dirs[0])) {
//首位为空,表示以/开头
this.cd(StrUtil.SLASH);
}
for (int i = 0; i < dirs.length; i++) {
if (StrUtil.isNotEmpty(dirs[i])) {
if ... | [
"public",
"void",
"mkDirs",
"(",
"String",
"dir",
")",
"{",
"final",
"String",
"[",
"]",
"dirs",
"=",
"StrUtil",
".",
"trim",
"(",
"dir",
")",
".",
"split",
"(",
"\"[\\\\\\\\/]+\"",
")",
";",
"final",
"String",
"now",
"=",
"pwd",
"(",
")",
";",
"if... | 创建指定文件夹及其父目录,从根目录开始创建,创建完成后回到默认的工作目录
@param dir 文件夹路径,绝对路径 | [
"创建指定文件夹及其父目录,从根目录开始创建,创建完成后回到默认的工作目录"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ftp/AbstractFtp.java#L114-L133 | train | Create all the directories in the specified directory. | [
30522,
2270,
11675,
12395,
4305,
2869,
1006,
5164,
16101,
1007,
1063,
2345,
5164,
1031,
1033,
16101,
2015,
1027,
2358,
22134,
4014,
1012,
12241,
1006,
16101,
1007,
1012,
3975,
1006,
1000,
1031,
1032,
1032,
1032,
1032,
1013,
1033,
1009,
1000... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/rest/CommonRest.java | CommonRest.count | @GetMapping("/count/{type}/{task}")
public Map<String, Object> count(@PathVariable String type, @PathVariable String task) {
return count(type, null, task);
} | java | @GetMapping("/count/{type}/{task}")
public Map<String, Object> count(@PathVariable String type, @PathVariable String task) {
return count(type, null, task);
} | [
"@",
"GetMapping",
"(",
"\"/count/{type}/{task}\"",
")",
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"count",
"(",
"@",
"PathVariable",
"String",
"type",
",",
"@",
"PathVariable",
"String",
"task",
")",
"{",
"return",
"count",
"(",
"type",
",",
"nu... | 统计总数 curl http://127.0.0.1:8081/count/hbase/mytest_person2.yml
@param type 类型 hbase, es
@param task 任务名对应配置文件名 mytest_person2.yml
@return | [
"统计总数",
"curl",
"http",
":",
"//",
"127",
".",
"0",
".",
"0",
".",
"1",
":",
"8081",
"/",
"count",
"/",
"hbase",
"/",
"mytest_person2",
".",
"yml"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/rest/CommonRest.java#L147-L150 | train | Count a single resource in a single resource group. | [
30522,
1030,
2131,
2863,
14853,
1006,
1000,
1013,
4175,
1013,
1063,
2828,
1065,
1013,
1063,
4708,
1065,
1000,
1007,
2270,
4949,
1026,
5164,
1010,
4874,
1028,
4175,
1006,
1030,
4130,
30524,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/core/fs/LimitedConnectionsFileSystem.java | LimitedConnectionsFileSystem.unregisterOutputStream | void unregisterOutputStream(OutStream stream) {
lock.lock();
try {
// only decrement if we actually remove the stream
if (openOutputStreams.remove(stream)) {
numReservedOutputStreams--;
available.signalAll();
}
}
finally {
lock.unlock();
}
} | java | void unregisterOutputStream(OutStream stream) {
lock.lock();
try {
// only decrement if we actually remove the stream
if (openOutputStreams.remove(stream)) {
numReservedOutputStreams--;
available.signalAll();
}
}
finally {
lock.unlock();
}
} | [
"void",
"unregisterOutputStream",
"(",
"OutStream",
"stream",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"// only decrement if we actually remove the stream",
"if",
"(",
"openOutputStreams",
".",
"remove",
"(",
"stream",
")",
")",
"{",
"numReservedO... | Atomically removes the given output stream from the set of currently open output streams,
and signals that new stream can now be opened. | [
"Atomically",
"removes",
"the",
"given",
"output",
"stream",
"from",
"the",
"set",
"of",
"currently",
"open",
"output",
"streams",
"and",
"signals",
"that",
"new",
"stream",
"can",
"now",
"be",
"opened",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/LimitedConnectionsFileSystem.java#L565-L577 | train | Unregister a stream. | [
30522,
11675,
4895,
2890,
24063,
10624,
4904,
18780,
21422,
1006,
21100,
25379,
5460,
1007,
1063,
5843,
1012,
5843,
1006,
1007,
1025,
3046,
1063,
1013,
1013,
2069,
11703,
28578,
4765,
2065,
2057,
2941,
6366,
1996,
5460,
2065,
1006,
2330,
58... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java | PerceptronClassifier.trainNaivePerceptron | private static LinearModel trainNaivePerceptron(Instance[] instanceList, FeatureMap featureMap, int maxIteration)
{
LinearModel model = new LinearModel(featureMap, new float[featureMap.size()]);
for (int it = 0; it < maxIteration; ++it)
{
Utility.shuffleArray(instanceList);
... | java | private static LinearModel trainNaivePerceptron(Instance[] instanceList, FeatureMap featureMap, int maxIteration)
{
LinearModel model = new LinearModel(featureMap, new float[featureMap.size()]);
for (int it = 0; it < maxIteration; ++it)
{
Utility.shuffleArray(instanceList);
... | [
"private",
"static",
"LinearModel",
"trainNaivePerceptron",
"(",
"Instance",
"[",
"]",
"instanceList",
",",
"FeatureMap",
"featureMap",
",",
"int",
"maxIteration",
")",
"{",
"LinearModel",
"model",
"=",
"new",
"LinearModel",
"(",
"featureMap",
",",
"new",
"float",... | 朴素感知机训练算法
@param instanceList 训练实例
@param featureMap 特征函数
@param maxIteration 训练迭代次数 | [
"朴素感知机训练算法"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java#L57-L71 | train | Train a national perceptron model. | [
30522,
2797,
10763,
7399,
5302,
9247,
3345,
26416,
3726,
4842,
3401,
13876,
4948,
1006,
6013,
1031,
1033,
6013,
9863,
1010,
3444,
2863,
2361,
3444,
2863,
2361,
1010,
20014,
21510,
14621,
3508,
1007,
1063,
7399,
5302,
9247,
2944,
1027,
2047,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-bloomFilter/src/main/java/cn/hutool/bloomfilter/BitSetBloomFilter.java | BitSetBloomFilter.hash | public static int hash(String str, int k) {
switch (k) {
case 0:
return HashUtil.rsHash(str);
case 1:
return HashUtil.jsHash(str);
case 2:
return HashUtil.elfHash(str);
case 3:
return HashUtil.bkdrHash(str);
case 4:
return HashUtil.apHash(str);
case 5:
return Has... | java | public static int hash(String str, int k) {
switch (k) {
case 0:
return HashUtil.rsHash(str);
case 1:
return HashUtil.jsHash(str);
case 2:
return HashUtil.elfHash(str);
case 3:
return HashUtil.bkdrHash(str);
case 4:
return HashUtil.apHash(str);
case 5:
return Has... | [
"public",
"static",
"int",
"hash",
"(",
"String",
"str",
",",
"int",
"k",
")",
"{",
"switch",
"(",
"k",
")",
"{",
"case",
"0",
":",
"return",
"HashUtil",
".",
"rsHash",
"(",
"str",
")",
";",
"case",
"1",
":",
"return",
"HashUtil",
".",
"jsHash",
... | 计算Hash值
@param str 被计算Hash的字符串
@param k Hash算法序号
@return Hash值 | [
"计算Hash值"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-bloomFilter/src/main/java/cn/hutool/bloomfilter/BitSetBloomFilter.java#L121-L142 | train | Returns the k - th hash value for the specified string. | [
30522,
2270,
10763,
20014,
23325,
1006,
5164,
2358,
2099,
1010,
20014,
1047,
1007,
1063,
6942,
1006,
1047,
1007,
1063,
2553,
1014,
1024,
2709,
23325,
21823,
2140,
1012,
12667,
14949,
2232,
1006,
2358,
2099,
1007,
1025,
2553,
1015,
1024,
270... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java | AbstractAsymmetricCrypto.decrypt | public byte[] decrypt(InputStream data, KeyType keyType) throws IORuntimeException {
return decrypt(IoUtil.readBytes(data), keyType);
} | java | public byte[] decrypt(InputStream data, KeyType keyType) throws IORuntimeException {
return decrypt(IoUtil.readBytes(data), keyType);
} | [
"public",
"byte",
"[",
"]",
"decrypt",
"(",
"InputStream",
"data",
",",
"KeyType",
"keyType",
")",
"throws",
"IORuntimeException",
"{",
"return",
"decrypt",
"(",
"IoUtil",
".",
"readBytes",
"(",
"data",
")",
",",
"keyType",
")",
";",
"}"
] | 解密
@param data 被解密的bytes
@param keyType 私钥或公钥 {@link KeyType}
@return 解密后的bytes
@throws IORuntimeException IO异常 | [
"解密"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java#L234-L236 | train | Decrypt the input stream. | [
30522,
2270,
24880,
1031,
1033,
11703,
2854,
13876,
1006,
20407,
25379,
2951,
1010,
3145,
13874,
3145,
13874,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2709,
11703,
2854,
13876,
1006,
22834,
21823,
2140,
1012,
3191,
3762,
4570,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/server/src/org/openqa/grid/web/servlet/console/ConsoleServlet.java | ConsoleServlet.getConfigInfo | private String getConfigInfo() {
StringBuilder builder = new StringBuilder();
builder.append("<div id='hub-config-container'>");
GridHubConfiguration config = getRegistry().getHub().getConfiguration();
builder.append("<div id='hub-config-content'>");
builder.append("<b>Config for the hub :</b><br/>... | java | private String getConfigInfo() {
StringBuilder builder = new StringBuilder();
builder.append("<div id='hub-config-container'>");
GridHubConfiguration config = getRegistry().getHub().getConfiguration();
builder.append("<div id='hub-config-content'>");
builder.append("<b>Config for the hub :</b><br/>... | [
"private",
"String",
"getConfigInfo",
"(",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"<div id='hub-config-container'>\"",
")",
";",
"GridHubConfiguration",
"config",
"=",
"getRegistry",
"(",
... | retracing how the hub config was built to help debugging.
@return html representation of the hub config | [
"retracing",
"how",
"the",
"hub",
"config",
"was",
"built",
"to",
"help",
"debugging",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/console/ConsoleServlet.java#L204-L219 | train | Get the configuration info for the hub | [
30522,
2797,
5164,
2131,
8663,
8873,
11528,
14876,
1006,
1007,
1063,
5164,
8569,
23891,
2099,
12508,
1027,
2047,
5164,
8569,
23891,
2099,
1006,
1007,
1025,
12508,
1012,
10439,
10497,
1006,
1000,
1026,
4487,
2615,
8909,
1027,
1005,
9594,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/perceptron/structures/IndexMaps.java | IndexMaps.clusterId | public int[] clusterId(String word)
{
int[] ids = new int[3];
ids[0] = -100;
ids[1] = -100;
ids[2] = -100;
if (brownFullClusters.containsKey(word))
ids[0] = brownFullClusters.get(word);
if (ids[0] > 0)
{
ids[1] = brown4Clusters.get(ids... | java | public int[] clusterId(String word)
{
int[] ids = new int[3];
ids[0] = -100;
ids[1] = -100;
ids[2] = -100;
if (brownFullClusters.containsKey(word))
ids[0] = brownFullClusters.get(word);
if (ids[0] > 0)
{
ids[1] = brown4Clusters.get(ids... | [
"public",
"int",
"[",
"]",
"clusterId",
"(",
"String",
"word",
")",
"{",
"int",
"[",
"]",
"ids",
"=",
"new",
"int",
"[",
"3",
"]",
";",
"ids",
"[",
"0",
"]",
"=",
"-",
"100",
";",
"ids",
"[",
"1",
"]",
"=",
"-",
"100",
";",
"ids",
"[",
"2... | 获取聚类id
@param word
@return | [
"获取聚类id"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/perceptron/structures/IndexMaps.java#L143-L158 | train | Get the clusterId of a single word. | [
30522,
2270,
20014,
1031,
1033,
9324,
3593,
1006,
5164,
2773,
1007,
1063,
20014,
1031,
1033,
8909,
2015,
1027,
2047,
20014,
1031,
1017,
1033,
1025,
8909,
2015,
1031,
1014,
1033,
1027,
1011,
2531,
1025,
8909,
2015,
1031,
30524,
1033,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java | Ftp.download | @Override
public void download(String path, File outFile) {
final String fileName = FileUtil.getName(path);
final String dir = StrUtil.removeSuffix(path, fileName);
download(dir, fileName, outFile);
} | java | @Override
public void download(String path, File outFile) {
final String fileName = FileUtil.getName(path);
final String dir = StrUtil.removeSuffix(path, fileName);
download(dir, fileName, outFile);
} | [
"@",
"Override",
"public",
"void",
"download",
"(",
"String",
"path",
",",
"File",
"outFile",
")",
"{",
"final",
"String",
"fileName",
"=",
"FileUtil",
".",
"getName",
"(",
"path",
")",
";",
"final",
"String",
"dir",
"=",
"StrUtil",
".",
"removeSuffix",
... | 下载文件
@param path 文件路径
@param outFile 输出文件或目录 | [
"下载文件"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java#L433-L438 | train | Downloads a file from a file system. | [
30522,
1030,
2058,
15637,
2270,
11675,
8816,
1006,
5164,
4130,
1010,
5371,
2041,
8873,
2571,
1007,
1063,
2345,
5164,
5371,
18442,
1027,
5371,
21823,
2140,
1012,
2131,
18442,
1006,
4130,
1007,
1025,
2345,
5164,
16101,
1027,
2358,
22134,
4014... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-socket/src/main/java/cn/hutool/socket/SocketUtil.java | SocketUtil.getRemoteAddress | public static SocketAddress getRemoteAddress(AsynchronousSocketChannel channel) {
try {
return (null == channel) ? null : channel.getRemoteAddress();
} catch (ClosedChannelException e) {
// Channel未打开或已关闭,返回null表示未连接
return null;
} catch (IOException e) {
throw new IORuntimeException(e);
}
... | java | public static SocketAddress getRemoteAddress(AsynchronousSocketChannel channel) {
try {
return (null == channel) ? null : channel.getRemoteAddress();
} catch (ClosedChannelException e) {
// Channel未打开或已关闭,返回null表示未连接
return null;
} catch (IOException e) {
throw new IORuntimeException(e);
}
... | [
"public",
"static",
"SocketAddress",
"getRemoteAddress",
"(",
"AsynchronousSocketChannel",
"channel",
")",
"{",
"try",
"{",
"return",
"(",
"null",
"==",
"channel",
")",
"?",
"null",
":",
"channel",
".",
"getRemoteAddress",
"(",
")",
";",
"}",
"catch",
"(",
"... | 获取远程端的地址信息,包括host和端口<br>
null表示channel为null或者远程主机未连接
@param channel {@link AsynchronousSocketChannel}
@return 远程端的地址信息,包括host和端口,null表示channel为null或者远程主机未连接 | [
"获取远程端的地址信息,包括host和端口<br",
">",
"null表示channel为null或者远程主机未连接"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-socket/src/main/java/cn/hutool/socket/SocketUtil.java#L25-L34 | train | Gets the remote address of the given socket channel. | [
30522,
2270,
10763,
22278,
4215,
16200,
4757,
2131,
28578,
12184,
4215,
16200,
4757,
1006,
2004,
6038,
2818,
4948,
3560,
6499,
19869,
10649,
20147,
2140,
3149,
1007,
1063,
3046,
1063,
2709,
1006,
19701,
1027,
1027,
3149,
1007,
1029,
19701,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java | MapUtil.of | public static <K, V> HashMap<K, V> of(K key, V value) {
return of(key, value, false);
} | java | public static <K, V> HashMap<K, V> of(K key, V value) {
return of(key, value, false);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"HashMap",
"<",
"K",
",",
"V",
">",
"of",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"return",
"of",
"(",
"key",
",",
"value",
",",
"false",
")",
";",
"}"
] | 将单一键值对转换为Map
@param <K> 键类型
@param <V> 值类型
@param key 键
@param value 值
@return {@link HashMap} | [
"将单一键值对转换为Map"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L175-L177 | train | Creates a new HashMap with the specified key and value. | [
30522,
2270,
10763,
1026,
1047,
1010,
1058,
1028,
23325,
2863,
2361,
1026,
1047,
1010,
1058,
1028,
1997,
1006,
1047,
3145,
1010,
1058,
3643,
1007,
1063,
2709,
1997,
1006,
3145,
1010,
3643,
1010,
6270,
1007,
1025,
1065,
102,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java | MainClassFinder.doWithMainClasses | static <T> T doWithMainClasses(JarFile jarFile, String classesLocation,
MainClassCallback<T> callback) throws IOException {
List<JarEntry> classEntries = getClassEntries(jarFile, classesLocation);
classEntries.sort(new ClassEntryComparator());
for (JarEntry entry : classEntries) {
try (InputStream inputStre... | java | static <T> T doWithMainClasses(JarFile jarFile, String classesLocation,
MainClassCallback<T> callback) throws IOException {
List<JarEntry> classEntries = getClassEntries(jarFile, classesLocation);
classEntries.sort(new ClassEntryComparator());
for (JarEntry entry : classEntries) {
try (InputStream inputStre... | [
"static",
"<",
"T",
">",
"T",
"doWithMainClasses",
"(",
"JarFile",
"jarFile",
",",
"String",
"classesLocation",
",",
"MainClassCallback",
"<",
"T",
">",
"callback",
")",
"throws",
"IOException",
"{",
"List",
"<",
"JarEntry",
">",
"classEntries",
"=",
"getClass... | Perform the given callback operation on all main classes from the given jar.
@param <T> the result type
@param jarFile the jar file to search
@param classesLocation the location within the jar containing classes
@param callback the callback
@return the first callback result or {@code null}
@throws IOException in case o... | [
"Perform",
"the",
"given",
"callback",
"operation",
"on",
"all",
"main",
"classes",
"from",
"the",
"given",
"jar",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java#L217-L237 | train | Performs a callback on all main classes in the given jar file. | [
30522,
10763,
1026,
1056,
1028,
1056,
23268,
8939,
24238,
26266,
2229,
1006,
15723,
8873,
30524,
20850,
8684,
1026,
1056,
1028,
2655,
5963,
1007,
11618,
22834,
10288,
24422,
1063,
2862,
1026,
15723,
4765,
2854,
1028,
2465,
4765,
5134,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/convert/ConverterRegistry.java | ConverterRegistry.putCustom | public ConverterRegistry putCustom(Type type, Converter<?> converter) {
if (null == customConverterMap) {
synchronized (this) {
if (null == customConverterMap) {
customConverterMap = new ConcurrentHashMap<>();
}
}
}
customConverterMap.put(type, converter);
return this;
} | java | public ConverterRegistry putCustom(Type type, Converter<?> converter) {
if (null == customConverterMap) {
synchronized (this) {
if (null == customConverterMap) {
customConverterMap = new ConcurrentHashMap<>();
}
}
}
customConverterMap.put(type, converter);
return this;
} | [
"public",
"ConverterRegistry",
"putCustom",
"(",
"Type",
"type",
",",
"Converter",
"<",
"?",
">",
"converter",
")",
"{",
"if",
"(",
"null",
"==",
"customConverterMap",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"null",
"==",
"customConvert... | 登记自定义转换器
@param type 转换的目标类型
@param converter 转换器
@return {@link ConverterRegistry} | [
"登记自定义转换器"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/ConverterRegistry.java#L114-L124 | train | Adds a custom converter to the registry. | [
30522,
2270,
10463,
28849,
24063,
2854,
2404,
7874,
20389,
1006,
2828,
2828,
1010,
10463,
2121,
1026,
1029,
1028,
10463,
2121,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
7661,
8663,
16874,
2121,
2863,
2361,
1007,
1063,
25549,
1006,
2023,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-hbase/src/main/java/org/apache/flink/addons/hbase/HBaseTableSchema.java | HBaseTableSchema.addColumn | void addColumn(String family, String qualifier, Class<?> clazz) {
Preconditions.checkNotNull(family, "family name");
Preconditions.checkNotNull(qualifier, "qualifier name");
Preconditions.checkNotNull(clazz, "class type");
Map<String, TypeInformation<?>> qualifierMap = this.familyMap.get(family);
if (!HBaseR... | java | void addColumn(String family, String qualifier, Class<?> clazz) {
Preconditions.checkNotNull(family, "family name");
Preconditions.checkNotNull(qualifier, "qualifier name");
Preconditions.checkNotNull(clazz, "class type");
Map<String, TypeInformation<?>> qualifierMap = this.familyMap.get(family);
if (!HBaseR... | [
"void",
"addColumn",
"(",
"String",
"family",
",",
"String",
"qualifier",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"family",
",",
"\"family name\"",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"quali... | Adds a column defined by family, qualifier, and type to the table schema.
@param family the family name
@param qualifier the qualifier name
@param clazz the data type of the qualifier | [
"Adds",
"a",
"column",
"defined",
"by",
"family",
"qualifier",
"and",
"type",
"to",
"the",
"table",
"schema",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hbase/src/main/java/org/apache/flink/addons/hbase/HBaseTableSchema.java#L48-L65 | train | Adds a column to the table. | [
30522,
11675,
5587,
25778,
2819,
2078,
1006,
5164,
2155,
1010,
5164,
10981,
1010,
2465,
1026,
1029,
1028,
18856,
10936,
2480,
1007,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
17048,
11231,
3363,
1006,
2155,
1010,
1000,
2155,
2171,
1000,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronPOSTagger.java | PerceptronPOSTagger.learn | public boolean learn(String... wordTags)
{
String[] words = new String[wordTags.length];
String[] tags = new String[wordTags.length];
for (int i = 0; i < wordTags.length; i++)
{
String[] wordTag = wordTags[i].split("//");
words[i] = wordTag[0];
tag... | java | public boolean learn(String... wordTags)
{
String[] words = new String[wordTags.length];
String[] tags = new String[wordTags.length];
for (int i = 0; i < wordTags.length; i++)
{
String[] wordTag = wordTags[i].split("//");
words[i] = wordTag[0];
tag... | [
"public",
"boolean",
"learn",
"(",
"String",
"...",
"wordTags",
")",
"{",
"String",
"[",
"]",
"words",
"=",
"new",
"String",
"[",
"wordTags",
".",
"length",
"]",
";",
"String",
"[",
"]",
"tags",
"=",
"new",
"String",
"[",
"wordTags",
".",
"length",
"... | 在线学习
@param wordTags [单词]/[词性]数组
@return 是否学习成功(失败的原因是参数错误) | [
"在线学习"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronPOSTagger.java#L109-L120 | train | Learn a sequence of words and tags from a sequence of words. | [
30522,
2270,
22017,
20898,
4553,
1006,
5164,
1012,
1012,
1012,
2773,
15900,
2015,
1007,
1063,
5164,
1031,
1033,
2616,
1027,
2047,
5164,
1031,
2773,
15900,
2015,
1012,
3091,
1033,
1025,
5164,
1031,
1033,
22073,
1027,
2047,
5164,
1031,
2773,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java | ResourceManager.closeTaskManagerConnection | protected void closeTaskManagerConnection(final ResourceID resourceID, final Exception cause) {
taskManagerHeartbeatManager.unmonitorTarget(resourceID);
WorkerRegistration<WorkerType> workerRegistration = taskExecutors.remove(resourceID);
if (workerRegistration != null) {
log.info("Closing TaskExecutor conne... | java | protected void closeTaskManagerConnection(final ResourceID resourceID, final Exception cause) {
taskManagerHeartbeatManager.unmonitorTarget(resourceID);
WorkerRegistration<WorkerType> workerRegistration = taskExecutors.remove(resourceID);
if (workerRegistration != null) {
log.info("Closing TaskExecutor conne... | [
"protected",
"void",
"closeTaskManagerConnection",
"(",
"final",
"ResourceID",
"resourceID",
",",
"final",
"Exception",
"cause",
")",
"{",
"taskManagerHeartbeatManager",
".",
"unmonitorTarget",
"(",
"resourceID",
")",
";",
"WorkerRegistration",
"<",
"WorkerType",
">",
... | This method should be called by the framework once it detects that a currently registered
task executor has failed.
@param resourceID Id of the TaskManager that has failed.
@param cause The exception which cause the TaskManager failed. | [
"This",
"method",
"should",
"be",
"called",
"by",
"the",
"framework",
"once",
"it",
"detects",
"that",
"a",
"currently",
"registered",
"task",
"executor",
"has",
"failed",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java#L794-L812 | train | Closes the connection to the TaskManager. | [
30522,
5123,
11675,
9346,
19895,
24805,
4590,
8663,
2638,
7542,
1006,
2345,
7692,
3593,
7692,
3593,
1010,
2345,
6453,
3426,
1007,
1063,
4708,
24805,
4590,
22375,
19442,
24805,
4590,
1012,
4895,
8202,
15660,
7559,
18150,
1006,
7692,
3593,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/ConfigurationUtils.java | ConfigurationUtils.parseTempDirectories | @Nonnull
public static String[] parseTempDirectories(Configuration configuration) {
return splitPaths(configuration.getString(CoreOptions.TMP_DIRS));
} | java | @Nonnull
public static String[] parseTempDirectories(Configuration configuration) {
return splitPaths(configuration.getString(CoreOptions.TMP_DIRS));
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"[",
"]",
"parseTempDirectories",
"(",
"Configuration",
"configuration",
")",
"{",
"return",
"splitPaths",
"(",
"configuration",
".",
"getString",
"(",
"CoreOptions",
".",
"TMP_DIRS",
")",
")",
";",
"}"
] | Extracts the task manager directories for temporary files as defined by
{@link org.apache.flink.configuration.CoreOptions#TMP_DIRS}.
@param configuration configuration object
@return array of configured directories (in order) | [
"Extracts",
"the",
"task",
"manager",
"directories",
"for",
"temporary",
"files",
"as",
"defined",
"by",
"{",
"@link",
"org",
".",
"apache",
".",
"flink",
".",
"configuration",
".",
"CoreOptions#TMP_DIRS",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/ConfigurationUtils.java#L98-L101 | train | Parses the configuration string to get an array of temp directories. | [
30522,
1030,
2512,
11231,
3363,
2270,
10763,
5164,
1031,
1033,
11968,
13462,
6633,
17299,
7442,
16761,
3111,
1006,
9563,
9563,
1007,
1063,
2709,
3975,
15069,
2015,
1006,
9563,
1012,
4152,
18886,
3070,
1006,
4563,
7361,
9285,
1012,
1056,
873... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java | Kafka.properties | public Kafka properties(Properties properties) {
Preconditions.checkNotNull(properties);
if (this.kafkaProperties == null) {
this.kafkaProperties = new HashMap<>();
}
this.kafkaProperties.clear();
properties.forEach((k, v) -> this.kafkaProperties.put((String) k, (String) v));
return this;
} | java | public Kafka properties(Properties properties) {
Preconditions.checkNotNull(properties);
if (this.kafkaProperties == null) {
this.kafkaProperties = new HashMap<>();
}
this.kafkaProperties.clear();
properties.forEach((k, v) -> this.kafkaProperties.put((String) k, (String) v));
return this;
} | [
"public",
"Kafka",
"properties",
"(",
"Properties",
"properties",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"properties",
")",
";",
"if",
"(",
"this",
".",
"kafkaProperties",
"==",
"null",
")",
"{",
"this",
".",
"kafkaProperties",
"=",
"new",
"Has... | Sets the configuration properties for the Kafka consumer. Resets previously set properties.
@param properties The configuration properties for the Kafka consumer. | [
"Sets",
"the",
"configuration",
"properties",
"for",
"the",
"Kafka",
"consumer",
".",
"Resets",
"previously",
"set",
"properties",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java#L97-L105 | train | Sets the Kafka properties. | [
30522,
2270,
10556,
24316,
2050,
5144,
1006,
5144,
5144,
1007,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
17048,
11231,
3363,
1006,
5144,
1007,
1025,
2065,
1006,
2023,
1012,
10556,
24316,
9331,
18981,
8743,
3111,
1027,
1027,
19701,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/TaskMetricGroup.java | TaskMetricGroup.putVariables | @Override
protected void putVariables(Map<String, String> variables) {
variables.put(ScopeFormat.SCOPE_TASK_VERTEX_ID, vertexId.toString());
variables.put(ScopeFormat.SCOPE_TASK_NAME, taskName);
variables.put(ScopeFormat.SCOPE_TASK_ATTEMPT_ID, executionId.toString());
variables.put(ScopeFormat.SCOPE_TASK_ATTEM... | java | @Override
protected void putVariables(Map<String, String> variables) {
variables.put(ScopeFormat.SCOPE_TASK_VERTEX_ID, vertexId.toString());
variables.put(ScopeFormat.SCOPE_TASK_NAME, taskName);
variables.put(ScopeFormat.SCOPE_TASK_ATTEMPT_ID, executionId.toString());
variables.put(ScopeFormat.SCOPE_TASK_ATTEM... | [
"@",
"Override",
"protected",
"void",
"putVariables",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"variables",
")",
"{",
"variables",
".",
"put",
"(",
"ScopeFormat",
".",
"SCOPE_TASK_VERTEX_ID",
",",
"vertexId",
".",
"toString",
"(",
")",
")",
";",
"var... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/TaskMetricGroup.java#L174-L181 | train | Override this method to add variables to the scope. | [
30522,
1030,
2058,
15637,
5123,
11675,
2404,
10755,
19210,
2015,
1006,
4949,
1026,
5164,
1010,
5164,
1028,
10857,
1007,
1063,
10857,
1012,
2404,
1006,
9531,
14192,
4017,
1012,
9531,
1035,
4708,
1035,
19449,
1035,
8909,
1010,
19449,
3593,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | common/src/main/java/io/netty/util/internal/PlatformDependent.java | PlatformDependent.newFixedMpscQueue | public static <T> Queue<T> newFixedMpscQueue(int capacity) {
return hasUnsafe() ? new MpscArrayQueue<T>(capacity) : new MpscAtomicArrayQueue<T>(capacity);
} | java | public static <T> Queue<T> newFixedMpscQueue(int capacity) {
return hasUnsafe() ? new MpscArrayQueue<T>(capacity) : new MpscAtomicArrayQueue<T>(capacity);
} | [
"public",
"static",
"<",
"T",
">",
"Queue",
"<",
"T",
">",
"newFixedMpscQueue",
"(",
"int",
"capacity",
")",
"{",
"return",
"hasUnsafe",
"(",
")",
"?",
"new",
"MpscArrayQueue",
"<",
"T",
">",
"(",
"capacity",
")",
":",
"new",
"MpscAtomicArrayQueue",
"<",... | Create a new {@link Queue} which is safe to use for multiple producers (different threads) and a single
consumer (one thread!) with the given fixes {@code capacity}. | [
"Create",
"a",
"new",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/PlatformDependent.java#L881-L883 | train | Creates a new queue of the specified capacity. | [
30522,
2270,
10763,
1026,
1056,
1028,
24240,
1026,
1056,
1028,
2047,
23901,
25370,
2278,
4226,
5657,
1006,
20014,
3977,
1007,
1063,
2709,
2038,
4609,
3736,
7959,
1006,
1007,
1029,
2047,
12616,
10010,
9447,
4226,
5657,
1026,
1056,
1028,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.unSimplify | public void unSimplify()
{
if (sourceNode == null)
{
sourceNode = new MDAGNode(false);
equivalenceClassMDAGNodeHashMap = new HashMap<MDAGNode, MDAGNode>();
MDAGNode[] toNodeArray = new MDAGNode[mdagDataArray.length];
createMDAGNode(simplifiedSourceNode... | java | public void unSimplify()
{
if (sourceNode == null)
{
sourceNode = new MDAGNode(false);
equivalenceClassMDAGNodeHashMap = new HashMap<MDAGNode, MDAGNode>();
MDAGNode[] toNodeArray = new MDAGNode[mdagDataArray.length];
createMDAGNode(simplifiedSourceNode... | [
"public",
"void",
"unSimplify",
"(",
")",
"{",
"if",
"(",
"sourceNode",
"==",
"null",
")",
"{",
"sourceNode",
"=",
"new",
"MDAGNode",
"(",
"false",
")",
";",
"equivalenceClassMDAGNodeHashMap",
"=",
"new",
"HashMap",
"<",
"MDAGNode",
",",
"MDAGNode",
">",
"... | 解压缩 | [
"解压缩"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L779-L795 | train | UnSimplify the source node. | [
30522,
2270,
11675,
4895,
5332,
8737,
3669,
12031,
1006,
1007,
1063,
2065,
1006,
3120,
3630,
3207,
1027,
1027,
19701,
1007,
1063,
3120,
3630,
3207,
1027,
2047,
9108,
8490,
3630,
3207,
1006,
6270,
1007,
1025,
27841,
26266,
26876,
8490,
3630,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.copyToUnsafe | public final void copyToUnsafe(int offset, Object target, int targetPointer, int numBytes) {
final long thisPointer = this.address + offset;
if (thisPointer + numBytes > addressLimit) {
throw new IndexOutOfBoundsException(
String.format("offset=%d, numBytes=%d, address=%d",
offset, numBytes, this.add... | java | public final void copyToUnsafe(int offset, Object target, int targetPointer, int numBytes) {
final long thisPointer = this.address + offset;
if (thisPointer + numBytes > addressLimit) {
throw new IndexOutOfBoundsException(
String.format("offset=%d, numBytes=%d, address=%d",
offset, numBytes, this.add... | [
"public",
"final",
"void",
"copyToUnsafe",
"(",
"int",
"offset",
",",
"Object",
"target",
",",
"int",
"targetPointer",
",",
"int",
"numBytes",
")",
"{",
"final",
"long",
"thisPointer",
"=",
"this",
".",
"address",
"+",
"offset",
";",
"if",
"(",
"thisPointe... | Bulk copy method. Copies {@code numBytes} bytes to target unsafe object and pointer.
NOTE: This is a unsafe method, no check here, please be carefully.
@param offset The position where the bytes are started to be read from in this memory segment.
@param target The unsafe memory to copy the bytes to.
@param targetPoint... | [
"Bulk",
"copy",
"method",
".",
"Copies",
"{",
"@code",
"numBytes",
"}",
"bytes",
"to",
"target",
"unsafe",
"object",
"and",
"pointer",
".",
"NOTE",
":",
"This",
"is",
"a",
"unsafe",
"method",
"no",
"check",
"here",
"please",
"be",
"carefully",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L1285-L1293 | train | Copy the data from this buffer to the target object using unsafe access. | [
30522,
2270,
2345,
11675,
6100,
24826,
3619,
10354,
2063,
1006,
20014,
16396,
1010,
4874,
4539,
1010,
20014,
4539,
8400,
2121,
1010,
20014,
15903,
17250,
2015,
1007,
1063,
2345,
2146,
2023,
8400,
2121,
1027,
2023,
1012,
4769,
1009,
16396,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/tuple/Tuple6.java | Tuple6.copy | @Override
@SuppressWarnings("unchecked")
public Tuple6<T0, T1, T2, T3, T4, T5> copy() {
return new Tuple6<>(this.f0,
this.f1,
this.f2,
this.f3,
this.f4,
this.f5);
} | java | @Override
@SuppressWarnings("unchecked")
public Tuple6<T0, T1, T2, T3, T4, T5> copy() {
return new Tuple6<>(this.f0,
this.f1,
this.f2,
this.f3,
this.f4,
this.f5);
} | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Tuple6",
"<",
"T0",
",",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
">",
"copy",
"(",
")",
"{",
"return",
"new",
"Tuple6",
"<>",
"(",
"this",
".",
"f0",
",",
"... | Shallow tuple copy.
@return A new Tuple with the same fields as this. | [
"Shallow",
"tuple",
"copy",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/tuple/Tuple6.java#L232-L241 | train | Returns a copy of this tuple. | [
30522,
1030,
2058,
15637,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10722,
10814,
2575,
1026,
1056,
2692,
1010,
1056,
2487,
1010,
1056,
2475,
1010,
1056,
2509,
1010,
1056,
2549,
1010,
1056,
2629,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | client/src/main/java/com/networknt/client/Http2Client.java | Http2Client.createSSLContext | @SuppressWarnings("unchecked")
public static SSLContext createSSLContext(String trustedNamesGroupKey) throws IOException {
SSLContext sslContext = null;
KeyManager[] keyManagers = null;
Map<String, Object> tlsMap = (Map<String, Object>)ClientConfig.get().getMappedConfig().get(TLS);
if(t... | java | @SuppressWarnings("unchecked")
public static SSLContext createSSLContext(String trustedNamesGroupKey) throws IOException {
SSLContext sslContext = null;
KeyManager[] keyManagers = null;
Map<String, Object> tlsMap = (Map<String, Object>)ClientConfig.get().getMappedConfig().get(TLS);
if(t... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"SSLContext",
"createSSLContext",
"(",
"String",
"trustedNamesGroupKey",
")",
"throws",
"IOException",
"{",
"SSLContext",
"sslContext",
"=",
"null",
";",
"KeyManager",
"[",
"]",
"keyManagers",
"... | create ssl context using specified trustedName config
@param trustedNamesGroupKey - the trustedName config to be used
@return SSLContext
@throws IOException | [
"create",
"ssl",
"context",
"using",
"specified",
"trustedName",
"config"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/Http2Client.java#L421-L483 | train | Create an SSLContext for the specified trusted names group key. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
7020,
22499,
10111,
18413,
9005,
14540,
8663,
18209,
1006,
5164,
9480,
18442,
28745,
22107,
14839,
1007,
11618,
22834,
10288,
24422,
1063,
7020,
224... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/configuration/Instance.java | Instance.isNonprojective | public boolean isNonprojective()
{
for (int dep1 : goldDependencies.keySet())
{
int head1 = goldDependencies.get(dep1).headIndex;
for (int dep2 : goldDependencies.keySet())
{
int head2 = goldDependencies.get(dep2).headIndex;
if (hea... | java | public boolean isNonprojective()
{
for (int dep1 : goldDependencies.keySet())
{
int head1 = goldDependencies.get(dep1).headIndex;
for (int dep2 : goldDependencies.keySet())
{
int head2 = goldDependencies.get(dep2).headIndex;
if (hea... | [
"public",
"boolean",
"isNonprojective",
"(",
")",
"{",
"for",
"(",
"int",
"dep1",
":",
"goldDependencies",
".",
"keySet",
"(",
")",
")",
"{",
"int",
"head1",
"=",
"goldDependencies",
".",
"get",
"(",
"dep1",
")",
".",
"headIndex",
";",
"for",
"(",
"int... | Shows whether the tree to train is projective or not
@return true if the tree is non-projective | [
"Shows",
"whether",
"the",
"tree",
"to",
"train",
"is",
"projective",
"or",
"not"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/configuration/Instance.java#L84-L103 | train | Is the image nonprojective? | [
30522,
2270,
22017,
20898,
3475,
2239,
21572,
20614,
3512,
1006,
1007,
1063,
2005,
1006,
20014,
2139,
2361,
2487,
1024,
2751,
3207,
11837,
4181,
9243,
1012,
6309,
3388,
1006,
1007,
1007,
1063,
20014,
2132,
2487,
1027,
2751,
3207,
11837,
418... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/WorkbookUtil.java | WorkbookUtil.writeBook | public static void writeBook(Workbook book, OutputStream out) throws IORuntimeException {
try {
book.write(out);
} catch (IOException e) {
throw new IORuntimeException(e);
}
} | java | public static void writeBook(Workbook book, OutputStream out) throws IORuntimeException {
try {
book.write(out);
} catch (IOException e) {
throw new IORuntimeException(e);
}
} | [
"public",
"static",
"void",
"writeBook",
"(",
"Workbook",
"book",
",",
"OutputStream",
"out",
")",
"throws",
"IORuntimeException",
"{",
"try",
"{",
"book",
".",
"write",
"(",
"out",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new... | 将Excel Workbook刷出到输出流,不关闭流
@param book {@link Workbook}
@param out 输出流
@throws IORuntimeException IO异常
@since 3.2.0 | [
"将Excel",
"Workbook刷出到输出流,不关闭流"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/WorkbookUtil.java#L203-L209 | train | Writes a new file from a workbook to an output stream. | [
30522,
2270,
10763,
11675,
4339,
8654,
1006,
2147,
8654,
2338,
1010,
27852,
25379,
2041,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
3046,
1063,
2338,
1012,
4339,
1006,
2041,
1007,
1025,
1065,
4608,
1006,
22834,
10288,
24422,
1041,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java | SqlConnRunner.insert | public int insert(Connection conn, Entity record) throws SQLException {
checkConn(conn);
if(CollectionUtil.isEmpty(record)){
throw new SQLException("Empty entity provided!");
}
PreparedStatement ps = null;
try {
ps = dialect.psForInsert(conn, record);
return ps.executeUpdate();
} catch (SQ... | java | public int insert(Connection conn, Entity record) throws SQLException {
checkConn(conn);
if(CollectionUtil.isEmpty(record)){
throw new SQLException("Empty entity provided!");
}
PreparedStatement ps = null;
try {
ps = dialect.psForInsert(conn, record);
return ps.executeUpdate();
} catch (SQ... | [
"public",
"int",
"insert",
"(",
"Connection",
"conn",
",",
"Entity",
"record",
")",
"throws",
"SQLException",
"{",
"checkConn",
"(",
"conn",
")",
";",
"if",
"(",
"CollectionUtil",
".",
"isEmpty",
"(",
"record",
")",
")",
"{",
"throw",
"new",
"SQLException"... | 插入数据<br>
此方法不会关闭Connection
@param conn 数据库连接
@param record 记录
@return 插入行数
@throws SQLException SQL执行异常 | [
"插入数据<br",
">",
"此方法不会关闭Connection"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java#L95-L109 | train | Insert a new entity into the database. | [
30522,
2270,
20014,
19274,
1006,
4434,
9530,
2078,
1010,
9178,
2501,
1007,
11618,
29296,
10288,
24422,
1063,
4638,
8663,
2078,
1006,
9530,
2078,
1007,
1025,
2065,
1006,
3074,
21823,
2140,
1012,
2003,
6633,
13876,
2100,
1006,
2501,
1007,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/util/PropertiesUtil.java | PropertiesUtil.getBoolean | public static boolean getBoolean(Properties config, String key, boolean defaultValue) {
String val = config.getProperty(key);
if (val == null) {
return defaultValue;
} else {
return Boolean.parseBoolean(val);
}
} | java | public static boolean getBoolean(Properties config, String key, boolean defaultValue) {
String val = config.getProperty(key);
if (val == null) {
return defaultValue;
} else {
return Boolean.parseBoolean(val);
}
} | [
"public",
"static",
"boolean",
"getBoolean",
"(",
"Properties",
"config",
",",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"String",
"val",
"=",
"config",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
... | Get boolean from properties.
This method returns {@code true} iff the parsed value is "true".
@param config Properties
@param key key in Properties
@param defaultValue default value if value is not set
@return default or value of key | [
"Get",
"boolean",
"from",
"properties",
".",
"This",
"method",
"returns",
"{",
"@code",
"true",
"}",
"iff",
"the",
"parsed",
"value",
"is",
"true",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/PropertiesUtil.java#L102-L109 | train | Get a boolean value from a Properties object. | [
30522,
2270,
10763,
22017,
20898,
2131,
5092,
9890,
2319,
1006,
5144,
9530,
8873,
2290,
1010,
5164,
3145,
1010,
22017,
20898,
12398,
10175,
5657,
1007,
1063,
5164,
11748,
1027,
9530,
8873,
2290,
1012,
2131,
21572,
4842,
3723,
1006,
3145,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Range.java | Range.nextUncheck | private T nextUncheck() {
if (0 != this.index || false == this.includeStart) {
// 非第一个元素或不包含第一个元素增加步进
this.current = this.next;
if (null != this.current) {
this.next = safeStep(this.next);
}
}
index++;
return this.current;
} | java | private T nextUncheck() {
if (0 != this.index || false == this.includeStart) {
// 非第一个元素或不包含第一个元素增加步进
this.current = this.next;
if (null != this.current) {
this.next = safeStep(this.next);
}
}
index++;
return this.current;
} | [
"private",
"T",
"nextUncheck",
"(",
")",
"{",
"if",
"(",
"0",
"!=",
"this",
".",
"index",
"||",
"false",
"==",
"this",
".",
"includeStart",
")",
"{",
"// 非第一个元素或不包含第一个元素增加步进\r",
"this",
".",
"current",
"=",
"this",
".",
"next",
";",
"if",
"(",
"null",
... | 获取下一个元素,并将下下个元素准备好 | [
"获取下一个元素,并将下下个元素准备好"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Range.java#L129-L139 | train | Uncheck the next element. | [
30522,
2797,
1056,
2279,
4609,
5403,
3600,
1006,
1007,
1063,
2065,
1006,
1014,
999,
1027,
2023,
1012,
5950,
1064,
1064,
6270,
1027,
1027,
2023,
1012,
2950,
7559,
2102,
1007,
1063,
1013,
1013,
100,
100,
1740,
100,
1769,
100,
100,
1744,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.prettyHexDump | public static String prettyHexDump(ByteBuf buffer, int offset, int length) {
return HexUtil.prettyHexDump(buffer, offset, length);
} | java | public static String prettyHexDump(ByteBuf buffer, int offset, int length) {
return HexUtil.prettyHexDump(buffer, offset, length);
} | [
"public",
"static",
"String",
"prettyHexDump",
"(",
"ByteBuf",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"return",
"HexUtil",
".",
"prettyHexDump",
"(",
"buffer",
",",
"offset",
",",
"length",
")",
";",
"}"
] | Returns a multi-line hexadecimal dump of the specified {@link ByteBuf} that is easy to read by humans,
starting at the given {@code offset} using the given {@code length}. | [
"Returns",
"a",
"multi",
"-",
"line",
"hexadecimal",
"dump",
"of",
"the",
"specified",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L918-L920 | train | Pretty hex dump of a byte buffer. | [
30522,
2270,
10763,
5164,
3492,
5369,
2595,
8566,
8737,
1006,
24880,
8569,
2546,
17698,
1010,
20014,
16396,
1010,
20014,
3091,
1007,
1063,
2709,
2002,
2595,
21823,
2140,
1012,
3492,
5369,
2595,
8566,
8737,
1006,
17698,
1010,
16396,
1010,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/features/FeatureExtractor.java | FeatureExtractor.extractExtendedFeatures | private static Object[] extractExtendedFeatures(Configuration configuration, int length)
{
Object[] featureMap = new Object[length];
State state = configuration.state;
Sentence sentence = configuration.sentence;
int b0Position = 0;
int b1Position = 0;
int b2Position... | java | private static Object[] extractExtendedFeatures(Configuration configuration, int length)
{
Object[] featureMap = new Object[length];
State state = configuration.state;
Sentence sentence = configuration.sentence;
int b0Position = 0;
int b1Position = 0;
int b2Position... | [
"private",
"static",
"Object",
"[",
"]",
"extractExtendedFeatures",
"(",
"Configuration",
"configuration",
",",
"int",
"length",
")",
"{",
"Object",
"[",
"]",
"featureMap",
"=",
"new",
"Object",
"[",
"length",
"]",
";",
"State",
"state",
"=",
"configuration",
... | 根据特征模板为状态提取特征
@param configuration
@return
@throws Exception | [
"根据特征模板为状态提取特征"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/features/FeatureExtractor.java#L39-L557 | train | Extract the extended features from the configuration. | [
30522,
2797,
10763,
4874,
1031,
1033,
14817,
10288,
6528,
5732,
30524,
29491,
26994,
1027,
1014,
1025,
20014,
1038,
2475,
26994,
1027,
1014,
1025,
20014,
1055,
2692,
26994,
1027,
1014,
1025,
2146,
17917,
2099,
1027,
1014,
1025,
1013,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java | JSONObject.isNull | public boolean isNull(String name) {
Object value = this.nameValuePairs.get(name);
return value == null || value == NULL;
} | java | public boolean isNull(String name) {
Object value = this.nameValuePairs.get(name);
return value == null || value == NULL;
} | [
"public",
"boolean",
"isNull",
"(",
"String",
"name",
")",
"{",
"Object",
"value",
"=",
"this",
".",
"nameValuePairs",
".",
"get",
"(",
"name",
")",
";",
"return",
"value",
"==",
"null",
"||",
"value",
"==",
"NULL",
";",
"}"
] | Returns true if this object has no mapping for {@code name} or if it has a mapping
whose value is {@link #NULL}.
@param name the name of the property
@return true if this object has no mapping for {@code name} | [
"Returns",
"true",
"if",
"this",
"object",
"has",
"no",
"mapping",
"for",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java#L352-L355 | train | Checks if the value for the given name is null. | [
30522,
2270,
22017,
20898,
3475,
18083,
1006,
5164,
2171,
1007,
1063,
4874,
3643,
1027,
2023,
1012,
2171,
10175,
5657,
4502,
18894,
1012,
2131,
1006,
2171,
1007,
1025,
2709,
3643,
1027,
1027,
19701,
1064,
1064,
3643,
1027,
1027,
19701,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonKeyedStream.java | PythonKeyedStream.time_window | public PythonWindowedStream time_window(Time size, Time slide) {
return new PythonWindowedStream<TimeWindow>(this.stream.timeWindow(size, slide));
} | java | public PythonWindowedStream time_window(Time size, Time slide) {
return new PythonWindowedStream<TimeWindow>(this.stream.timeWindow(size, slide));
} | [
"public",
"PythonWindowedStream",
"time_window",
"(",
"Time",
"size",
",",
"Time",
"slide",
")",
"{",
"return",
"new",
"PythonWindowedStream",
"<",
"TimeWindow",
">",
"(",
"this",
".",
"stream",
".",
"timeWindow",
"(",
"size",
",",
"slide",
")",
")",
";",
... | A thin wrapper layer over {@link KeyedStream#timeWindow(Time, Time)}.
@param size The size of the window.
@return The python wrapper {@link PythonWindowedStream} | [
"A",
"thin",
"wrapper",
"layer",
"over",
"{",
"@link",
"KeyedStream#timeWindow",
"(",
"Time",
"Time",
")",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonKeyedStream.java#L74-L76 | train | Create a new time window stream. | [
30522,
2270,
18750,
11101,
15096,
21422,
2051,
1035,
3332,
1006,
2051,
2946,
1010,
2051,
7358,
1007,
1063,
2709,
2047,
18750,
11101,
15096,
21422,
1026,
2051,
11101,
5004,
1028,
1006,
2023,
1012,
5460,
1012,
2051,
11101,
5004,
1006,
2946,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java | SecureUtil.getCertificate | public static Certificate getCertificate(KeyStore keyStore, String alias) {
return KeyUtil.getCertificate(keyStore, alias);
} | java | public static Certificate getCertificate(KeyStore keyStore, String alias) {
return KeyUtil.getCertificate(keyStore, alias);
} | [
"public",
"static",
"Certificate",
"getCertificate",
"(",
"KeyStore",
"keyStore",
",",
"String",
"alias",
")",
"{",
"return",
"KeyUtil",
".",
"getCertificate",
"(",
"keyStore",
",",
"alias",
")",
";",
"}"
] | 获得 Certification
@param keyStore {@link KeyStore}
@param alias 别名
@return {@link Certificate} | [
"获得",
"Certification"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L388-L390 | train | Get a certificate from a key store and alias. | [
30522,
2270,
10763,
8196,
2131,
17119,
3775,
8873,
16280,
1006,
6309,
19277,
6309,
19277,
1010,
5164,
14593,
1007,
1063,
2709,
3145,
21823,
2140,
1012,
2131,
17119,
3775,
8873,
16280,
1006,
6309,
19277,
1010,
14593,
1007,
1025,
1065,
102,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/BinaryHashTable.java | BinaryHashTable.putBuildRow | public void putBuildRow(BaseRow row) throws IOException {
final int hashCode = hash(this.buildSideProjection.apply(row).hashCode(), 0);
// TODO: combine key projection and build side conversion to code gen.
insertIntoTable(originBuildSideSerializer.baseRowToBinary(row), hashCode);
} | java | public void putBuildRow(BaseRow row) throws IOException {
final int hashCode = hash(this.buildSideProjection.apply(row).hashCode(), 0);
// TODO: combine key projection and build side conversion to code gen.
insertIntoTable(originBuildSideSerializer.baseRowToBinary(row), hashCode);
} | [
"public",
"void",
"putBuildRow",
"(",
"BaseRow",
"row",
")",
"throws",
"IOException",
"{",
"final",
"int",
"hashCode",
"=",
"hash",
"(",
"this",
".",
"buildSideProjection",
".",
"apply",
"(",
"row",
")",
".",
"hashCode",
"(",
")",
",",
"0",
")",
";",
"... | Put a build side row to hash table. | [
"Put",
"a",
"build",
"side",
"row",
"to",
"hash",
"table",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/BinaryHashTable.java#L243-L247 | train | Put a build side row into the build side table. | [
30522,
2270,
11675,
2404,
8569,
4014,
22196,
2860,
1006,
2918,
10524,
5216,
1007,
11618,
22834,
10288,
24422,
1063,
2345,
20014,
23325,
16044,
1027,
23325,
1006,
2023,
1012,
16473,
5178,
21572,
20614,
3258,
1012,
6611,
1006,
5216,
1007,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HttpConnection.java | HttpConnection.openConnection | private URLConnection openConnection() throws IOException {
return (null == this.proxy) ? url.openConnection() : url.openConnection(this.proxy);
} | java | private URLConnection openConnection() throws IOException {
return (null == this.proxy) ? url.openConnection() : url.openConnection(this.proxy);
} | [
"private",
"URLConnection",
"openConnection",
"(",
")",
"throws",
"IOException",
"{",
"return",
"(",
"null",
"==",
"this",
".",
"proxy",
")",
"?",
"url",
".",
"openConnection",
"(",
")",
":",
"url",
".",
"openConnection",
"(",
"this",
".",
"proxy",
")",
... | 建立连接
@return {@link URLConnection}
@throws IOException | [
"建立连接"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpConnection.java#L523-L525 | train | Opens a connection to the URL. | [
30522,
2797,
24471,
22499,
10087,
7542,
2330,
8663,
2638,
7542,
1006,
1007,
11618,
22834,
10288,
24422,
1063,
2709,
1006,
19701,
1027,
1027,
2023,
1012,
24540,
1007,
1029,
24471,
2140,
1012,
2330,
8663,
2638,
7542,
1006,
1007,
1024,
24471,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java | Execution.allocateAndAssignSlotForExecution | public CompletableFuture<Execution> allocateAndAssignSlotForExecution(
SlotProvider slotProvider,
boolean queued,
LocationPreferenceConstraint locationPreferenceConstraint,
@Nonnull Set<AllocationID> allPreviousExecutionGraphAllocationIds,
Time allocationTimeout) throws IllegalExecutionStateException {
... | java | public CompletableFuture<Execution> allocateAndAssignSlotForExecution(
SlotProvider slotProvider,
boolean queued,
LocationPreferenceConstraint locationPreferenceConstraint,
@Nonnull Set<AllocationID> allPreviousExecutionGraphAllocationIds,
Time allocationTimeout) throws IllegalExecutionStateException {
... | [
"public",
"CompletableFuture",
"<",
"Execution",
">",
"allocateAndAssignSlotForExecution",
"(",
"SlotProvider",
"slotProvider",
",",
"boolean",
"queued",
",",
"LocationPreferenceConstraint",
"locationPreferenceConstraint",
",",
"@",
"Nonnull",
"Set",
"<",
"AllocationID",
">... | Allocates and assigns a slot obtained from the slot provider to the execution.
@param slotProvider to obtain a new slot from
@param queued if the allocation can be queued
@param locationPreferenceConstraint constraint for the location preferences
@param allPreviousExecutionGraphAllocationIds set with all previous allo... | [
"Allocates",
"and",
"assigns",
"a",
"slot",
"obtained",
"from",
"the",
"slot",
"provider",
"to",
"the",
"execution",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java#L478-L567 | train | Allocates a slot for the execution. | [
30522,
2270,
4012,
10814,
10880,
11263,
11244,
1026,
7781,
1028,
2035,
24755,
27058,
8943,
18719,
16206,
14540,
4140,
29278,
10288,
8586,
13700,
1006,
10453,
21572,
17258,
2121,
10453,
21572,
17258,
2121,
1010,
22017,
20898,
24240,
2094,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dictionary/CustomDictionary.java | CustomDictionary.isDicNeedUpdate | private static boolean isDicNeedUpdate(String mainPath, String path[])
{
if (HanLP.Config.IOAdapter != null &&
!HanLP.Config.IOAdapter.getClass().getName().contains("com.hankcs.hanlp.corpus.io.FileIOAdapter"))
{
return false;
}
String binPath = mainPath + Pred... | java | private static boolean isDicNeedUpdate(String mainPath, String path[])
{
if (HanLP.Config.IOAdapter != null &&
!HanLP.Config.IOAdapter.getClass().getName().contains("com.hankcs.hanlp.corpus.io.FileIOAdapter"))
{
return false;
}
String binPath = mainPath + Pred... | [
"private",
"static",
"boolean",
"isDicNeedUpdate",
"(",
"String",
"mainPath",
",",
"String",
"path",
"[",
"]",
")",
"{",
"if",
"(",
"HanLP",
".",
"Config",
".",
"IOAdapter",
"!=",
"null",
"&&",
"!",
"HanLP",
".",
"Config",
".",
"IOAdapter",
".",
"getClas... | 获取本地词典更新状态
@return true 表示本地词典比缓存文件新,需要删除缓存 | [
"获取本地词典更新状态"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/CustomDictionary.java#L377-L410 | train | is dic need update? | [
30522,
2797,
10763,
22017,
20898,
2003,
14808,
24045,
8566,
17299,
3686,
1006,
5164,
2364,
15069,
1010,
5164,
4130,
1031,
1033,
1007,
1063,
2065,
1006,
7658,
14277,
1012,
9530,
8873,
2290,
1012,
22834,
8447,
13876,
2121,
999,
1027,
19701,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.copy | public static long copy(FileInputStream in, FileOutputStream out) throws IORuntimeException {
Assert.notNull(in, "FileInputStream is null!");
Assert.notNull(out, "FileOutputStream is null!");
final FileChannel inChannel = in.getChannel();
final FileChannel outChannel = out.getChannel();
try {
ret... | java | public static long copy(FileInputStream in, FileOutputStream out) throws IORuntimeException {
Assert.notNull(in, "FileInputStream is null!");
Assert.notNull(out, "FileOutputStream is null!");
final FileChannel inChannel = in.getChannel();
final FileChannel outChannel = out.getChannel();
try {
ret... | [
"public",
"static",
"long",
"copy",
"(",
"FileInputStream",
"in",
",",
"FileOutputStream",
"out",
")",
"throws",
"IORuntimeException",
"{",
"Assert",
".",
"notNull",
"(",
"in",
",",
"\"FileInputStream is null!\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"out",
... | 拷贝文件流,使用NIO
@param in 输入
@param out 输出
@return 拷贝的字节数
@throws IORuntimeException IO异常 | [
"拷贝文件流,使用NIO"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L213-L225 | train | Copy a file from one stream to another. | [
30522,
2270,
10763,
2146,
6100,
1006,
5371,
2378,
18780,
21422,
1999,
1010,
5371,
5833,
18780,
21422,
2041,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
1999,
1010,
1000,
5371,
2378,
18780,
21422,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-shardingsphere | sharding-transaction/sharding-transaction-core/src/main/java/org/apache/shardingsphere/transaction/ShardingTransactionManagerEngine.java | ShardingTransactionManagerEngine.getTransactionManager | public ShardingTransactionManager getTransactionManager(final TransactionType transactionType) {
ShardingTransactionManager result = transactionManagerMap.get(transactionType);
if (TransactionType.LOCAL != transactionType) {
Preconditions.checkNotNull(result, "Cannot find transaction manager... | java | public ShardingTransactionManager getTransactionManager(final TransactionType transactionType) {
ShardingTransactionManager result = transactionManagerMap.get(transactionType);
if (TransactionType.LOCAL != transactionType) {
Preconditions.checkNotNull(result, "Cannot find transaction manager... | [
"public",
"ShardingTransactionManager",
"getTransactionManager",
"(",
"final",
"TransactionType",
"transactionType",
")",
"{",
"ShardingTransactionManager",
"result",
"=",
"transactionManagerMap",
".",
"get",
"(",
"transactionType",
")",
";",
"if",
"(",
"TransactionType",
... | Get sharding transaction manager.
@param transactionType transaction type
@return sharding transaction manager | [
"Get",
"sharding",
"transaction",
"manager",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-transaction/sharding-transaction-core/src/main/java/org/apache/shardingsphere/transaction/ShardingTransactionManagerEngine.java#L90-L96 | train | Gets the sharding transaction manager for the given transaction type. | [
30522,
2270,
21146,
17080,
3070,
6494,
3619,
18908,
3258,
24805,
4590,
2131,
6494,
3619,
18908,
3258,
24805,
4590,
1006,
2345,
12598,
13874,
12598,
13874,
1007,
1063,
21146,
17080,
3070,
6494,
3619,
18908,
3258,
24805,
4590,
2765,
1027,
12598... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/trie/datrie/MutableDoubleArrayTrieInteger.java | MutableDoubleArrayTrieInteger.prefixMatch | public List<String> prefixMatch(String prefix)
{
int curState = 1;
IntArrayList bytes = new IntArrayList(prefix.length() * 4);
for (int i = 0; i < prefix.length(); i++)
{
int codePoint = prefix.charAt(i);
if (curState < 1)
{
return ... | java | public List<String> prefixMatch(String prefix)
{
int curState = 1;
IntArrayList bytes = new IntArrayList(prefix.length() * 4);
for (int i = 0; i < prefix.length(); i++)
{
int codePoint = prefix.charAt(i);
if (curState < 1)
{
return ... | [
"public",
"List",
"<",
"String",
">",
"prefixMatch",
"(",
"String",
"prefix",
")",
"{",
"int",
"curState",
"=",
"1",
";",
"IntArrayList",
"bytes",
"=",
"new",
"IntArrayList",
"(",
"prefix",
".",
"length",
"(",
")",
"*",
"4",
")",
";",
"for",
"(",
"in... | 查询以prefix开头的所有键
@param prefix
@return | [
"查询以prefix开头的所有键"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/trie/datrie/MutableDoubleArrayTrieInteger.java#L462-L502 | train | Returns a list of strings that match the prefix. | [
30522,
2270,
2862,
1026,
5164,
1028,
17576,
18900,
2818,
1006,
5164,
17576,
1007,
1063,
20014,
12731,
12096,
3686,
1027,
1015,
1025,
20014,
2906,
9447,
9863,
27507,
1027,
2047,
20014,
2906,
9447,
9863,
1006,
17576,
1012,
3091,
1006,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.addStringInternal | private void addStringInternal(String str)
{
String prefixString = determineLongestPrefixInMDAG(str);
String suffixString = str.substring(prefixString.length());
//Retrive the data related to the first confluence node (a node with two or more incoming transitions)
//in the _transiti... | java | private void addStringInternal(String str)
{
String prefixString = determineLongestPrefixInMDAG(str);
String suffixString = str.substring(prefixString.length());
//Retrive the data related to the first confluence node (a node with two or more incoming transitions)
//in the _transiti... | [
"private",
"void",
"addStringInternal",
"(",
"String",
"str",
")",
"{",
"String",
"prefixString",
"=",
"determineLongestPrefixInMDAG",
"(",
"str",
")",
";",
"String",
"suffixString",
"=",
"str",
".",
"substring",
"(",
"prefixString",
".",
"length",
"(",
")",
"... | Adds a String to the MDAG (called by addString to do actual MDAG manipulation).
@param str the String to be added to the MDAG | [
"Adds",
"a",
"String",
"to",
"the",
"MDAG",
"(",
"called",
"by",
"addString",
"to",
"do",
"actual",
"MDAG",
"manipulation",
")",
"."
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L682-L712 | train | Add a string to the CRA | [
30522,
2797,
11675,
9909,
18886,
3070,
18447,
11795,
2389,
1006,
5164,
2358,
2099,
1007,
1063,
5164,
17576,
3367,
4892,
1027,
5646,
10052,
4355,
28139,
8873,
20303,
26876,
8490,
1006,
2358,
2099,
1007,
1025,
5164,
16809,
3367,
4892,
1027,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.getBinaryStr | public static String getBinaryStr(Number number) {
if (number instanceof Long) {
return Long.toBinaryString((Long) number);
} else if (number instanceof Integer) {
return Integer.toBinaryString((Integer) number);
} else {
return Long.toBinaryString(number.longValue());
}
} | java | public static String getBinaryStr(Number number) {
if (number instanceof Long) {
return Long.toBinaryString((Long) number);
} else if (number instanceof Integer) {
return Integer.toBinaryString((Integer) number);
} else {
return Long.toBinaryString(number.longValue());
}
} | [
"public",
"static",
"String",
"getBinaryStr",
"(",
"Number",
"number",
")",
"{",
"if",
"(",
"number",
"instanceof",
"Long",
")",
"{",
"return",
"Long",
".",
"toBinaryString",
"(",
"(",
"Long",
")",
"number",
")",
";",
"}",
"else",
"if",
"(",
"number",
... | 获得数字对应的二进制字符串
@param number 数字
@return 二进制字符串 | [
"获得数字对应的二进制字符串"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1477-L1485 | train | Returns the binary string representation of the given number. | [
30522,
2270,
10763,
5164,
2131,
21114,
24769,
16344,
1006,
2193,
2193,
1007,
1063,
2065,
1006,
2193,
6013,
11253,
2146,
1007,
1063,
2709,
2146,
1012,
28096,
5649,
3367,
4892,
1006,
1006,
2146,
1007,
2193,
1007,
1025,
1065,
2842,
2065,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ResourceCondition.java | ResourceCondition.getResourceOutcome | protected ConditionOutcome getResourceOutcome(ConditionContext context,
AnnotatedTypeMetadata metadata) {
List<String> found = new ArrayList<>();
for (String location : this.resourceLocations) {
Resource resource = context.getResourceLoader().getResource(location);
if (resource != null && resource.exists()... | java | protected ConditionOutcome getResourceOutcome(ConditionContext context,
AnnotatedTypeMetadata metadata) {
List<String> found = new ArrayList<>();
for (String location : this.resourceLocations) {
Resource resource = context.getResourceLoader().getResource(location);
if (resource != null && resource.exists()... | [
"protected",
"ConditionOutcome",
"getResourceOutcome",
"(",
"ConditionContext",
"context",
",",
"AnnotatedTypeMetadata",
"metadata",
")",
"{",
"List",
"<",
"String",
">",
"found",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"String",
"location",
":... | Check if one of the default resource locations actually exists.
@param context the condition context
@param metadata the annotation metadata
@return the condition outcome | [
"Check",
"if",
"one",
"of",
"the",
"default",
"resource",
"locations",
"actually",
"exists",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ResourceCondition.java#L77-L95 | train | Gets the resource outcome. | [
30522,
5123,
4650,
5833,
9006,
2063,
2131,
6072,
8162,
3401,
5833,
9006,
2063,
1006,
4650,
8663,
18209,
6123,
1010,
5754,
17287,
3064,
13874,
11368,
8447,
2696,
27425,
1007,
1063,
2862,
1026,
5164,
1028,
2179,
1027,
2047,
9140,
9863,
1026,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/ds/DSFactory.java | DSFactory.doCreate | private static DSFactory doCreate(Setting setting) {
try {
return new HikariDSFactory(setting);
} catch (NoClassDefFoundError e) {
// ignore
}
try {
return new DruidDSFactory(setting);
} catch (NoClassDefFoundError e) {
// ignore
}
try {
return new TomcatDSFactory(setting);
}... | java | private static DSFactory doCreate(Setting setting) {
try {
return new HikariDSFactory(setting);
} catch (NoClassDefFoundError e) {
// ignore
}
try {
return new DruidDSFactory(setting);
} catch (NoClassDefFoundError e) {
// ignore
}
try {
return new TomcatDSFactory(setting);
}... | [
"private",
"static",
"DSFactory",
"doCreate",
"(",
"Setting",
"setting",
")",
"{",
"try",
"{",
"return",
"new",
"HikariDSFactory",
"(",
"setting",
")",
";",
"}",
"catch",
"(",
"NoClassDefFoundError",
"e",
")",
"{",
"// ignore\r",
"}",
"try",
"{",
"return",
... | 创建数据源实现工厂<br>
此方法通过“试错”方式查找引入项目的连接池库,按照优先级寻找,一旦寻找到则创建对应的数据源工厂<br>
连接池优先级:Hikari > Druid > Tomcat > Dbcp > C3p0 > Hutool Pooled
@return 日志实现类
@since 4.1.3 | [
"创建数据源实现工厂<br",
">",
"此方法通过“试错”方式查找引入项目的连接池库,按照优先级寻找,一旦寻找到则创建对应的数据源工厂<br",
">",
"连接池优先级:Hikari",
">",
"Druid",
">",
"Tomcat",
">",
"Dbcp",
">",
"C3p0",
">",
"Hutool",
"Pooled"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/ds/DSFactory.java#L158-L187 | train | Creates a DSFactory object from the given setting. | [
30522,
2797,
10763,
16233,
21450,
9986,
29313,
1006,
4292,
4292,
1007,
1063,
3046,
1063,
2709,
2047,
7632,
20224,
5104,
21450,
1006,
4292,
1007,
1025,
1065,
4608,
1006,
2053,
26266,
3207,
4246,
28819,
2121,
29165,
1041,
1007,
1063,
1013,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/os/CommandLine.java | CommandLine.setEnvironmentVariables | public void setEnvironmentVariables(Map<String, String> environment) {
for (Map.Entry<String, String> entry : environment.entrySet()) {
setEnvironmentVariable(entry.getKey(), entry.getValue());
}
} | java | public void setEnvironmentVariables(Map<String, String> environment) {
for (Map.Entry<String, String> entry : environment.entrySet()) {
setEnvironmentVariable(entry.getKey(), entry.getValue());
}
} | [
"public",
"void",
"setEnvironmentVariables",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"environment",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"environment",
".",
"entrySet",
"(",
")",
")",
"{",
"... | Adds the specified environment variables.
@param environment the variables to add
@throws IllegalArgumentException if any value given is null (unsupported) | [
"Adds",
"the",
"specified",
"environment",
"variables",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/os/CommandLine.java#L61-L65 | train | Sets the environment variables. | [
30522,
2270,
11675,
2275,
2368,
21663,
2239,
3672,
10755,
19210,
2015,
1006,
4949,
1026,
5164,
1010,
5164,
1028,
4044,
1007,
1063,
2005,
1006,
4949,
1012,
4443,
1026,
5164,
1010,
5164,
1028,
4443,
1024,
4044,
1012,
4443,
13462,
1006,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/restore/RocksDBFullRestoreOperation.java | RocksDBFullRestoreOperation.restoreKeyGroupsInStateHandle | private void restoreKeyGroupsInStateHandle()
throws IOException, StateMigrationException, RocksDBException {
try {
currentStateHandleInStream = currentKeyGroupsStateHandle.openInputStream();
cancelStreamRegistry.registerCloseable(currentStateHandleInStream);
currentStateHandleInView = new DataInputViewStre... | java | private void restoreKeyGroupsInStateHandle()
throws IOException, StateMigrationException, RocksDBException {
try {
currentStateHandleInStream = currentKeyGroupsStateHandle.openInputStream();
cancelStreamRegistry.registerCloseable(currentStateHandleInStream);
currentStateHandleInView = new DataInputViewStre... | [
"private",
"void",
"restoreKeyGroupsInStateHandle",
"(",
")",
"throws",
"IOException",
",",
"StateMigrationException",
",",
"RocksDBException",
"{",
"try",
"{",
"currentStateHandleInStream",
"=",
"currentKeyGroupsStateHandle",
".",
"openInputStream",
"(",
")",
";",
"cance... | Restore one key groups state handle. | [
"Restore",
"one",
"key",
"groups",
"state",
"handle",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/restore/RocksDBFullRestoreOperation.java#L151-L164 | train | Restore the state handle of the current state. | [
30522,
2797,
11675,
9239,
14839,
17058,
11493,
9153,
2618,
11774,
2571,
1006,
1007,
11618,
22834,
10288,
24422,
1010,
2110,
4328,
29397,
10288,
24422,
1010,
5749,
18939,
10288,
24422,
1063,
3046,
1063,
14731,
12259,
11774,
19856,
21422,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/InMemoryPartition.java | InMemoryPartition.resetOverflowBuckets | public ArrayList<MemorySegment> resetOverflowBuckets() {
this.numOverflowSegments = 0;
this.nextOverflowBucket = 0;
ArrayList<MemorySegment> result = new ArrayList<MemorySegment>(this.overflowSegments.length);
for(int i = 0; i < this.overflowSegments.length; i++) {
if(this.overflowSegments[i] != null) {
... | java | public ArrayList<MemorySegment> resetOverflowBuckets() {
this.numOverflowSegments = 0;
this.nextOverflowBucket = 0;
ArrayList<MemorySegment> result = new ArrayList<MemorySegment>(this.overflowSegments.length);
for(int i = 0; i < this.overflowSegments.length; i++) {
if(this.overflowSegments[i] != null) {
... | [
"public",
"ArrayList",
"<",
"MemorySegment",
">",
"resetOverflowBuckets",
"(",
")",
"{",
"this",
".",
"numOverflowSegments",
"=",
"0",
";",
"this",
".",
"nextOverflowBucket",
"=",
"0",
";",
"ArrayList",
"<",
"MemorySegment",
">",
"result",
"=",
"new",
"ArrayLi... | resets overflow bucket counters and returns freed memory and should only be used for resizing
@return freed memory segments | [
"resets",
"overflow",
"bucket",
"counters",
"and",
"returns",
"freed",
"memory",
"and",
"should",
"only",
"be",
"used",
"for",
"resizing"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/InMemoryPartition.java#L176-L188 | train | Reset overflow buckets. | [
30522,
2270,
9140,
9863,
1026,
3638,
3366,
21693,
4765,
1028,
25141,
7840,
12314,
24204,
8454,
1006,
1007,
1063,
2023,
1012,
16371,
5302,
6299,
12314,
3366,
21693,
11187,
1027,
1014,
1025,
2023,
1012,
2279,
7840,
12314,
24204,
3388,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/GraphCsvReader.java | GraphCsvReader.edgeTypes | public <K, EV> Graph<K, NullValue, EV> edgeTypes(Class<K> vertexKey, Class<EV> edgeValue) {
if (edgeReader == null) {
throw new RuntimeException("The edge input file cannot be null!");
}
DataSet<Tuple3<K, K, EV>> edges = edgeReader
.types(vertexKey, vertexKey, edgeValue)
.name(GraphCsvReader.class.get... | java | public <K, EV> Graph<K, NullValue, EV> edgeTypes(Class<K> vertexKey, Class<EV> edgeValue) {
if (edgeReader == null) {
throw new RuntimeException("The edge input file cannot be null!");
}
DataSet<Tuple3<K, K, EV>> edges = edgeReader
.types(vertexKey, vertexKey, edgeValue)
.name(GraphCsvReader.class.get... | [
"public",
"<",
"K",
",",
"EV",
">",
"Graph",
"<",
"K",
",",
"NullValue",
",",
"EV",
">",
"edgeTypes",
"(",
"Class",
"<",
"K",
">",
"vertexKey",
",",
"Class",
"<",
"EV",
">",
"edgeValue",
")",
"{",
"if",
"(",
"edgeReader",
"==",
"null",
")",
"{",
... | Creates a Graph from CSV input with edge values, but without vertex values.
@param vertexKey the type of the vertex IDs
@param edgeValue the type of the edge values
@return a Graph where the edges are read from an edges CSV file (with values). | [
"Creates",
"a",
"Graph",
"from",
"CSV",
"input",
"with",
"edge",
"values",
"but",
"without",
"vertex",
"values",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/GraphCsvReader.java#L134-L145 | train | Reads the edge types from the CSV file. | [
30522,
2270,
1026,
1047,
1010,
23408,
1028,
10629,
1026,
1047,
1010,
19701,
10175,
5657,
30524,
19701,
999,
1000,
1007,
1025,
1065,
2951,
13462,
1026,
10722,
10814,
2509,
1026,
1047,
1010,
1047,
1010,
23408,
1028,
1028,
7926,
1027,
3341,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManagerRuntimeServices.java | ResourceManagerRuntimeServices.fromConfiguration | public static ResourceManagerRuntimeServices fromConfiguration(
ResourceManagerRuntimeServicesConfiguration configuration,
HighAvailabilityServices highAvailabilityServices,
ScheduledExecutor scheduledExecutor) throws Exception {
final SlotManagerConfiguration slotManagerConfiguration = configuration.getSlo... | java | public static ResourceManagerRuntimeServices fromConfiguration(
ResourceManagerRuntimeServicesConfiguration configuration,
HighAvailabilityServices highAvailabilityServices,
ScheduledExecutor scheduledExecutor) throws Exception {
final SlotManagerConfiguration slotManagerConfiguration = configuration.getSlo... | [
"public",
"static",
"ResourceManagerRuntimeServices",
"fromConfiguration",
"(",
"ResourceManagerRuntimeServicesConfiguration",
"configuration",
",",
"HighAvailabilityServices",
"highAvailabilityServices",
",",
"ScheduledExecutor",
"scheduledExecutor",
")",
"throws",
"Exception",
"{",... | -------------------- Static methods -------------------------------------- | [
"--------------------",
"Static",
"methods",
"--------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManagerRuntimeServices.java#L50-L70 | train | Creates a new instance of the ResourceManagerRuntimeServices class based on the given configuration. | [
30522,
2270,
10763,
7692,
24805,
4590,
15532,
7292,
8043,
7903,
2229,
2013,
8663,
8873,
27390,
3370,
1006,
7692,
24805,
4590,
15532,
7292,
8043,
7903,
2229,
8663,
8873,
27390,
3370,
9563,
1010,
2152,
12462,
11733,
8553,
8043,
7903,
2229,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryString.java | BinaryString.keyValue | public BinaryString keyValue(byte split1, byte split2, BinaryString keyName) {
ensureMaterialized();
if (keyName == null || keyName.getSizeInBytes() == 0) {
return null;
}
if (inFirstSegment() && keyName.inFirstSegment()) {
// position in byte
int byteIdx = 0;
// position of last split1
int lastS... | java | public BinaryString keyValue(byte split1, byte split2, BinaryString keyName) {
ensureMaterialized();
if (keyName == null || keyName.getSizeInBytes() == 0) {
return null;
}
if (inFirstSegment() && keyName.inFirstSegment()) {
// position in byte
int byteIdx = 0;
// position of last split1
int lastS... | [
"public",
"BinaryString",
"keyValue",
"(",
"byte",
"split1",
",",
"byte",
"split2",
",",
"BinaryString",
"keyName",
")",
"{",
"ensureMaterialized",
"(",
")",
";",
"if",
"(",
"keyName",
"==",
"null",
"||",
"keyName",
".",
"getSizeInBytes",
"(",
")",
"==",
"... | Parse target string as key-value string and
return the value matches key name.
If accept any null arguments, return null.
example:
keyvalue('k1=v1;k2=v2', ';', '=', 'k2') = 'v2'
keyvalue('k1:v1,k2:v2', ',', ':', 'k3') = NULL
@param split1 separator between key-value tuple.
@param split2 separator between key and val... | [
"Parse",
"target",
"string",
"as",
"key",
"-",
"value",
"string",
"and",
"return",
"the",
"value",
"matches",
"key",
"name",
".",
"If",
"accept",
"any",
"null",
"arguments",
"return",
"null",
".",
"example",
":",
"keyvalue",
"(",
"k1",
"=",
"v1",
";",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryString.java#L936-L965 | train | Returns the value of the first key in this segment split1 and split2 in this segment. | [
30522,
2270,
12441,
3367,
4892,
3145,
10175,
5657,
1006,
24880,
3975,
2487,
1010,
24880,
3975,
2475,
1010,
12441,
3367,
4892,
3145,
18442,
1007,
1063,
5676,
8585,
14482,
3550,
1006,
1007,
1025,
2065,
1006,
3145,
18442,
1027,
1027,
19701,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | handler/src/main/java/com/networknt/handler/Handler.java | Handler.getNext | public static HttpHandler getNext(HttpServerExchange httpServerExchange, HttpHandler next) throws Exception {
if (next != null) {
return next;
}
return getNext(httpServerExchange);
} | java | public static HttpHandler getNext(HttpServerExchange httpServerExchange, HttpHandler next) throws Exception {
if (next != null) {
return next;
}
return getNext(httpServerExchange);
} | [
"public",
"static",
"HttpHandler",
"getNext",
"(",
"HttpServerExchange",
"httpServerExchange",
",",
"HttpHandler",
"next",
")",
"throws",
"Exception",
"{",
"if",
"(",
"next",
"!=",
"null",
")",
"{",
"return",
"next",
";",
"}",
"return",
"getNext",
"(",
"httpSe... | Returns the instance of the next handler, or the given next param if it's not
null.
@param httpServerExchange
The current requests server exchange.
@param next
If not null, return this.
@return The next handler in the chain, or next if it's not null.
@throws Exception exception | [
"Returns",
"the",
"instance",
"of",
"the",
"next",
"handler",
"or",
"the",
"given",
"next",
"param",
"if",
"it",
"s",
"not",
"null",
"."
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/handler/src/main/java/com/networknt/handler/Handler.java#L295-L300 | train | Get the next handler. | [
30522,
2270,
10763,
8299,
11774,
3917,
2131,
2638,
18413,
1006,
16770,
2121,
28943,
2595,
22305,
2063,
16770,
2121,
28943,
2595,
22305,
2063,
1010,
8299,
11774,
3917,
2279,
1007,
11618,
6453,
1063,
2065,
1006,
2279,
999,
1027,
19701,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java | TypeExtractor.getForClass | public static <X> TypeInformation<X> getForClass(Class<X> clazz) {
final ArrayList<Type> typeHierarchy = new ArrayList<>();
typeHierarchy.add(clazz);
return new TypeExtractor().privateGetForClass(clazz, typeHierarchy);
} | java | public static <X> TypeInformation<X> getForClass(Class<X> clazz) {
final ArrayList<Type> typeHierarchy = new ArrayList<>();
typeHierarchy.add(clazz);
return new TypeExtractor().privateGetForClass(clazz, typeHierarchy);
} | [
"public",
"static",
"<",
"X",
">",
"TypeInformation",
"<",
"X",
">",
"getForClass",
"(",
"Class",
"<",
"X",
">",
"clazz",
")",
"{",
"final",
"ArrayList",
"<",
"Type",
">",
"typeHierarchy",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"typeHierarchy",
... | Creates type information from a given Class such as Integer, String[] or POJOs.
This method does not support ParameterizedTypes such as Tuples or complex type hierarchies.
In most cases {@link TypeExtractor#createTypeInfo(Type)} is the recommended method for type extraction
(a Class is a child of Type).
@param clazz ... | [
"Creates",
"type",
"information",
"from",
"a",
"given",
"Class",
"such",
"as",
"Integer",
"String",
"[]",
"or",
"POJOs",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java#L1636-L1640 | train | Get the type information for the given class. | [
30522,
2270,
10763,
1026,
1060,
1028,
2828,
2378,
14192,
3370,
1026,
1060,
1028,
2131,
29278,
26266,
1006,
2465,
1026,
1060,
1028,
18856,
10936,
2480,
1007,
1063,
2345,
9140,
9863,
1026,
2828,
1028,
2828,
4048,
6906,
29389,
1027,
2047,
9140... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerConfiguration.java | TaskManagerConfiguration.fromConfiguration | public static TaskManagerConfiguration fromConfiguration(Configuration configuration) {
int numberSlots = configuration.getInteger(TaskManagerOptions.NUM_TASK_SLOTS, 1);
if (numberSlots == -1) {
numberSlots = 1;
}
final String[] tmpDirPaths = ConfigurationUtils.parseTempDirectories(configuration);
final... | java | public static TaskManagerConfiguration fromConfiguration(Configuration configuration) {
int numberSlots = configuration.getInteger(TaskManagerOptions.NUM_TASK_SLOTS, 1);
if (numberSlots == -1) {
numberSlots = 1;
}
final String[] tmpDirPaths = ConfigurationUtils.parseTempDirectories(configuration);
final... | [
"public",
"static",
"TaskManagerConfiguration",
"fromConfiguration",
"(",
"Configuration",
"configuration",
")",
"{",
"int",
"numberSlots",
"=",
"configuration",
".",
"getInteger",
"(",
"TaskManagerOptions",
".",
"NUM_TASK_SLOTS",
",",
"1",
")",
";",
"if",
"(",
"num... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerConfiguration.java#L178-L292 | train | Creates a new TaskManagerConfiguration from the given configuration. | [
30522,
2270,
10763,
4708,
24805,
4590,
8663,
8873,
27390,
3370,
2013,
8663,
8873,
27390,
3370,
1006,
9563,
9563,
1007,
1063,
20014,
3616,
10994,
2015,
1027,
9563,
1012,
2131,
18447,
26320,
1006,
4708,
24805,
4590,
7361,
9285,
1012,
16371,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/AbstractKeyedStateBackend.java | AbstractKeyedStateBackend.getPartitionedState | @SuppressWarnings("unchecked")
@Override
public <N, S extends State> S getPartitionedState(
final N namespace,
final TypeSerializer<N> namespaceSerializer,
final StateDescriptor<S, ?> stateDescriptor) throws Exception {
checkNotNull(namespace, "Namespace");
if (lastName != null && lastName.equals(state... | java | @SuppressWarnings("unchecked")
@Override
public <N, S extends State> S getPartitionedState(
final N namespace,
final TypeSerializer<N> namespaceSerializer,
final StateDescriptor<S, ?> stateDescriptor) throws Exception {
checkNotNull(namespace, "Namespace");
if (lastName != null && lastName.equals(state... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"<",
"N",
",",
"S",
"extends",
"State",
">",
"S",
"getPartitionedState",
"(",
"final",
"N",
"namespace",
",",
"final",
"TypeSerializer",
"<",
"N",
">",
"namespaceSerializer",
",",
... | TODO: NOTE: This method does a lot of work caching / retrieving states just to update the namespace.
This method should be removed for the sake of namespaces being lazily fetched from the keyed
state backend, or being set on the state directly.
@see KeyedStateBackend | [
"TODO",
":",
"NOTE",
":",
"This",
"method",
"does",
"a",
"lot",
"of",
"work",
"caching",
"/",
"retrieving",
"states",
"just",
"to",
"update",
"the",
"namespace",
".",
"This",
"method",
"should",
"be",
"removed",
"for",
"the",
"sake",
"of",
"namespaces",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/AbstractKeyedStateBackend.java#L306-L336 | train | Get the partitioned state. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
1030,
2058,
15637,
2270,
1026,
1050,
1010,
1055,
8908,
2110,
1028,
1055,
2131,
19362,
3775,
3508,
2098,
9153,
2618,
1006,
2345,
1050,
3415,
15327,
1010,
2345,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java | TomcatServletWebServerFactory.setTomcatProtocolHandlerCustomizers | public void setTomcatProtocolHandlerCustomizers(
Collection<? extends TomcatProtocolHandlerCustomizer<?>> tomcatProtocolHandlerCustomizer) {
Assert.notNull(tomcatProtocolHandlerCustomizer,
"TomcatProtocolHandlerCustomizers must not be null");
this.tomcatProtocolHandlerCustomizers = new ArrayList<>(
tomca... | java | public void setTomcatProtocolHandlerCustomizers(
Collection<? extends TomcatProtocolHandlerCustomizer<?>> tomcatProtocolHandlerCustomizer) {
Assert.notNull(tomcatProtocolHandlerCustomizer,
"TomcatProtocolHandlerCustomizers must not be null");
this.tomcatProtocolHandlerCustomizers = new ArrayList<>(
tomca... | [
"public",
"void",
"setTomcatProtocolHandlerCustomizers",
"(",
"Collection",
"<",
"?",
"extends",
"TomcatProtocolHandlerCustomizer",
"<",
"?",
">",
">",
"tomcatProtocolHandlerCustomizer",
")",
"{",
"Assert",
".",
"notNull",
"(",
"tomcatProtocolHandlerCustomizer",
",",
"\"T... | Set {@link TomcatProtocolHandlerCustomizer}s that should be applied to the Tomcat
{@link Connector}. Calling this method will replace any existing customizers.
@param tomcatProtocolHandlerCustomizer the customizers to set
@since 2.2.0 | [
"Set",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java#L641-L647 | train | Sets the collection of TomcatProtocolHandlerCustomizers to use. | [
30522,
2270,
11675,
2275,
20389,
11266,
21572,
30524,
3419,
11266,
21572,
3406,
25778,
11774,
3917,
7874,
20389,
17629,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
3419,
11266,
21572,
3406,
25778,
11774,
3917,
7874,
20389,
17629,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/algorithm/ahocorasick/interval/IntervalNode.java | IntervalNode.findOverlaps | public List<Intervalable> findOverlaps(Intervalable interval)
{
List<Intervalable> overlaps = new ArrayList<Intervalable>();
if (this.point < interval.getStart())
{
// 右边找找
addToOverlaps(interval, overlaps, findOverlappingRanges(this.right, interval));
a... | java | public List<Intervalable> findOverlaps(Intervalable interval)
{
List<Intervalable> overlaps = new ArrayList<Intervalable>();
if (this.point < interval.getStart())
{
// 右边找找
addToOverlaps(interval, overlaps, findOverlappingRanges(this.right, interval));
a... | [
"public",
"List",
"<",
"Intervalable",
">",
"findOverlaps",
"(",
"Intervalable",
"interval",
")",
"{",
"List",
"<",
"Intervalable",
">",
"overlaps",
"=",
"new",
"ArrayList",
"<",
"Intervalable",
">",
"(",
")",
";",
"if",
"(",
"this",
".",
"point",
"<",
"... | 寻找与interval有重叠的区间
@param interval
@return | [
"寻找与interval有重叠的区间"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/algorithm/ahocorasick/interval/IntervalNode.java#L104-L130 | train | Find the overlapping intervals. | [
30522,
2270,
2862,
1026,
13483,
3085,
1028,
2424,
7840,
2721,
4523,
1006,
13483,
3085,
13483,
1007,
1063,
2862,
1026,
13483,
3085,
1028,
17702,
2015,
1027,
2047,
9140,
9863,
1026,
13483,
3085,
1028,
1006,
1007,
1025,
2065,
1006,
2023,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/DynaBean.java | DynaBean.safeGet | public <T> T safeGet(String fieldName){
try {
return get(fieldName);
} catch (Exception e) {
return null;
}
} | java | public <T> T safeGet(String fieldName){
try {
return get(fieldName);
} catch (Exception e) {
return null;
}
} | [
"public",
"<",
"T",
">",
"T",
"safeGet",
"(",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"get",
"(",
"fieldName",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"null",
";",
"}",
"}"
] | 获得字段对应值,获取异常返回{@code null}
@param <T> 属性值类型
@param fieldName 字段名
@return 字段值
@since 3.1.1 | [
"获得字段对应值,获取异常返回",
"{",
"@code",
"null",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/DynaBean.java#L99-L105 | train | Get a field from the underlying resource. | [
30522,
2270,
1026,
1056,
1028,
1056,
3647,
18150,
1006,
5164,
2492,
18442,
1007,
1063,
3046,
1063,
2709,
2131,
1006,
2492,
18442,
1007,
1025,
1065,
4608,
1006,
6453,
1041,
1007,
1063,
2709,
19701,
1025,
1065,
1065,
102,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java | LiveReloadServer.stop | public void stop() throws IOException {
synchronized (this.monitor) {
if (this.listenThread != null) {
closeAllConnections();
try {
this.executor.shutdown();
this.executor.awaitTermination(1, TimeUnit.MINUTES);
}
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
... | java | public void stop() throws IOException {
synchronized (this.monitor) {
if (this.listenThread != null) {
closeAllConnections();
try {
this.executor.shutdown();
this.executor.awaitTermination(1, TimeUnit.MINUTES);
}
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
... | [
"public",
"void",
"stop",
"(",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"this",
".",
"monitor",
")",
"{",
"if",
"(",
"this",
".",
"listenThread",
"!=",
"null",
")",
"{",
"closeAllConnections",
"(",
")",
";",
"try",
"{",
"this",
".",
"exe... | Gracefully stop the livereload server.
@throws IOException in case of I/O errors | [
"Gracefully",
"stop",
"the",
"livereload",
"server",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java#L166-L188 | train | Stop the monitor. | [
30522,
2270,
11675,
2644,
1006,
1007,
11618,
22834,
10288,
24422,
1063,
25549,
1006,
2023,
1012,
8080,
1007,
1063,
2065,
1006,
2023,
1012,
4952,
2705,
16416,
2094,
999,
1027,
19701,
1007,
1063,
2485,
8095,
8663,
2638,
22014,
1006,
1007,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/Router.java | Router.size | public int size() {
int ret = anyMethodRouter.size();
for (MethodlessRouter<T> router : routers.values()) {
ret += router.size();
}
return ret;
} | java | public int size() {
int ret = anyMethodRouter.size();
for (MethodlessRouter<T> router : routers.values()) {
ret += router.size();
}
return ret;
} | [
"public",
"int",
"size",
"(",
")",
"{",
"int",
"ret",
"=",
"anyMethodRouter",
".",
"size",
"(",
")",
";",
"for",
"(",
"MethodlessRouter",
"<",
"T",
">",
"router",
":",
"routers",
".",
"values",
"(",
")",
")",
"{",
"ret",
"+=",
"router",
".",
"size"... | Returns the number of routes in this router. | [
"Returns",
"the",
"number",
"of",
"routes",
"in",
"this",
"router",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/Router.java#L156-L164 | train | Returns the number of methods in this router. | [
30522,
2270,
20014,
2946,
1006,
1007,
1063,
20014,
2128,
2102,
1027,
2151,
11368,
6806,
22196,
19901,
1012,
2946,
1006,
1007,
1025,
2005,
1006,
4118,
3238,
22494,
3334,
1026,
1056,
1028,
2799,
2099,
1024,
2799,
2869,
1012,
5300,
1006,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoDS.java | MongoDS.buildMongoClientOptions | private Builder buildMongoClientOptions(Builder builder, String group) {
if (setting == null) {
return builder;
}
if (group == null) {
group = StrUtil.EMPTY;
} else {
group = group + StrUtil.DOT;
}
// 每个主机答应的连接数(每个主机的连接池大小),当连接池被用光时,会被阻塞住
Integer connectionsPerHost = setting.getInt(... | java | private Builder buildMongoClientOptions(Builder builder, String group) {
if (setting == null) {
return builder;
}
if (group == null) {
group = StrUtil.EMPTY;
} else {
group = group + StrUtil.DOT;
}
// 每个主机答应的连接数(每个主机的连接池大小),当连接池被用光时,会被阻塞住
Integer connectionsPerHost = setting.getInt(... | [
"private",
"Builder",
"buildMongoClientOptions",
"(",
"Builder",
"builder",
",",
"String",
"group",
")",
"{",
"if",
"(",
"setting",
"==",
"null",
")",
"{",
"return",
"builder",
";",
"}",
"if",
"(",
"group",
"==",
"null",
")",
"{",
"group",
"=",
"StrUtil"... | 构件MongoDB连接选项<br>
@param group 分组,当分组对应的选项不存在时会读取根选项,如果也不存在使用默认值
@return Builder | [
"构件MongoDB连接选项<br",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoDS.java#L338-L391 | train | Build the options for a MongoDB client. | [
30522,
2797,
12508,
3857,
8202,
3995,
20464,
11638,
7361,
9285,
1006,
12508,
12508,
1010,
5164,
2177,
1007,
1063,
2065,
1006,
4292,
1027,
1027,
19701,
1007,
1063,
2709,
12508,
1025,
1065,
2065,
1006,
2177,
1027,
1027,
19701,
1007,
1063,
217... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/convert/Convert.java | Convert.toDate | public static Date toDate(Object value, Date defaultValue) {
return convert(Date.class, value, defaultValue);
} | java | public static Date toDate(Object value, Date defaultValue) {
return convert(Date.class, value, defaultValue);
} | [
"public",
"static",
"Date",
"toDate",
"(",
"Object",
"value",
",",
"Date",
"defaultValue",
")",
"{",
"return",
"convert",
"(",
"Date",
".",
"class",
",",
"value",
",",
"defaultValue",
")",
";",
"}"
] | 转换为Date<br>
如果给定的值为空,或者转换失败,返回默认值<br>
转换失败不会报错
@param value 被转换的值
@param defaultValue 转换错误时的默认值
@return 结果
@since 4.1.6 | [
"转换为Date<br",
">",
"如果给定的值为空,或者转换失败,返回默认值<br",
">",
"转换失败不会报错"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java#L447-L449 | train | Converts value into a Date. | [
30522,
2270,
10763,
3058,
28681,
3686,
1006,
4874,
3643,
1010,
3058,
12398,
10175,
5657,
1007,
1063,
2709,
10463,
1006,
3058,
1012,
2465,
1010,
3643,
1010,
12398,
10175,
5657,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java | AbstractFilterRegistrationBean.setServletRegistrationBeans | public void setServletRegistrationBeans(
Collection<? extends ServletRegistrationBean<?>> servletRegistrationBeans) {
Assert.notNull(servletRegistrationBeans,
"ServletRegistrationBeans must not be null");
this.servletRegistrationBeans = new LinkedHashSet<>(servletRegistrationBeans);
} | java | public void setServletRegistrationBeans(
Collection<? extends ServletRegistrationBean<?>> servletRegistrationBeans) {
Assert.notNull(servletRegistrationBeans,
"ServletRegistrationBeans must not be null");
this.servletRegistrationBeans = new LinkedHashSet<>(servletRegistrationBeans);
} | [
"public",
"void",
"setServletRegistrationBeans",
"(",
"Collection",
"<",
"?",
"extends",
"ServletRegistrationBean",
"<",
"?",
">",
">",
"servletRegistrationBeans",
")",
"{",
"Assert",
".",
"notNull",
"(",
"servletRegistrationBeans",
",",
"\"ServletRegistrationBeans must n... | Set {@link ServletRegistrationBean}s that the filter will be registered against.
@param servletRegistrationBeans the Servlet registration beans | [
"Set",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java#L75-L80 | train | Sets the servlet registration beans. | [
30522,
2270,
11675,
4520,
2121,
2615,
7485,
2890,
24063,
8156,
4783,
6962,
1006,
3074,
1026,
1029,
8908,
14262,
2615,
7485,
2890,
24063,
8156,
4783,
2319,
1026,
1029,
1028,
1028,
14262,
2615,
7485,
2890,
24063,
8156,
4783,
6962,
1007,
1063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | client/src/main/java/com/networknt/client/ssl/APINameChecker.java | APINameChecker.verifyAndThrow | public static void verifyAndThrow(final String name, final X509Certificate cert) throws CertificateException{
if (!verify(name, cert)) {
throw new CertificateException("No name matching " + name + " found");
}
} | java | public static void verifyAndThrow(final String name, final X509Certificate cert) throws CertificateException{
if (!verify(name, cert)) {
throw new CertificateException("No name matching " + name + " found");
}
} | [
"public",
"static",
"void",
"verifyAndThrow",
"(",
"final",
"String",
"name",
",",
"final",
"X509Certificate",
"cert",
")",
"throws",
"CertificateException",
"{",
"if",
"(",
"!",
"verify",
"(",
"name",
",",
"cert",
")",
")",
"{",
"throw",
"new",
"Certificate... | Perform server identify check using given name and throw CertificateException if the check fails.
@param name
@param cert
@throws CertificateException | [
"Perform",
"server",
"identify",
"check",
"using",
"given",
"name",
"and",
"throw",
"CertificateException",
"if",
"the",
"check",
"fails",
"."
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/ssl/APINameChecker.java#L54-L58 | train | Verifies that a certificate matches the name and throws an exception if not. | [
30522,
2270,
10763,
11675,
20410,
5685,
2705,
10524,
1006,
2345,
5164,
2171,
1010,
2345,
1060,
12376,
2683,
17119,
3775,
30524,
1006,
1000,
2053,
2171,
9844,
1000,
1009,
2171,
1009,
1000,
2179,
1000,
1007,
1025,
1065,
1065,
102,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.isGeneral | public static boolean isGeneral(CharSequence value, int min, int max) {
String reg = "^\\w{" + min + "," + max + "}$";
if (min < 0) {
min = 0;
}
if (max <= 0) {
reg = "^\\w{" + min + ",}$";
}
return isMactchRegex(reg, value);
} | java | public static boolean isGeneral(CharSequence value, int min, int max) {
String reg = "^\\w{" + min + "," + max + "}$";
if (min < 0) {
min = 0;
}
if (max <= 0) {
reg = "^\\w{" + min + ",}$";
}
return isMactchRegex(reg, value);
} | [
"public",
"static",
"boolean",
"isGeneral",
"(",
"CharSequence",
"value",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"String",
"reg",
"=",
"\"^\\\\w{\"",
"+",
"min",
"+",
"\",\"",
"+",
"max",
"+",
"\"}$\"",
";",
"if",
"(",
"min",
"<",
"0",
")",
... | 验证是否为给定长度范围的英文字母 、数字和下划线
@param value 值
@param min 最小长度,负数自动识别为0
@param max 最大长度,0或负数表示不限制最大长度
@return 是否为给定长度范围的英文字母 、数字和下划线 | [
"验证是否为给定长度范围的英文字母",
"、数字和下划线"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L373-L382 | train | Checks if the given character sequence is a general sequence of characters. | [
30522,
2270,
10763,
22017,
20898,
2003,
6914,
21673,
1006,
25869,
3366,
4226,
5897,
3643,
1010,
20014,
8117,
1010,
20014,
4098,
1007,
1063,
5164,
19723,
1027,
1000,
1034,
1032,
1032,
1059,
1063,
1000,
1009,
8117,
1009,
1000,
1010,
1000,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java | Graph.outDegrees | public DataSet<Tuple2<K, LongValue>> outDegrees() {
return vertices.coGroup(edges).where(0).equalTo(0).with(new CountNeighborsCoGroup<>())
.name("Out-degree");
} | java | public DataSet<Tuple2<K, LongValue>> outDegrees() {
return vertices.coGroup(edges).where(0).equalTo(0).with(new CountNeighborsCoGroup<>())
.name("Out-degree");
} | [
"public",
"DataSet",
"<",
"Tuple2",
"<",
"K",
",",
"LongValue",
">",
">",
"outDegrees",
"(",
")",
"{",
"return",
"vertices",
".",
"coGroup",
"(",
"edges",
")",
".",
"where",
"(",
"0",
")",
".",
"equalTo",
"(",
"0",
")",
".",
"with",
"(",
"new",
"... | Return the out-degree of all vertices in the graph.
@return A DataSet of {@code Tuple2<vertexId, outDegree>} | [
"Return",
"the",
"out",
"-",
"degree",
"of",
"all",
"vertices",
"in",
"the",
"graph",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L926-L930 | train | Returns a DataSet of vertices that have out - degree values. | [
30522,
2270,
2951,
13462,
1026,
10722,
10814,
2475,
1026,
1047,
1010,
2146,
10175,
5657,
1028,
1028,
2041,
3207,
28637,
2015,
1006,
1007,
1063,
2709,
18984,
1012,
2522,
17058,
1006,
7926,
1007,
1012,
2073,
1006,
1014,
1007,
1012,
5020,
3406... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java | WebSocketServerHandshaker.selectSubprotocol | protected String selectSubprotocol(String requestedSubprotocols) {
if (requestedSubprotocols == null || subprotocols.length == 0) {
return null;
}
String[] requestedSubprotocolArray = requestedSubprotocols.split(",");
for (String p: requestedSubprotocolArray) {
S... | java | protected String selectSubprotocol(String requestedSubprotocols) {
if (requestedSubprotocols == null || subprotocols.length == 0) {
return null;
}
String[] requestedSubprotocolArray = requestedSubprotocols.split(",");
for (String p: requestedSubprotocolArray) {
S... | [
"protected",
"String",
"selectSubprotocol",
"(",
"String",
"requestedSubprotocols",
")",
"{",
"if",
"(",
"requestedSubprotocols",
"==",
"null",
"||",
"subprotocols",
".",
"length",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"String",
"[",
"]",
"requested... | Selects the first matching supported sub protocol
@param requestedSubprotocols
CSV of protocols to be supported. e.g. "chat, superchat"
@return First matching supported sub protocol. Null if not found. | [
"Selects",
"the",
"first",
"matching",
"supported",
"sub",
"protocol"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java#L341-L361 | train | Select the subprotocol for the current request. | [
30522,
5123,
5164,
27034,
12083,
21572,
3406,
25778,
1006,
5164,
7303,
6342,
2497,
21572,
3406,
25778,
2015,
1007,
1063,
2065,
1006,
7303,
6342,
2497,
21572,
3406,
25778,
2015,
1027,
1027,
19701,
1064,
1064,
4942,
21572,
3406,
25778,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/sampling/BernoulliSampler.java | BernoulliSampler.sample | @Override
public Iterator<T> sample(final Iterator<T> input) {
if (fraction == 0) {
return emptyIterable;
}
return new SampledIterator<T>() {
T current = null;
@Override
public boolean hasNext() {
if (current == null) {
current = getNextSampledElement();
}
return current != null;
... | java | @Override
public Iterator<T> sample(final Iterator<T> input) {
if (fraction == 0) {
return emptyIterable;
}
return new SampledIterator<T>() {
T current = null;
@Override
public boolean hasNext() {
if (current == null) {
current = getNextSampledElement();
}
return current != null;
... | [
"@",
"Override",
"public",
"Iterator",
"<",
"T",
">",
"sample",
"(",
"final",
"Iterator",
"<",
"T",
">",
"input",
")",
"{",
"if",
"(",
"fraction",
"==",
"0",
")",
"{",
"return",
"emptyIterable",
";",
"}",
"return",
"new",
"SampledIterator",
"<",
"T",
... | Sample the input elements, for each input element, take a Bernoulli trail for sampling.
@param input Elements to be sampled.
@return The sampled result which is lazy computed upon input elements. | [
"Sample",
"the",
"input",
"elements",
"for",
"each",
"input",
"element",
"take",
"a",
"Bernoulli",
"trail",
"for",
"sampling",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/sampling/BernoulliSampler.java#L82-L144 | train | Sample an iterator of elements from the input. | [
30522,
1030,
2058,
15637,
2270,
2009,
6906,
4263,
1026,
1056,
1028,
7099,
1006,
2345,
2009,
6906,
4263,
1026,
1056,
1028,
7953,
1007,
1063,
2065,
1006,
12884,
1027,
1027,
1014,
1007,
1063,
2709,
4064,
21646,
3085,
1025,
1065,
2709,
2047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.addAllIfNotContains | public static <T> List<T> addAllIfNotContains(List<T> list, List<T> otherList) {
for (T t : otherList) {
if (false == list.contains(t)) {
list.add(t);
}
}
return list;
} | java | public static <T> List<T> addAllIfNotContains(List<T> list, List<T> otherList) {
for (T t : otherList) {
if (false == list.contains(t)) {
list.add(t);
}
}
return list;
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"addAllIfNotContains",
"(",
"List",
"<",
"T",
">",
"list",
",",
"List",
"<",
"T",
">",
"otherList",
")",
"{",
"for",
"(",
"T",
"t",
":",
"otherList",
")",
"{",
"if",
"(",
"false",
"==",
... | 将另一个列表中的元素加入到列表中,如果列表中已经存在此元素则忽略之
@param <T> 集合元素类型
@param list 列表
@param otherList 其它列表
@return 此列表 | [
"将另一个列表中的元素加入到列表中,如果列表中已经存在此元素则忽略之"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1818-L1825 | train | Adds all elements from the otherList to the list if they do not already exist. | [
30522,
2270,
10763,
1026,
1056,
1028,
2862,
1026,
1056,
1028,
5587,
8095,
10128,
17048,
8663,
18249,
2015,
1006,
2862,
1026,
1056,
1028,
2862,
1010,
2862,
1026,
1056,
1028,
2060,
9863,
1007,
1063,
2005,
1006,
1056,
1056,
1024,
2060,
9863,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2StreamChannelBootstrap.java | Http2StreamChannelBootstrap.attr | @SuppressWarnings("unchecked")
public <T> Http2StreamChannelBootstrap attr(AttributeKey<T> key, T value) {
if (key == null) {
throw new NullPointerException("key");
}
if (value == null) {
synchronized (attrs) {
attrs.remove(key);
}
... | java | @SuppressWarnings("unchecked")
public <T> Http2StreamChannelBootstrap attr(AttributeKey<T> key, T value) {
if (key == null) {
throw new NullPointerException("key");
}
if (value == null) {
synchronized (attrs) {
attrs.remove(key);
}
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"Http2StreamChannelBootstrap",
"attr",
"(",
"AttributeKey",
"<",
"T",
">",
"key",
",",
"T",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPoi... | Allow to specify an initial attribute of the newly created {@link Http2StreamChannel}. If the {@code value} is
{@code null}, the attribute of the specified {@code key} is removed. | [
"Allow",
"to",
"specify",
"an",
"initial",
"attribute",
"of",
"the",
"newly",
"created",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2StreamChannelBootstrap.java#L77-L92 | train | Add an attribute to the attribute list. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
1026,
1056,
1028,
8299,
2475,
21422,
26058,
27927,
20528,
2361,
2012,
16344,
1006,
17961,
14839,
1026,
1056,
1028,
3145,
1010,
1056,
3643,
1007,
1063,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.valuesOfKeys | @SuppressWarnings("unchecked")
public static <K, V> ArrayList<V> valuesOfKeys(Map<K, V> map, K... keys) {
final ArrayList<V> values = new ArrayList<>();
for (K k : keys) {
values.add(map.get(k));
}
return values;
} | java | @SuppressWarnings("unchecked")
public static <K, V> ArrayList<V> valuesOfKeys(Map<K, V> map, K... keys) {
final ArrayList<V> values = new ArrayList<>();
for (K k : keys) {
values.add(map.get(k));
}
return values;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"K",
",",
"V",
">",
"ArrayList",
"<",
"V",
">",
"valuesOfKeys",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"K",
"...",
"keys",
")",
"{",
"final",
"ArrayList",
"<",
"... | 从Map中获取指定键列表对应的值列表<br>
如果key在map中不存在或key对应值为null,则返回值列表对应位置的值也为null
@param <K> 键类型
@param <V> 值类型
@param map {@link Map}
@param keys 键列表
@return 值列表
@since 3.0.8 | [
"从Map中获取指定键列表对应的值列表<br",
">",
"如果key在map中不存在或key对应值为null,则返回值列表对应位置的值也为null"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1975-L1982 | train | Returns an ArrayList of values of the specified keys in the specified map. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
1026,
1047,
1010,
1058,
1028,
9140,
9863,
1026,
1058,
1028,
5300,
11253,
14839,
2015,
1006,
4949,
1026,
1047,
1010,
1058,
1028,
4949,
1010,
1047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java | HandleHelper.handleRsToBeanList | public static <E, T extends Collection<E>> T handleRsToBeanList(ResultSet rs, T collection, Class<E> elementBeanType) throws SQLException {
final ResultSetMetaData meta = rs.getMetaData();
final int columnCount = meta.getColumnCount();
while (rs.next()) {
collection.add(handleRow(columnCount, meta, rs, e... | java | public static <E, T extends Collection<E>> T handleRsToBeanList(ResultSet rs, T collection, Class<E> elementBeanType) throws SQLException {
final ResultSetMetaData meta = rs.getMetaData();
final int columnCount = meta.getColumnCount();
while (rs.next()) {
collection.add(handleRow(columnCount, meta, rs, e... | [
"public",
"static",
"<",
"E",
",",
"T",
"extends",
"Collection",
"<",
"E",
">",
">",
"T",
"handleRsToBeanList",
"(",
"ResultSet",
"rs",
",",
"T",
"collection",
",",
"Class",
"<",
"E",
">",
"elementBeanType",
")",
"throws",
"SQLException",
"{",
"final",
"... | 处理多条数据并返回一个Bean列表
@param <E> 集合元素类型
@param <T> 集合类型
@param rs 数据集
@param collection 数据集
@param elementBeanType Bean类型
@return Entity列表
@throws SQLException SQL执行异常
@since 3.1.0 | [
"处理多条数据并返回一个Bean列表"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java#L188-L197 | train | Handles a ResultSet to a Collection of BeanObjects. | [
30522,
2270,
10763,
1026,
1041,
1010,
1056,
8908,
3074,
1026,
1041,
1028,
1028,
1056,
28213,
16033,
4783,
2319,
30524,
16671,
1027,
18804,
1012,
2131,
25778,
2819,
15305,
16671,
1006,
1007,
1025,
2096,
1006,
12667,
1012,
2279,
1006,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java | WebServiceTemplateBuilder.interceptors | public WebServiceTemplateBuilder interceptors(
Collection<? extends ClientInterceptor> interceptors) {
Assert.notNull(interceptors, "Interceptors must not be null");
return new WebServiceTemplateBuilder(this.detectHttpMessageSender,
append(Collections.<ClientInterceptor>emptySet(), interceptors),
this.in... | java | public WebServiceTemplateBuilder interceptors(
Collection<? extends ClientInterceptor> interceptors) {
Assert.notNull(interceptors, "Interceptors must not be null");
return new WebServiceTemplateBuilder(this.detectHttpMessageSender,
append(Collections.<ClientInterceptor>emptySet(), interceptors),
this.in... | [
"public",
"WebServiceTemplateBuilder",
"interceptors",
"(",
"Collection",
"<",
"?",
"extends",
"ClientInterceptor",
">",
"interceptors",
")",
"{",
"Assert",
".",
"notNull",
"(",
"interceptors",
",",
"\"Interceptors must not be null\"",
")",
";",
"return",
"new",
"WebS... | Set the {@link ClientInterceptor ClientInterceptors} that should be used with the
{@link WebServiceTemplate}. Setting this value will replace any previously defined
interceptors.
@param interceptors the interceptors to set
@return a new builder instance
@see #additionalInterceptors(Collection) | [
"Set",
"the",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java#L218-L226 | train | Create a new WebServiceTemplateBuilder with the specified interceptors. | [
30522,
2270,
4773,
8043,
7903,
12870,
8737,
13806,
8569,
23891,
2099,
24727,
2015,
1006,
3074,
1026,
1029,
8908,
7396,
18447,
2121,
3401,
13876,
2953,
1028,
24727,
2015,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
24727,
2015,
1010,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.isGreaterOrEqual | public static boolean isGreaterOrEqual(BigDecimal bigNum1, BigDecimal bigNum2) {
Assert.notNull(bigNum1);
Assert.notNull(bigNum2);
return bigNum1.compareTo(bigNum2) >= 0;
} | java | public static boolean isGreaterOrEqual(BigDecimal bigNum1, BigDecimal bigNum2) {
Assert.notNull(bigNum1);
Assert.notNull(bigNum2);
return bigNum1.compareTo(bigNum2) >= 0;
} | [
"public",
"static",
"boolean",
"isGreaterOrEqual",
"(",
"BigDecimal",
"bigNum1",
",",
"BigDecimal",
"bigNum2",
")",
"{",
"Assert",
".",
"notNull",
"(",
"bigNum1",
")",
";",
"Assert",
".",
"notNull",
"(",
"bigNum2",
")",
";",
"return",
"bigNum1",
".",
"compar... | 比较大小,参数1 >= 参数2 返回true
@param bigNum1 数字1
@param bigNum2 数字2
@return 是否大于等于
@since 3,0.9 | [
"比较大小,参数1",
">",
";",
"=",
"参数2",
"返回true"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1636-L1640 | train | Checks if the first argument is greater than or equal to the second argument. | [
30522,
2270,
10763,
22017,
20898,
2003,
17603,
24932,
5686,
26426,
1006,
2502,
3207,
6895,
9067,
2502,
19172,
2487,
1010,
2502,
3207,
6895,
9067,
2502,
19172,
2475,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
2502,
19172,
2487,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.split | public static <T> List<List<T>> split(Collection<T> collection, int size) {
final List<List<T>> result = new ArrayList<>();
ArrayList<T> subList = new ArrayList<>(size);
for (T t : collection) {
if (subList.size() >= size) {
result.add(subList);
subList = new ArrayList<>(size);
}
subLis... | java | public static <T> List<List<T>> split(Collection<T> collection, int size) {
final List<List<T>> result = new ArrayList<>();
ArrayList<T> subList = new ArrayList<>(size);
for (T t : collection) {
if (subList.size() >= size) {
result.add(subList);
subList = new ArrayList<>(size);
}
subLis... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"List",
"<",
"T",
">",
">",
"split",
"(",
"Collection",
"<",
"T",
">",
"collection",
",",
"int",
"size",
")",
"{",
"final",
"List",
"<",
"List",
"<",
"T",
">",
">",
"result",
"=",
"new",
"ArrayList"... | 对集合按照指定长度分段,每一个段为单独的集合,返回这个集合的列表
@param <T> 集合元素类型
@param collection 集合
@param size 每个段的长度
@return 分段列表 | [
"对集合按照指定长度分段,每一个段为单独的集合,返回这个集合的列表"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L907-L920 | train | Splits the given collection into smaller lists of lists of size. | [
30522,
2270,
10763,
1026,
1056,
1028,
2862,
1026,
2862,
1026,
1056,
1028,
1028,
3975,
1006,
3074,
1026,
1056,
1028,
3074,
1010,
20014,
2946,
1007,
1063,
2345,
2862,
1026,
2862,
1026,
1056,
1028,
1028,
2765,
1027,
2047,
9140,
9863,
1026,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/digest/DigestUtil.java | DigestUtil.sha1 | public static byte[] sha1(String data, String charset) {
return new Digester(DigestAlgorithm.SHA1).digest(data, charset);
} | java | public static byte[] sha1(String data, String charset) {
return new Digester(DigestAlgorithm.SHA1).digest(data, charset);
} | [
"public",
"static",
"byte",
"[",
"]",
"sha1",
"(",
"String",
"data",
",",
"String",
"charset",
")",
"{",
"return",
"new",
"Digester",
"(",
"DigestAlgorithm",
".",
"SHA1",
")",
".",
"digest",
"(",
"data",
",",
"charset",
")",
";",
"}"
] | 计算SHA-1摘要值
@param data 被摘要数据
@param charset 编码
@return SHA-1摘要 | [
"计算SHA",
"-",
"1摘要值"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/DigestUtil.java#L150-L152 | train | Returns the SHA1 digest of the given data. | [
30522,
2270,
10763,
24880,
1031,
1033,
21146,
2487,
1006,
5164,
2951,
1010,
5164,
25869,
13462,
1007,
1063,
2709,
2047,
17886,
2121,
1006,
17886,
2389,
20255,
8939,
2213,
1012,
21146,
2487,
1007,
1012,
17886,
1006,
2951,
1010,
25869,
13462,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandler.java | DefaultErrorWebExceptionHandler.getHttpStatus | protected HttpStatus getHttpStatus(Map<String, Object> errorAttributes) {
int statusCode = (int) errorAttributes.get("status");
return HttpStatus.valueOf(statusCode);
} | java | protected HttpStatus getHttpStatus(Map<String, Object> errorAttributes) {
int statusCode = (int) errorAttributes.get("status");
return HttpStatus.valueOf(statusCode);
} | [
"protected",
"HttpStatus",
"getHttpStatus",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"errorAttributes",
")",
"{",
"int",
"statusCode",
"=",
"(",
"int",
")",
"errorAttributes",
".",
"get",
"(",
"\"status\"",
")",
";",
"return",
"HttpStatus",
".",
"value... | Get the HTTP error status information from the error map.
@param errorAttributes the current error information
@return the error HTTP status | [
"Get",
"the",
"HTTP",
"error",
"status",
"information",
"from",
"the",
"error",
"map",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandler.java#L165-L168 | train | Get the http status from the error attributes. | [
30522,
5123,
16770,
29336,
2271,
2131,
11039,
25856,
9153,
5809,
1006,
4949,
1026,
5164,
1010,
4874,
1028,
7561,
19321,
3089,
8569,
4570,
1007,
1063,
20014,
3570,
16044,
1027,
1006,
20014,
1007,
7561,
19321,
3089,
8569,
4570,
1012,
2131,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java | AbsSetting.toBean | public Object toBean(final String group, Object bean) {
return BeanUtil.fillBean(bean, new ValueProvider<String>(){
@Override
public Object value(String key, Type valueType) {
final String value = getByGroup(key, group);
// if (null != value) {
// log.debug("Parse setting to object field [{}=... | java | public Object toBean(final String group, Object bean) {
return BeanUtil.fillBean(bean, new ValueProvider<String>(){
@Override
public Object value(String key, Type valueType) {
final String value = getByGroup(key, group);
// if (null != value) {
// log.debug("Parse setting to object field [{}=... | [
"public",
"Object",
"toBean",
"(",
"final",
"String",
"group",
",",
"Object",
"bean",
")",
"{",
"return",
"BeanUtil",
".",
"fillBean",
"(",
"bean",
",",
"new",
"ValueProvider",
"<",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Object",
"valu... | 将setting中的键值关系映射到对象中,原理是调用对象对应的set方法<br>
只支持基本类型的转换
@param group 分组
@param bean Bean对象
@return Bean | [
"将setting中的键值关系映射到对象中,原理是调用对象对应的set方法<br",
">",
"只支持基本类型的转换"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java#L264-L281 | train | Converts a map of data to a bean. | [
30522,
2270,
4874,
2000,
4783,
2319,
1006,
2345,
5164,
2177,
1010,
4874,
14068,
1007,
1063,
2709,
14068,
21823,
2140,
1012,
6039,
4783,
2319,
30524,
19701,
999,
1027,
3643,
1007,
1063,
1013,
1013,
8833,
1012,
2139,
8569,
2290,
1006,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java | ExecutionGraph.failGlobal | public void failGlobal(Throwable t) {
assertRunningInJobMasterMainThread();
while (true) {
JobStatus current = state;
// stay in these states
if (current == JobStatus.FAILING ||
current == JobStatus.SUSPENDED ||
current.isGloballyTerminalState()) {
return;
} else if (transitionState(curren... | java | public void failGlobal(Throwable t) {
assertRunningInJobMasterMainThread();
while (true) {
JobStatus current = state;
// stay in these states
if (current == JobStatus.FAILING ||
current == JobStatus.SUSPENDED ||
current.isGloballyTerminalState()) {
return;
} else if (transitionState(curren... | [
"public",
"void",
"failGlobal",
"(",
"Throwable",
"t",
")",
"{",
"assertRunningInJobMasterMainThread",
"(",
")",
";",
"while",
"(",
"true",
")",
"{",
"JobStatus",
"current",
"=",
"state",
";",
"// stay in these states",
"if",
"(",
"current",
"==",
"JobStatus",
... | Fails the execution graph globally. This failure will not be recovered by a specific
failover strategy, but results in a full restart of all tasks.
<p>This global failure is meant to be triggered in cases where the consistency of the
execution graph' state cannot be guaranteed any more (for example when catching unexp... | [
"Fails",
"the",
"execution",
"graph",
"globally",
".",
"This",
"failure",
"will",
"not",
"be",
"recovered",
"by",
"a",
"specific",
"failover",
"strategy",
"but",
"results",
"in",
"a",
"full",
"restart",
"of",
"all",
"tasks",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L1158-L1208 | train | Fail the global job. | [
30522,
2270,
11675,
8246,
23296,
16429,
2389,
1006,
5466,
3085,
1056,
1007,
1063,
20865,
15532,
5582,
2378,
5558,
25526,
24268,
24238,
2705,
16416,
2094,
1006,
1007,
1025,
2096,
1006,
2995,
1007,
1063,
5841,
29336,
2271,
2783,
1027,
2110,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBase.java | FlinkKafkaConsumerBase.setStartFromSpecificOffsets | public FlinkKafkaConsumerBase<T> setStartFromSpecificOffsets(Map<KafkaTopicPartition, Long> specificStartupOffsets) {
this.startupMode = StartupMode.SPECIFIC_OFFSETS;
this.startupOffsetsTimestamp = null;
this.specificStartupOffsets = checkNotNull(specificStartupOffsets);
return this;
} | java | public FlinkKafkaConsumerBase<T> setStartFromSpecificOffsets(Map<KafkaTopicPartition, Long> specificStartupOffsets) {
this.startupMode = StartupMode.SPECIFIC_OFFSETS;
this.startupOffsetsTimestamp = null;
this.specificStartupOffsets = checkNotNull(specificStartupOffsets);
return this;
} | [
"public",
"FlinkKafkaConsumerBase",
"<",
"T",
">",
"setStartFromSpecificOffsets",
"(",
"Map",
"<",
"KafkaTopicPartition",
",",
"Long",
">",
"specificStartupOffsets",
")",
"{",
"this",
".",
"startupMode",
"=",
"StartupMode",
".",
"SPECIFIC_OFFSETS",
";",
"this",
".",... | Specifies the consumer to start reading partitions from specific offsets, set independently for each partition.
The specified offset should be the offset of the next record that will be read from partitions.
This lets the consumer ignore any committed group offsets in Zookeeper / Kafka brokers.
<p>If the provided map ... | [
"Specifies",
"the",
"consumer",
"to",
"start",
"reading",
"partitions",
"from",
"specific",
"offsets",
"set",
"independently",
"for",
"each",
"partition",
".",
"The",
"specified",
"offset",
"should",
"be",
"the",
"offset",
"of",
"the",
"next",
"record",
"that",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBase.java#L463-L468 | train | Sets the startup offsets for the Kafka consumer. | [
30522,
2270,
13109,
19839,
2912,
24316,
22684,
3619,
17897,
28483,
3366,
1026,
1056,
1028,
4520,
7559,
24475,
21716,
13102,
8586,
18513,
27475,
8454,
1006,
4949,
1026,
10556,
24316,
10610,
24330,
19362,
3775,
3508,
1010,
2146,
1028,
3563,
141... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java | FlinkYarnSessionCli.repStep | private static boolean repStep(
BufferedReader in,
boolean readConsoleInput) throws IOException, InterruptedException {
// wait until CLIENT_POLLING_INTERVAL is over or the user entered something.
long startTime = System.currentTimeMillis();
while ((System.currentTimeMillis() - startTime) < CLIENT_POLLING_... | java | private static boolean repStep(
BufferedReader in,
boolean readConsoleInput) throws IOException, InterruptedException {
// wait until CLIENT_POLLING_INTERVAL is over or the user entered something.
long startTime = System.currentTimeMillis();
while ((System.currentTimeMillis() - startTime) < CLIENT_POLLING_... | [
"private",
"static",
"boolean",
"repStep",
"(",
"BufferedReader",
"in",
",",
"boolean",
"readConsoleInput",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"// wait until CLIENT_POLLING_INTERVAL is over or the user entered something.",
"long",
"startTime",
"=",
... | Read-Evaluate-Print step for the REPL.
@param in to read from
@param readConsoleInput true if console input has to be read
@return true if the REPL shall be continued, otherwise false
@throws IOException
@throws InterruptedException | [
"Read",
"-",
"Evaluate",
"-",
"Print",
"step",
"for",
"the",
"REPL",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java#L910-L940 | train | This method is called by the client thread to handle interactive session commands. | [
30522,
2797,
10763,
22017,
20898,
16360,
13473,
2361,
1006,
17698,
2098,
16416,
4063,
1999,
1010,
22017,
20898,
3191,
8663,
19454,
12377,
18780,
1007,
11618,
22834,
10288,
24422,
1010,
7153,
10288,
24422,
1063,
1013,
1013,
3524,
2127,
7396,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/builder/EqualsBuilder.java | EqualsBuilder.reflectionEquals | public static boolean reflectionEquals(final Object lhs, final Object rhs, final boolean testTransients, final Class<?> reflectUpToClass,
final String... excludeFields) {
if (lhs == rhs) {
return true;
}
if (lhs == null || rhs == null) {
return false;
... | java | public static boolean reflectionEquals(final Object lhs, final Object rhs, final boolean testTransients, final Class<?> reflectUpToClass,
final String... excludeFields) {
if (lhs == rhs) {
return true;
}
if (lhs == null || rhs == null) {
return false;
... | [
"public",
"static",
"boolean",
"reflectionEquals",
"(",
"final",
"Object",
"lhs",
",",
"final",
"Object",
"rhs",
",",
"final",
"boolean",
"testTransients",
",",
"final",
"Class",
"<",
"?",
">",
"reflectUpToClass",
",",
"final",
"String",
"...",
"excludeFields",
... | <p>This method uses reflection to determine if the two <code>Object</code>s
are equal.</p>
<p>It uses <code>AccessibleObject.setAccessible</code> to gain access to private
fields. This means that it will throw a security exception if run under
a security manager, if the permissions are not set up correctly. It is also... | [
"<p",
">",
"This",
"method",
"uses",
"reflection",
"to",
"determine",
"if",
"the",
"two",
"<code",
">",
"Object<",
"/",
"code",
">",
"s",
"are",
"equal",
".",
"<",
"/",
"p",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/builder/EqualsBuilder.java#L313-L364 | train | Checks if two objects are equal. | [
30522,
2270,
10763,
22017,
20898,
9185,
2063,
26426,
2015,
1006,
2345,
4874,
1048,
7898,
1010,
2345,
4874,
1054,
7898,
1010,
2345,
22017,
20898,
3231,
6494,
3619,
11638,
2015,
1010,
2345,
2465,
1026,
1029,
1028,
8339,
29441,
10085,
27102,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | handler/src/main/java/io/netty/handler/logging/LoggingHandler.java | LoggingHandler.format | protected String format(ChannelHandlerContext ctx, String eventName, Object arg) {
if (arg instanceof ByteBuf) {
return formatByteBuf(ctx, eventName, (ByteBuf) arg);
} else if (arg instanceof ByteBufHolder) {
return formatByteBufHolder(ctx, eventName, (ByteBufHolder) arg);
... | java | protected String format(ChannelHandlerContext ctx, String eventName, Object arg) {
if (arg instanceof ByteBuf) {
return formatByteBuf(ctx, eventName, (ByteBuf) arg);
} else if (arg instanceof ByteBufHolder) {
return formatByteBufHolder(ctx, eventName, (ByteBufHolder) arg);
... | [
"protected",
"String",
"format",
"(",
"ChannelHandlerContext",
"ctx",
",",
"String",
"eventName",
",",
"Object",
"arg",
")",
"{",
"if",
"(",
"arg",
"instanceof",
"ByteBuf",
")",
"{",
"return",
"formatByteBuf",
"(",
"ctx",
",",
"eventName",
",",
"(",
"ByteBuf... | Formats an event and returns the formatted message.
@param eventName the name of the event
@param arg the argument of the event | [
"Formats",
"an",
"event",
"and",
"returns",
"the",
"formatted",
"message",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/logging/LoggingHandler.java#L288-L296 | train | Format a message. | [
30522,
5123,
5164,
4289,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
5164,
2724,
18442,
1010,
4874,
12098,
2290,
1007,
1063,
2065,
1006,
12098,
2290,
6013,
11253,
24880,
8569,
2546,
1007,
1063,
2709,
4289,
3762,
2618,
8569,
254... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java | ExcelBase.getSheetNames | public List<String> getSheetNames() {
final int totalSheet = workbook.getNumberOfSheets();
List<String> result = new ArrayList<>(totalSheet);
for (int i = 0; i < totalSheet; i++) {
result.add(this.workbook.getSheetAt(i).getSheetName());
}
return result;
} | java | public List<String> getSheetNames() {
final int totalSheet = workbook.getNumberOfSheets();
List<String> result = new ArrayList<>(totalSheet);
for (int i = 0; i < totalSheet; i++) {
result.add(this.workbook.getSheetAt(i).getSheetName());
}
return result;
} | [
"public",
"List",
"<",
"String",
">",
"getSheetNames",
"(",
")",
"{",
"final",
"int",
"totalSheet",
"=",
"workbook",
".",
"getNumberOfSheets",
"(",
")",
";",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
"totalSheet",
")",
";"... | 获取表名列表
@return 表名列表
@since 4.0.3 | [
"获取表名列表"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java#L83-L90 | train | Gets the list of sheet names from the workbook. | [
30522,
2270,
2862,
1026,
5164,
1028,
4152,
21030,
2102,
18442,
2015,
1006,
1007,
1063,
2345,
20014,
21948,
21030,
2102,
1027,
2147,
8654,
1012,
2131,
19172,
5677,
11253,
4095,
15558,
2015,
1006,
1007,
1025,
2862,
1026,
5164,
1028,
2765,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/seg/common/Graph.java | Graph.parseResult | public static String parseResult(List<Vertex> path)
{
if (path.size() < 2)
{
throw new RuntimeException("路径节点数小于2:" + path);
}
StringBuffer sb = new StringBuffer();
for (int i = 1; i < path.size() - 1; ++i)
{
Vertex v = path.get(i);
... | java | public static String parseResult(List<Vertex> path)
{
if (path.size() < 2)
{
throw new RuntimeException("路径节点数小于2:" + path);
}
StringBuffer sb = new StringBuffer();
for (int i = 1; i < path.size() - 1; ++i)
{
Vertex v = path.get(i);
... | [
"public",
"static",
"String",
"parseResult",
"(",
"List",
"<",
"Vertex",
">",
"path",
")",
"{",
"if",
"(",
"path",
".",
"size",
"(",
")",
"<",
"2",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"路径节点数小于2:\" + path);",
"",
"",
"",
"",
"}",
"Str... | 从一个路径中转换出空格隔开的结果
@param path
@return | [
"从一个路径中转换出空格隔开的结果"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/common/Graph.java#L116-L131 | train | Parse result. | [
30522,
2270,
10763,
5164,
11968,
8043,
2229,
11314,
1006,
2862,
1026,
19449,
1028,
4130,
1007,
1063,
2065,
1006,
4130,
1012,
2946,
1006,
1007,
1026,
1016,
1007,
1063,
5466,
2047,
2448,
7292,
10288,
24422,
1006,
1000,
100,
100,
100,
100,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java | ExcelUtil.getReader | public static ExcelReader getReader(String bookFilePath, int sheetIndex) {
try {
return new ExcelReader(bookFilePath, sheetIndex);
} catch (NoClassDefFoundError e) {
throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG);
}
} | java | public static ExcelReader getReader(String bookFilePath, int sheetIndex) {
try {
return new ExcelReader(bookFilePath, sheetIndex);
} catch (NoClassDefFoundError e) {
throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG);
}
} | [
"public",
"static",
"ExcelReader",
"getReader",
"(",
"String",
"bookFilePath",
",",
"int",
"sheetIndex",
")",
"{",
"try",
"{",
"return",
"new",
"ExcelReader",
"(",
"bookFilePath",
",",
"sheetIndex",
")",
";",
"}",
"catch",
"(",
"NoClassDefFoundError",
"e",
")"... | 获取Excel读取器,通过调用{@link ExcelReader}的read或readXXX方法读取Excel内容
@param bookFilePath Excel文件路径,绝对路径或相对于ClassPath路径
@param sheetIndex sheet序号,0表示第一个sheet
@return {@link ExcelReader}
@since 3.1.1 | [
"获取Excel读取器,通过调用",
"{",
"@link",
"ExcelReader",
"}",
"的read或readXXX方法读取Excel内容"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java#L215-L221 | train | Returns an ExcelReader object for the specified sheet index. | [
30522,
2270,
10763,
24970,
16416,
4063,
2131,
16416,
4063,
1006,
5164,
2338,
8873,
2571,
15069,
1010,
20014,
7123,
22254,
10288,
1007,
1063,
3046,
1063,
2709,
2047,
24970,
16416,
4063,
1006,
2338,
8873,
2571,
15069,
1010,
7123,
22254,
10288,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java | UnsafeExternalSorter.getIterator | public UnsafeSorterIterator getIterator(int startIndex) throws IOException {
if (spillWriters.isEmpty()) {
assert(inMemSorter != null);
UnsafeSorterIterator iter = inMemSorter.getSortedIterator();
moveOver(iter, startIndex);
return iter;
} else {
LinkedList<UnsafeSorterIterator> qu... | java | public UnsafeSorterIterator getIterator(int startIndex) throws IOException {
if (spillWriters.isEmpty()) {
assert(inMemSorter != null);
UnsafeSorterIterator iter = inMemSorter.getSortedIterator();
moveOver(iter, startIndex);
return iter;
} else {
LinkedList<UnsafeSorterIterator> qu... | [
"public",
"UnsafeSorterIterator",
"getIterator",
"(",
"int",
"startIndex",
")",
"throws",
"IOException",
"{",
"if",
"(",
"spillWriters",
".",
"isEmpty",
"(",
")",
")",
"{",
"assert",
"(",
"inMemSorter",
"!=",
"null",
")",
";",
"UnsafeSorterIterator",
"iter",
"... | Returns an iterator starts from startIndex, which will return the rows in the order as
inserted.
It is the caller's responsibility to call `cleanupResources()`
after consuming this iterator.
TODO: support forced spilling | [
"Returns",
"an",
"iterator",
"starts",
"from",
"startIndex",
"which",
"will",
"return",
"the",
"rows",
"in",
"the",
"order",
"as",
"inserted",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java#L634-L658 | train | Get an iterator for the specified startIndex. | [
30522,
2270,
25135,
21748,
3334,
21646,
8844,
2131,
21646,
8844,
1006,
20014,
2707,
22254,
10288,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
14437,
15994,
2015,
1012,
2003,
6633,
13876,
2100,
1006,
1007,
1007,
1063,
20865,
1006,
1999... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/state/MapStateDescriptor.java | MapStateDescriptor.getKeySerializer | public TypeSerializer<UK> getKeySerializer() {
final TypeSerializer<Map<UK, UV>> rawSerializer = getSerializer();
if (!(rawSerializer instanceof MapSerializer)) {
throw new IllegalStateException("Unexpected serializer type.");
}
return ((MapSerializer<UK, UV>) rawSerializer).getKeySerializer();
} | java | public TypeSerializer<UK> getKeySerializer() {
final TypeSerializer<Map<UK, UV>> rawSerializer = getSerializer();
if (!(rawSerializer instanceof MapSerializer)) {
throw new IllegalStateException("Unexpected serializer type.");
}
return ((MapSerializer<UK, UV>) rawSerializer).getKeySerializer();
} | [
"public",
"TypeSerializer",
"<",
"UK",
">",
"getKeySerializer",
"(",
")",
"{",
"final",
"TypeSerializer",
"<",
"Map",
"<",
"UK",
",",
"UV",
">",
">",
"rawSerializer",
"=",
"getSerializer",
"(",
")",
";",
"if",
"(",
"!",
"(",
"rawSerializer",
"instanceof",
... | Gets the serializer for the keys in the state.
@return The serializer for the keys in the state. | [
"Gets",
"the",
"serializer",
"for",
"the",
"keys",
"in",
"the",
"state",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/state/MapStateDescriptor.java#L99-L106 | train | Get the key serializer. | [
30522,
2270,
4127,
11610,
28863,
1026,
2866,
1028,
2131,
14839,
8043,
4818,
17629,
1006,
1007,
1063,
2345,
4127,
11610,
28863,
1026,
4949,
1026,
2866,
1010,
23068,
1028,
1028,
6315,
8043,
4818,
17629,
1027,
4152,
11610,
28863,
1006,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java | AbstractErrorWebExceptionHandler.renderErrorView | protected Mono<ServerResponse> renderErrorView(String viewName,
ServerResponse.BodyBuilder responseBody, Map<String, Object> error) {
if (isTemplateAvailable(viewName)) {
return responseBody.render(viewName, error);
}
Resource resource = resolveResource(viewName);
if (resource != null) {
return respons... | java | protected Mono<ServerResponse> renderErrorView(String viewName,
ServerResponse.BodyBuilder responseBody, Map<String, Object> error) {
if (isTemplateAvailable(viewName)) {
return responseBody.render(viewName, error);
}
Resource resource = resolveResource(viewName);
if (resource != null) {
return respons... | [
"protected",
"Mono",
"<",
"ServerResponse",
">",
"renderErrorView",
"(",
"String",
"viewName",
",",
"ServerResponse",
".",
"BodyBuilder",
"responseBody",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"error",
")",
"{",
"if",
"(",
"isTemplateAvailable",
"(",
"... | Render the given error data as a view, using a template view if available or a
static HTML file if available otherwise. This will return an empty
{@code Publisher} if none of the above are available.
@param viewName the view name
@param responseBody the error response being built
@param error the error data as a map
@r... | [
"Render",
"the",
"given",
"error",
"data",
"as",
"a",
"view",
"using",
"a",
"template",
"view",
"if",
"available",
"or",
"a",
"static",
"HTML",
"file",
"if",
"available",
"otherwise",
".",
"This",
"will",
"return",
"an",
"empty",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java#L171-L181 | train | Render error view. | [
30522,
5123,
18847,
1026,
8241,
6072,
26029,
3366,
1028,
17552,
2121,
29165,
8584,
1006,
5164,
3193,
18442,
1010,
8241,
6072,
26029,
3366,
1012,
2303,
8569,
23891,
2099,
3433,
23684,
1010,
4949,
1026,
5164,
1010,
4874,
1028,
7561,
1007,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.