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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/bigram/WordNatureDependencyModel.java | WordNatureDependencyModel.getEdge | public Edge getEdge(Node from, Node to)
{
// 首先尝试词+词
Attribute attribute = get(from.compiledWord, to.compiledWord);
if (attribute == null) attribute = get(from.compiledWord, WordNatureWeightModelMaker.wrapTag(to.label));
if (attribute == null) attribute = get(WordNatureWeightModelMak... | java | public Edge getEdge(Node from, Node to)
{
// 首先尝试词+词
Attribute attribute = get(from.compiledWord, to.compiledWord);
if (attribute == null) attribute = get(from.compiledWord, WordNatureWeightModelMaker.wrapTag(to.label));
if (attribute == null) attribute = get(WordNatureWeightModelMak... | [
"public",
"Edge",
"getEdge",
"(",
"Node",
"from",
",",
"Node",
"to",
")",
"{",
"// 首先尝试词+词",
"Attribute",
"attribute",
"=",
"get",
"(",
"from",
".",
"compiledWord",
",",
"to",
".",
"compiledWord",
")",
";",
"if",
"(",
"attribute",
"==",
"null",
")",
"a... | 打分
@param from
@param to
@return | [
"打分"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/bigram/WordNatureDependencyModel.java#L171-L187 | train | Get edge from two nodes. | [
30522,
2270,
3341,
2131,
24225,
1006,
13045,
2013,
1010,
13045,
2000,
1007,
1063,
1013,
1013,
100,
100,
100,
100,
100,
1009,
100,
17961,
17961,
1027,
2131,
1006,
2013,
1012,
9227,
18351,
1010,
2000,
1012,
9227,
18351,
1007,
1025,
2065,
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 | transport/src/main/java/io/netty/channel/nio/AbstractNioChannel.java | AbstractNioChannel.newDirectBuffer | protected final ByteBuf newDirectBuffer(ByteBuf buf) {
final int readableBytes = buf.readableBytes();
if (readableBytes == 0) {
ReferenceCountUtil.safeRelease(buf);
return Unpooled.EMPTY_BUFFER;
}
final ByteBufAllocator alloc = alloc();
if (alloc.isDirect... | java | protected final ByteBuf newDirectBuffer(ByteBuf buf) {
final int readableBytes = buf.readableBytes();
if (readableBytes == 0) {
ReferenceCountUtil.safeRelease(buf);
return Unpooled.EMPTY_BUFFER;
}
final ByteBufAllocator alloc = alloc();
if (alloc.isDirect... | [
"protected",
"final",
"ByteBuf",
"newDirectBuffer",
"(",
"ByteBuf",
"buf",
")",
"{",
"final",
"int",
"readableBytes",
"=",
"buf",
".",
"readableBytes",
"(",
")",
";",
"if",
"(",
"readableBytes",
"==",
"0",
")",
"{",
"ReferenceCountUtil",
".",
"safeRelease",
... | Returns an off-heap copy of the specified {@link ByteBuf}, and releases the original one.
Note that this method does not create an off-heap copy if the allocation / deallocation cost is too high,
but just returns the original {@link ByteBuf}.. | [
"Returns",
"an",
"off",
"-",
"heap",
"copy",
"of",
"the",
"specified",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/nio/AbstractNioChannel.java#L439-L463 | train | Creates a direct buffer for the specified byte buffer. | [
30522,
5123,
2345,
24880,
8569,
2546,
2047,
4305,
2890,
6593,
8569,
12494,
1006,
24880,
8569,
2546,
20934,
2546,
1007,
1063,
2345,
20014,
3191,
3085,
3762,
4570,
1027,
20934,
2546,
1012,
3191,
3085,
3762,
4570,
1006,
1007,
1025,
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... |
networknt/light-4j | metrics/src/main/java/io/dropwizard/metrics/InstrumentedExecutors.java | InstrumentedExecutors.newSingleThreadExecutor | public static InstrumentedExecutorService newSingleThreadExecutor(
ThreadFactory threadFactory, MetricRegistry registry) {
return new InstrumentedExecutorService(Executors.newSingleThreadExecutor(threadFactory), registry);
} | java | public static InstrumentedExecutorService newSingleThreadExecutor(
ThreadFactory threadFactory, MetricRegistry registry) {
return new InstrumentedExecutorService(Executors.newSingleThreadExecutor(threadFactory), registry);
} | [
"public",
"static",
"InstrumentedExecutorService",
"newSingleThreadExecutor",
"(",
"ThreadFactory",
"threadFactory",
",",
"MetricRegistry",
"registry",
")",
"{",
"return",
"new",
"InstrumentedExecutorService",
"(",
"Executors",
".",
"newSingleThreadExecutor",
"(",
"threadFact... | Creates an InstrumentedExecutor that uses a single worker thread operating
off an unbounded queue, and uses the provided ThreadFactory to
create a new thread when needed. Unlike the otherwise
equivalent {@code newFixedThreadPool(1, threadFactory)} the
returned executor is guaranteed not to be reconfigurable to use
addi... | [
"Creates",
"an",
"InstrumentedExecutor",
"that",
"uses",
"a",
"single",
"worker",
"thread",
"operating",
"off",
"an",
"unbounded",
"queue",
"and",
"uses",
"the",
"provided",
"ThreadFactory",
"to",
"create",
"a",
"new",
"thread",
"when",
"needed",
".",
"Unlike",
... | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/metrics/src/main/java/io/dropwizard/metrics/InstrumentedExecutors.java#L211-L214 | train | Create a new single thread executor. | [
30522,
2270,
10763,
6602,
14728,
2595,
8586,
16161,
22573,
2099,
7903,
2063,
2739,
2075,
7485,
28362,
9648,
2595,
8586,
16161,
2099,
1006,
11689,
21450,
11689,
21450,
1010,
12046,
2890,
24063,
2854,
15584,
1007,
1063,
2709,
2047,
6602,
14728,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/IterativeStream.java | IterativeStream.withFeedbackType | public <F> ConnectedIterativeStreams<T, F> withFeedbackType(TypeHint<F> feedbackTypeHint) {
return withFeedbackType(TypeInformation.of(feedbackTypeHint));
} | java | public <F> ConnectedIterativeStreams<T, F> withFeedbackType(TypeHint<F> feedbackTypeHint) {
return withFeedbackType(TypeInformation.of(feedbackTypeHint));
} | [
"public",
"<",
"F",
">",
"ConnectedIterativeStreams",
"<",
"T",
",",
"F",
">",
"withFeedbackType",
"(",
"TypeHint",
"<",
"F",
">",
"feedbackTypeHint",
")",
"{",
"return",
"withFeedbackType",
"(",
"TypeInformation",
".",
"of",
"(",
"feedbackTypeHint",
")",
")",... | Changes the feedback type of the iteration and allows the user to apply
co-transformations on the input and feedback stream, as in a
{@link ConnectedStreams}.
<p>For type safety the user needs to define the feedback type
@param feedbackTypeHint
Class of the elements in the feedback stream.
@return A {@link ConnectedI... | [
"Changes",
"the",
"feedback",
"type",
"of",
"the",
"iteration",
"and",
"allows",
"the",
"user",
"to",
"apply",
"co",
"-",
"transformations",
"on",
"the",
"input",
"and",
"feedback",
"stream",
"as",
"in",
"a",
"{",
"@link",
"ConnectedStreams",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/IterativeStream.java#L108-L110 | train | Sets the feedback type of the connected iterators. | [
30522,
2270,
1026,
1042,
1028,
4198,
21646,
8082,
21422,
2015,
1026,
1056,
1010,
1042,
1028,
2007,
7959,
2098,
5963,
13874,
1006,
2828,
10606,
2102,
1026,
1042,
1028,
12247,
13874,
10606,
2102,
1007,
1063,
2709,
2007,
7959,
2098,
5963,
1387... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
redisson/redisson | redisson/src/main/java/org/redisson/misc/HighwayHash.java | HighwayHash.update | public void update(long a0, long a1, long a2, long a3) {
if (done) {
throw new IllegalStateException("Can compute a hash only once per instance");
}
v1[0] += mul0[0] + a0;
v1[1] += mul0[1] + a1;
v1[2] += mul0[2] + a2;
v1[3] += mul0[3] + a3;
for (int i = 0; i < 4; ++i) {
mul0[i] ^... | java | public void update(long a0, long a1, long a2, long a3) {
if (done) {
throw new IllegalStateException("Can compute a hash only once per instance");
}
v1[0] += mul0[0] + a0;
v1[1] += mul0[1] + a1;
v1[2] += mul0[2] + a2;
v1[3] += mul0[3] + a3;
for (int i = 0; i < 4; ++i) {
mul0[i] ^... | [
"public",
"void",
"update",
"(",
"long",
"a0",
",",
"long",
"a1",
",",
"long",
"a2",
",",
"long",
"a3",
")",
"{",
"if",
"(",
"done",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Can compute a hash only once per instance\"",
")",
";",
"}",
"v1... | Updates the hash with 32 bytes of data given as 4 longs. This function is
more efficient than updatePacket when you can use it.
@param a0 first 8 bytes in little endian 64-bit long
@param a1 next 8 bytes in little endian 64-bit long
@param a2 next 8 bytes in little endian 64-bit long
@param a3 last 8 bytes in little en... | [
"Updates",
"the",
"hash",
"with",
"32",
"bytes",
"of",
"data",
"given",
"as",
"4",
"longs",
".",
"This",
"function",
"is",
"more",
"efficient",
"than",
"updatePacket",
"when",
"you",
"can",
"use",
"it",
"."
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/misc/HighwayHash.java#L78-L99 | train | Update the hash table with the given values. | [
30522,
2270,
11675,
10651,
1006,
2146,
1037,
2692,
1010,
2146,
17350,
1010,
2146,
22441,
1010,
2146,
1037,
2509,
1007,
1063,
2065,
1006,
2589,
30524,
2064,
24134,
1037,
23325,
2069,
2320,
2566,
6013,
1000,
1007,
1025,
1065,
1058,
2487,
1031... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/MutableHashTable.java | MutableHashTable.open | public void open(final MutableObjectIterator<BT> buildSide, final MutableObjectIterator<PT> probeSide,
boolean buildOuterJoin) throws IOException {
this.buildSideOuterJoin = buildOuterJoin;
// sanity checks
if (!this.closed.compareAndSet(true, false)) {
throw new IllegalStateException("Hash Join cannot be ... | java | public void open(final MutableObjectIterator<BT> buildSide, final MutableObjectIterator<PT> probeSide,
boolean buildOuterJoin) throws IOException {
this.buildSideOuterJoin = buildOuterJoin;
// sanity checks
if (!this.closed.compareAndSet(true, false)) {
throw new IllegalStateException("Hash Join cannot be ... | [
"public",
"void",
"open",
"(",
"final",
"MutableObjectIterator",
"<",
"BT",
">",
"buildSide",
",",
"final",
"MutableObjectIterator",
"<",
"PT",
">",
"probeSide",
",",
"boolean",
"buildOuterJoin",
")",
"throws",
"IOException",
"{",
"this",
".",
"buildSideOuterJoin"... | Opens the hash join. This method reads the build-side input and constructs the initial
hash table, gradually spilling partitions that do not fit into memory.
@param buildSide Build side input.
@param probeSide Probe side input.
@param buildOuterJoin Whether outer join on build side.
@throws IOException Throw... | [
"Opens",
"the",
"hash",
"join",
".",
"This",
"method",
"reads",
"the",
"build",
"-",
"side",
"input",
"and",
"constructs",
"the",
"initial",
"hash",
"table",
"gradually",
"spilling",
"partitions",
"that",
"do",
"not",
"fit",
"into",
"memory",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/MutableHashTable.java#L471-L494 | train | Opens the hash join. | [
30522,
2270,
11675,
2330,
1006,
2345,
14163,
10880,
16429,
20614,
21646,
8844,
1026,
18411,
1028,
16473,
5178,
1010,
2345,
14163,
10880,
16429,
20614,
21646,
8844,
1026,
13866,
1028,
15113,
7363,
1010,
22017,
20898,
3857,
5833,
2121,
5558,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/mining/cluster/SparseVector.java | SparseVector.multiply_constant | void multiply_constant(double x)
{
for (Map.Entry<Integer, Double> entry : entrySet())
{
entry.setValue(entry.getValue() * x);
}
} | java | void multiply_constant(double x)
{
for (Map.Entry<Integer, Double> entry : entrySet())
{
entry.setValue(entry.getValue() * x);
}
} | [
"void",
"multiply_constant",
"(",
"double",
"x",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"Double",
">",
"entry",
":",
"entrySet",
"(",
")",
")",
"{",
"entry",
".",
"setValue",
"(",
"entry",
".",
"getValue",
"(",
")",
"*",
"x... | Multiply each value of avector by a constant value. | [
"Multiply",
"each",
"value",
"of",
"avector",
"by",
"a",
"constant",
"value",
"."
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java#L66-L72 | train | Multiplies the value of all the attributes of the CIS object by a constant value. | [
30522,
11675,
4800,
22086,
1035,
5377,
1006,
3313,
1060,
1007,
1063,
2005,
1006,
4949,
1012,
4443,
1026,
16109,
1010,
3313,
1028,
4443,
1024,
4443,
13462,
1006,
1007,
1007,
1063,
4443,
1012,
2275,
10175,
5657,
1006,
4443,
1012,
2131,
10175,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.unset | public synchronized void unset(String name) {
String[] names = null;
if (!isDeprecated(name)) {
names = getAlternativeNames(name);
if(names == null) {
names = new String[]{name};
}
}
else {
names = handleDeprecation(deprecationContext.get(), name);
}
for(String n: names) {
getOverlay().r... | java | public synchronized void unset(String name) {
String[] names = null;
if (!isDeprecated(name)) {
names = getAlternativeNames(name);
if(names == null) {
names = new String[]{name};
}
}
else {
names = handleDeprecation(deprecationContext.get(), name);
}
for(String n: names) {
getOverlay().r... | [
"public",
"synchronized",
"void",
"unset",
"(",
"String",
"name",
")",
"{",
"String",
"[",
"]",
"names",
"=",
"null",
";",
"if",
"(",
"!",
"isDeprecated",
"(",
"name",
")",
")",
"{",
"names",
"=",
"getAlternativeNames",
"(",
"name",
")",
";",
"if",
"... | Unset a previously set property. | [
"Unset",
"a",
"previously",
"set",
"property",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L1283-L1299 | train | Unsets the property with the given name. | [
30522,
2270,
25549,
11675,
4895,
13462,
1006,
5164,
2171,
1007,
1063,
5164,
1031,
1033,
3415,
1027,
19701,
1025,
2065,
1006,
999,
2003,
3207,
28139,
12921,
1006,
2171,
1007,
1007,
1063,
3415,
1027,
2131,
2389,
16451,
8082,
18442,
2015,
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... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/serialization/SimpleStringSchema.java | SimpleStringSchema.writeObject | private void writeObject (ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
out.writeUTF(charset.name());
} | java | private void writeObject (ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
out.writeUTF(charset.name());
} | [
"private",
"void",
"writeObject",
"(",
"ObjectOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"defaultWriteObject",
"(",
")",
";",
"out",
".",
"writeUTF",
"(",
"charset",
".",
"name",
"(",
")",
")",
";",
"}"
] | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/serialization/SimpleStringSchema.java#L97-L100 | train | Write the object. | [
30522,
2797,
11675,
4339,
16429,
20614,
1006,
4874,
5833,
18780,
21422,
2041,
1007,
11618,
22834,
10288,
24422,
1063,
2041,
1012,
12398,
26373,
16429,
20614,
1006,
1007,
1025,
2041,
1012,
4339,
4904,
2546,
1006,
25869,
13462,
1012,
2171,
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/util/ClassUtil.java | ClassUtil.getPackagePath | public static String getPackagePath(Class<?> clazz) {
return getPackage(clazz).replace(StrUtil.C_DOT, StrUtil.C_SLASH);
} | java | public static String getPackagePath(Class<?> clazz) {
return getPackage(clazz).replace(StrUtil.C_DOT, StrUtil.C_SLASH);
} | [
"public",
"static",
"String",
"getPackagePath",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"return",
"getPackage",
"(",
"clazz",
")",
".",
"replace",
"(",
"StrUtil",
".",
"C_DOT",
",",
"StrUtil",
".",
"C_SLASH",
")",
";",
"}"
] | 获得给定类所在包的路径<br>
例如:<br>
com.xiaoleilu.hutool.util.ClassUtil =》 com/xiaoleilu/hutool/util
@param clazz 类
@return 包名 | [
"获得给定类所在包的路径<br",
">",
"例如:<br",
">",
"com",
".",
"xiaoleilu",
".",
"hutool",
".",
"util",
".",
"ClassUtil",
"=",
"》",
"com",
"/",
"xiaoleilu",
"/",
"hutool",
"/",
"util"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L966-L968 | train | Gets the package path for the given class. | [
30522,
2270,
10763,
5164,
2131,
23947,
4270,
15069,
1006,
2465,
1026,
1029,
1028,
18856,
10936,
2480,
1007,
1063,
2709,
2131,
23947,
4270,
1006,
18856,
10936,
2480,
1007,
1012,
5672,
1006,
2358,
22134,
4014,
1012,
1039,
1035,
11089,
1010,
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... |
alibaba/canal | client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/common/AbstractResource.java | AbstractResource.lastModified | @Override
public long lastModified() throws IOException {
long lastModified = getFileForLastModifiedCheck().lastModified();
if (lastModified == 0L) {
throw new FileNotFoundException(
getDescription() + " cannot be resolved in the file system for resolving its last-modifie... | java | @Override
public long lastModified() throws IOException {
long lastModified = getFileForLastModifiedCheck().lastModified();
if (lastModified == 0L) {
throw new FileNotFoundException(
getDescription() + " cannot be resolved in the file system for resolving its last-modifie... | [
"@",
"Override",
"public",
"long",
"lastModified",
"(",
")",
"throws",
"IOException",
"{",
"long",
"lastModified",
"=",
"getFileForLastModifiedCheck",
"(",
")",
".",
"lastModified",
"(",
")",
";",
"if",
"(",
"lastModified",
"==",
"0L",
")",
"{",
"throw",
"ne... | This implementation checks the timestamp of the underlying File, if
available.
@see #getFileForLastModifiedCheck() | [
"This",
"implementation",
"checks",
"the",
"timestamp",
"of",
"the",
"underlying",
"File",
"if",
"available",
"."
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/common/AbstractResource.java#L130-L138 | train | Returns the last - modified timestamp of the file. | [
30522,
1030,
2058,
15637,
2270,
2146,
2197,
5302,
4305,
10451,
1006,
1007,
11618,
22834,
10288,
24422,
1063,
2146,
2197,
5302,
4305,
10451,
1027,
2131,
8873,
2571,
29278,
8523,
21246,
7716,
7810,
5403,
3600,
1006,
1007,
1012,
2197,
5302,
43... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/dictionary/item/SimpleItem.java | SimpleItem.combine | public void combine(SimpleItem other)
{
for (Map.Entry<String, Integer> entry : other.labelMap.entrySet())
{
addLabel(entry.getKey(), entry.getValue());
}
} | java | public void combine(SimpleItem other)
{
for (Map.Entry<String, Integer> entry : other.labelMap.entrySet())
{
addLabel(entry.getKey(), entry.getValue());
}
} | [
"public",
"void",
"combine",
"(",
"SimpleItem",
"other",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Integer",
">",
"entry",
":",
"other",
".",
"labelMap",
".",
"entrySet",
"(",
")",
")",
"{",
"addLabel",
"(",
"entry",
".",
"getKe... | 合并两个条目,两者的标签map会合并
@param other | [
"合并两个条目,两者的标签map会合并"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/dictionary/item/SimpleItem.java#L133-L139 | train | Combine two URIs. | [
30522,
2270,
11675,
11506,
1006,
3722,
4221,
2213,
2060,
1007,
1063,
2005,
1006,
4949,
1012,
4443,
1026,
5164,
1010,
16109,
1028,
4443,
1024,
2060,
1012,
3830,
2863,
2361,
1012,
4443,
13462,
1006,
1007,
1007,
1063,
5587,
20470,
2884,
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/util/ArrayUtil.java | ArrayUtil.wrap | public static Float[] wrap(float... values) {
if (null == values) {
return null;
}
final int length = values.length;
if (0 == length) {
return new Float[0];
}
final Float[] array = new Float[length];
for (int i = 0; i < length; i++) {
array[i] = Float.valueOf(values[i]);
}
retur... | java | public static Float[] wrap(float... values) {
if (null == values) {
return null;
}
final int length = values.length;
if (0 == length) {
return new Float[0];
}
final Float[] array = new Float[length];
for (int i = 0; i < length; i++) {
array[i] = Float.valueOf(values[i]);
}
retur... | [
"public",
"static",
"Float",
"[",
"]",
"wrap",
"(",
"float",
"...",
"values",
")",
"{",
"if",
"(",
"null",
"==",
"values",
")",
"{",
"return",
"null",
";",
"}",
"final",
"int",
"length",
"=",
"values",
".",
"length",
";",
"if",
"(",
"0",
"==",
"l... | 将原始类型数组包装为包装类型
@param values 原始类型数组
@return 包装类型数组 | [
"将原始类型数组包装为包装类型"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L1619-L1633 | train | Wraps the specified float array in a single array. | [
30522,
2270,
10763,
14257,
1031,
1033,
10236,
1006,
14257,
1012,
1012,
1012,
5300,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
5300,
1007,
1063,
2709,
19701,
1025,
1065,
2345,
20014,
3091,
1027,
5300,
1012,
3091,
1025,
2065,
1006,
1014,
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-java/src/main/java/org/apache/flink/api/java/functions/SelectByMinFunction.java | SelectByMinFunction.reduce | @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public T reduce(T value1, T value2) throws Exception {
for (int position : fields) {
// Save position of compared key
// Get both values - both implement comparable
Comparable comparable1 = value1.getFieldNotNull(position);
Comparable comparable2... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public T reduce(T value1, T value2) throws Exception {
for (int position : fields) {
// Save position of compared key
// Get both values - both implement comparable
Comparable comparable1 = value1.getFieldNotNull(position);
Comparable comparable2... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"@",
"Override",
"public",
"T",
"reduce",
"(",
"T",
"value1",
",",
"T",
"value2",
")",
"throws",
"Exception",
"{",
"for",
"(",
"int",
"position",
":",
"fields",
")",
"{",
... | Reduce implementation, returns smaller tuple or value1 if both tuples are
equal. Comparison highly depends on the order and amount of fields chosen
as indices. All given fields (at construction time) are checked in the same
order as defined (at construction time). If both tuples are equal in one
index, the next index i... | [
"Reduce",
"implementation",
"returns",
"smaller",
"tuple",
"or",
"value1",
"if",
"both",
"tuples",
"are",
"equal",
".",
"Comparison",
"highly",
"depends",
"on",
"the",
"order",
"and",
"amount",
"of",
"fields",
"chosen",
"as",
"indices",
".",
"All",
"given",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/functions/SelectByMinFunction.java#L73-L94 | train | Reduce two objects. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1063,
1000,
4895,
5403,
18141,
1000,
1010,
1000,
6315,
13874,
2015,
1000,
1065,
1007,
1030,
2058,
15637,
2270,
1056,
5547,
1006,
1056,
3643,
2487,
1010,
1056,
3643,
2475,
1007,
11618,
6453,
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... |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HttpResponse.java | HttpResponse.init | private HttpResponse init() throws HttpException {
try {
this.status = httpConnection.responseCode();
this.in = (this.status < HttpStatus.HTTP_BAD_REQUEST) ? httpConnection.getInputStream() : httpConnection.getErrorStream();
} catch (IOException e) {
if (e instanceof FileNotFoundException) {
// 服... | java | private HttpResponse init() throws HttpException {
try {
this.status = httpConnection.responseCode();
this.in = (this.status < HttpStatus.HTTP_BAD_REQUEST) ? httpConnection.getInputStream() : httpConnection.getErrorStream();
} catch (IOException e) {
if (e instanceof FileNotFoundException) {
// 服... | [
"private",
"HttpResponse",
"init",
"(",
")",
"throws",
"HttpException",
"{",
"try",
"{",
"this",
".",
"status",
"=",
"httpConnection",
".",
"responseCode",
"(",
")",
";",
"this",
".",
"in",
"=",
"(",
"this",
".",
"status",
"<",
"HttpStatus",
".",
"HTTP_B... | 初始化Http响应<br>
初始化包括:
<pre>
1、读取Http状态
2、读取头信息
3、持有Http流,并不关闭流
</pre>
@return this
@throws HttpException IO异常 | [
"初始化Http响应<br",
">",
"初始化包括:"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpResponse.java#L344-L384 | train | Initializes the response object. | [
30522,
2797,
8299,
6072,
26029,
3366,
1999,
4183,
1006,
1007,
11618,
8299,
10288,
24422,
1063,
3046,
1063,
2023,
1012,
3570,
1027,
8299,
8663,
2638,
7542,
1012,
3433,
16044,
1006,
1007,
1025,
2023,
1012,
1999,
1027,
1006,
2023,
1012,
3570,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ReduceOperator.java | ReduceOperator.translateSelectorFunctionReducer | private static <T, K> org.apache.flink.api.common.operators.SingleInputOperator<?, T, ?> translateSelectorFunctionReducer(
SelectorFunctionKeys<T, ?> rawKeys,
ReduceFunction<T> function,
TypeInformation<T> inputType,
String name,
Operator<T> input,
int parallelism,
CombineHint hint) {
@SuppressWarnings(... | java | private static <T, K> org.apache.flink.api.common.operators.SingleInputOperator<?, T, ?> translateSelectorFunctionReducer(
SelectorFunctionKeys<T, ?> rawKeys,
ReduceFunction<T> function,
TypeInformation<T> inputType,
String name,
Operator<T> input,
int parallelism,
CombineHint hint) {
@SuppressWarnings(... | [
"private",
"static",
"<",
"T",
",",
"K",
">",
"org",
".",
"apache",
".",
"flink",
".",
"api",
".",
"common",
".",
"operators",
".",
"SingleInputOperator",
"<",
"?",
",",
"T",
",",
"?",
">",
"translateSelectorFunctionReducer",
"(",
"SelectorFunctionKeys",
"... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/ReduceOperator.java#L177-L197 | train | Translate a selector function reducer into a single input operator. | [
30522,
2797,
10763,
1026,
1056,
1010,
1047,
1028,
8917,
1012,
15895,
1012,
13109,
19839,
1012,
17928,
1012,
2691,
1012,
9224,
1012,
2309,
2378,
18780,
25918,
8844,
1026,
1029,
1010,
1056,
1010,
1029,
1028,
16315,
12260,
16761,
11263,
27989,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/BatchTask.java | BatchTask.initOutputs | protected void initOutputs() throws Exception {
this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
this.eventualOutputs = new ArrayList<RecordWriter<?>>();
ClassLoader userCodeClassLoader = getUserCodeClassLoader();
this.accumulatorMap = getEnvironment().getAccumulatorRegistry().getUserMap();
this.o... | java | protected void initOutputs() throws Exception {
this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
this.eventualOutputs = new ArrayList<RecordWriter<?>>();
ClassLoader userCodeClassLoader = getUserCodeClassLoader();
this.accumulatorMap = getEnvironment().getAccumulatorRegistry().getUserMap();
this.o... | [
"protected",
"void",
"initOutputs",
"(",
")",
"throws",
"Exception",
"{",
"this",
".",
"chainedTasks",
"=",
"new",
"ArrayList",
"<",
"ChainedDriver",
"<",
"?",
",",
"?",
">",
">",
"(",
")",
";",
"this",
".",
"eventualOutputs",
"=",
"new",
"ArrayList",
"<... | Creates a writer for each output. Creates an OutputCollector which forwards its input to all writers.
The output collector applies the configured shipping strategies for each writer. | [
"Creates",
"a",
"writer",
"for",
"each",
"output",
".",
"Creates",
"an",
"OutputCollector",
"which",
"forwards",
"its",
"input",
"to",
"all",
"writers",
".",
"The",
"output",
"collector",
"applies",
"the",
"configured",
"shipping",
"strategies",
"for",
"each",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/BatchTask.java#L1021-L1031 | train | Initialize the output list. | [
30522,
5123,
11675,
1999,
9956,
4904,
18780,
2015,
1006,
1007,
11618,
6453,
1063,
2023,
1012,
22075,
10230,
5705,
1027,
2047,
9140,
9863,
1026,
22075,
23663,
2099,
1026,
1029,
1010,
1029,
1028,
1028,
1006,
1007,
1025,
2023,
1012,
9523,
5833... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Segment.java | Segment.simpleAtomSegment | protected static List<AtomNode> simpleAtomSegment(char[] charArray, int start, int end)
{
List<AtomNode> atomNodeList = new LinkedList<AtomNode>();
atomNodeList.add(new AtomNode(new String(charArray, start, end - start), CharType.CT_LETTER));
return atomNodeList;
} | java | protected static List<AtomNode> simpleAtomSegment(char[] charArray, int start, int end)
{
List<AtomNode> atomNodeList = new LinkedList<AtomNode>();
atomNodeList.add(new AtomNode(new String(charArray, start, end - start), CharType.CT_LETTER));
return atomNodeList;
} | [
"protected",
"static",
"List",
"<",
"AtomNode",
">",
"simpleAtomSegment",
"(",
"char",
"[",
"]",
"charArray",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"List",
"<",
"AtomNode",
">",
"atomNodeList",
"=",
"new",
"LinkedList",
"<",
"AtomNode",
">",
... | 简易原子分词,将所有字放到一起作为一个词
@param charArray
@param start
@param end
@return | [
"简易原子分词,将所有字放到一起作为一个词"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/Segment.java#L143-L148 | train | Simple atom segment. | [
30522,
5123,
10763,
2862,
1026,
13787,
3630,
3207,
1028,
3722,
10610,
5244,
13910,
3672,
1006,
25869,
1031,
1033,
25869,
2906,
9447,
1010,
20014,
2707,
1010,
20014,
2203,
1007,
1063,
2862,
1026,
13787,
3630,
3207,
1028,
13787,
3630,
9247,
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-libraries/flink-cep/src/main/java/org/apache/flink/cep/PatternStream.java | PatternStream.select | public <L, R> SingleOutputStreamOperator<R> select(
final OutputTag<L> timedOutPartialMatchesTag,
final PatternTimeoutFunction<T, L> patternTimeoutFunction,
final PatternSelectFunction<T, R> patternSelectFunction) {
final TypeInformation<R> rightTypeInfo = TypeExtractor.getUnaryOperatorReturnType(
patter... | java | public <L, R> SingleOutputStreamOperator<R> select(
final OutputTag<L> timedOutPartialMatchesTag,
final PatternTimeoutFunction<T, L> patternTimeoutFunction,
final PatternSelectFunction<T, R> patternSelectFunction) {
final TypeInformation<R> rightTypeInfo = TypeExtractor.getUnaryOperatorReturnType(
patter... | [
"public",
"<",
"L",
",",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"select",
"(",
"final",
"OutputTag",
"<",
"L",
">",
"timedOutPartialMatchesTag",
",",
"final",
"PatternTimeoutFunction",
"<",
"T",
",",
"L",
">",
"patternTimeoutFunction",
",",
"fi... | Applies a select function to the detected pattern sequence. For each pattern sequence the
provided {@link PatternSelectFunction} is called. The pattern select function can produce
exactly one resulting element.
<p>Applies a timeout function to a partial pattern sequence which has timed out. For each
partial pattern se... | [
"Applies",
"a",
"select",
"function",
"to",
"the",
"detected",
"pattern",
"sequence",
".",
"For",
"each",
"pattern",
"sequence",
"the",
"provided",
"{",
"@link",
"PatternSelectFunction",
"}",
"is",
"called",
".",
"The",
"pattern",
"select",
"function",
"can",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/PatternStream.java#L192-L212 | train | Selects a single output stream from a single input tag. | [
30522,
2270,
1026,
1048,
1010,
1054,
1028,
2309,
5833,
18780,
21422,
25918,
8844,
1026,
1054,
1028,
7276,
1006,
2345,
6434,
15900,
1026,
1048,
1028,
22313,
5833,
19362,
20925,
18900,
8376,
15900,
1010,
2345,
5418,
7292,
5833,
11263,
27989,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/dictionary/SuffixDictionary.java | SuffixDictionary.entrySet | public Set<Map.Entry<String, Integer>> entrySet()
{
Set<Map.Entry<String, Integer>> treeSet = new LinkedHashSet<Map.Entry<String, Integer>>();
for (Map.Entry<String, Integer> entry : trie.entrySet())
{
treeSet.add(new AbstractMap.SimpleEntry<String, Integer>(reverse(entry.getKey(... | java | public Set<Map.Entry<String, Integer>> entrySet()
{
Set<Map.Entry<String, Integer>> treeSet = new LinkedHashSet<Map.Entry<String, Integer>>();
for (Map.Entry<String, Integer> entry : trie.entrySet())
{
treeSet.add(new AbstractMap.SimpleEntry<String, Integer>(reverse(entry.getKey(... | [
"public",
"Set",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"Integer",
">",
">",
"entrySet",
"(",
")",
"{",
"Set",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"Integer",
">",
">",
"treeSet",
"=",
"new",
"LinkedHashSet",
"<",
"Map",
".",
"Entry... | 键值对
@return | [
"键值对"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/dictionary/SuffixDictionary.java#L104-L113 | train | Get a Set of Entry objects from the map. | [
30522,
2270,
2275,
1026,
4949,
1012,
4443,
1026,
5164,
1010,
16109,
1028,
1028,
4443,
13462,
1006,
1007,
1063,
2275,
1026,
4949,
1012,
4443,
1026,
5164,
1010,
16109,
1028,
1028,
3628,
3388,
1027,
2047,
5799,
14949,
7898,
3388,
1026,
4949,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | transport/src/main/java/io/netty/channel/PendingWriteQueue.java | PendingWriteQueue.removeAndWriteAll | public ChannelFuture removeAndWriteAll() {
assert ctx.executor().inEventLoop();
if (isEmpty()) {
return null;
}
ChannelPromise p = ctx.newPromise();
PromiseCombiner combiner = new PromiseCombiner(ctx.executor());
try {
// It is possible for some ... | java | public ChannelFuture removeAndWriteAll() {
assert ctx.executor().inEventLoop();
if (isEmpty()) {
return null;
}
ChannelPromise p = ctx.newPromise();
PromiseCombiner combiner = new PromiseCombiner(ctx.executor());
try {
// It is possible for some ... | [
"public",
"ChannelFuture",
"removeAndWriteAll",
"(",
")",
"{",
"assert",
"ctx",
".",
"executor",
"(",
")",
".",
"inEventLoop",
"(",
")",
";",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"ChannelPromise",
"p",
"=",
"ctx",
".",
... | Remove all pending write operation and performs them via
{@link ChannelHandlerContext#write(Object, ChannelPromise)}.
@return {@link ChannelFuture} if something was written and {@code null}
if the {@link PendingWriteQueue} is empty. | [
"Remove",
"all",
"pending",
"write",
"operation",
"and",
"performs",
"them",
"via",
"{",
"@link",
"ChannelHandlerContext#write",
"(",
"Object",
"ChannelPromise",
")",
"}",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/PendingWriteQueue.java#L125-L160 | train | Removes all pending writes from the queue and writes them to the channel. | [
30522,
2270,
3149,
11263,
11244,
6366,
5685,
26373,
8095,
1006,
1007,
1063,
20865,
14931,
2595,
1012,
4654,
8586,
16161,
2099,
1006,
1007,
1012,
1999,
18697,
3372,
4135,
7361,
1006,
1007,
1025,
2065,
1006,
2003,
6633,
13876,
2100,
1006,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.cleanEmpty | public static boolean cleanEmpty(File directory) throws IORuntimeException {
if (directory == null || directory.exists() == false || false == directory.isDirectory()) {
return true;
}
final File[] files = directory.listFiles();
if(ArrayUtil.isEmpty(files)) {
//空文件夹则删除之
directory.delete();
}... | java | public static boolean cleanEmpty(File directory) throws IORuntimeException {
if (directory == null || directory.exists() == false || false == directory.isDirectory()) {
return true;
}
final File[] files = directory.listFiles();
if(ArrayUtil.isEmpty(files)) {
//空文件夹则删除之
directory.delete();
}... | [
"public",
"static",
"boolean",
"cleanEmpty",
"(",
"File",
"directory",
")",
"throws",
"IORuntimeException",
"{",
"if",
"(",
"directory",
"==",
"null",
"||",
"directory",
".",
"exists",
"(",
")",
"==",
"false",
"||",
"false",
"==",
"directory",
".",
"isDirect... | 清理空文件夹<br>
此方法用于递归删除空的文件夹,不删除文件<br>
如果传入的文件夹本身就是空的,删除这个文件夹
@param directory 文件夹
@return 成功与否
@throws IORuntimeException IO异常
@since 4.5.5 | [
"清理空文件夹<br",
">",
"此方法用于递归删除空的文件夹,不删除文件<br",
">",
"如果传入的文件夹本身就是空的,删除这个文件夹"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L813-L827 | train | Clean empty directory. | [
30522,
2270,
10763,
22017,
20898,
4550,
6633,
13876,
2100,
1006,
5371,
14176,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2065,
1006,
14176,
1027,
1027,
19701,
1064,
1064,
14176,
1012,
6526,
1006,
1007,
1027,
1027,
6270,
1064,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/context/properties/bind/Binder.java | Binder.bind | public <T> BindResult<T> bind(ConfigurationPropertyName name, Bindable<T> target,
BindHandler handler) {
Assert.notNull(name, "Name must not be null");
Assert.notNull(target, "Target must not be null");
handler = (handler != null) ? handler : BindHandler.DEFAULT;
Context context = new Context();
T bound = ... | java | public <T> BindResult<T> bind(ConfigurationPropertyName name, Bindable<T> target,
BindHandler handler) {
Assert.notNull(name, "Name must not be null");
Assert.notNull(target, "Target must not be null");
handler = (handler != null) ? handler : BindHandler.DEFAULT;
Context context = new Context();
T bound = ... | [
"public",
"<",
"T",
">",
"BindResult",
"<",
"T",
">",
"bind",
"(",
"ConfigurationPropertyName",
"name",
",",
"Bindable",
"<",
"T",
">",
"target",
",",
"BindHandler",
"handler",
")",
"{",
"Assert",
".",
"notNull",
"(",
"name",
",",
"\"Name must not be null\""... | Bind the specified target {@link Bindable} using this binder's
{@link ConfigurationPropertySource property sources}.
@param name the configuration property name to bind
@param target the target bindable
@param handler the bind handler (may be {@code null})
@param <T> the bound type
@return the binding result (never {@c... | [
"Bind",
"the",
"specified",
"target",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java#L203-L211 | train | Binds the given target to the given configuration property name using the given handler. | [
30522,
2270,
1026,
1056,
1028,
14187,
6072,
11314,
1026,
1056,
1028,
14187,
1006,
9563,
21572,
4842,
25680,
14074,
2171,
1010,
14187,
3085,
1026,
1056,
1028,
4539,
1010,
14187,
11774,
3917,
28213,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/NShort/Path/NShortPath.java | NShortPath.initNShortPath | private void initNShortPath(Graph inGraph, int nValueKind)
{
graph = inGraph;
N = nValueKind;
// 获取顶点的数目
vertexCount = inGraph.vertexes.length;
fromArray = new CQueue[vertexCount - 1][]; // 不包含起点
weightArray = new double[vertexCount - 1][];
//每个节点的最小堆
... | java | private void initNShortPath(Graph inGraph, int nValueKind)
{
graph = inGraph;
N = nValueKind;
// 获取顶点的数目
vertexCount = inGraph.vertexes.length;
fromArray = new CQueue[vertexCount - 1][]; // 不包含起点
weightArray = new double[vertexCount - 1][];
//每个节点的最小堆
... | [
"private",
"void",
"initNShortPath",
"(",
"Graph",
"inGraph",
",",
"int",
"nValueKind",
")",
"{",
"graph",
"=",
"inGraph",
";",
"N",
"=",
"nValueKind",
";",
"// 获取顶点的数目",
"vertexCount",
"=",
"inGraph",
".",
"vertexes",
".",
"length",
";",
"fromArray",
"=",
... | 初始化,主要分配内存
@param inGraph 输入图
@param nValueKind 希望的N值 | [
"初始化,主要分配内存"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/NShort/Path/NShortPath.java#L63-L83 | train | init N short path | [
30522,
2797,
11675,
1999,
4183,
3619,
27794,
15069,
1006,
10629,
13749,
24342,
1010,
20014,
1050,
10175,
5657,
18824,
1007,
1063,
10629,
30524,
1031,
19449,
3597,
16671,
1011,
1015,
1033,
1031,
1033,
1025,
1013,
1013,
1744,
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/WorkbookUtil.java | WorkbookUtil.createBook | public static Workbook createBook(InputStream in, String password, boolean closeAfterRead) {
try {
return WorkbookFactory.create(IoUtil.toMarkSupportStream(in), password);
} catch (Exception e) {
throw new POIException(e);
} finally {
if (closeAfterRead) {
IoUtil.close(in);
}
}
} | java | public static Workbook createBook(InputStream in, String password, boolean closeAfterRead) {
try {
return WorkbookFactory.create(IoUtil.toMarkSupportStream(in), password);
} catch (Exception e) {
throw new POIException(e);
} finally {
if (closeAfterRead) {
IoUtil.close(in);
}
}
} | [
"public",
"static",
"Workbook",
"createBook",
"(",
"InputStream",
"in",
",",
"String",
"password",
",",
"boolean",
"closeAfterRead",
")",
"{",
"try",
"{",
"return",
"WorkbookFactory",
".",
"create",
"(",
"IoUtil",
".",
"toMarkSupportStream",
"(",
"in",
")",
",... | 创建或加载工作簿
@param in Excel输入流
@param password 密码
@param closeAfterRead 读取结束是否关闭流
@return {@link Workbook}
@since 4.0.3 | [
"创建或加载工作簿"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/WorkbookUtil.java#L86-L96 | train | Creates a new book from an input stream. | [
30522,
2270,
10763,
2147,
8654,
3443,
8654,
1006,
20407,
25379,
1999,
1010,
5164,
20786,
1010,
22017,
20898,
2485,
10354,
3334,
16416,
2094,
1007,
1063,
3046,
1063,
2709,
2147,
8654,
21450,
1012,
3443,
1006,
22834,
21823,
2140,
1012,
3419,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/slot/TaskSlotTable.java | TaskSlotTable.markSlotInactive | public boolean markSlotInactive(AllocationID allocationId, Time slotTimeout) throws SlotNotFoundException {
checkInit();
TaskSlot taskSlot = getTaskSlot(allocationId);
if (taskSlot != null) {
if (taskSlot.markInactive()) {
// register a timeout to free the slot
timerService.registerTimeout(allocation... | java | public boolean markSlotInactive(AllocationID allocationId, Time slotTimeout) throws SlotNotFoundException {
checkInit();
TaskSlot taskSlot = getTaskSlot(allocationId);
if (taskSlot != null) {
if (taskSlot.markInactive()) {
// register a timeout to free the slot
timerService.registerTimeout(allocation... | [
"public",
"boolean",
"markSlotInactive",
"(",
"AllocationID",
"allocationId",
",",
"Time",
"slotTimeout",
")",
"throws",
"SlotNotFoundException",
"{",
"checkInit",
"(",
")",
";",
"TaskSlot",
"taskSlot",
"=",
"getTaskSlot",
"(",
"allocationId",
")",
";",
"if",
"(",... | Marks the slot under the given allocation id as inactive. If the slot could not be found,
then a {@link SlotNotFoundException} is thrown.
@param allocationId to identify the task slot to mark as inactive
@param slotTimeout until the slot times out
@throws SlotNotFoundException if the slot could not be found for the gi... | [
"Marks",
"the",
"slot",
"under",
"the",
"given",
"allocation",
"id",
"as",
"inactive",
".",
"If",
"the",
"slot",
"could",
"not",
"be",
"found",
"then",
"a",
"{",
"@link",
"SlotNotFoundException",
"}",
"is",
"thrown",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L259-L276 | train | Mark the slot inactive. | [
30522,
2270,
22017,
20898,
6017,
10994,
3981,
15277,
1006,
16169,
3593,
16169,
3593,
1010,
2051,
10453,
7292,
5833,
1007,
11618,
10453,
17048,
14876,
8630,
10288,
24422,
1063,
4638,
5498,
2102,
1006,
1007,
1025,
8518,
10994,
8518,
10994,
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/lang/Assert.java | Assert.notEmpty | public static Object[] notEmpty(Object[] array, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
if (ArrayUtil.isEmpty(array)) {
throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params));
}
return array;
} | java | public static Object[] notEmpty(Object[] array, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
if (ArrayUtil.isEmpty(array)) {
throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params));
}
return array;
} | [
"public",
"static",
"Object",
"[",
"]",
"notEmpty",
"(",
"Object",
"[",
"]",
"array",
",",
"String",
"errorMsgTemplate",
",",
"Object",
"...",
"params",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"array",
")"... | 断言给定数组是否包含元素,数组必须不为 {@code null} 且至少包含一个元素
<pre class="code">
Assert.notEmpty(array, "The array must have elements");
</pre>
@param array 被检查的数组
@param errorMsgTemplate 异常时的消息模板
@param params 参数列表
@return 被检查的数组
@throws IllegalArgumentException if the object array is {@code null} or has no elements | [
"断言给定数组是否包含元素,数组必须不为",
"{",
"@code",
"null",
"}",
"且至少包含一个元素"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L278-L283 | train | Returns an empty array if the array is empty. | [
30522,
2270,
10763,
4874,
1031,
1033,
3602,
27718,
2100,
1006,
4874,
1031,
1033,
9140,
1010,
5164,
7561,
5244,
13512,
6633,
15725,
1010,
4874,
1012,
1012,
1012,
11498,
5244,
1007,
11618,
6206,
2906,
22850,
15781,
2595,
24422,
1063,
2065,
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/collection/CollUtil.java | CollUtil.filter | public static <K, V> Map<K, V> filter(Map<K, V> map, Editor<Entry<K, V>> editor) {
return MapUtil.filter(map, editor);
} | java | public static <K, V> Map<K, V> filter(Map<K, V> map, Editor<Entry<K, V>> editor) {
return MapUtil.filter(map, editor);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"filter",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"Editor",
"<",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"editor",
")",
"{",
"return",
"MapUtil",
".",
"fil... | 过滤<br>
过滤过程通过传入的Editor实现来返回需要的元素内容,这个Editor实现可以实现以下功能:
<pre>
1、过滤出需要的对象,如果返回null表示这个元素对象抛弃
2、修改元素对象,返回集合中为修改后的对象
</pre>
@param <K> Key类型
@param <V> Value类型
@param map Map
@param editor 编辑器接口
@return 过滤后的Map
@see MapUtil#filter(Map, Editor) | [
"过滤<br",
">",
"过滤过程通过传入的Editor实现来返回需要的元素内容,这个Editor实现可以实现以下功能:"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1268-L1270 | train | Filter the given map by applying the given editor to each entry in the map. | [
30522,
2270,
10763,
1026,
1047,
1010,
1058,
1028,
4949,
1026,
1047,
1010,
1058,
1028,
11307,
1006,
4949,
1026,
1047,
1010,
1058,
1028,
4949,
1010,
3559,
1026,
4443,
1026,
1047,
1010,
1058,
1028,
1028,
3559,
1007,
1063,
2709,
4949,
21823,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/jobmaster/JobMaster.java | JobMaster.acknowledgeCheckpoint | @Override
public void acknowledgeCheckpoint(
final JobID jobID,
final ExecutionAttemptID executionAttemptID,
final long checkpointId,
final CheckpointMetrics checkpointMetrics,
final TaskStateSnapshot checkpointState) {
final CheckpointCoordinator checkpointCoordinator = executionGraph.getCheckpointC... | java | @Override
public void acknowledgeCheckpoint(
final JobID jobID,
final ExecutionAttemptID executionAttemptID,
final long checkpointId,
final CheckpointMetrics checkpointMetrics,
final TaskStateSnapshot checkpointState) {
final CheckpointCoordinator checkpointCoordinator = executionGraph.getCheckpointC... | [
"@",
"Override",
"public",
"void",
"acknowledgeCheckpoint",
"(",
"final",
"JobID",
"jobID",
",",
"final",
"ExecutionAttemptID",
"executionAttemptID",
",",
"final",
"long",
"checkpointId",
",",
"final",
"CheckpointMetrics",
"checkpointMetrics",
",",
"final",
"TaskStateSn... | TODO: This method needs a leader session ID | [
"TODO",
":",
"This",
"method",
"needs",
"a",
"leader",
"session",
"ID"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java#L496-L528 | train | Acknowledges a checkpoint. | [
30522,
1030,
2058,
15637,
2270,
11675,
13399,
5403,
3600,
8400,
1006,
2345,
3105,
3593,
3105,
3593,
1010,
2345,
7781,
19321,
6633,
13876,
3593,
7781,
19321,
6633,
13876,
3593,
1010,
2345,
2146,
26520,
3593,
1010,
2345,
26520,
12589,
2015,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/NeuralNetworkParser.java | NeuralNetworkParser.get_valency_features | void get_valency_features(final Context ctx,
final List<Integer> nr_left_children,
final List<Integer> nr_right_children,
List<Integer> features)
{
if (!use_valency)
{
return;
}
int... | java | void get_valency_features(final Context ctx,
final List<Integer> nr_left_children,
final List<Integer> nr_right_children,
List<Integer> features)
{
if (!use_valency)
{
return;
}
int... | [
"void",
"get_valency_features",
"(",
"final",
"Context",
"ctx",
",",
"final",
"List",
"<",
"Integer",
">",
"nr_left_children",
",",
"final",
"List",
"<",
"Integer",
">",
"nr_right_children",
",",
"List",
"<",
"Integer",
">",
"features",
")",
"{",
"if",
"(",
... | 获取(S0和S1的)配价特征
@param ctx 上下文
@param nr_left_children 左孩子数量列表
@param nr_right_children 右孩子数量列表
@param features 输出特征 | [
"获取",
"(",
"S0和S1的",
")",
"配价特征"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/NeuralNetworkParser.java#L761-L806 | train | Get the valency features. | [
30522,
11675,
2131,
1035,
10380,
9407,
1035,
2838,
1006,
2345,
6123,
14931,
2595,
1010,
2345,
2862,
1026,
16109,
1028,
17212,
1035,
2187,
1035,
2336,
1010,
2345,
2862,
1026,
16109,
1028,
17212,
1035,
2157,
1035,
2336,
1010,
2862,
1026,
1610... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/spdy/SpdySessionHandler.java | SpdySessionHandler.updateInitialReceiveWindowSize | private void updateInitialReceiveWindowSize(int newInitialWindowSize) {
int deltaWindowSize = newInitialWindowSize - initialReceiveWindowSize;
initialReceiveWindowSize = newInitialWindowSize;
spdySession.updateAllReceiveWindowSizes(deltaWindowSize);
} | java | private void updateInitialReceiveWindowSize(int newInitialWindowSize) {
int deltaWindowSize = newInitialWindowSize - initialReceiveWindowSize;
initialReceiveWindowSize = newInitialWindowSize;
spdySession.updateAllReceiveWindowSizes(deltaWindowSize);
} | [
"private",
"void",
"updateInitialReceiveWindowSize",
"(",
"int",
"newInitialWindowSize",
")",
"{",
"int",
"deltaWindowSize",
"=",
"newInitialWindowSize",
"-",
"initialReceiveWindowSize",
";",
"initialReceiveWindowSize",
"=",
"newInitialWindowSize",
";",
"spdySession",
".",
... | need to synchronize to prevent new streams from being created while updating active streams | [
"need",
"to",
"synchronize",
"to",
"prevent",
"new",
"streams",
"from",
"being",
"created",
"while",
"updating",
"active",
"streams"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java#L706-L710 | train | Update the initial receive window size. | [
30522,
2797,
11675,
10651,
5498,
20925,
2890,
3401,
3512,
11101,
15568,
4697,
1006,
20014,
2047,
5498,
20925,
11101,
15568,
4697,
1007,
1063,
20014,
7160,
11101,
15568,
4697,
1027,
2047,
5498,
20925,
11101,
15568,
4697,
1011,
3988,
2890,
3401... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ssl/CipherSuiteConverter.java | CipherSuiteConverter.toOpenSsl | static String toOpenSsl(String javaCipherSuite, boolean boringSSL) {
String converted = j2o.get(javaCipherSuite);
if (converted != null) {
return converted;
}
return cacheFromJava(javaCipherSuite, boringSSL);
} | java | static String toOpenSsl(String javaCipherSuite, boolean boringSSL) {
String converted = j2o.get(javaCipherSuite);
if (converted != null) {
return converted;
}
return cacheFromJava(javaCipherSuite, boringSSL);
} | [
"static",
"String",
"toOpenSsl",
"(",
"String",
"javaCipherSuite",
",",
"boolean",
"boringSSL",
")",
"{",
"String",
"converted",
"=",
"j2o",
".",
"get",
"(",
"javaCipherSuite",
")",
";",
"if",
"(",
"converted",
"!=",
"null",
")",
"{",
"return",
"converted",
... | Converts the specified Java cipher suite to its corresponding OpenSSL cipher suite name.
@return {@code null} if the conversion has failed | [
"Converts",
"the",
"specified",
"Java",
"cipher",
"suite",
"to",
"its",
"corresponding",
"OpenSSL",
"cipher",
"suite",
"name",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java#L153-L159 | train | Converts a javaCipherSuite to an open SSL string. | [
30522,
10763,
5164,
2205,
11837,
4757,
2140,
1006,
5164,
9262,
6895,
27921,
28880,
2063,
1010,
22017,
20898,
11771,
4757,
2140,
1007,
1063,
5164,
4991,
1027,
1046,
2475,
2080,
1012,
2131,
1006,
9262,
6895,
27921,
28880,
2063,
1007,
1025,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/mining/word2vec/AbstractVectorModel.java | AbstractVectorModel.nearest | public List<Map.Entry<K, Float>> nearest(K key)
{
return nearest(key, 10);
} | java | public List<Map.Entry<K, Float>> nearest(K key)
{
return nearest(key, 10);
} | [
"public",
"List",
"<",
"Map",
".",
"Entry",
"<",
"K",
",",
"Float",
">",
">",
"nearest",
"(",
"K",
"key",
")",
"{",
"return",
"nearest",
"(",
"key",
",",
"10",
")",
";",
"}"
] | 查询与词语最相似的词语
@param key 词语
@return 键值对列表, 键是相似词语, 值是相似度, 按相似度降序排列 | [
"查询与词语最相似的词语"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/AbstractVectorModel.java#L160-L163 | train | Returns the nearest record set entry for the given key. | [
30522,
2270,
2862,
1026,
4949,
1012,
4443,
1026,
1047,
1010,
14257,
1028,
1028,
7205,
1006,
1047,
3145,
1007,
1063,
2709,
7205,
1006,
3145,
1010,
2184,
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,
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-smtp/src/main/java/io/netty/handler/codec/smtp/SmtpRequests.java | SmtpRequests.vrfy | public static SmtpRequest vrfy(CharSequence user) {
return new DefaultSmtpRequest(SmtpCommand.VRFY, ObjectUtil.checkNotNull(user, "user"));
} | java | public static SmtpRequest vrfy(CharSequence user) {
return new DefaultSmtpRequest(SmtpCommand.VRFY, ObjectUtil.checkNotNull(user, "user"));
} | [
"public",
"static",
"SmtpRequest",
"vrfy",
"(",
"CharSequence",
"user",
")",
"{",
"return",
"new",
"DefaultSmtpRequest",
"(",
"SmtpCommand",
".",
"VRFY",
",",
"ObjectUtil",
".",
"checkNotNull",
"(",
"user",
",",
"\"user\"",
")",
")",
";",
"}"
] | Creates a {@code VRFY} request. | [
"Creates",
"a",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-smtp/src/main/java/io/netty/handler/codec/smtp/SmtpRequests.java#L131-L133 | train | Create a new VRFY request. | [
30522,
2270,
10763,
30524,
1012,
27830,
12031,
1010,
4874,
21823,
2140,
1012,
4638,
17048,
11231,
3363,
1006,
5310,
1010,
1000,
5310,
1000,
1007,
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,
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/AllWindowedStream.java | AllWindowedStream.reduce | @PublicEvolving
public <R> SingleOutputStreamOperator<R> reduce(
ReduceFunction<T> reduceFunction,
AllWindowFunction<T, R, W> function) {
TypeInformation<T> inType = input.getType();
TypeInformation<R> resultType = getAllWindowFunctionReturnType(function, inType);
return reduce(reduceFunction, function, ... | java | @PublicEvolving
public <R> SingleOutputStreamOperator<R> reduce(
ReduceFunction<T> reduceFunction,
AllWindowFunction<T, R, W> function) {
TypeInformation<T> inType = input.getType();
TypeInformation<R> resultType = getAllWindowFunctionReturnType(function, inType);
return reduce(reduceFunction, function, ... | [
"@",
"PublicEvolving",
"public",
"<",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"reduce",
"(",
"ReduceFunction",
"<",
"T",
">",
"reduceFunction",
",",
"AllWindowFunction",
"<",
"T",
",",
"R",
",",
"W",
">",
"function",
")",
"{",
"TypeInformation... | Applies the given window function to each window. The window function is called for each
evaluation of the window for each key individually. The output of the window function is
interpreted as a regular non-windowed stream.
<p>Arriving data is incrementally aggregated using the given reducer.
@param reduceFunction Th... | [
"Applies",
"the",
"given",
"window",
"function",
"to",
"each",
"window",
".",
"The",
"window",
"function",
"is",
"called",
"for",
"each",
"evaluation",
"of",
"the",
"window",
"for",
"each",
"key",
"individually",
".",
"The",
"output",
"of",
"the",
"window",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java#L232-L241 | train | Returns a new stream that combines the results of applying the given reduce function and all window functions. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
1026,
1054,
1028,
2309,
5833,
18780,
21422,
25918,
8844,
1026,
1054,
1028,
5547,
1006,
5547,
11263,
27989,
1026,
1056,
1028,
5547,
11263,
27989,
1010,
2035,
11101,
5004,
11263,
27989,
1026,
1056,
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/trie/DoubleArrayTrie.java | DoubleArrayTrie.save | public boolean save(DataOutputStream out)
{
try
{
out.writeInt(size);
for (int i = 0; i < size; i++)
{
out.writeInt(base[i]);
out.writeInt(check[i]);
}
}
catch (Exception e)
{
return f... | java | public boolean save(DataOutputStream out)
{
try
{
out.writeInt(size);
for (int i = 0; i < size; i++)
{
out.writeInt(base[i]);
out.writeInt(check[i]);
}
}
catch (Exception e)
{
return f... | [
"public",
"boolean",
"save",
"(",
"DataOutputStream",
"out",
")",
"{",
"try",
"{",
"out",
".",
"writeInt",
"(",
"size",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"out",
".",
"writeInt",
"(",
"b... | 将base和check保存下来
@param out
@return | [
"将base和check保存下来"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/trie/DoubleArrayTrie.java#L478-L495 | train | Save the result of this object to the specified output stream. | [
30522,
2270,
22017,
20898,
3828,
1006,
2951,
5833,
18780,
21422,
2041,
1007,
1063,
3046,
1063,
2041,
1012,
4339,
18447,
1006,
2946,
1007,
1025,
2005,
1006,
20014,
1045,
1027,
1014,
1025,
1045,
1026,
2946,
1025,
1045,
1009,
1009,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dictionary/py/String2PinyinConverter.java | String2PinyinConverter.convert2Array | public static Pinyin[] convert2Array(String complexText, boolean removeTone)
{
return PinyinUtil.convertList2Array(convert(complexText, removeTone));
} | java | public static Pinyin[] convert2Array(String complexText, boolean removeTone)
{
return PinyinUtil.convertList2Array(convert(complexText, removeTone));
} | [
"public",
"static",
"Pinyin",
"[",
"]",
"convert2Array",
"(",
"String",
"complexText",
",",
"boolean",
"removeTone",
")",
"{",
"return",
"PinyinUtil",
".",
"convertList2Array",
"(",
"convert",
"(",
"complexText",
",",
"removeTone",
")",
")",
";",
"}"
] | 将拼音文本转化为完整的拼音,支持汉英混合的杂乱文本,注意如果混用拼音和输入法头的话,并不会有多高的准确率,声调也不会准的
@param complexText
@return | [
"将拼音文本转化为完整的拼音,支持汉英混合的杂乱文本,注意如果混用拼音和输入法头的话,并不会有多高的准确率,声调也不会准的"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/py/String2PinyinConverter.java#L59-L62 | train | Convert a string to an array of Pinyin objects. | [
30522,
2270,
10763,
9973,
1031,
1033,
10463,
2475,
2906,
9447,
1006,
5164,
3375,
18209,
1010,
22017,
20898,
6366,
5524,
1007,
1063,
2709,
9973,
21823,
2140,
1012,
10463,
9863,
2475,
2906,
9447,
1006,
10463,
1006,
3375,
18209,
1010,
6366,
55... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.computeAllPriorAllocationIds | private Set<AllocationID> computeAllPriorAllocationIds() {
HashSet<AllocationID> allPreviousAllocationIds = new HashSet<>(getNumberOfExecutionJobVertices());
for (ExecutionVertex executionVertex : getAllExecutionVertices()) {
AllocationID latestPriorAllocation = executionVertex.getLatestPriorAllocation();
if ... | java | private Set<AllocationID> computeAllPriorAllocationIds() {
HashSet<AllocationID> allPreviousAllocationIds = new HashSet<>(getNumberOfExecutionJobVertices());
for (ExecutionVertex executionVertex : getAllExecutionVertices()) {
AllocationID latestPriorAllocation = executionVertex.getLatestPriorAllocation();
if ... | [
"private",
"Set",
"<",
"AllocationID",
">",
"computeAllPriorAllocationIds",
"(",
")",
"{",
"HashSet",
"<",
"AllocationID",
">",
"allPreviousAllocationIds",
"=",
"new",
"HashSet",
"<>",
"(",
"getNumberOfExecutionJobVertices",
"(",
")",
")",
";",
"for",
"(",
"Execut... | Computes and returns a set with the prior allocation ids from all execution vertices in the graph. | [
"Computes",
"and",
"returns",
"a",
"set",
"with",
"the",
"prior",
"allocation",
"ids",
"from",
"all",
"execution",
"vertices",
"in",
"the",
"graph",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L1686-L1695 | train | Compute all the allocation IDs that are prior to the execution vertices. | [
30522,
2797,
2275,
1026,
16169,
3593,
1028,
24134,
8095,
18098,
25346,
8095,
23909,
9821,
1006,
1007,
1063,
23325,
13462,
1026,
16169,
3593,
1028,
2035,
28139,
24918,
8095,
23909,
9821,
1027,
2047,
23325,
13462,
1026,
1028,
1006,
2131,
19172,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-optimizer/src/main/java/org/apache/flink/optimizer/plan/DualInputPlanNode.java | DualInputPlanNode.accept | @Override
public void accept(Visitor<PlanNode> visitor) {
if (visitor.preVisit(this)) {
this.input1.getSource().accept(visitor);
this.input2.getSource().accept(visitor);
for (Channel broadcastInput : getBroadcastInputs()) {
broadcastInput.getSource().accept(visitor);
}
visitor.postVisit(th... | java | @Override
public void accept(Visitor<PlanNode> visitor) {
if (visitor.preVisit(this)) {
this.input1.getSource().accept(visitor);
this.input2.getSource().accept(visitor);
for (Channel broadcastInput : getBroadcastInputs()) {
broadcastInput.getSource().accept(visitor);
}
visitor.postVisit(th... | [
"@",
"Override",
"public",
"void",
"accept",
"(",
"Visitor",
"<",
"PlanNode",
">",
"visitor",
")",
"{",
"if",
"(",
"visitor",
".",
"preVisit",
"(",
"this",
")",
")",
"{",
"this",
".",
"input1",
".",
"getSource",
"(",
")",
".",
"accept",
"(",
"visitor... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/plan/DualInputPlanNode.java#L160-L172 | train | Visit this node. | [
30522,
1030,
2058,
15637,
2270,
11675,
5138,
1006,
10367,
1026,
2933,
3630,
3207,
1028,
10367,
1007,
1063,
2065,
1006,
10367,
1012,
3653,
11365,
4183,
1006,
2023,
1007,
1007,
1063,
2023,
1012,
7953,
2487,
1012,
4152,
8162,
3401,
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-socket/src/main/java/cn/hutool/socket/nio/NioServer.java | NioServer.doListen | private void doListen() throws IOException {
while (0 != this.selector.select()) {
// 返回已选择键的集合
final Iterator<SelectionKey> keyIter = selector.selectedKeys().iterator();
while (keyIter.hasNext()) {
handle(keyIter.next());
keyIter.remove();
}
}
} | java | private void doListen() throws IOException {
while (0 != this.selector.select()) {
// 返回已选择键的集合
final Iterator<SelectionKey> keyIter = selector.selectedKeys().iterator();
while (keyIter.hasNext()) {
handle(keyIter.next());
keyIter.remove();
}
}
} | [
"private",
"void",
"doListen",
"(",
")",
"throws",
"IOException",
"{",
"while",
"(",
"0",
"!=",
"this",
".",
"selector",
".",
"select",
"(",
")",
")",
"{",
"// 返回已选择键的集合\r",
"final",
"Iterator",
"<",
"SelectionKey",
">",
"keyIter",
"=",
"selector",
".",
... | 开始监听
@throws IOException IO异常 | [
"开始监听"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-socket/src/main/java/cn/hutool/socket/nio/NioServer.java#L81-L90 | train | Listen for events. | [
30522,
2797,
11675,
2079,
9863,
2368,
1006,
1007,
11618,
22834,
10288,
24422,
1063,
2096,
1006,
1014,
999,
1027,
2023,
1012,
27000,
1012,
7276,
1006,
1007,
1007,
1063,
1013,
1013,
100,
100,
100,
100,
100,
100,
1916,
100,
1792,
2345,
2009,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/AllWindowedStream.java | AllWindowedStream.trigger | @PublicEvolving
public AllWindowedStream<T, W> trigger(Trigger<? super T, ? super W> trigger) {
if (windowAssigner instanceof MergingWindowAssigner && !trigger.canMerge()) {
throw new UnsupportedOperationException("A merging window assigner cannot be used with a trigger that does not support merging.");
}
th... | java | @PublicEvolving
public AllWindowedStream<T, W> trigger(Trigger<? super T, ? super W> trigger) {
if (windowAssigner instanceof MergingWindowAssigner && !trigger.canMerge()) {
throw new UnsupportedOperationException("A merging window assigner cannot be used with a trigger that does not support merging.");
}
th... | [
"@",
"PublicEvolving",
"public",
"AllWindowedStream",
"<",
"T",
",",
"W",
">",
"trigger",
"(",
"Trigger",
"<",
"?",
"super",
"T",
",",
"?",
"super",
"W",
">",
"trigger",
")",
"{",
"if",
"(",
"windowAssigner",
"instanceof",
"MergingWindowAssigner",
"&&",
"!... | Sets the {@code Trigger} that should be used to trigger window emission. | [
"Sets",
"the",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java#L126-L134 | train | Sets the trigger for this stream. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
2035,
11101,
15096,
21422,
1026,
1056,
1010,
1059,
1028,
9495,
1006,
9495,
1026,
1029,
3565,
1056,
1010,
1029,
3565,
1059,
1028,
9495,
1007,
1063,
2065,
1006,
3332,
12054,
23773,
2121,
6013,
11253,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-common/src/main/java/org/apache/flink/table/api/TableSchema.java | TableSchema.getFieldName | public Optional<String> getFieldName(int fieldIndex) {
if (fieldIndex < 0 || fieldIndex >= fieldNames.length) {
return Optional.empty();
}
return Optional.of(fieldNames[fieldIndex]);
} | java | public Optional<String> getFieldName(int fieldIndex) {
if (fieldIndex < 0 || fieldIndex >= fieldNames.length) {
return Optional.empty();
}
return Optional.of(fieldNames[fieldIndex]);
} | [
"public",
"Optional",
"<",
"String",
">",
"getFieldName",
"(",
"int",
"fieldIndex",
")",
"{",
"if",
"(",
"fieldIndex",
"<",
"0",
"||",
"fieldIndex",
">=",
"fieldNames",
".",
"length",
")",
"{",
"return",
"Optional",
".",
"empty",
"(",
")",
";",
"}",
"r... | Returns the specified name for the given field index.
@param fieldIndex the index of the field | [
"Returns",
"the",
"specified",
"name",
"for",
"the",
"given",
"field",
"index",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java#L147-L152 | train | Gets the name of the field at the given index. | [
30522,
2270,
11887,
1026,
5164,
1028,
2131,
3790,
18442,
1006,
20014,
2492,
22254,
10288,
1007,
1063,
2065,
1006,
2492,
22254,
10288,
1026,
1014,
1064,
1064,
2492,
22254,
10288,
1028,
1027,
2492,
18442,
2015,
1012,
3091,
1007,
1063,
2709,
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.colNameToIndex | public static int colNameToIndex(String colName) {
int length = colName.length();
char c;
int index = -1;
for (int i = 0; i < length; i++) {
c = Character.toUpperCase(colName.charAt(i));
if (Character.isDigit(c)) {
break;// 确定指定的char值是否为数字
}
index = (index + 1) * 26 + (int) c - 'A';
... | java | public static int colNameToIndex(String colName) {
int length = colName.length();
char c;
int index = -1;
for (int i = 0; i < length; i++) {
c = Character.toUpperCase(colName.charAt(i));
if (Character.isDigit(c)) {
break;// 确定指定的char值是否为数字
}
index = (index + 1) * 26 + (int) c - 'A';
... | [
"public",
"static",
"int",
"colNameToIndex",
"(",
"String",
"colName",
")",
"{",
"int",
"length",
"=",
"colName",
".",
"length",
"(",
")",
";",
"char",
"c",
";",
"int",
"index",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",... | 根据表元的列名转换为列号
@param colName 列名, 从A开始
@return A1->0; B1->1...AA1->26
@since 4.1.20 | [
"根据表元的列名转换为列号"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java#L560-L572 | train | Converts a column name to a column name index. | [
30522,
2270,
10763,
20014,
8902,
18442,
3406,
22254,
10288,
1006,
5164,
8902,
18442,
1007,
1063,
20014,
3091,
1027,
8902,
18442,
1012,
3091,
1006,
1007,
1025,
25869,
1039,
1025,
20014,
5950,
1027,
1011,
1015,
1025,
2005,
1006,
20014,
1045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.touch | public static File touch(String fullFilePath) throws IORuntimeException {
if (fullFilePath == null) {
return null;
}
return touch(file(fullFilePath));
} | java | public static File touch(String fullFilePath) throws IORuntimeException {
if (fullFilePath == null) {
return null;
}
return touch(file(fullFilePath));
} | [
"public",
"static",
"File",
"touch",
"(",
"String",
"fullFilePath",
")",
"throws",
"IORuntimeException",
"{",
"if",
"(",
"fullFilePath",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"touch",
"(",
"file",
"(",
"fullFilePath",
")",
")",
";",... | 创建文件及其父目录,如果这个文件存在,直接返回这个文件<br>
此方法不对File对象类型做判断,如果File不存在,无法判断其类型
@param fullFilePath 文件的全路径,使用POSIX风格
@return 文件,若路径为null,返回null
@throws IORuntimeException IO异常 | [
"创建文件及其父目录,如果这个文件存在,直接返回这个文件<br",
">",
"此方法不对File对象类型做判断,如果File不存在,无法判断其类型"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L595-L600 | train | Creates a new file with the specified path and creates a new file with the specified name. | [
30522,
2270,
10763,
5371,
3543,
1006,
5164,
2440,
8873,
2571,
15069,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2065,
1006,
2440,
8873,
2571,
15069,
1027,
1027,
19701,
1007,
1063,
2709,
19701,
1025,
1065,
2709,
3543,
1006,
5371,
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 | common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java | SingleThreadEventExecutor.runAllTasksFrom | protected final boolean runAllTasksFrom(Queue<Runnable> taskQueue) {
Runnable task = pollTaskFrom(taskQueue);
if (task == null) {
return false;
}
for (;;) {
safeExecute(task);
task = pollTaskFrom(taskQueue);
if (task == null) {
... | java | protected final boolean runAllTasksFrom(Queue<Runnable> taskQueue) {
Runnable task = pollTaskFrom(taskQueue);
if (task == null) {
return false;
}
for (;;) {
safeExecute(task);
task = pollTaskFrom(taskQueue);
if (task == null) {
... | [
"protected",
"final",
"boolean",
"runAllTasksFrom",
"(",
"Queue",
"<",
"Runnable",
">",
"taskQueue",
")",
"{",
"Runnable",
"task",
"=",
"pollTaskFrom",
"(",
"taskQueue",
")",
";",
"if",
"(",
"task",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"f... | Runs all tasks from the passed {@code taskQueue}.
@param taskQueue To poll and execute all tasks.
@return {@code true} if at least one task was executed. | [
"Runs",
"all",
"tasks",
"from",
"the",
"passed",
"{",
"@code",
"taskQueue",
"}",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java#L375-L387 | train | Run all tasks from the given queue. | [
30522,
5123,
2345,
22017,
20898,
2448,
8095,
10230,
5705,
19699,
5358,
1006,
24240,
1026,
2448,
22966,
1028,
4708,
4226,
5657,
1007,
1063,
2448,
22966,
4708,
1027,
8554,
10230,
2243,
19699,
5358,
1006,
4708,
4226,
5657,
1007,
1025,
2065,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java | JSONStringer.close | JSONStringer close(Scope empty, Scope nonempty, String closeBracket)
throws JSONException {
Scope context = peek();
if (context != nonempty && context != empty) {
throw new JSONException("Nesting problem");
}
this.stack.remove(this.stack.size() - 1);
if (context == nonempty) {
newline();
}
this.... | java | JSONStringer close(Scope empty, Scope nonempty, String closeBracket)
throws JSONException {
Scope context = peek();
if (context != nonempty && context != empty) {
throw new JSONException("Nesting problem");
}
this.stack.remove(this.stack.size() - 1);
if (context == nonempty) {
newline();
}
this.... | [
"JSONStringer",
"close",
"(",
"Scope",
"empty",
",",
"Scope",
"nonempty",
",",
"String",
"closeBracket",
")",
"throws",
"JSONException",
"{",
"Scope",
"context",
"=",
"peek",
"(",
")",
";",
"if",
"(",
"context",
"!=",
"nonempty",
"&&",
"context",
"!=",
"em... | Closes the current scope by appending any necessary whitespace and the given
bracket.
@param empty any necessary whitespace
@param nonempty the current scope
@param closeBracket the close bracket
@return the JSON stringer
@throws JSONException if processing of json failed | [
"Closes",
"the",
"current",
"scope",
"by",
"appending",
"any",
"necessary",
"whitespace",
"and",
"the",
"given",
"bracket",
"."
] | 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/JSONStringer.java#L194-L207 | train | Close a scope. | [
30522,
1046,
23345,
18886,
11392,
2485,
1006,
9531,
4064,
1010,
9531,
3904,
27718,
2100,
1010,
5164,
2485,
10024,
19869,
2102,
1007,
11618,
1046,
3385,
10288,
24422,
1063,
9531,
6123,
1027,
19043,
1006,
1007,
1025,
2065,
1006,
6123,
999,
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/api/common/distributions/CommonRangeBoundaries.java | CommonRangeBoundaries.binarySearch | private int binarySearch(T record) {
int low = 0;
int high = this.boundaries.length - 1;
typeComparator.extractKeys(record, keys, 0);
while (low <= high) {
final int mid = (low + high) >>> 1;
final int result = compareKeys(flatComparators, keys, this.boundaries[mid]);
if (result > 0) {
low = mid ... | java | private int binarySearch(T record) {
int low = 0;
int high = this.boundaries.length - 1;
typeComparator.extractKeys(record, keys, 0);
while (low <= high) {
final int mid = (low + high) >>> 1;
final int result = compareKeys(flatComparators, keys, this.boundaries[mid]);
if (result > 0) {
low = mid ... | [
"private",
"int",
"binarySearch",
"(",
"T",
"record",
")",
"{",
"int",
"low",
"=",
"0",
";",
"int",
"high",
"=",
"this",
".",
"boundaries",
".",
"length",
"-",
"1",
";",
"typeComparator",
".",
"extractKeys",
"(",
"record",
",",
"keys",
",",
"0",
")",... | Search the range index of input record. | [
"Search",
"the",
"range",
"index",
"of",
"input",
"record",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/distributions/CommonRangeBoundaries.java#L43-L63 | train | Searches for the key in the record in the flat comparators. | [
30522,
2797,
20014,
12441,
17310,
11140,
1006,
1056,
2501,
1007,
1063,
20014,
2659,
1027,
1014,
1025,
20014,
2152,
1027,
2023,
1012,
7372,
1012,
3091,
1011,
1015,
1025,
2828,
9006,
28689,
4263,
1012,
14817,
14839,
2015,
1006,
2501,
1010,
63... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/img/ImgUtil.java | ImgUtil.createImage | public static void createImage(String str, Font font, Color backgroundColor, Color fontColor, ImageOutputStream out) throws IORuntimeException {
// 获取font的样式应用在str上的整个矩形
Rectangle2D r = font.getStringBounds(str, new FontRenderContext(AffineTransform.getScaleInstance(1, 1), false, false));
int unitHeight = (int... | java | public static void createImage(String str, Font font, Color backgroundColor, Color fontColor, ImageOutputStream out) throws IORuntimeException {
// 获取font的样式应用在str上的整个矩形
Rectangle2D r = font.getStringBounds(str, new FontRenderContext(AffineTransform.getScaleInstance(1, 1), false, false));
int unitHeight = (int... | [
"public",
"static",
"void",
"createImage",
"(",
"String",
"str",
",",
"Font",
"font",
",",
"Color",
"backgroundColor",
",",
"Color",
"fontColor",
",",
"ImageOutputStream",
"out",
")",
"throws",
"IORuntimeException",
"{",
"// 获取font的样式应用在str上的整个矩形\r",
"Rectangle2D",
... | 根据文字创建PNG图片
@param str 文字
@param font 字体{@link Font}
@param backgroundColor 背景颜色
@param fontColor 字体颜色
@param out 图片输出地
@throws IORuntimeException IO异常 | [
"根据文字创建PNG图片"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1269-L1286 | train | Create an image from a string using a font. | [
30522,
2270,
10763,
11675,
3443,
9581,
3351,
1006,
5164,
2358,
2099,
1010,
15489,
15489,
1010,
3609,
4281,
18717,
1010,
3609,
15489,
18717,
1010,
3746,
5833,
18780,
21422,
2041,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
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... |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.getLong | public long getLong(String key, long defaultValue) {
Object o = getRawValue(key);
if (o == null) {
return defaultValue;
}
return convertToLong(o, defaultValue);
} | java | public long getLong(String key, long defaultValue) {
Object o = getRawValue(key);
if (o == null) {
return defaultValue;
}
return convertToLong(o, defaultValue);
} | [
"public",
"long",
"getLong",
"(",
"String",
"key",
",",
"long",
"defaultValue",
")",
"{",
"Object",
"o",
"=",
"getRawValue",
"(",
"key",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return",
"convertToLong",
"(... | Returns the value associated with the given key as a long.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) value associated with the given key | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"as",
"a",
"long",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L278-L285 | train | Returns the long value for the given key. The defaultValue is returned if the key does not exist or if the value is not a long value. | [
30522,
2270,
2146,
2131,
10052,
1006,
5164,
3145,
1010,
2146,
12398,
10175,
5657,
1007,
1063,
4874,
1051,
1027,
2131,
2527,
2860,
10175,
5657,
1006,
3145,
1007,
1025,
2065,
1006,
1051,
1027,
1027,
19701,
1007,
1063,
2709,
12398,
10175,
5657... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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(InputStream in, OutputStream out) throws IORuntimeException {
return copy(in, out, DEFAULT_BUFFER_SIZE);
} | java | public static long copy(InputStream in, OutputStream out) throws IORuntimeException {
return copy(in, out, DEFAULT_BUFFER_SIZE);
} | [
"public",
"static",
"long",
"copy",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
")",
"throws",
"IORuntimeException",
"{",
"return",
"copy",
"(",
"in",
",",
"out",
",",
"DEFAULT_BUFFER_SIZE",
")",
";",
"}"
] | 拷贝流,使用默认Buffer大小
@param in 输入流
@param out 输出流
@return 传输的byte数
@throws IORuntimeException IO异常 | [
"拷贝流,使用默认Buffer大小"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L133-L135 | train | Copy the contents of the input stream to the output stream using the default buffer size. | [
30522,
2270,
10763,
2146,
6100,
1006,
20407,
25379,
1999,
1010,
27852,
25379,
2041,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2709,
6100,
1006,
1999,
1010,
2041,
1010,
12398,
1035,
17698,
1035,
2946,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/support/ui/ExpectedConditions.java | ExpectedConditions.frameToBeAvailableAndSwitchToIt | public static ExpectedCondition<WebDriver> frameToBeAvailableAndSwitchToIt(final By locator) {
return new ExpectedCondition<WebDriver>() {
@Override
public WebDriver apply(WebDriver driver) {
try {
return driver.switchTo().frame(driver.findElement(locator));
} catch (NoSuchFram... | java | public static ExpectedCondition<WebDriver> frameToBeAvailableAndSwitchToIt(final By locator) {
return new ExpectedCondition<WebDriver>() {
@Override
public WebDriver apply(WebDriver driver) {
try {
return driver.switchTo().frame(driver.findElement(locator));
} catch (NoSuchFram... | [
"public",
"static",
"ExpectedCondition",
"<",
"WebDriver",
">",
"frameToBeAvailableAndSwitchToIt",
"(",
"final",
"By",
"locator",
")",
"{",
"return",
"new",
"ExpectedCondition",
"<",
"WebDriver",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"WebDriver",
"apply",... | An expectation for checking whether the given frame is available to switch to. <p> If the frame
is available it switches the given driver to the specified frame.
@param locator used to find the frame
@return WebDriver instance after frame has been switched | [
"An",
"expectation",
"for",
"checking",
"whether",
"the",
"given",
"frame",
"is",
"available",
"to",
"switch",
"to",
".",
"<p",
">",
"If",
"the",
"frame",
"is",
"available",
"it",
"switches",
"the",
"given",
"driver",
"to",
"the",
"specified",
"frame",
"."... | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L496-L512 | train | An expectation for checking that a frame is available on the page. | [
30522,
2270,
10763,
3517,
8663,
20562,
1026,
4773,
23663,
2099,
1028,
4853,
3406,
4783,
12462,
11733,
3468,
29560,
9148,
10649,
3406,
4183,
1006,
2345,
2011,
8840,
11266,
2953,
1007,
1063,
2709,
2047,
3517,
8663,
20562,
1026,
4773,
23663,
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/thread/ThreadUtil.java | ThreadUtil.newNamedThreadFactory | public static ThreadFactory newNamedThreadFactory(String prefix, ThreadGroup threadGroup, boolean isDeamon) {
return new NamedThreadFactory(prefix, threadGroup, isDeamon);
} | java | public static ThreadFactory newNamedThreadFactory(String prefix, ThreadGroup threadGroup, boolean isDeamon) {
return new NamedThreadFactory(prefix, threadGroup, isDeamon);
} | [
"public",
"static",
"ThreadFactory",
"newNamedThreadFactory",
"(",
"String",
"prefix",
",",
"ThreadGroup",
"threadGroup",
",",
"boolean",
"isDeamon",
")",
"{",
"return",
"new",
"NamedThreadFactory",
"(",
"prefix",
",",
"threadGroup",
",",
"isDeamon",
")",
";",
"}"... | 创建线程工厂
@param prefix 线程名前缀
@param threadGroup 线程组,可以为null
@param isDeamon 是否守护线程
@since 4.0.0 | [
"创建线程工厂"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java#L407-L409 | train | Creates a thread factory that creates threads that use the specified thread group. | [
30522,
2270,
10763,
11689,
21450,
2047,
18442,
11927,
28362,
4215,
21450,
1006,
5164,
17576,
1010,
11689,
17058,
11689,
17058,
1010,
22017,
20898,
2003,
3207,
22591,
2078,
1007,
1063,
2709,
2047,
2315,
2705,
16416,
20952,
18908,
10253,
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... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/generator/RMatGraph.java | RMatGraph.setNoise | public RMatGraph<T> setNoise(boolean noiseEnabled, float noise) {
Preconditions.checkArgument(noise >= 0.0f && noise <= 2.0f,
"RMat parameter noise must be non-negative and less than or equal to 2.0");
this.noiseEnabled = noiseEnabled;
this.noise = noise;
return this;
} | java | public RMatGraph<T> setNoise(boolean noiseEnabled, float noise) {
Preconditions.checkArgument(noise >= 0.0f && noise <= 2.0f,
"RMat parameter noise must be non-negative and less than or equal to 2.0");
this.noiseEnabled = noiseEnabled;
this.noise = noise;
return this;
} | [
"public",
"RMatGraph",
"<",
"T",
">",
"setNoise",
"(",
"boolean",
"noiseEnabled",
",",
"float",
"noise",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"noise",
">=",
"0.0f",
"&&",
"noise",
"<=",
"2.0f",
",",
"\"RMat parameter noise must be non-negative and... | Enable and configure noise. Each edge is generated independently, but
when noise is enabled the parameters A, B, and C are randomly increased
or decreased, then normalized, by a fraction of the noise factor during
the computation of each bit.
@param noiseEnabled whether to enable noise perturbation
@param noise streng... | [
"Enable",
"and",
"configure",
"noise",
".",
"Each",
"edge",
"is",
"generated",
"independently",
"but",
"when",
"noise",
"is",
"enabled",
"the",
"parameters",
"A",
"B",
"and",
"C",
"are",
"randomly",
"increased",
"or",
"decreased",
"then",
"normalized",
"by",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/generator/RMatGraph.java#L133-L141 | train | Sets the noise value. | [
30522,
2270,
28549,
4017,
14413,
1026,
1056,
1028,
2275,
3630,
5562,
1006,
22017,
20898,
5005,
8189,
23242,
1010,
14257,
5005,
1007,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
2906,
22850,
4765,
1006,
5005,
1028,
1027,
1014,
1012,
1014,
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... |
redisson/redisson | redisson/src/main/java/org/redisson/api/LocalCachedMapOptions.java | LocalCachedMapOptions.maxIdle | public LocalCachedMapOptions<K, V> maxIdle(long maxIdle, TimeUnit timeUnit) {
return maxIdle(timeUnit.toMillis(maxIdle));
} | java | public LocalCachedMapOptions<K, V> maxIdle(long maxIdle, TimeUnit timeUnit) {
return maxIdle(timeUnit.toMillis(maxIdle));
} | [
"public",
"LocalCachedMapOptions",
"<",
"K",
",",
"V",
">",
"maxIdle",
"(",
"long",
"maxIdle",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"maxIdle",
"(",
"timeUnit",
".",
"toMillis",
"(",
"maxIdle",
")",
")",
";",
"}"
] | Sets max idle time for each map entry in local cache.
If value equals to <code>0</code> then timeout is not applied
@param maxIdle - max idle time
@param timeUnit - time unit
@return LocalCachedMapOptions instance | [
"Sets",
"max",
"idle",
"time",
"for",
"each",
"map",
"entry",
"in",
"local",
"cache",
".",
"If",
"value",
"equals",
"to",
"<code",
">",
"0<",
"/",
"code",
">",
"then",
"timeout",
"is",
"not",
"applied"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/api/LocalCachedMapOptions.java#L268-L270 | train | Returns a cache options that limits the maximum number of idle entries in the cache. | [
30522,
2270,
2334,
3540,
7690,
2863,
16340,
9285,
1026,
1047,
1010,
1058,
1028,
21510,
10362,
1006,
2146,
21510,
10362,
1010,
2051,
19496,
2102,
2051,
19496,
2102,
1007,
1063,
2709,
21510,
10362,
1006,
2051,
19496,
2102,
1012,
3419,
8591,
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-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/typeutils/BinaryRowSerializer.java | BinaryRowSerializer.checkSkipWriteForFixLengthPart | private int checkSkipWriteForFixLengthPart(AbstractPagedOutputView out) throws IOException {
// skip if there is no enough size.
int available = out.getSegmentSize() - out.getCurrentPositionInSegment();
if (available < getSerializedRowFixedPartLength()) {
out.advance();
return available;
}
return 0;
} | java | private int checkSkipWriteForFixLengthPart(AbstractPagedOutputView out) throws IOException {
// skip if there is no enough size.
int available = out.getSegmentSize() - out.getCurrentPositionInSegment();
if (available < getSerializedRowFixedPartLength()) {
out.advance();
return available;
}
return 0;
} | [
"private",
"int",
"checkSkipWriteForFixLengthPart",
"(",
"AbstractPagedOutputView",
"out",
")",
"throws",
"IOException",
"{",
"// skip if there is no enough size.",
"int",
"available",
"=",
"out",
".",
"getSegmentSize",
"(",
")",
"-",
"out",
".",
"getCurrentPositionInSegm... | We need skip bytes to write when the remain bytes of current segment is not
enough to write binary row fixed part.
See {@link BinaryRow}. | [
"We",
"need",
"skip",
"bytes",
"to",
"write",
"when",
"the",
"remain",
"bytes",
"of",
"current",
"segment",
"is",
"not",
"enough",
"to",
"write",
"binary",
"row",
"fixed",
"part",
".",
"See",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/typeutils/BinaryRowSerializer.java#L284-L292 | train | Check if we need to skip the write for the fixed length part. | [
30522,
2797,
20014,
14148,
3211,
28400,
17625,
29278,
8873,
2595,
7770,
13512,
22269,
8445,
1006,
10061,
13704,
26797,
25856,
4904,
8584,
2041,
1007,
11618,
22834,
10288,
24422,
1063,
1013,
1013,
13558,
2065,
2045,
2003,
30524,
2131,
10841,
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/URLUtil.java | URLUtil.getPath | public static String getPath(String uriStr) {
URI uri = null;
try {
uri = new URI(uriStr);
} catch (URISyntaxException e) {
throw new UtilException(e);
}
return uri.getPath();
} | java | public static String getPath(String uriStr) {
URI uri = null;
try {
uri = new URI(uriStr);
} catch (URISyntaxException e) {
throw new UtilException(e);
}
return uri.getPath();
} | [
"public",
"static",
"String",
"getPath",
"(",
"String",
"uriStr",
")",
"{",
"URI",
"uri",
"=",
"null",
";",
"try",
"{",
"uri",
"=",
"new",
"URI",
"(",
"uriStr",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"throw",
"new",
"UtilEx... | 获得path部分<br>
@param uriStr URI路径
@return path
@exception UtilException 包装URISyntaxException | [
"获得path部分<br",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java#L391-L399 | train | Returns the path of the given URI. | [
30522,
2270,
10763,
5164,
2131,
15069,
1006,
5164,
24471,
2923,
2099,
1007,
1063,
24471,
2072,
24471,
2072,
1027,
19701,
1025,
3046,
1063,
24471,
2072,
1027,
2047,
24471,
2072,
1006,
24471,
2923,
2099,
1007,
1025,
1065,
4608,
1006,
24471,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/corpus/document/sentence/Sentence.java | Sentence.toWordArray | public String[] toWordArray()
{
List<Word> wordList = toSimpleWordList();
String[] wordArray = new String[wordList.size()];
Iterator<Word> iterator = wordList.iterator();
for (int i = 0; i < wordArray.length; i++)
{
wordArray[i] = iterator.next().value;
}
... | java | public String[] toWordArray()
{
List<Word> wordList = toSimpleWordList();
String[] wordArray = new String[wordList.size()];
Iterator<Word> iterator = wordList.iterator();
for (int i = 0; i < wordArray.length; i++)
{
wordArray[i] = iterator.next().value;
}
... | [
"public",
"String",
"[",
"]",
"toWordArray",
"(",
")",
"{",
"List",
"<",
"Word",
">",
"wordList",
"=",
"toSimpleWordList",
"(",
")",
";",
"String",
"[",
"]",
"wordArray",
"=",
"new",
"String",
"[",
"wordList",
".",
"size",
"(",
")",
"]",
";",
"Iterat... | 获取所有单词构成的数组
@return | [
"获取所有单词构成的数组"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/document/sentence/Sentence.java#L418-L428 | train | To word array. | [
30522,
2270,
5164,
1031,
1033,
15805,
8551,
2906,
9447,
1006,
1007,
1063,
2862,
1026,
2773,
1028,
2773,
9863,
1027,
2000,
5332,
23344,
18351,
9863,
1006,
1007,
1025,
5164,
1031,
1033,
2773,
2906,
9447,
1027,
2047,
5164,
1031,
2773,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandler.java | DefaultErrorWebExceptionHandler.renderErrorResponse | protected Mono<ServerResponse> renderErrorResponse(ServerRequest request) {
boolean includeStackTrace = isIncludeStackTrace(request, MediaType.ALL);
Map<String, Object> error = getErrorAttributes(request, includeStackTrace);
return ServerResponse.status(getHttpStatus(error))
.contentType(MediaType.APPLICATION... | java | protected Mono<ServerResponse> renderErrorResponse(ServerRequest request) {
boolean includeStackTrace = isIncludeStackTrace(request, MediaType.ALL);
Map<String, Object> error = getErrorAttributes(request, includeStackTrace);
return ServerResponse.status(getHttpStatus(error))
.contentType(MediaType.APPLICATION... | [
"protected",
"Mono",
"<",
"ServerResponse",
">",
"renderErrorResponse",
"(",
"ServerRequest",
"request",
")",
"{",
"boolean",
"includeStackTrace",
"=",
"isIncludeStackTrace",
"(",
"request",
",",
"MediaType",
".",
"ALL",
")",
";",
"Map",
"<",
"String",
",",
"Obj... | Render the error information as a JSON payload.
@param request the current request
@return a {@code Publisher} of the HTTP response | [
"Render",
"the",
"error",
"information",
"as",
"a",
"JSON",
"payload",
"."
] | 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#L134-L140 | train | Render an error response. | [
30522,
5123,
18847,
1026,
8241,
6072,
26029,
3366,
1028,
17552,
2121,
29165,
6072,
26029,
3366,
1006,
8241,
2890,
15500,
5227,
1007,
1063,
22017,
20898,
2950,
2696,
3600,
6494,
3401,
1027,
2003,
2378,
20464,
22087,
2696,
3600,
6494,
3401,
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... |
networknt/light-4j | http-url/src/main/java/com/networknt/url/HttpURL.java | HttpURL.encodePath | public static String encodePath(String path) {
// Any characters that are not one of the following are
// percent-encoded (including spaces):
// a-z A-Z 0-9 . - _ ~ ! $ & ' ( ) * + , ; = : @ / %
if (StringUtils.isBlank(path)) {
return path;
}
StringBuilder... | java | public static String encodePath(String path) {
// Any characters that are not one of the following are
// percent-encoded (including spaces):
// a-z A-Z 0-9 . - _ ~ ! $ & ' ( ) * + , ; = : @ / %
if (StringUtils.isBlank(path)) {
return path;
}
StringBuilder... | [
"public",
"static",
"String",
"encodePath",
"(",
"String",
"path",
")",
"{",
"// Any characters that are not one of the following are",
"// percent-encoded (including spaces):",
"// a-z A-Z 0-9 . - _ ~ ! $ & ' ( ) * + , ; = : @ / %",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(... | <p>URL-Encodes a URL path. The entire string supplied is assumed
to be a URL path. Unsafe characters are percent-encoded using UTF-8
(as specified by W3C standard).
@param path path portion of a URL
@return encoded path
@since 1.7.0 | [
"<p",
">",
"URL",
"-",
"Encodes",
"a",
"URL",
"path",
".",
"The",
"entire",
"string",
"supplied",
"is",
"assumed",
"to",
"be",
"a",
"URL",
"path",
".",
"Unsafe",
"characters",
"are",
"percent",
"-",
"encoded",
"using",
"UTF",
"-",
"8",
"(",
"as",
"sp... | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/http-url/src/main/java/com/networknt/url/HttpURL.java#L428-L460 | train | Encode path. | [
30522,
2270,
10763,
5164,
4372,
16044,
15069,
1006,
5164,
4130,
1007,
1063,
1013,
1013,
2151,
3494,
2008,
2024,
2025,
2028,
1997,
1996,
2206,
2024,
1013,
1013,
3867,
1011,
12359,
1006,
2164,
7258,
1007,
1024,
1013,
1013,
1037,
1011,
1062,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.writeFromStream | public static File writeFromStream(InputStream in, File dest) throws IORuntimeException {
return FileWriter.create(dest).writeFromStream(in);
} | java | public static File writeFromStream(InputStream in, File dest) throws IORuntimeException {
return FileWriter.create(dest).writeFromStream(in);
} | [
"public",
"static",
"File",
"writeFromStream",
"(",
"InputStream",
"in",
",",
"File",
"dest",
")",
"throws",
"IORuntimeException",
"{",
"return",
"FileWriter",
".",
"create",
"(",
"dest",
")",
".",
"writeFromStream",
"(",
"in",
")",
";",
"}"
] | 将流的内容写入文件<br>
@param dest 目标文件
@param in 输入流
@return dest
@throws IORuntimeException IO异常 | [
"将流的内容写入文件<br",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L3153-L3155 | train | Write from stream to file. | [
30522,
2270,
10763,
5371,
4339,
19699,
22225,
25379,
1006,
20407,
25379,
1999,
1010,
5371,
4078,
2102,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2709,
5371,
15994,
1012,
3443,
1006,
4078,
2102,
1007,
1012,
4339,
19699,
22225,
25379... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/WeightedFairQueueByteDistributor.java | WeightedFairQueueByteDistributor.numChildren | int numChildren(int streamId) {
State state = state(streamId);
return state == null ? 0 : state.children.size();
} | java | int numChildren(int streamId) {
State state = state(streamId);
return state == null ? 0 : state.children.size();
} | [
"int",
"numChildren",
"(",
"int",
"streamId",
")",
"{",
"State",
"state",
"=",
"state",
"(",
"streamId",
")",
";",
"return",
"state",
"==",
"null",
"?",
"0",
":",
"state",
".",
"children",
".",
"size",
"(",
")",
";",
"}"
] | For testing only! | [
"For",
"testing",
"only!"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributor.java#L367-L370 | train | Returns number of children of a given stream. | [
30522,
20014,
16371,
12458,
19466,
16200,
2078,
1006,
20014,
5460,
3593,
1007,
1063,
2110,
2110,
1027,
2110,
1006,
5460,
3593,
1007,
1025,
2709,
2110,
1027,
1027,
19701,
1029,
1014,
1024,
2110,
1012,
2336,
1012,
2946,
1006,
1007,
1025,
1065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/instance/SlotSharingGroupAssignment.java | SlotSharingGroupAssignment.releaseSimpleSlot | void releaseSimpleSlot(SimpleSlot simpleSlot) {
synchronized (lock) {
// try to transition to the CANCELED state. That state marks
// that the releasing is in progress
if (simpleSlot.markCancelled()) {
// sanity checks
if (simpleSlot.isAlive()) {
throw new IllegalStateException("slot is still a... | java | void releaseSimpleSlot(SimpleSlot simpleSlot) {
synchronized (lock) {
// try to transition to the CANCELED state. That state marks
// that the releasing is in progress
if (simpleSlot.markCancelled()) {
// sanity checks
if (simpleSlot.isAlive()) {
throw new IllegalStateException("slot is still a... | [
"void",
"releaseSimpleSlot",
"(",
"SimpleSlot",
"simpleSlot",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"// try to transition to the CANCELED state. That state marks",
"// that the releasing is in progress",
"if",
"(",
"simpleSlot",
".",
"markCancelled",
"(",
")",
")... | Releases the simple slot from the assignment group.
@param simpleSlot The SimpleSlot to be released | [
"Releases",
"the",
"simple",
"slot",
"from",
"the",
"assignment",
"group",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/instance/SlotSharingGroupAssignment.java#L457-L509 | train | Releases a slot from the slot sharing group. | [
30522,
11675,
7085,
5714,
21112,
10994,
1006,
3722,
14540,
4140,
3722,
14540,
4140,
1007,
1063,
25549,
1006,
5843,
1007,
1063,
1013,
1013,
3046,
2000,
6653,
2000,
1996,
13261,
2110,
1012,
2008,
2110,
6017,
1013,
1013,
2008,
1996,
8287,
2003... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/comparator/CompareUtil.java | CompareUtil.compare | public static <T extends Comparable<? super T>> int compare(T c1, T c2, boolean isNullGreater) {
if (c1 == c2) {
return 0;
} else if (c1 == null) {
return isNullGreater ? 1 : -1;
} else if (c2 == null) {
return isNullGreater ? -1 : 1;
}
return c1.compareTo(c2);
} | java | public static <T extends Comparable<? super T>> int compare(T c1, T c2, boolean isNullGreater) {
if (c1 == c2) {
return 0;
} else if (c1 == null) {
return isNullGreater ? 1 : -1;
} else if (c2 == null) {
return isNullGreater ? -1 : 1;
}
return c1.compareTo(c2);
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
"super",
"T",
">",
">",
"int",
"compare",
"(",
"T",
"c1",
",",
"T",
"c2",
",",
"boolean",
"isNullGreater",
")",
"{",
"if",
"(",
"c1",
"==",
"c2",
")",
"{",
"return",
"0",
";",
"}",
... | {@code null}安全的对象比较
@param <T> 被比较对象类型(必须实现Comparable接口)
@param c1 对象1,可以为{@code null}
@param c2 对象2,可以为{@code null}
@param isNullGreater 当被比较对象为null时是否排在前面
@return 比较结果,如果c1 < c2,返回数小于0,c1==c2返回0,c1 > c2 大于0
@see java.util.Comparator#compare(Object, Object) | [
"{",
"@code",
"null",
"}",
"安全的对象比较"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/comparator/CompareUtil.java#L28-L37 | train | Compare two Comparable objects. | [
30522,
2270,
10763,
1026,
1056,
8908,
12435,
1026,
1029,
3565,
1056,
1028,
1028,
20014,
12826,
1006,
1056,
27723,
1010,
1056,
29248,
1010,
22017,
20898,
3475,
18083,
17603,
24932,
1007,
1063,
2065,
1006,
27723,
1027,
1027,
29248,
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... |
apache/flink | flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/factories/TableFactoryUtil.java | TableFactoryUtil.findAndCreateTableSink | public static <T> TableSink<T> findAndCreateTableSink(Descriptor descriptor) {
Map<String, String> properties = descriptor.toProperties();
TableSink tableSink;
try {
tableSink = TableFactoryService
.find(TableSinkFactory.class, properties)
.createTableSink(properties);
} catch (Throwable t) {
thr... | java | public static <T> TableSink<T> findAndCreateTableSink(Descriptor descriptor) {
Map<String, String> properties = descriptor.toProperties();
TableSink tableSink;
try {
tableSink = TableFactoryService
.find(TableSinkFactory.class, properties)
.createTableSink(properties);
} catch (Throwable t) {
thr... | [
"public",
"static",
"<",
"T",
">",
"TableSink",
"<",
"T",
">",
"findAndCreateTableSink",
"(",
"Descriptor",
"descriptor",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
"=",
"descriptor",
".",
"toProperties",
"(",
")",
";",
"TableSink",
... | Returns a table sink matching the descriptor. | [
"Returns",
"a",
"table",
"sink",
"matching",
"the",
"descriptor",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/factories/TableFactoryUtil.java#L65-L78 | train | Find and create a table sink. | [
30522,
2270,
10763,
1026,
1056,
1028,
7251,
19839,
1026,
1056,
1028,
2424,
5685,
16748,
3686,
10880,
11493,
2243,
1006,
4078,
23235,
2953,
4078,
23235,
2953,
1007,
1063,
4949,
1026,
5164,
1010,
5164,
1028,
5144,
1027,
4078,
23235,
2953,
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... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/DbUtil.java | DbUtil.newSqlRunner | @Deprecated
public static SqlRunner newSqlRunner(DataSource ds, Dialect dialect) {
return SqlRunner.create(ds, dialect);
} | java | @Deprecated
public static SqlRunner newSqlRunner(DataSource ds, Dialect dialect) {
return SqlRunner.create(ds, dialect);
} | [
"@",
"Deprecated",
"public",
"static",
"SqlRunner",
"newSqlRunner",
"(",
"DataSource",
"ds",
",",
"Dialect",
"dialect",
")",
"{",
"return",
"SqlRunner",
".",
"create",
"(",
"ds",
",",
"dialect",
")",
";",
"}"
] | 实例化一个新的SQL运行对象
@param ds 数据源
@param dialect SQL方言
@return SQL执行类
@deprecated 请使用 {@link #use(DataSource, Dialect)} | [
"实例化一个新的SQL运行对象"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/DbUtil.java#L95-L98 | train | Create a new instance of a sql runner. | [
30522,
1030,
2139,
28139,
12921,
2270,
10763,
29296,
23195,
2739,
4160,
20974,
4609,
3678,
1006,
2951,
6499,
3126,
3401,
16233,
1010,
9329,
9329,
1007,
1063,
2709,
29296,
23195,
1012,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/LexerEngineFactory.java | LexerEngineFactory.newInstance | public static LexerEngine newInstance(final DatabaseType dbType, final String sql) {
switch (dbType) {
case H2:
return new LexerEngine(new H2Lexer(sql));
case MySQL:
return new LexerEngine(new MySQLLexer(sql));
case Oracle:
retu... | java | public static LexerEngine newInstance(final DatabaseType dbType, final String sql) {
switch (dbType) {
case H2:
return new LexerEngine(new H2Lexer(sql));
case MySQL:
return new LexerEngine(new MySQLLexer(sql));
case Oracle:
retu... | [
"public",
"static",
"LexerEngine",
"newInstance",
"(",
"final",
"DatabaseType",
"dbType",
",",
"final",
"String",
"sql",
")",
"{",
"switch",
"(",
"dbType",
")",
"{",
"case",
"H2",
":",
"return",
"new",
"LexerEngine",
"(",
"new",
"H2Lexer",
"(",
"sql",
")",... | Create lexical analysis engine instance.
@param dbType database type
@param sql SQL
@return lexical analysis engine instance | [
"Create",
"lexical",
"analysis",
"engine",
"instance",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/LexerEngineFactory.java#L44-L59 | train | Create lexer engine instance. | [
30522,
2270,
10763,
17244,
7869,
3070,
3170,
2047,
7076,
26897,
1006,
2345,
7809,
13874,
16962,
13874,
1010,
2345,
5164,
29296,
1007,
1063,
6942,
1006,
16962,
13874,
1007,
1063,
2553,
1044,
2475,
1024,
2709,
2047,
17244,
7869,
3070,
3170,
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/executiongraph/Execution.java | Execution.notifyCheckpointComplete | public void notifyCheckpointComplete(long checkpointId, long timestamp) {
final LogicalSlot slot = assignedResource;
if (slot != null) {
final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway();
taskManagerGateway.notifyCheckpointComplete(attemptId, getVertex().getJobId(), checkpointId, ti... | java | public void notifyCheckpointComplete(long checkpointId, long timestamp) {
final LogicalSlot slot = assignedResource;
if (slot != null) {
final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway();
taskManagerGateway.notifyCheckpointComplete(attemptId, getVertex().getJobId(), checkpointId, ti... | [
"public",
"void",
"notifyCheckpointComplete",
"(",
"long",
"checkpointId",
",",
"long",
"timestamp",
")",
"{",
"final",
"LogicalSlot",
"slot",
"=",
"assignedResource",
";",
"if",
"(",
"slot",
"!=",
"null",
")",
"{",
"final",
"TaskManagerGateway",
"taskManagerGatew... | Notify the task of this execution about a completed checkpoint.
@param checkpointId of the completed checkpoint
@param timestamp of the completed checkpoint | [
"Notify",
"the",
"task",
"of",
"this",
"execution",
"about",
"a",
"completed",
"checkpoint",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java#L848-L859 | train | Notifies the task manager that a checkpoint has completed. | [
30522,
2270,
11675,
2025,
8757,
5403,
3600,
8400,
9006,
10814,
2618,
1006,
2146,
26520,
3593,
1010,
2146,
2335,
15464,
2361,
1007,
1063,
2345,
11177,
14540,
4140,
10453,
1027,
4137,
6072,
8162,
3401,
1025,
2065,
1006,
10453,
999,
1027,
1970... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ArrayUtil.java | ArrayUtil.copy | public static Object copy(Object src, int srcPos, Object dest, int destPos, int length) {
System.arraycopy(src, srcPos, dest, destPos, length);
return dest;
} | java | public static Object copy(Object src, int srcPos, Object dest, int destPos, int length) {
System.arraycopy(src, srcPos, dest, destPos, length);
return dest;
} | [
"public",
"static",
"Object",
"copy",
"(",
"Object",
"src",
",",
"int",
"srcPos",
",",
"Object",
"dest",
",",
"int",
"destPos",
",",
"int",
"length",
")",
"{",
"System",
".",
"arraycopy",
"(",
"src",
",",
"srcPos",
",",
"dest",
",",
"destPos",
",",
"... | 包装 {@link System#arraycopy(Object, int, Object, int, int)}<br>
数组复制
@param src 源数组
@param srcPos 源数组开始位置
@param dest 目标数组
@param destPos 目标数组开始位置
@param length 拷贝数组长度
@return 目标数组
@since 3.0.6 | [
"包装",
"{",
"@link",
"System#arraycopy",
"(",
"Object",
"int",
"Object",
"int",
"int",
")",
"}",
"<br",
">",
"数组复制"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L573-L576 | train | Copies the contents of the array src to the array dest. | [
30522,
2270,
10763,
4874,
6100,
1006,
4874,
5034,
2278,
1010,
20014,
5034,
21906,
2891,
1010,
4874,
4078,
2102,
1010,
20014,
4078,
25856,
2891,
1010,
20014,
3091,
1007,
1063,
2291,
1012,
9140,
3597,
7685,
1006,
5034,
2278,
1010,
5034,
21906... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTags.java | WebClientExchangeTags.clientName | public static Tag clientName(ClientRequest request) {
String host = request.url().getHost();
if (host == null) {
return CLIENT_NAME_NONE;
}
return Tag.of("clientName", host);
} | java | public static Tag clientName(ClientRequest request) {
String host = request.url().getHost();
if (host == null) {
return CLIENT_NAME_NONE;
}
return Tag.of("clientName", host);
} | [
"public",
"static",
"Tag",
"clientName",
"(",
"ClientRequest",
"request",
")",
"{",
"String",
"host",
"=",
"request",
".",
"url",
"(",
")",
".",
"getHost",
"(",
")",
";",
"if",
"(",
"host",
"==",
"null",
")",
"{",
"return",
"CLIENT_NAME_NONE",
";",
"}"... | Create a {@code clientName} {@code Tag} derived from the
{@link java.net.URI#getHost host} of the {@link ClientRequest#url() URL} of the
given {@code request}.
@param request the request
@return the clientName tag | [
"Create",
"a",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTags.java#L120-L126 | train | Gets the client name. | [
30522,
2270,
10763,
6415,
7396,
18442,
1006,
7396,
2890,
15500,
5227,
1007,
1063,
5164,
3677,
1027,
5227,
1012,
24471,
2140,
1006,
1007,
1012,
2131,
15006,
2102,
1006,
1007,
1025,
2065,
1006,
3677,
1027,
1027,
19701,
1007,
1063,
2709,
7396,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Sign.java | Sign.verify | public boolean verify(byte[] data, byte[] sign) {
lock.lock();
try {
signature.initVerify(this.publicKey);
signature.update(data);
return signature.verify(sign);
} catch (Exception e) {
throw new CryptoException(e);
} finally {
lock.unlock();
}
} | java | public boolean verify(byte[] data, byte[] sign) {
lock.lock();
try {
signature.initVerify(this.publicKey);
signature.update(data);
return signature.verify(sign);
} catch (Exception e) {
throw new CryptoException(e);
} finally {
lock.unlock();
}
} | [
"public",
"boolean",
"verify",
"(",
"byte",
"[",
"]",
"data",
",",
"byte",
"[",
"]",
"sign",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"signature",
".",
"initVerify",
"(",
"this",
".",
"publicKey",
")",
";",
"signature",
".",
"updat... | 用公钥检验数字签名的合法性
@param data 数据
@param sign 签名
@return 是否验证通过 | [
"用公钥检验数字签名的合法性"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/Sign.java#L195-L206 | train | Verifies the signature of the data. | [
30522,
2270,
22017,
20898,
20410,
1006,
24880,
1031,
1033,
2951,
1010,
24880,
1031,
1033,
3696,
1007,
30524,
1012,
10651,
1006,
2951,
1007,
1025,
2709,
8085,
1012,
20410,
1006,
3696,
1007,
1025,
1065,
4608,
1006,
6453,
1041,
1007,
1063,
546... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.validateIpv4 | public static <T extends CharSequence> T validateIpv4(T value, String errorMsg) throws ValidateException {
if (false == isIpv4(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | java | public static <T extends CharSequence> T validateIpv4(T value, String errorMsg) throws ValidateException {
if (false == isIpv4(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateIpv4",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isIpv4",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"Va... | 验证是否为IPV4地址
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常 | [
"验证是否为IPV4地址"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L809-L814 | train | Validate an IPv4 address. | [
30522,
2270,
10763,
1026,
1056,
8908,
25869,
3366,
4226,
5897,
1028,
1056,
9398,
3686,
11514,
2615,
2549,
1006,
1056,
3643,
1010,
5164,
7561,
5244,
2290,
1007,
11618,
9398,
3686,
10288,
24422,
1063,
2065,
1006,
6270,
1027,
1027,
2003,
11514... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.next | public static void next(HttpServerExchange httpServerExchange, HttpHandler next) throws Exception {
if (next != null) {
next.handleRequest(httpServerExchange);
} else {
next(httpServerExchange);
}
} | java | public static void next(HttpServerExchange httpServerExchange, HttpHandler next) throws Exception {
if (next != null) {
next.handleRequest(httpServerExchange);
} else {
next(httpServerExchange);
}
} | [
"public",
"static",
"void",
"next",
"(",
"HttpServerExchange",
"httpServerExchange",
",",
"HttpHandler",
"next",
")",
"throws",
"Exception",
"{",
"if",
"(",
"next",
"!=",
"null",
")",
"{",
"next",
".",
"handleRequest",
"(",
"httpServerExchange",
")",
";",
"}",... | Go to the next handler if the given next is none null. Reason for this is for
middleware to provide their instance next if it exists. Since if it exists,
the server hasn't been able to find the handler.yml.
@param httpServerExchange
The current requests server exchange.
@param next
The next HttpHandler to go to if it'... | [
"Go",
"to",
"the",
"next",
"handler",
"if",
"the",
"given",
"next",
"is",
"none",
"null",
".",
"Reason",
"for",
"this",
"is",
"for",
"middleware",
"to",
"provide",
"their",
"instance",
"next",
"if",
"it",
"exists",
".",
"Since",
"if",
"it",
"exists",
"... | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/handler/src/main/java/com/networknt/handler/Handler.java#L224-L230 | train | Handle the next request. | [
30522,
2270,
10763,
11675,
2279,
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,
1063,
2279,
1012,
28213,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/compression/Snappy.java | Snappy.encodeCopy | private static void encodeCopy(ByteBuf out, int offset, int length) {
while (length >= 68) {
encodeCopyWithOffset(out, offset, 64);
length -= 64;
}
if (length > 64) {
encodeCopyWithOffset(out, offset, 60);
length -= 60;
}
encodeCo... | java | private static void encodeCopy(ByteBuf out, int offset, int length) {
while (length >= 68) {
encodeCopyWithOffset(out, offset, 64);
length -= 64;
}
if (length > 64) {
encodeCopyWithOffset(out, offset, 60);
length -= 60;
}
encodeCo... | [
"private",
"static",
"void",
"encodeCopy",
"(",
"ByteBuf",
"out",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"while",
"(",
"length",
">=",
"68",
")",
"{",
"encodeCopyWithOffset",
"(",
"out",
",",
"offset",
",",
"64",
")",
";",
"length",
"-="... | Encodes a series of copies, each at most 64 bytes in length.
@param out The output buffer to write the copy pointer to
@param offset The offset at which the original instance lies
@param length The length of the original instance | [
"Encodes",
"a",
"series",
"of",
"copies",
"each",
"at",
"most",
"64",
"bytes",
"in",
"length",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java#L256-L268 | train | EncodeCopy method. | [
30522,
2797,
10763,
11675,
4372,
16044,
3597,
7685,
1006,
24880,
8569,
2546,
2041,
1010,
20014,
16396,
1010,
20014,
3091,
1007,
1063,
2096,
1006,
3091,
1028,
1027,
30524,
4185,
1025,
1065,
2065,
1006,
3091,
1028,
4185,
1007,
1063,
4372,
160... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/crf/CRFTagger.java | CRFTagger.train | public void train(String templFile, String trainFile, String modelFile,
int maxitr, int freq, double eta, double C, int threadNum, int shrinkingSize,
Encoder.Algorithm algorithm) throws IOException
{
Encoder encoder = new Encoder();
if (!encoder.learn(temp... | java | public void train(String templFile, String trainFile, String modelFile,
int maxitr, int freq, double eta, double C, int threadNum, int shrinkingSize,
Encoder.Algorithm algorithm) throws IOException
{
Encoder encoder = new Encoder();
if (!encoder.learn(temp... | [
"public",
"void",
"train",
"(",
"String",
"templFile",
",",
"String",
"trainFile",
",",
"String",
"modelFile",
",",
"int",
"maxitr",
",",
"int",
"freq",
",",
"double",
"eta",
",",
"double",
"C",
",",
"int",
"threadNum",
",",
"int",
"shrinkingSize",
",",
... | 训练
@param templFile 模板文件
@param trainFile 训练文件
@param modelFile 模型文件
@param maxitr 最大迭代次数
@param freq 特征最低频次
@param eta 收敛阈值
@param C cost-factor
@param threadNum 线程数
@param shrinkingSize
@param algorithm 训练算法
@return | [
"训练"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/crf/CRFTagger.java#L59-L70 | train | Train a single tag set from a templ file and a model file. | [
30522,
2270,
11675,
3345,
1006,
5164,
8915,
8737,
10270,
9463,
1010,
5164,
3345,
8873,
2571,
1010,
5164,
2944,
8873,
2571,
1010,
20014,
21510,
16344,
1010,
20014,
10424,
2063,
4160,
1010,
3313,
27859,
1010,
3313,
1039,
1010,
20014,
11689,
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/HashCodeBuilder.java | HashCodeBuilder.reflectionHashCode | public static int reflectionHashCode(final Object object, final Collection<String> excludeFields) {
return reflectionHashCode(object, ArrayUtil.toArray(excludeFields, String.class));
} | java | public static int reflectionHashCode(final Object object, final Collection<String> excludeFields) {
return reflectionHashCode(object, ArrayUtil.toArray(excludeFields, String.class));
} | [
"public",
"static",
"int",
"reflectionHashCode",
"(",
"final",
"Object",
"object",
",",
"final",
"Collection",
"<",
"String",
">",
"excludeFields",
")",
"{",
"return",
"reflectionHashCode",
"(",
"object",
",",
"ArrayUtil",
".",
"toArray",
"(",
"excludeFields",
"... | <p>
Uses reflection to build a valid hash code from the fields of {@code object}.
</p>
<p>
This constructor uses two hard coded choices for the constants needed to build a hash code.
</p>
<p>
It uses <code>AccessibleObject.setAccessible</code> to gain access to private fields. This means that it will
throw a security... | [
"<p",
">",
"Uses",
"reflection",
"to",
"build",
"a",
"valid",
"hash",
"code",
"from",
"the",
"fields",
"of",
"{",
"@code",
"object",
"}",
".",
"<",
"/",
"p",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/builder/HashCodeBuilder.java#L418-L420 | train | Get the hashCode of the object using reflection. | [
30522,
2270,
10763,
20014,
9185,
14949,
16257,
10244,
1006,
2345,
4874,
4874,
1010,
2345,
3074,
1026,
5164,
1028,
23329,
15155,
1007,
1063,
2709,
9185,
14949,
16257,
10244,
1006,
4874,
1010,
9140,
21823,
2140,
1012,
2000,
2906,
9447,
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/web/servlet/MultipartProperties.java | MultipartProperties.createMultipartConfig | public MultipartConfigElement createMultipartConfig() {
MultipartConfigFactory factory = new MultipartConfigFactory();
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();
map.from(this.fileSizeThreshold).to(factory::setFileSizeThreshold);
map.from(this.location).whenHasText().to(factory::setL... | java | public MultipartConfigElement createMultipartConfig() {
MultipartConfigFactory factory = new MultipartConfigFactory();
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();
map.from(this.fileSizeThreshold).to(factory::setFileSizeThreshold);
map.from(this.location).whenHasText().to(factory::setL... | [
"public",
"MultipartConfigElement",
"createMultipartConfig",
"(",
")",
"{",
"MultipartConfigFactory",
"factory",
"=",
"new",
"MultipartConfigFactory",
"(",
")",
";",
"PropertyMapper",
"map",
"=",
"PropertyMapper",
".",
"get",
"(",
")",
".",
"alwaysApplyingWhenNonNull",
... | Create a new {@link MultipartConfigElement} using the properties.
@return a new {@link MultipartConfigElement} configured using there properties | [
"Create",
"a",
"new",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartProperties.java#L134-L142 | train | Creates a MultipartConfigElement. | [
30522,
2270,
4800,
19362,
13535,
2239,
8873,
12439,
13665,
3443,
12274,
7096,
11514,
8445,
8663,
8873,
2290,
1006,
1007,
1063,
4800,
19362,
13535,
2239,
8873,
25708,
18908,
10253,
4713,
1027,
2047,
4800,
19362,
13535,
2239,
8873,
25708,
18908... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/context/AnnotationConfigServletWebApplicationContext.java | AnnotationConfigServletWebApplicationContext.register | @Override
public final void register(Class<?>... annotatedClasses) {
Assert.notEmpty(annotatedClasses,
"At least one annotated class must be specified");
this.annotatedClasses.addAll(Arrays.asList(annotatedClasses));
} | java | @Override
public final void register(Class<?>... annotatedClasses) {
Assert.notEmpty(annotatedClasses,
"At least one annotated class must be specified");
this.annotatedClasses.addAll(Arrays.asList(annotatedClasses));
} | [
"@",
"Override",
"public",
"final",
"void",
"register",
"(",
"Class",
"<",
"?",
">",
"...",
"annotatedClasses",
")",
"{",
"Assert",
".",
"notEmpty",
"(",
"annotatedClasses",
",",
"\"At least one annotated class must be specified\"",
")",
";",
"this",
".",
"annotat... | Register one or more annotated classes to be processed. Note that
{@link #refresh()} must be called in order for the context to fully process the new
class.
<p>
Calls to {@code #register} are idempotent; adding the same annotated class more
than once has no additional effect.
@param annotatedClasses one or more annotat... | [
"Register",
"one",
"or",
"more",
"annotated",
"classes",
"to",
"be",
"processed",
".",
"Note",
"that",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebApplicationContext.java#L178-L183 | train | Registers the specified annotated classes. | [
30522,
1030,
2058,
15637,
2270,
2345,
11675,
4236,
1006,
2465,
1026,
1029,
1028,
1012,
1012,
1012,
5754,
17287,
3064,
26266,
2229,
1007,
1063,
20865,
1012,
3602,
27718,
2100,
1006,
5754,
17287,
3064,
26266,
2229,
1010,
1000,
2012,
2560,
202... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/window/internal/InternalWindowProcessFunction.java | InternalWindowProcessFunction.open | public void open(Context<K, W> ctx) throws Exception {
this.ctx = ctx;
this.windowAssigner.open(ctx);
} | java | public void open(Context<K, W> ctx) throws Exception {
this.ctx = ctx;
this.windowAssigner.open(ctx);
} | [
"public",
"void",
"open",
"(",
"Context",
"<",
"K",
",",
"W",
">",
"ctx",
")",
"throws",
"Exception",
"{",
"this",
".",
"ctx",
"=",
"ctx",
";",
"this",
".",
"windowAssigner",
".",
"open",
"(",
"ctx",
")",
";",
"}"
] | Initialization method for the function. It is called before the actual working methods. | [
"Initialization",
"method",
"for",
"the",
"function",
".",
"It",
"is",
"called",
"before",
"the",
"actual",
"working",
"methods",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/internal/InternalWindowProcessFunction.java#L58-L61 | train | Opens the context. | [
30522,
2270,
11675,
2330,
1006,
6123,
1026,
1047,
1010,
1059,
1028,
14931,
2595,
1007,
11618,
6453,
1063,
2023,
1012,
14931,
2595,
1027,
14931,
2595,
1025,
2023,
1012,
3332,
12054,
23773,
2121,
1012,
2330,
1006,
14931,
2595,
1007,
1025,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/trie/datrie/Utf8CharacterMapping.java | Utf8CharacterMapping.toIdList | @Override
public int[] toIdList(int codePoint)
{
int count;
if (codePoint < 0x80)
count = 1;
else if (codePoint < 0x800)
count = 2;
else if (codePoint < 0x10000)
count = 3;
else if (codePoint < 0x200000)
count = 4;
e... | java | @Override
public int[] toIdList(int codePoint)
{
int count;
if (codePoint < 0x80)
count = 1;
else if (codePoint < 0x800)
count = 2;
else if (codePoint < 0x10000)
count = 3;
else if (codePoint < 0x200000)
count = 4;
e... | [
"@",
"Override",
"public",
"int",
"[",
"]",
"toIdList",
"(",
"int",
"codePoint",
")",
"{",
"int",
"count",
";",
"if",
"(",
"codePoint",
"<",
"0x80",
")",
"count",
"=",
"1",
";",
"else",
"if",
"(",
"codePoint",
"<",
"0x800",
")",
"count",
"=",
"2",
... | codes ported from iconv lib in utf8.h utf8_codepointtomb | [
"codes",
"ported",
"from",
"iconv",
"lib",
"in",
"utf8",
".",
"h",
"utf8_codepointtomb"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/trie/datrie/Utf8CharacterMapping.java#L55-L100 | train | Override toIdList to return an array of int for a single code point. | [
30522,
1030,
2058,
15637,
2270,
20014,
1031,
1033,
2000,
3593,
9863,
1006,
20014,
3642,
8400,
1007,
1063,
20014,
4175,
1025,
2065,
1006,
3642,
8400,
1026,
1014,
2595,
17914,
1007,
4175,
1027,
1015,
1025,
2842,
2065,
1006,
3642,
8400,
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... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/savepoint/SavepointSerializers.java | SavepointSerializers.getSerializer | @SuppressWarnings("unchecked")
public static SavepointSerializer<?> getSerializer(int version) {
SavepointSerializer<?> serializer = SERIALIZERS.get(version);
if (serializer != null) {
return serializer;
} else {
throw new IllegalArgumentException("Cannot restore savepoint version " + version + ".");
}
... | java | @SuppressWarnings("unchecked")
public static SavepointSerializer<?> getSerializer(int version) {
SavepointSerializer<?> serializer = SERIALIZERS.get(version);
if (serializer != null) {
return serializer;
} else {
throw new IllegalArgumentException("Cannot restore savepoint version " + version + ".");
}
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"SavepointSerializer",
"<",
"?",
">",
"getSerializer",
"(",
"int",
"version",
")",
"{",
"SavepointSerializer",
"<",
"?",
">",
"serializer",
"=",
"SERIALIZERS",
".",
"get",
"(",
"version",
... | Returns the {@link SavepointSerializer} for the given savepoint version.
@param version Savepoint version to get serializer for
@return Savepoint for the given version
@throws IllegalArgumentException If unknown savepoint version | [
"Returns",
"the",
"{",
"@link",
"SavepointSerializer",
"}",
"for",
"the",
"given",
"savepoint",
"version",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/savepoint/SavepointSerializers.java#L74-L82 | train | Get the serializer for the given version. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
3828,
26521,
11610,
28863,
1026,
1029,
1028,
4152,
11610,
28863,
1006,
20014,
2544,
1007,
1063,
3828,
26521,
11610,
28863,
1026,
1029,
1028,
7642,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ssh/Sftp.java | Sftp.cd | @Override
public boolean cd(String directory) {
if (StrUtil.isBlank(directory)) {
// 当前目录
return true;
}
try {
channel.cd(directory.replaceAll("\\\\", "/"));
return true;
} catch (SftpException e) {
return false;
}
} | java | @Override
public boolean cd(String directory) {
if (StrUtil.isBlank(directory)) {
// 当前目录
return true;
}
try {
channel.cd(directory.replaceAll("\\\\", "/"));
return true;
} catch (SftpException e) {
return false;
}
} | [
"@",
"Override",
"public",
"boolean",
"cd",
"(",
"String",
"directory",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"directory",
")",
")",
"{",
"// 当前目录\r",
"return",
"true",
";",
"}",
"try",
"{",
"channel",
".",
"cd",
"(",
"directory",
".",
... | 打开指定目录,如果指定路径非目录或不存在返回false
@param directory directory
@return 是否打开目录 | [
"打开指定目录,如果指定路径非目录或不存在返回false"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ssh/Sftp.java#L276-L288 | train | Opens a remote file descriptor. | [
30522,
1030,
2058,
15637,
2270,
22017,
20898,
3729,
1006,
5164,
14176,
1007,
1063,
2065,
1006,
2358,
22134,
4014,
1012,
2003,
28522,
8950,
1006,
14176,
1007,
1007,
1063,
1013,
1013,
100,
1776,
1918,
100,
2709,
2995,
1025,
1065,
3046,
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... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.fromArgs | public static ParameterTool fromArgs(String[] args) {
final Map<String, String> map = new HashMap<>(args.length / 2);
int i = 0;
while (i < args.length) {
final String key;
if (args[i].startsWith("--")) {
key = args[i].substring(2);
} else if (args[i].startsWith("-")) {
key = args[i].substring(... | java | public static ParameterTool fromArgs(String[] args) {
final Map<String, String> map = new HashMap<>(args.length / 2);
int i = 0;
while (i < args.length) {
final String key;
if (args[i].startsWith("--")) {
key = args[i].substring(2);
} else if (args[i].startsWith("-")) {
key = args[i].substring(... | [
"public",
"static",
"ParameterTool",
"fromArgs",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
"args",
".",
"length",
"/",
"2",
")",
";",
"int",
"i",
"=",
"0",... | Returns {@link ParameterTool} for the given arguments. The arguments are keys followed by values.
Keys have to start with '-' or '--'
<p><strong>Example arguments:</strong>
--key1 value1 --key2 value2 -key3 value3
@param args Input array arguments
@return A {@link ParameterTool} | [
"Returns",
"{",
"@link",
"ParameterTool",
"}",
"for",
"the",
"given",
"arguments",
".",
"The",
"arguments",
"are",
"keys",
"followed",
"by",
"values",
".",
"Keys",
"have",
"to",
"start",
"with",
"-",
"or",
"--"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L70-L110 | train | Parses the arguments and returns a ParameterTool object. | [
30522,
2270,
10763,
16381,
3406,
4747,
2013,
2906,
5620,
1006,
5164,
1031,
1033,
12098,
5620,
1007,
1063,
2345,
4949,
1026,
5164,
1010,
5164,
1028,
4949,
1027,
2047,
23325,
2863,
2361,
1026,
1028,
1006,
12098,
5620,
1012,
3091,
1013,
1016,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java | FixedLengthRowBasedKeyValueBatch.rowIterator | @Override
public org.apache.spark.unsafe.KVIterator<UnsafeRow, UnsafeRow> rowIterator() {
return new org.apache.spark.unsafe.KVIterator<UnsafeRow, UnsafeRow>() {
private final UnsafeRow key = new UnsafeRow(keySchema.length());
private final UnsafeRow value = new UnsafeRow(valueSchema.length());
... | java | @Override
public org.apache.spark.unsafe.KVIterator<UnsafeRow, UnsafeRow> rowIterator() {
return new org.apache.spark.unsafe.KVIterator<UnsafeRow, UnsafeRow>() {
private final UnsafeRow key = new UnsafeRow(keySchema.length());
private final UnsafeRow value = new UnsafeRow(valueSchema.length());
... | [
"@",
"Override",
"public",
"org",
".",
"apache",
".",
"spark",
".",
"unsafe",
".",
"KVIterator",
"<",
"UnsafeRow",
",",
"UnsafeRow",
">",
"rowIterator",
"(",
")",
"{",
"return",
"new",
"org",
".",
"apache",
".",
"spark",
".",
"unsafe",
".",
"KVIterator",... | Returns an iterator to go through all rows | [
"Returns",
"an",
"iterator",
"to",
"go",
"through",
"all",
"rows"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java#L105-L163 | train | Returns an iterator over the rows of this table. | [
30522,
1030,
2058,
15637,
2270,
8917,
1012,
15895,
1012,
12125,
1012,
25135,
1012,
24888,
21646,
8844,
1026,
25135,
10524,
1010,
25135,
10524,
1028,
5216,
21646,
8844,
1006,
1007,
1063,
2709,
2047,
8917,
1012,
15895,
1012,
12125,
1012,
25135,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java | Statistics.toProperties | @Override
public final Map<String, String> toProperties() {
final DescriptorProperties properties = new DescriptorProperties();
properties.putProperties(internalProperties);
properties.putInt(STATISTICS_PROPERTY_VERSION, 1);
List<Map<String, String>> namedStats = new ArrayList<>();
for (Map.Entry<String, M... | java | @Override
public final Map<String, String> toProperties() {
final DescriptorProperties properties = new DescriptorProperties();
properties.putProperties(internalProperties);
properties.putInt(STATISTICS_PROPERTY_VERSION, 1);
List<Map<String, String>> namedStats = new ArrayList<>();
for (Map.Entry<String, M... | [
"@",
"Override",
"public",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"toProperties",
"(",
")",
"{",
"final",
"DescriptorProperties",
"properties",
"=",
"new",
"DescriptorProperties",
"(",
")",
";",
"properties",
".",
"putProperties",
"(",
"internalPrope... | Converts this descriptor into a set of properties. | [
"Converts",
"this",
"descriptor",
"into",
"a",
"set",
"of",
"properties",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java#L151-L167 | train | Returns a map of properties that can be used to write the descriptor to the output stream. | [
30522,
1030,
2058,
15637,
2270,
2345,
4949,
1026,
5164,
1010,
5164,
1028,
2327,
18981,
8743,
3111,
1006,
1007,
1063,
2345,
4078,
23235,
2953,
21572,
4842,
7368,
5144,
1027,
2047,
4078,
23235,
2953,
21572,
4842,
7368,
1006,
1007,
1025,
5144,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/taskmanager/TaskManagerLocation.java | TaskManagerLocation.getHostName | public static String getHostName(InetAddress inetAddress) {
String hostName;
String fqdnHostName = getFqdnHostName(inetAddress);
if (fqdnHostName.equals(inetAddress.getHostAddress())) {
// this happens when the name lookup fails, either due to an exception,
// or because no hostname can be found for the ad... | java | public static String getHostName(InetAddress inetAddress) {
String hostName;
String fqdnHostName = getFqdnHostName(inetAddress);
if (fqdnHostName.equals(inetAddress.getHostAddress())) {
// this happens when the name lookup fails, either due to an exception,
// or because no hostname can be found for the ad... | [
"public",
"static",
"String",
"getHostName",
"(",
"InetAddress",
"inetAddress",
")",
"{",
"String",
"hostName",
";",
"String",
"fqdnHostName",
"=",
"getFqdnHostName",
"(",
"inetAddress",
")",
";",
"if",
"(",
"fqdnHostName",
".",
"equals",
"(",
"inetAddress",
"."... | Gets the hostname of the TaskManager based on the network address.
@param inetAddress the network address that the TaskManager binds its sockets to
@return hostname of the TaskManager | [
"Gets",
"the",
"hostname",
"of",
"the",
"TaskManager",
"based",
"on",
"the",
"network",
"address",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/TaskManagerLocation.java#L193-L209 | train | Get the hostname of the IP address | [
30522,
2270,
10763,
5164,
2131,
15006,
2102,
18442,
1006,
1999,
12928,
14141,
8303,
1999,
12928,
14141,
8303,
1007,
1063,
5164,
3677,
18442,
1025,
5164,
1042,
4160,
2094,
25311,
14122,
18442,
1027,
2131,
2546,
4160,
2094,
25311,
14122,
18442,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-planner-blink/src/main/java/org/apache/flink/table/expressions/RexNodeConverter.java | RexNodeConverter.valueAsCalendar | private static Calendar valueAsCalendar(Object value) {
Date date = (Date) value;
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal;
} | java | private static Calendar valueAsCalendar(Object value) {
Date date = (Date) value;
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal;
} | [
"private",
"static",
"Calendar",
"valueAsCalendar",
"(",
"Object",
"value",
")",
"{",
"Date",
"date",
"=",
"(",
"Date",
")",
"value",
";",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"date",
")",
"... | Convert a Date value to a Calendar. Calcite's fromCalendarField functions use the
Calendar.get methods, so the raw values of the individual fields are preserved when
converted to the String formats.
@return get the Calendar value | [
"Convert",
"a",
"Date",
"value",
"to",
"a",
"Calendar",
".",
"Calcite",
"s",
"fromCalendarField",
"functions",
"use",
"the",
"Calendar",
".",
"get",
"methods",
"so",
"the",
"raw",
"values",
"of",
"the",
"individual",
"fields",
"are",
"preserved",
"when",
"co... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/expressions/RexNodeConverter.java#L234-L239 | train | Convert value to Calendar. | [
30522,
2797,
10763,
8094,
3643,
3022,
9289,
10497,
2906,
1006,
4874,
3643,
1007,
1063,
3058,
3058,
1027,
1006,
3058,
1007,
3643,
1025,
8094,
10250,
1027,
8094,
1012,
2131,
7076,
26897,
1006,
1007,
1025,
10250,
1012,
2275,
7292,
1006,
3058,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
redisson/redisson | redisson/src/main/java/org/redisson/misc/HighwayHash.java | HighwayHash.hash128 | public static long[] hash128(
byte[] data, int offset, int length, long[] key) {
HighwayHash h = new HighwayHash(key);
h.processAll(data, offset, length);
return h.finalize128();
} | java | public static long[] hash128(
byte[] data, int offset, int length, long[] key) {
HighwayHash h = new HighwayHash(key);
h.processAll(data, offset, length);
return h.finalize128();
} | [
"public",
"static",
"long",
"[",
"]",
"hash128",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
",",
"long",
"[",
"]",
"key",
")",
"{",
"HighwayHash",
"h",
"=",
"new",
"HighwayHash",
"(",
"key",
")",
";",
"h",
".",
"pr... | NOTE: The 128-bit HighwayHash algorithm is not yet frozen and subject to change.
@param data array with data bytes
@param offset position of first byte of data to read from
@param length number of bytes from data to read
@param key array of size 4 with the key to initialize the hash with
@return array of size 2 contai... | [
"NOTE",
":",
"The",
"128",
"-",
"bit",
"HighwayHash",
"algorithm",
"is",
"not",
"yet",
"frozen",
"and",
"subject",
"to",
"change",
"."
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/misc/HighwayHash.java#L305-L310 | train | Hash 128 - bit bytes. | [
30522,
2270,
10763,
2146,
1031,
1033,
23325,
12521,
2620,
1006,
24880,
1031,
1033,
2951,
1010,
20014,
16396,
1010,
20014,
3091,
1010,
2146,
1031,
1033,
3145,
1007,
1063,
3307,
14949,
2232,
1044,
1027,
2047,
3307,
14949,
2232,
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... |
apache/spark | common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDB.java | LevelDB.db | DB db() {
DB _db = this._db.get();
if (_db == null) {
throw new IllegalStateException("DB is closed.");
}
return _db;
} | java | DB db() {
DB _db = this._db.get();
if (_db == null) {
throw new IllegalStateException("DB is closed.");
}
return _db;
} | [
"DB",
"db",
"(",
")",
"{",
"DB",
"_db",
"=",
"this",
".",
"_db",
".",
"get",
"(",
")",
";",
"if",
"(",
"_db",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"DB is closed.\"",
")",
";",
"}",
"return",
"_db",
";",
"}"
] | Try to avoid use-after close since that has the tendency of crashing the JVM. This doesn't
prevent methods that retrieved the instance from using it after close, but hopefully will
catch most cases; otherwise, we'll need some kind of locking. | [
"Try",
"to",
"avoid",
"use",
"-",
"after",
"close",
"since",
"that",
"has",
"the",
"tendency",
"of",
"crashing",
"the",
"JVM",
".",
"This",
"doesn",
"t",
"prevent",
"methods",
"that",
"retrieved",
"the",
"instance",
"from",
"using",
"it",
"after",
"close",... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDB.java#L264-L270 | train | Get the DB object. | [
30522,
16962,
16962,
1006,
1007,
1063,
16962,
1035,
16962,
1027,
2023,
1012,
1035,
16962,
1012,
2131,
1006,
1007,
1025,
2065,
1006,
1035,
16962,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
6206,
9153,
17389,
2595,
24422,
1006,
1000,
16962,
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... |
redisson/redisson | redisson/src/main/java/org/redisson/config/Config.java | Config.fromYAML | public static Config fromYAML(InputStream inputStream) throws IOException {
ConfigSupport support = new ConfigSupport();
return support.fromYAML(inputStream, Config.class);
} | java | public static Config fromYAML(InputStream inputStream) throws IOException {
ConfigSupport support = new ConfigSupport();
return support.fromYAML(inputStream, Config.class);
} | [
"public",
"static",
"Config",
"fromYAML",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"ConfigSupport",
"support",
"=",
"new",
"ConfigSupport",
"(",
")",
";",
"return",
"support",
".",
"fromYAML",
"(",
"inputStream",
",",
"Config",
".",
... | Read config object stored in YAML format from <code>InputStream</code>
@param inputStream object
@return config
@throws IOException error | [
"Read",
"config",
"object",
"stored",
"in",
"YAML",
"format",
"from",
"<code",
">",
"InputStream<",
"/",
"code",
">"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/config/Config.java#L651-L654 | train | Creates a Config object from a YAML input stream. | [
30522,
2270,
10763,
9530,
8873,
2290,
2013,
14852,
2140,
1006,
20407,
25379,
20407,
25379,
1007,
11618,
22834,
10288,
24422,
1063,
9530,
8873,
5620,
6279,
6442,
2490,
1027,
2047,
9530,
8873,
5620,
6279,
6442,
1006,
1007,
1025,
2709,
2490,
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-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java | SqlValidatorImpl.registerQuery | private void registerQuery(
SqlValidatorScope parentScope,
SqlValidatorScope usingScope,
SqlNode node,
SqlNode enclosingNode,
String alias,
boolean forceNullable,
boolean checkUpdate) {
Objects.requireNonNull(node);
Objects.requireNonNull(enclosingNode);
Preconditions.checkArgument(usingScope == nul... | java | private void registerQuery(
SqlValidatorScope parentScope,
SqlValidatorScope usingScope,
SqlNode node,
SqlNode enclosingNode,
String alias,
boolean forceNullable,
boolean checkUpdate) {
Objects.requireNonNull(node);
Objects.requireNonNull(enclosingNode);
Preconditions.checkArgument(usingScope == nul... | [
"private",
"void",
"registerQuery",
"(",
"SqlValidatorScope",
"parentScope",
",",
"SqlValidatorScope",
"usingScope",
",",
"SqlNode",
"node",
",",
"SqlNode",
"enclosingNode",
",",
"String",
"alias",
",",
"boolean",
"forceNullable",
",",
"boolean",
"checkUpdate",
")",
... | Registers a query in a parent scope.
@param parentScope Parent scope which this scope turns to in order to
resolve objects
@param usingScope Scope whose child list this scope should add itself to
@param node Query node
@param alias Name of this query within its parent. Must be specified
if usingScope != ... | [
"Registers",
"a",
"query",
"in",
"a",
"parent",
"scope",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L2371-L2685 | train | Register a query with the appropriate scope. | [
30522,
2797,
11675,
4236,
4226,
2854,
1006,
29296,
10175,
8524,
6591,
16186,
3008,
16186,
1010,
29296,
10175,
8524,
6591,
16186,
2478,
26127,
1010,
29296,
3630,
3207,
13045,
1010,
29296,
3630,
3207,
4372,
20464,
18606,
3630,
3207,
1010,
5164,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/DbUtil.java | DbUtil.setShowSqlGlobal | public static void setShowSqlGlobal(Setting setting) {
// 初始化SQL显示
final boolean isShowSql = Convert.toBool(setting.remove("showSql"), false);
final boolean isFormatSql = Convert.toBool(setting.remove("formatSql"), false);
final boolean isShowParams = Convert.toBool(setting.remove("showParams"), false);
... | java | public static void setShowSqlGlobal(Setting setting) {
// 初始化SQL显示
final boolean isShowSql = Convert.toBool(setting.remove("showSql"), false);
final boolean isFormatSql = Convert.toBool(setting.remove("formatSql"), false);
final boolean isShowParams = Convert.toBool(setting.remove("showParams"), false);
... | [
"public",
"static",
"void",
"setShowSqlGlobal",
"(",
"Setting",
"setting",
")",
"{",
"// 初始化SQL显示\r",
"final",
"boolean",
"isShowSql",
"=",
"Convert",
".",
"toBool",
"(",
"setting",
".",
"remove",
"(",
"\"showSql\"",
")",
",",
"false",
")",
";",
"final",
"bo... | 从配置文件中读取SQL打印选项
@param setting 配置文件
@since 4.1.7 | [
"从配置文件中读取SQL打印选项"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/DbUtil.java#L236-L248 | train | Sets the showSql global setting. | [
30522,
2270,
10763,
11675,
4520,
14406,
2015,
4160,
2140,
23296,
16429,
2389,
1006,
4292,
4292,
1007,
1063,
1013,
1013,
100,
100,
100,
29296,
100,
1923,
2345,
22017,
20898,
26354,
14406,
2015,
4160,
2140,
1027,
10463,
1012,
2000,
5092,
4747... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/functions/SqlLikeUtils.java | SqlLikeUtils.sqlToRegexSimilar | static String sqlToRegexSimilar(
String sqlPattern,
char escapeChar) {
similarEscapeRuleChecking(sqlPattern, escapeChar);
boolean insideCharacterEnumeration = false;
final StringBuilder javaPattern =
new StringBuilder(sqlPattern.length() * 2);
final int len = sqlPattern.length();
for (int i = 0; i < l... | java | static String sqlToRegexSimilar(
String sqlPattern,
char escapeChar) {
similarEscapeRuleChecking(sqlPattern, escapeChar);
boolean insideCharacterEnumeration = false;
final StringBuilder javaPattern =
new StringBuilder(sqlPattern.length() * 2);
final int len = sqlPattern.length();
for (int i = 0; i < l... | [
"static",
"String",
"sqlToRegexSimilar",
"(",
"String",
"sqlPattern",
",",
"char",
"escapeChar",
")",
"{",
"similarEscapeRuleChecking",
"(",
"sqlPattern",
",",
"escapeChar",
")",
";",
"boolean",
"insideCharacterEnumeration",
"=",
"false",
";",
"final",
"StringBuilder"... | Translates SQL SIMILAR pattern to Java regex pattern. | [
"Translates",
"SQL",
"SIMILAR",
"pattern",
"to",
"Java",
"regex",
"pattern",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlLikeUtils.java#L231-L306 | train | Converts SQL pattern to regular expression similar. | [
30522,
10763,
5164,
29296,
19277,
3351,
2595,
5332,
4328,
8017,
1006,
5164,
29296,
4502,
12079,
2078,
1010,
25869,
4019,
7507,
2099,
1007,
1063,
2714,
2229,
19464,
6820,
2571,
5403,
23177,
1006,
29296,
4502,
12079,
2078,
1010,
4019,
7507,
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-core/src/main/java/org/apache/flink/util/LinkedOptionalMap.java | LinkedOptionalMap.unwrapOptionals | public LinkedHashMap<K, V> unwrapOptionals() {
final LinkedHashMap<K, V> unwrapped = new LinkedHashMap<>(underlyingMap.size());
for (Entry<String, KeyValue<K, V>> entry : underlyingMap.entrySet()) {
String namedKey = entry.getKey();
KeyValue<K, V> kv = entry.getValue();
if (kv.key == null) {
throw new... | java | public LinkedHashMap<K, V> unwrapOptionals() {
final LinkedHashMap<K, V> unwrapped = new LinkedHashMap<>(underlyingMap.size());
for (Entry<String, KeyValue<K, V>> entry : underlyingMap.entrySet()) {
String namedKey = entry.getKey();
KeyValue<K, V> kv = entry.getValue();
if (kv.key == null) {
throw new... | [
"public",
"LinkedHashMap",
"<",
"K",
",",
"V",
">",
"unwrapOptionals",
"(",
")",
"{",
"final",
"LinkedHashMap",
"<",
"K",
",",
"V",
">",
"unwrapped",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
"underlyingMap",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
... | Assuming all the entries of this map are present (keys and values) this method would return
a map with these key and values, stripped from their Optional wrappers.
NOTE: please note that if any of the key or values are absent this method would throw an {@link IllegalStateException}. | [
"Assuming",
"all",
"the",
"entries",
"of",
"this",
"map",
"are",
"present",
"(",
"keys",
"and",
"values",
")",
"this",
"method",
"would",
"return",
"a",
"map",
"with",
"these",
"key",
"and",
"values",
"stripped",
"from",
"their",
"Optional",
"wrappers",
".... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/LinkedOptionalMap.java#L180-L195 | train | Unwraps the options of the map. | [
30522,
2270,
5799,
14949,
22444,
2361,
1026,
1047,
1010,
1058,
1028,
4895,
13088,
9331,
7361,
3508,
9777,
1006,
1007,
1063,
2345,
5799,
14949,
22444,
2361,
1026,
1047,
1010,
1058,
1028,
4895,
13088,
29098,
2098,
1027,
2047,
5799,
14949,
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/seg/DictionaryBasedSegment.java | DictionaryBasedSegment.posTag | protected void posTag(char[] charArray, int[] wordNet, Nature[] natureArray)
{
if (config.speechTagging)
{
for (int i = 0; i < natureArray.length; )
{
if (natureArray[i] == null)
{
int j = i + 1;
for (; j... | java | protected void posTag(char[] charArray, int[] wordNet, Nature[] natureArray)
{
if (config.speechTagging)
{
for (int i = 0; i < natureArray.length; )
{
if (natureArray[i] == null)
{
int j = i + 1;
for (; j... | [
"protected",
"void",
"posTag",
"(",
"char",
"[",
"]",
"charArray",
",",
"int",
"[",
"]",
"wordNet",
",",
"Nature",
"[",
"]",
"natureArray",
")",
"{",
"if",
"(",
"config",
".",
"speechTagging",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | 词性标注
@param charArray 字符数组
@param wordNet 词语长度
@param natureArray 输出词性 | [
"词性标注"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/DictionaryBasedSegment.java#L46-L77 | train | posTag Method. | [
30522,
5123,
11675,
2695,
8490,
1006,
25869,
1031,
1033,
25869,
2906,
9447,
1010,
20014,
1031,
1033,
2773,
7159,
1010,
3267,
1031,
1033,
3267,
2906,
9447,
1007,
1063,
2065,
1006,
9530,
8873,
2290,
1012,
4613,
15900,
4726,
1007,
1063,
2005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.file | public static File file(File parent, String path) {
if (StrUtil.isBlank(path)) {
throw new NullPointerException("File path is blank!");
}
return checkSlip(parent, new File(parent, path));
} | java | public static File file(File parent, String path) {
if (StrUtil.isBlank(path)) {
throw new NullPointerException("File path is blank!");
}
return checkSlip(parent, new File(parent, path));
} | [
"public",
"static",
"File",
"file",
"(",
"File",
"parent",
",",
"String",
"path",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"path",
")",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"File path is blank!\"",
")",
";",
"}",
"return",
... | 创建File对象<br>
此方法会检查slip漏洞,漏洞说明见http://blog.nsfocus.net/zip-slip-2/
@param parent 父文件对象
@param path 文件路径
@return File | [
"创建File对象<br",
">",
"此方法会检查slip漏洞,漏洞说明见http",
":",
"//",
"blog",
".",
"nsfocus",
".",
"net",
"/",
"zip",
"-",
"slip",
"-",
"2",
"/"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L341-L346 | train | Creates a new file from the given parent file and path. | [
30522,
2270,
10763,
5371,
5371,
1006,
5371,
6687,
1010,
5164,
4130,
1007,
1063,
2065,
1006,
2358,
22134,
4014,
1012,
2003,
28522,
8950,
1006,
4130,
1007,
1007,
1063,
5466,
2047,
19701,
8400,
7869,
2595,
24422,
1006,
1000,
5371,
4130,
2003,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/utility/ByteUtil.java | ByteUtil.bytesHighFirstToInt | public static int bytesHighFirstToInt(byte[] bytes, int start)
{
int num = bytes[start + 3] & 0xFF;
num |= ((bytes[start + 2] << 8) & 0xFF00);
num |= ((bytes[start + 1] << 16) & 0xFF0000);
num |= ((bytes[start] << 24) & 0xFF000000);
return num;
} | java | public static int bytesHighFirstToInt(byte[] bytes, int start)
{
int num = bytes[start + 3] & 0xFF;
num |= ((bytes[start + 2] << 8) & 0xFF00);
num |= ((bytes[start + 1] << 16) & 0xFF0000);
num |= ((bytes[start] << 24) & 0xFF000000);
return num;
} | [
"public",
"static",
"int",
"bytesHighFirstToInt",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"start",
")",
"{",
"int",
"num",
"=",
"bytes",
"[",
"start",
"+",
"3",
"]",
"&",
"0xFF",
";",
"num",
"|=",
"(",
"(",
"bytes",
"[",
"start",
"+",
"2",
"]... | 字节数组和整型的转换,高位在前,适用于读取writeInt的数据
@param bytes 字节数组
@return 整型 | [
"字节数组和整型的转换,高位在前,适用于读取writeInt的数据"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/utility/ByteUtil.java#L237-L244 | train | Get the high - first int from the bytes array. | [
30522,
2270,
10763,
20014,
27507,
4048,
5603,
8873,
12096,
3406,
18447,
1006,
24880,
1031,
1033,
27507,
1010,
20014,
2707,
1007,
1063,
20014,
16371,
2213,
1027,
27507,
1031,
2707,
1009,
1017,
1033,
1004,
1014,
2595,
4246,
1025,
16371,
2213,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
redisson/redisson | redisson/src/main/java/org/redisson/api/MapOptions.java | MapOptions.writer | public MapOptions<K, V> writer(MapWriter<K, V> writer) {
this.writer = writer;
return this;
} | java | public MapOptions<K, V> writer(MapWriter<K, V> writer) {
this.writer = writer;
return this;
} | [
"public",
"MapOptions",
"<",
"K",
",",
"V",
">",
"writer",
"(",
"MapWriter",
"<",
"K",
",",
"V",
">",
"writer",
")",
"{",
"this",
".",
"writer",
"=",
"writer",
";",
"return",
"this",
";",
"}"
] | Sets {@link MapWriter} object.
@param writer object
@return MapOptions instance | [
"Sets",
"{",
"@link",
"MapWriter",
"}",
"object",
"."
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/api/MapOptions.java#L85-L88 | train | Sets the map writer. | [
30522,
2270,
4949,
7361,
9285,
1026,
1047,
1010,
1058,
1028,
3213,
1006,
4949,
15994,
1026,
1047,
1010,
1058,
1028,
3213,
1007,
1063,
2023,
1012,
3213,
1027,
3213,
1025,
2709,
2023,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ClassLoaderUtil.java | ClassLoaderUtil.loadPrimitiveClass | public static Class<?> loadPrimitiveClass(String name) {
Class<?> result = null;
if (StrUtil.isNotBlank(name)) {
name = name.trim();
if (name.length() <= 8) {
result = primitiveTypeNameMap.get(name);
}
}
return result;
} | java | public static Class<?> loadPrimitiveClass(String name) {
Class<?> result = null;
if (StrUtil.isNotBlank(name)) {
name = name.trim();
if (name.length() <= 8) {
result = primitiveTypeNameMap.get(name);
}
}
return result;
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"loadPrimitiveClass",
"(",
"String",
"name",
")",
"{",
"Class",
"<",
"?",
">",
"result",
"=",
"null",
";",
"if",
"(",
"StrUtil",
".",
"isNotBlank",
"(",
"name",
")",
")",
"{",
"name",
"=",
"name",
".",
"t... | 加载原始类型的类。包括原始类型、原始类型数组和void
@param name 原始类型名,比如 int
@return 原始类型类 | [
"加载原始类型的类。包括原始类型、原始类型数组和void"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassLoaderUtil.java#L200-L209 | train | Loads a primitive class from the system. | [
30522,
2270,
10763,
2465,
1026,
1029,
1028,
7170,
18098,
27605,
6024,
26266,
1006,
5164,
2171,
1007,
1063,
2465,
1026,
1029,
1028,
2765,
1027,
19701,
1025,
2065,
1006,
2358,
22134,
4014,
1012,
3475,
4140,
28522,
8950,
1006,
30524,
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-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java | DelimitedInputFormat.configure | @Override
public void configure(Configuration parameters) {
super.configure(parameters);
// the if() clauses are to prevent the configure() method from
// overwriting the values set by the setters
if (Arrays.equals(delimiter, new byte[] {'\n'})) {
String delimString = parameters.getString(RECORD_DELIMITER... | java | @Override
public void configure(Configuration parameters) {
super.configure(parameters);
// the if() clauses are to prevent the configure() method from
// overwriting the values set by the setters
if (Arrays.equals(delimiter, new byte[] {'\n'})) {
String delimString = parameters.getString(RECORD_DELIMITER... | [
"@",
"Override",
"public",
"void",
"configure",
"(",
"Configuration",
"parameters",
")",
"{",
"super",
".",
"configure",
"(",
"parameters",
")",
";",
"// the if() clauses are to prevent the configure() method from",
"// overwriting the values set by the setters",
"if",
"(",
... | Configures this input format by reading the path to the file from the configuration and the string that
defines the record delimiter.
@param parameters The configuration object to read the parameters from. | [
"Configures",
"this",
"input",
"format",
"by",
"reading",
"the",
"path",
"to",
"the",
"file",
"from",
"the",
"configuration",
"and",
"the",
"string",
"that",
"defines",
"the",
"record",
"delimiter",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java#L311-L339 | train | Override the configure method to set the values in the configuration. | [
30522,
1030,
2058,
15637,
2270,
11675,
9530,
8873,
27390,
2063,
1006,
9563,
11709,
1007,
1063,
3565,
1012,
9530,
8873,
27390,
2063,
1006,
11709,
1007,
1025,
1013,
1013,
1996,
2065,
1006,
1007,
24059,
2024,
2000,
4652,
1996,
9530,
8873,
2739... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/CWSEvaluator.java | CWSEvaluator.evaluate | public static CWSEvaluator.Result evaluate(Segment segment, String outputPath, String goldFile, String dictPath) throws IOException
{
IOUtil.LineIterator lineIterator = new IOUtil.LineIterator(goldFile);
BufferedWriter bw = IOUtil.newBufferedWriter(outputPath);
for (String line : lineIterato... | java | public static CWSEvaluator.Result evaluate(Segment segment, String outputPath, String goldFile, String dictPath) throws IOException
{
IOUtil.LineIterator lineIterator = new IOUtil.LineIterator(goldFile);
BufferedWriter bw = IOUtil.newBufferedWriter(outputPath);
for (String line : lineIterato... | [
"public",
"static",
"CWSEvaluator",
".",
"Result",
"evaluate",
"(",
"Segment",
"segment",
",",
"String",
"outputPath",
",",
"String",
"goldFile",
",",
"String",
"dictPath",
")",
"throws",
"IOException",
"{",
"IOUtil",
".",
"LineIterator",
"lineIterator",
"=",
"n... | 标准化评测分词器
@param segment 分词器
@param outputPath 分词预测输出文件
@param goldFile 测试集segmented file
@param dictPath 训练集单词列表
@return 一个储存准确率的结构
@throws IOException | [
"标准化评测分词器"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/common/CWSEvaluator.java#L191-L210 | train | Evaluate a CWSECTYPE file. | [
30522,
2270,
10763,
19296,
3366,
10175,
6692,
4263,
1012,
2765,
16157,
1006,
6903,
6903,
1010,
5164,
6434,
15069,
1010,
5164,
2751,
8873,
2571,
1010,
5164,
4487,
6593,
15069,
1007,
11618,
22834,
10288,
24422,
1063,
22834,
21823,
2140,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.