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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
alibaba/canal | client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/monitor/remote/DbRemoteConfigLoader.java | DbRemoteConfigLoader.loadRemoteConfig | @Override
public void loadRemoteConfig() {
try {
// 加载远程adapter配置
ConfigItem configItem = getRemoteAdapterConfig();
if (configItem != null) {
if (configItem.getModifiedTime() != currentConfigTimestamp) {
currentConfigTimestamp = ... | java | @Override
public void loadRemoteConfig() {
try {
// 加载远程adapter配置
ConfigItem configItem = getRemoteAdapterConfig();
if (configItem != null) {
if (configItem.getModifiedTime() != currentConfigTimestamp) {
currentConfigTimestamp = ... | [
"@",
"Override",
"public",
"void",
"loadRemoteConfig",
"(",
")",
"{",
"try",
"{",
"// 加载远程adapter配置\r",
"ConfigItem",
"configItem",
"=",
"getRemoteAdapterConfig",
"(",
")",
";",
"if",
"(",
"configItem",
"!=",
"null",
")",
"{",
"if",
"(",
"configItem",
".",
"... | 加载远程application.yml配置 | [
"加载远程application",
".",
"yml配置"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/monitor/remote/DbRemoteConfigLoader.java#L73-L88 | train | Load the remote adapter config. | [
30522,
1030,
2058,
15637,
2270,
11675,
7170,
28578,
12184,
8663,
8873,
2290,
1006,
1007,
1063,
3046,
1063,
1013,
1013,
1779,
100,
100,
100,
15581,
2121,
100,
100,
9530,
8873,
23806,
6633,
9530,
8873,
23806,
6633,
1027,
2131,
28578,
12184,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/heartbeat/HeartbeatServices.java | HeartbeatServices.createHeartbeatManagerSender | public <I, O> HeartbeatManager<I, O> createHeartbeatManagerSender(
ResourceID resourceId,
HeartbeatListener<I, O> heartbeatListener,
ScheduledExecutor scheduledExecutor,
Logger log) {
return new HeartbeatManagerSenderImpl<>(
heartbeatInterval,
heartbeatTimeout,
resourceId,
heartbeatListener,
s... | java | public <I, O> HeartbeatManager<I, O> createHeartbeatManagerSender(
ResourceID resourceId,
HeartbeatListener<I, O> heartbeatListener,
ScheduledExecutor scheduledExecutor,
Logger log) {
return new HeartbeatManagerSenderImpl<>(
heartbeatInterval,
heartbeatTimeout,
resourceId,
heartbeatListener,
s... | [
"public",
"<",
"I",
",",
"O",
">",
"HeartbeatManager",
"<",
"I",
",",
"O",
">",
"createHeartbeatManagerSender",
"(",
"ResourceID",
"resourceId",
",",
"HeartbeatListener",
"<",
"I",
",",
"O",
">",
"heartbeatListener",
",",
"ScheduledExecutor",
"scheduledExecutor",
... | Creates a heartbeat manager which actively sends heartbeats to monitoring targets.
@param resourceId Resource Id which identifies the owner of the heartbeat manager
@param heartbeatListener Listener which will be notified upon heartbeat timeouts for registered
targets
@param scheduledExecutor Scheduled executor to be ... | [
"Creates",
"a",
"heartbeat",
"manager",
"which",
"actively",
"sends",
"heartbeats",
"to",
"monitoring",
"targets",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/heartbeat/HeartbeatServices.java#L88-L102 | train | Creates a heartbeat manager sender. | [
30522,
2270,
1026,
1045,
1010,
1051,
1028,
12251,
24805,
4590,
1026,
1045,
1010,
1051,
1028,
3443,
22375,
19442,
24805,
15776,
10497,
2121,
1006,
7692,
3593,
7692,
3593,
1010,
12251,
9863,
24454,
1026,
1045,
1010,
1051,
1028,
12251,
9863,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/nonha/embedded/EmbeddedLeaderService.java | EmbeddedLeaderService.confirmLeader | private void confirmLeader(final EmbeddedLeaderElectionService service, final UUID leaderSessionId) {
synchronized (lock) {
// if the service was shut down in the meantime, ignore this confirmation
if (!service.running || shutdown) {
return;
}
try {
// check if the confirmation is for the same gr... | java | private void confirmLeader(final EmbeddedLeaderElectionService service, final UUID leaderSessionId) {
synchronized (lock) {
// if the service was shut down in the meantime, ignore this confirmation
if (!service.running || shutdown) {
return;
}
try {
// check if the confirmation is for the same gr... | [
"private",
"void",
"confirmLeader",
"(",
"final",
"EmbeddedLeaderElectionService",
"service",
",",
"final",
"UUID",
"leaderSessionId",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"// if the service was shut down in the meantime, ignore this confirmation",
"if",
"(",
"!... | Callback from leader contenders when they confirm a leader grant. | [
"Callback",
"from",
"leader",
"contenders",
"when",
"they",
"confirm",
"a",
"leader",
"grant",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/nonha/embedded/EmbeddedLeaderService.java#L239-L268 | train | Confirm the leader. | [
30522,
2797,
11675,
12210,
19000,
1006,
2345,
11157,
19000,
12260,
22014,
2121,
7903,
2063,
2326,
1010,
2345,
1057,
21272,
4177,
7971,
3258,
3593,
1007,
1063,
25549,
1006,
5843,
1007,
1063,
1013,
1013,
2065,
1996,
2326,
2001,
3844,
2091,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dictionary/CustomDictionary.java | CustomDictionary.add | public static boolean add(String word)
{
if (HanLP.Config.Normalization) word = CharTable.convert(word);
if (contains(word)) return false;
return insert(word, null);
} | java | public static boolean add(String word)
{
if (HanLP.Config.Normalization) word = CharTable.convert(word);
if (contains(word)) return false;
return insert(word, null);
} | [
"public",
"static",
"boolean",
"add",
"(",
"String",
"word",
")",
"{",
"if",
"(",
"HanLP",
".",
"Config",
".",
"Normalization",
")",
"word",
"=",
"CharTable",
".",
"convert",
"(",
"word",
")",
";",
"if",
"(",
"contains",
"(",
"word",
")",
")",
"retur... | 往自定义词典中插入一个新词(非覆盖模式)<br>
动态增删不会持久化到词典文件
@param word 新词 如“裸婚”
@return 是否插入成功(失败的原因可能是不覆盖等,可以通过调试模式了解原因) | [
"往自定义词典中插入一个新词(非覆盖模式)<br",
">",
"动态增删不会持久化到词典文件"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/CustomDictionary.java#L278-L283 | train | Add a new CID word. | [
30522,
2270,
10763,
22017,
20898,
5587,
1006,
5164,
2773,
1007,
1063,
2065,
1006,
7658,
14277,
1012,
9530,
8873,
2290,
1012,
3671,
3989,
1007,
2773,
1027,
3673,
3085,
1012,
10463,
1006,
2773,
1007,
1025,
2065,
1006,
3397,
1006,
2773,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/operators/base/CrossOperatorBase.java | CrossOperatorBase.executeOnCollections | @Override
protected List<OUT> executeOnCollections(List<IN1> inputData1, List<IN2> inputData2, RuntimeContext ctx, ExecutionConfig executionConfig) throws Exception {
CrossFunction<IN1, IN2, OUT> function = this.userFunction.getUserCodeObject();
FunctionUtils.setFunctionRuntimeContext(function, ctx);
Function... | java | @Override
protected List<OUT> executeOnCollections(List<IN1> inputData1, List<IN2> inputData2, RuntimeContext ctx, ExecutionConfig executionConfig) throws Exception {
CrossFunction<IN1, IN2, OUT> function = this.userFunction.getUserCodeObject();
FunctionUtils.setFunctionRuntimeContext(function, ctx);
Function... | [
"@",
"Override",
"protected",
"List",
"<",
"OUT",
">",
"executeOnCollections",
"(",
"List",
"<",
"IN1",
">",
"inputData1",
",",
"List",
"<",
"IN2",
">",
"inputData2",
",",
"RuntimeContext",
"ctx",
",",
"ExecutionConfig",
"executionConfig",
")",
"throws",
"Exce... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/base/CrossOperatorBase.java#L91-L115 | train | Execute on collections. | [
30522,
1030,
2058,
15637,
5123,
2862,
1026,
2041,
1028,
15389,
2239,
26895,
18491,
2015,
1006,
2862,
1026,
1999,
2487,
1028,
7953,
2850,
2696,
2487,
1010,
2862,
1026,
1999,
2475,
1028,
7953,
2850,
2696,
2475,
1010,
2448,
7292,
8663,
18209,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/util/EnvironmentInformation.java | EnvironmentInformation.getJvmStartupOptions | public static String getJvmStartupOptions() {
try {
final RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
final StringBuilder bld = new StringBuilder();
for (String s : bean.getInputArguments()) {
bld.append(s).append(' ');
}
return bld.toString();
}
catch (Throwable t) {
ret... | java | public static String getJvmStartupOptions() {
try {
final RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
final StringBuilder bld = new StringBuilder();
for (String s : bean.getInputArguments()) {
bld.append(s).append(' ');
}
return bld.toString();
}
catch (Throwable t) {
ret... | [
"public",
"static",
"String",
"getJvmStartupOptions",
"(",
")",
"{",
"try",
"{",
"final",
"RuntimeMXBean",
"bean",
"=",
"ManagementFactory",
".",
"getRuntimeMXBean",
"(",
")",
";",
"final",
"StringBuilder",
"bld",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"f... | Gets the system parameters and environment parameters that were passed to the JVM on startup.
@return The options passed to the JVM on startup. | [
"Gets",
"the",
"system",
"parameters",
"and",
"environment",
"parameters",
"that",
"were",
"passed",
"to",
"the",
"JVM",
"on",
"startup",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java#L189-L203 | train | Get the JVM startup options. | [
30522,
2270,
10763,
5164,
2131,
3501,
2615,
5244,
7559,
8525,
16340,
9285,
1006,
1007,
1063,
3046,
1063,
2345,
2448,
7292,
22984,
4783,
2319,
14068,
1027,
2968,
21450,
1012,
2131,
15532,
7292,
22984,
4783,
2319,
1006,
1007,
1025,
2345,
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... |
apache/flink | flink-core/src/main/java/org/apache/flink/util/FileUtils.java | FileUtils.deleteDirectory | public static void deleteDirectory(File directory) throws IOException {
checkNotNull(directory, "directory");
guardIfWindows(FileUtils::deleteDirectoryInternal, directory);
} | java | public static void deleteDirectory(File directory) throws IOException {
checkNotNull(directory, "directory");
guardIfWindows(FileUtils::deleteDirectoryInternal, directory);
} | [
"public",
"static",
"void",
"deleteDirectory",
"(",
"File",
"directory",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"directory",
",",
"\"directory\"",
")",
";",
"guardIfWindows",
"(",
"FileUtils",
"::",
"deleteDirectoryInternal",
",",
"directory",
")",
... | Deletes the given directory recursively.
<p>If the directory does not exist, this does not throw an exception, but simply does nothing.
It considers the fact that a directory-to-be-deleted is not present a success.
<p>This method is safe against other concurrent deletion attempts.
@param directory The directory to b... | [
"Deletes",
"the",
"given",
"directory",
"recursively",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/FileUtils.java#L241-L245 | train | Deletes the given directory. | [
30522,
2270,
10763,
11675,
17159,
7442,
16761,
2100,
1006,
5371,
14176,
1007,
11618,
22834,
10288,
24422,
1063,
4638,
17048,
11231,
3363,
1006,
14176,
1010,
1000,
14176,
1000,
1007,
1025,
3457,
10128,
11101,
15568,
1006,
5371,
21823,
4877,
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/network-common/src/main/java/org/apache/spark/network/TransportContext.java | TransportContext.createServer | public TransportServer createServer(int port, List<TransportServerBootstrap> bootstraps) {
return new TransportServer(this, null, port, rpcHandler, bootstraps);
} | java | public TransportServer createServer(int port, List<TransportServerBootstrap> bootstraps) {
return new TransportServer(this, null, port, rpcHandler, bootstraps);
} | [
"public",
"TransportServer",
"createServer",
"(",
"int",
"port",
",",
"List",
"<",
"TransportServerBootstrap",
">",
"bootstraps",
")",
"{",
"return",
"new",
"TransportServer",
"(",
"this",
",",
"null",
",",
"port",
",",
"rpcHandler",
",",
"bootstraps",
")",
";... | Create a server which will attempt to bind to a specific port. | [
"Create",
"a",
"server",
"which",
"will",
"attempt",
"to",
"bind",
"to",
"a",
"specific",
"port",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/TransportContext.java#L150-L152 | train | Create a new server with the specified port and bootstraps. | [
30522,
2270,
19003,
2121,
6299,
9005,
2121,
6299,
1006,
20014,
3417,
1010,
2862,
1026,
19003,
2121,
6299,
27927,
20528,
2361,
1028,
6879,
6494,
4523,
1007,
1063,
2709,
2047,
19003,
2121,
6299,
1006,
2023,
1010,
19701,
1010,
3417,
1010,
1054... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/HanLP.java | HanLP.convertToPinyinFirstCharString | public static String convertToPinyinFirstCharString(String text, String separator, boolean remainNone)
{
List<Pinyin> pinyinList = PinyinDictionary.convertToPinyin(text, remainNone);
int length = pinyinList.size();
StringBuilder sb = new StringBuilder(length * (1 + separator.length()));
... | java | public static String convertToPinyinFirstCharString(String text, String separator, boolean remainNone)
{
List<Pinyin> pinyinList = PinyinDictionary.convertToPinyin(text, remainNone);
int length = pinyinList.size();
StringBuilder sb = new StringBuilder(length * (1 + separator.length()));
... | [
"public",
"static",
"String",
"convertToPinyinFirstCharString",
"(",
"String",
"text",
",",
"String",
"separator",
",",
"boolean",
"remainNone",
")",
"{",
"List",
"<",
"Pinyin",
">",
"pinyinList",
"=",
"PinyinDictionary",
".",
"convertToPinyin",
"(",
"text",
",",
... | 转化为拼音(首字母)
@param text 文本
@param separator 分隔符
@param remainNone 有些字没有拼音(如标点),是否保留它们(用none表示)
@return 一个字符串,由[首字母][分隔符][首字母]构成 | [
"转化为拼音(首字母)"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/HanLP.java#L608-L624 | train | Convert a string of Pinyin first char to a String of UTF - 8 characters. | [
30522,
2270,
10763,
5164,
10463,
14399,
24300,
2378,
8873,
12096,
7507,
12096,
4892,
1006,
5164,
3793,
1010,
5164,
19802,
25879,
2953,
1010,
22017,
20898,
3961,
8540,
2063,
1007,
1063,
2862,
1026,
9973,
1028,
9973,
9863,
1027,
9973,
29201,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/SqlFunctionUtils.java | SqlFunctionUtils.hash | public static String hash(String algorithm, String str, String charsetName) {
try {
byte[] digest = MessageDigest
.getInstance(algorithm)
.digest(strToBytesWithCharset(str, charsetName));
return EncodingUtils.hex(digest);
} catch (NoSuchAlgorithmException e) {
throw new IllegalArgumentException("Un... | java | public static String hash(String algorithm, String str, String charsetName) {
try {
byte[] digest = MessageDigest
.getInstance(algorithm)
.digest(strToBytesWithCharset(str, charsetName));
return EncodingUtils.hex(digest);
} catch (NoSuchAlgorithmException e) {
throw new IllegalArgumentException("Un... | [
"public",
"static",
"String",
"hash",
"(",
"String",
"algorithm",
",",
"String",
"str",
",",
"String",
"charsetName",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"digest",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"algorithm",
")",
".",
"digest",
"(",
"... | Calculate the hash value of a given string.
@param algorithm message digest algorithm.
@param str string to hash.
@param charsetName charset of string.
@return hash value of string. | [
"Calculate",
"the",
"hash",
"value",
"of",
"a",
"given",
"string",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L473-L482 | train | Returns the hex encoded hash of the given string. | [
30522,
2270,
10763,
5164,
23325,
1006,
5164,
9896,
1010,
5164,
2358,
2099,
1010,
5164,
25869,
13462,
18442,
1007,
1063,
3046,
1063,
24880,
1031,
1033,
17886,
1027,
4471,
4305,
8449,
2102,
1012,
2131,
7076,
26897,
1006,
9896,
1007,
1012,
178... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ReferenceCountUtil.java | ReferenceCountUtil.release | public static boolean release(Object msg, int decrement) {
if (msg instanceof ReferenceCounted) {
return ((ReferenceCounted) msg).release(decrement);
}
return false;
} | java | public static boolean release(Object msg, int decrement) {
if (msg instanceof ReferenceCounted) {
return ((ReferenceCounted) msg).release(decrement);
}
return false;
} | [
"public",
"static",
"boolean",
"release",
"(",
"Object",
"msg",
",",
"int",
"decrement",
")",
"{",
"if",
"(",
"msg",
"instanceof",
"ReferenceCounted",
")",
"{",
"return",
"(",
"(",
"ReferenceCounted",
")",
"msg",
")",
".",
"release",
"(",
"decrement",
")",... | Try to call {@link ReferenceCounted#release(int)} if the specified message implements {@link ReferenceCounted}.
If the specified message doesn't implement {@link ReferenceCounted}, this method does nothing. | [
"Try",
"to",
"call",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/ReferenceCountUtil.java#L97-L102 | train | Release a reference count. | [
30522,
2270,
10763,
22017,
20898,
2713,
1006,
4874,
5796,
2290,
1010,
20014,
11703,
28578,
4765,
1007,
1063,
2065,
1006,
5796,
2290,
6013,
11253,
4431,
3597,
16671,
2098,
1007,
1063,
2709,
1006,
1006,
4431,
3597,
16671,
2098,
1007,
5796,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/text/StrSpliter.java | StrSpliter.addToList | private static List<String> addToList(List<String> list, String part, boolean isTrim, boolean ignoreEmpty){
if(isTrim){
part = StrUtil.trim(part);
}
if(false == ignoreEmpty || false == part.isEmpty()){
list.add(part);
}
return list;
} | java | private static List<String> addToList(List<String> list, String part, boolean isTrim, boolean ignoreEmpty){
if(isTrim){
part = StrUtil.trim(part);
}
if(false == ignoreEmpty || false == part.isEmpty()){
list.add(part);
}
return list;
} | [
"private",
"static",
"List",
"<",
"String",
">",
"addToList",
"(",
"List",
"<",
"String",
">",
"list",
",",
"String",
"part",
",",
"boolean",
"isTrim",
",",
"boolean",
"ignoreEmpty",
")",
"{",
"if",
"(",
"isTrim",
")",
"{",
"part",
"=",
"StrUtil",
".",... | 将字符串加入List中
@param list 列表
@param part 被加入的部分
@param isTrim 是否去除两端空白符
@param ignoreEmpty 是否略过空字符串(空字符串不做为一个元素)
@return 列表 | [
"将字符串加入List中"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/StrSpliter.java#L494-L502 | train | Adds a string to a list of strings. | [
30522,
2797,
10763,
2862,
1026,
5164,
1028,
5587,
3406,
9863,
1006,
2862,
1026,
5164,
1028,
2862,
1010,
5164,
2112,
1010,
22017,
20898,
21541,
20026,
1010,
22017,
20898,
8568,
6633,
13876,
2100,
1007,
1063,
2065,
1006,
21541,
20026,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/convert/Convert.java | Convert.toChar | public static Character toChar(Object value, Character defaultValue) {
return convert(Character.class, value, defaultValue);
} | java | public static Character toChar(Object value, Character defaultValue) {
return convert(Character.class, value, defaultValue);
} | [
"public",
"static",
"Character",
"toChar",
"(",
"Object",
"value",
",",
"Character",
"defaultValue",
")",
"{",
"return",
"convert",
"(",
"Character",
".",
"class",
",",
"value",
",",
"defaultValue",
")",
";",
"}"
] | 转换为字符<br>
如果给定的值为null,或者转换失败,返回默认值<br>
转换失败不会报错
@param value 被转换的值
@param defaultValue 转换错误时的默认值
@return 结果 | [
"转换为字符<br",
">",
"如果给定的值为null,或者转换失败,返回默认值<br",
">",
"转换失败不会报错"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java#L77-L79 | train | Converts value of type IDENTITY to Character. | [
30522,
2270,
10763,
2839,
2000,
7507,
2099,
1006,
4874,
3643,
1010,
2839,
12398,
10175,
5657,
1007,
1063,
2709,
10463,
1006,
2839,
1012,
2465,
1010,
3643,
1010,
12398,
10175,
5657,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/YamlProcessor.java | YamlProcessor.process | protected void process(MatchCallback callback) {
Yaml yaml = createYaml();
for (Resource resource : this.resources) {
boolean found = process(callback, yaml, resource);
if (this.resolutionMethod == ResolutionMethod.FIRST_FOUND && found) {
return;
}
... | java | protected void process(MatchCallback callback) {
Yaml yaml = createYaml();
for (Resource resource : this.resources) {
boolean found = process(callback, yaml, resource);
if (this.resolutionMethod == ResolutionMethod.FIRST_FOUND && found) {
return;
}
... | [
"protected",
"void",
"process",
"(",
"MatchCallback",
"callback",
")",
"{",
"Yaml",
"yaml",
"=",
"createYaml",
"(",
")",
";",
"for",
"(",
"Resource",
"resource",
":",
"this",
".",
"resources",
")",
"{",
"boolean",
"found",
"=",
"process",
"(",
"callback",
... | Provide an opportunity for subclasses to process the Yaml parsed from the
supplied resources. Each resource is parsed in turn and the documents inside
checked against the {@link #setDocumentMatchers(DocumentMatcher...)
matchers}. If a document matches it is passed into the callback, along with
its representation as Pro... | [
"Provide",
"an",
"opportunity",
"for",
"subclasses",
"to",
"process",
"the",
"Yaml",
"parsed",
"from",
"the",
"supplied",
"resources",
".",
"Each",
"resource",
"is",
"parsed",
"in",
"turn",
"and",
"the",
"documents",
"inside",
"checked",
"against",
"the",
"{",... | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/common/YamlProcessor.java#L110-L118 | train | Process the resource list. | [
30522,
5123,
11675,
2832,
1006,
2674,
9289,
20850,
8684,
30524,
1012,
4219,
1007,
1063,
22017,
20898,
2179,
1027,
2832,
1006,
2655,
5963,
1010,
8038,
19968,
1010,
7692,
1007,
1025,
2065,
1006,
2023,
1012,
5813,
11368,
6806,
2094,
1027,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/utility/TextUtility.java | TextUtility.isAllIndex | public static boolean isAllIndex(byte[] sString)
{
int nLen = sString.length;
int i = 0;
while (i < nLen - 1 && getUnsigned(sString[i]) == 162)
{
i += 2;
}
if (i >= nLen)
return true;
while (i < nLen && (sString[i] > 'A' - 1 && sString... | java | public static boolean isAllIndex(byte[] sString)
{
int nLen = sString.length;
int i = 0;
while (i < nLen - 1 && getUnsigned(sString[i]) == 162)
{
i += 2;
}
if (i >= nLen)
return true;
while (i < nLen && (sString[i] > 'A' - 1 && sString... | [
"public",
"static",
"boolean",
"isAllIndex",
"(",
"byte",
"[",
"]",
"sString",
")",
"{",
"int",
"nLen",
"=",
"sString",
".",
"length",
";",
"int",
"i",
"=",
"0",
";",
"while",
"(",
"i",
"<",
"nLen",
"-",
"1",
"&&",
"getUnsigned",
"(",
"sString",
"[... | 是否全是序号
@param sString
@return | [
"是否全是序号"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/utility/TextUtility.java#L210-L234 | train | is all index of a string in a CIS file | [
30522,
2270,
10763,
22017,
20898,
18061,
21202,
3207,
2595,
1006,
24880,
1031,
1033,
7020,
18886,
3070,
1007,
1063,
20014,
17953,
2368,
1027,
7020,
18886,
3070,
1012,
3091,
1025,
20014,
1045,
1027,
1014,
1025,
2096,
1006,
1045,
1026,
17953,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.checkBetween | public static Number checkBetween(Number value, Number min, Number max) {
notNull(value);
notNull(min);
notNull(max);
double valueDouble = value.doubleValue();
double minDouble = min.doubleValue();
double maxDouble = max.doubleValue();
if (valueDouble < minDouble || valueDouble > maxDouble) {
t... | java | public static Number checkBetween(Number value, Number min, Number max) {
notNull(value);
notNull(min);
notNull(max);
double valueDouble = value.doubleValue();
double minDouble = min.doubleValue();
double maxDouble = max.doubleValue();
if (valueDouble < minDouble || valueDouble > maxDouble) {
t... | [
"public",
"static",
"Number",
"checkBetween",
"(",
"Number",
"value",
",",
"Number",
"min",
",",
"Number",
"max",
")",
"{",
"notNull",
"(",
"value",
")",
";",
"notNull",
"(",
"min",
")",
";",
"notNull",
"(",
"max",
")",
";",
"double",
"valueDouble",
"=... | 检查值是否在指定范围内
@param value 值
@param min 最小值(包含)
@param max 最大值(包含)
@return 检查后的长度值
@since 4.1.10 | [
"检查值是否在指定范围内"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L622-L633 | train | Checks if the given value is between the given values. | [
30522,
2270,
10763,
2193,
4638,
20915,
28394,
2078,
1006,
2193,
3643,
1010,
2193,
8117,
1010,
2193,
4098,
1007,
1063,
2025,
11231,
3363,
1006,
3643,
1007,
1025,
2025,
11231,
3363,
1006,
8117,
1007,
1025,
2025,
11231,
3363,
1006,
4098,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.readLines | public static <T extends Collection<String>> T readLines(URL url, String charsetName, T collection) throws IORuntimeException {
return readLines(url, CharsetUtil.charset(charsetName), collection);
} | java | public static <T extends Collection<String>> T readLines(URL url, String charsetName, T collection) throws IORuntimeException {
return readLines(url, CharsetUtil.charset(charsetName), collection);
} | [
"public",
"static",
"<",
"T",
"extends",
"Collection",
"<",
"String",
">",
">",
"T",
"readLines",
"(",
"URL",
"url",
",",
"String",
"charsetName",
",",
"T",
"collection",
")",
"throws",
"IORuntimeException",
"{",
"return",
"readLines",
"(",
"url",
",",
"Ch... | 从文件中读取每一行数据
@param <T> 集合类型
@param url 文件的URL
@param charsetName 字符集
@param collection 集合
@return 文件中的每行内容的集合
@throws IORuntimeException IO异常 | [
"从文件中读取每一行数据"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2261-L2263 | train | Reads the contents of the URL into the given collection. | [
30522,
2270,
10763,
1026,
1056,
8908,
3074,
1026,
5164,
1028,
1028,
1056,
3191,
12735,
1006,
24471,
2140,
24471,
2140,
1010,
5164,
25869,
13462,
18442,
1010,
1056,
3074,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2709,
3191,
12735,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/HttpRequest.java | HttpRequest.method | public HttpRequest method(Method method) {
if (Method.PATCH == method) {
this.method = Method.POST;
this.header("X-HTTP-Method-Override", "PATCH");
} else {
this.method = method;
}
return this;
} | java | public HttpRequest method(Method method) {
if (Method.PATCH == method) {
this.method = Method.POST;
this.header("X-HTTP-Method-Override", "PATCH");
} else {
this.method = method;
}
return this;
} | [
"public",
"HttpRequest",
"method",
"(",
"Method",
"method",
")",
"{",
"if",
"(",
"Method",
".",
"PATCH",
"==",
"method",
")",
"{",
"this",
".",
"method",
"=",
"Method",
".",
"POST",
";",
"this",
".",
"header",
"(",
"\"X-HTTP-Method-Override\"",
",",
"\"P... | 设置请求方法
@param method HTTP方法
@return HttpRequest | [
"设置请求方法"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java#L295-L303 | train | Sets the HTTP method to use. | [
30522,
2270,
8299,
2890,
15500,
4118,
1006,
4118,
4118,
1007,
1063,
2065,
1006,
4118,
1012,
8983,
1027,
1027,
4118,
1007,
1063,
2023,
1012,
4118,
1027,
4118,
1012,
2695,
1025,
2023,
1012,
20346,
1006,
1000,
1060,
1011,
8299,
1011,
4118,
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/annotation/CombinationAnnotationElement.java | CombinationAnnotationElement.parseDeclared | private void parseDeclared(Annotation[] annotations) {
Class<? extends Annotation> annotationType;
// 直接注解
for (Annotation annotation : annotations) {
annotationType = annotation.annotationType();
if (false == META_ANNOTATIONS.contains(annotationType)) {
declaredAnnotationMap.put(annotationType, a... | java | private void parseDeclared(Annotation[] annotations) {
Class<? extends Annotation> annotationType;
// 直接注解
for (Annotation annotation : annotations) {
annotationType = annotation.annotationType();
if (false == META_ANNOTATIONS.contains(annotationType)) {
declaredAnnotationMap.put(annotationType, a... | [
"private",
"void",
"parseDeclared",
"(",
"Annotation",
"[",
"]",
"annotations",
")",
"{",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationType",
";",
"// 直接注解\r",
"for",
"(",
"Annotation",
"annotation",
":",
"annotations",
")",
"{",
"annotationType",... | 进行递归解析注解,直到全部都是元注解为止
@param annotations Class, Method, Field等 | [
"进行递归解析注解,直到全部都是元注解为止"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/annotation/CombinationAnnotationElement.java#L98-L108 | train | Parse declared annotations. | [
30522,
2797,
11675,
11968,
6924,
8586,
8017,
2098,
1006,
5754,
17287,
3508,
1031,
1033,
5754,
17287,
9285,
1007,
1063,
2465,
1026,
1029,
8908,
5754,
17287,
3508,
1028,
5754,
17287,
3508,
13874,
30524,
5754,
17287,
3508,
1024,
5754,
17287,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/CompactingHashTable.java | CompactingHashTable.resizeHashTable | private boolean resizeHashTable() throws IOException {
final int newNumBuckets = 2*this.numBuckets;
final int bucketsPerSegment = this.bucketsPerSegmentMask + 1;
final int newNumSegments = (newNumBuckets + (bucketsPerSegment-1)) / bucketsPerSegment;
final int additionalSegments = newNumSegments-this.buckets.len... | java | private boolean resizeHashTable() throws IOException {
final int newNumBuckets = 2*this.numBuckets;
final int bucketsPerSegment = this.bucketsPerSegmentMask + 1;
final int newNumSegments = (newNumBuckets + (bucketsPerSegment-1)) / bucketsPerSegment;
final int additionalSegments = newNumSegments-this.buckets.len... | [
"private",
"boolean",
"resizeHashTable",
"(",
")",
"throws",
"IOException",
"{",
"final",
"int",
"newNumBuckets",
"=",
"2",
"*",
"this",
".",
"numBuckets",
";",
"final",
"int",
"bucketsPerSegment",
"=",
"this",
".",
"bucketsPerSegmentMask",
"+",
"1",
";",
"fin... | Attempts to double the number of buckets
@return true on success
@throws IOException | [
"Attempts",
"to",
"double",
"the",
"number",
"of",
"buckets"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java#L874-L1048 | train | Resizes the hash table. | [
30522,
2797,
22017,
20898,
24501,
4697,
14949,
22893,
3468,
1006,
1007,
30524,
1027,
2023,
1012,
13610,
17668,
3366,
21693,
4765,
9335,
2243,
1009,
1015,
1025,
2345,
20014,
2047,
19172,
3366,
21693,
11187,
1027,
1006,
2047,
19172,
24204,
8454... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java | UnsafeExternalSorter.spill | @Override
public long spill(long size, MemoryConsumer trigger) throws IOException {
if (trigger != this) {
if (readingIterator != null) {
return readingIterator.spill();
}
return 0L; // this should throw exception
}
if (inMemSorter == null || inMemSorter.numRecords() <= 0) {
... | java | @Override
public long spill(long size, MemoryConsumer trigger) throws IOException {
if (trigger != this) {
if (readingIterator != null) {
return readingIterator.spill();
}
return 0L; // this should throw exception
}
if (inMemSorter == null || inMemSorter.numRecords() <= 0) {
... | [
"@",
"Override",
"public",
"long",
"spill",
"(",
"long",
"size",
",",
"MemoryConsumer",
"trigger",
")",
"throws",
"IOException",
"{",
"if",
"(",
"trigger",
"!=",
"this",
")",
"{",
"if",
"(",
"readingIterator",
"!=",
"null",
")",
"{",
"return",
"readingIter... | Sort and spill the current records in response to memory pressure. | [
"Sort",
"and",
"spill",
"the",
"current",
"records",
"in",
"response",
"to",
"memory",
"pressure",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java#L196-L236 | train | Spill the data from the in - memory sorter to disk. | [
30522,
1030,
2058,
15637,
2270,
2146,
14437,
1006,
2146,
2946,
1010,
3638,
8663,
23545,
2099,
9495,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
9495,
999,
1027,
2023,
1007,
1063,
2065,
1006,
3752,
21646,
8844,
999,
1027,
19701,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/ZooKeeperCompletedCheckpointStore.java | ZooKeeperCompletedCheckpointStore.pathToCheckpointId | public static long pathToCheckpointId(String path) {
try {
String numberString;
// check if we have a leading slash
if ('/' == path.charAt(0)) {
numberString = path.substring(1);
} else {
numberString = path;
}
return Long.parseLong(numberString);
} catch (NumberFormatException e) {
LO... | java | public static long pathToCheckpointId(String path) {
try {
String numberString;
// check if we have a leading slash
if ('/' == path.charAt(0)) {
numberString = path.substring(1);
} else {
numberString = path;
}
return Long.parseLong(numberString);
} catch (NumberFormatException e) {
LO... | [
"public",
"static",
"long",
"pathToCheckpointId",
"(",
"String",
"path",
")",
"{",
"try",
"{",
"String",
"numberString",
";",
"// check if we have a leading slash",
"if",
"(",
"'",
"'",
"==",
"path",
".",
"charAt",
"(",
"0",
")",
")",
"{",
"numberString",
"=... | Converts a path to the checkpoint id.
@param path in ZooKeeper
@return Checkpoint id parsed from the path | [
"Converts",
"a",
"path",
"to",
"the",
"checkpoint",
"id",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/ZooKeeperCompletedCheckpointStore.java#L324-L341 | train | Converts a path to a checkpoint id. | [
30522,
2270,
10763,
2146,
4130,
3406,
5403,
3600,
8400,
3593,
1006,
5164,
4130,
1007,
1063,
3046,
1063,
5164,
3616,
18886,
3070,
1025,
1013,
1013,
4638,
2065,
2057,
2031,
1037,
2877,
18296,
2065,
1006,
1005,
1013,
1005,
1027,
1027,
4130,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/HashUtil.java | HashUtil.pjwHash | public static int pjwHash(String str) {
int bitsInUnsignedInt = 32;
int threeQuarters = (bitsInUnsignedInt * 3) / 4;
int oneEighth = bitsInUnsignedInt / 8;
int highBits = 0xFFFFFFFF << (bitsInUnsignedInt - oneEighth);
int hash = 0;
int test = 0;
for (int i = 0; i < str.length(); i++) {
hash =... | java | public static int pjwHash(String str) {
int bitsInUnsignedInt = 32;
int threeQuarters = (bitsInUnsignedInt * 3) / 4;
int oneEighth = bitsInUnsignedInt / 8;
int highBits = 0xFFFFFFFF << (bitsInUnsignedInt - oneEighth);
int hash = 0;
int test = 0;
for (int i = 0; i < str.length(); i++) {
hash =... | [
"public",
"static",
"int",
"pjwHash",
"(",
"String",
"str",
")",
"{",
"int",
"bitsInUnsignedInt",
"=",
"32",
";",
"int",
"threeQuarters",
"=",
"(",
"bitsInUnsignedInt",
"*",
"3",
")",
"/",
"4",
";",
"int",
"oneEighth",
"=",
"bitsInUnsignedInt",
"/",
"8",
... | PJW算法
@param str 字符串
@return hash值 | [
"PJW算法"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/HashUtil.java#L235-L252 | train | Returns the hash value of the given string. | [
30522,
2270,
10763,
20014,
1052,
3501,
2860,
14949,
2232,
1006,
5164,
2358,
2099,
1007,
1063,
20014,
9017,
2378,
4609,
5332,
19225,
18447,
1027,
3590,
1025,
20014,
2093,
16211,
19418,
2015,
1027,
1006,
9017,
2378,
4609,
5332,
19225,
18447,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.getBoolean | public boolean getBoolean(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Boolean.valueOf(value);
} | java | public boolean getBoolean(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Boolean.valueOf(value);
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"null",
")",
";",
"String",
"value",
"=",
"getRequired",
"(",
"key",
")",
";",
"return",
"Boolean",
".",
"valueOf",
"(",
"value",
")",
";",
"}"
] | Returns the Boolean value for the given key.
The method fails if the key does not exist. | [
"Returns",
"the",
"Boolean",
"value",
"for",
"the",
"given",
"key",
".",
"The",
"method",
"fails",
"if",
"the",
"key",
"does",
"not",
"exist",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L387-L391 | train | Gets a boolean value. | [
30522,
2270,
22017,
20898,
2131,
5092,
9890,
2319,
1006,
5164,
3145,
1007,
1063,
5587,
3406,
3207,
7011,
11314,
2015,
1006,
3145,
1010,
19701,
1007,
1025,
5164,
3643,
1027,
2131,
2890,
15549,
5596,
1006,
3145,
1007,
1025,
2709,
22017,
20898... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.append | public HashCodeBuilder append(final byte[] array) {
if (array == null) {
iTotal = iTotal * iConstant;
} else {
for (final byte element : array) {
append(element);
}
}
return this;
} | java | public HashCodeBuilder append(final byte[] array) {
if (array == null) {
iTotal = iTotal * iConstant;
} else {
for (final byte element : array) {
append(element);
}
}
return this;
} | [
"public",
"HashCodeBuilder",
"append",
"(",
"final",
"byte",
"[",
"]",
"array",
")",
"{",
"if",
"(",
"array",
"==",
"null",
")",
"{",
"iTotal",
"=",
"iTotal",
"*",
"iConstant",
";",
"}",
"else",
"{",
"for",
"(",
"final",
"byte",
"element",
":",
"arra... | <p>
Append a <code>hashCode</code> for a <code>byte</code> array.
</p>
@param array
the array to add to the <code>hashCode</code>
@return this | [
"<p",
">",
"Append",
"a",
"<code",
">",
"hashCode<",
"/",
"code",
">",
"for",
"a",
"<code",
">",
"byte<",
"/",
"code",
">",
"array",
".",
"<",
"/",
"p",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/builder/HashCodeBuilder.java#L622-L631 | train | Appends the array of bytes to the hash code. | [
30522,
2270,
23325,
16044,
8569,
23891,
2099,
10439,
10497,
1006,
2345,
24880,
1031,
1033,
9140,
1007,
1063,
2065,
1006,
9140,
1027,
1027,
19701,
1007,
1063,
23333,
9080,
1027,
23333,
9080,
1008,
18407,
5794,
2102,
1025,
1065,
2842,
1063,
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... |
netty/netty | transport/src/main/java/io/netty/channel/ChannelHandlerMask.java | ChannelHandlerMask.mask | static int mask(Class<? extends ChannelHandler> clazz) {
// Try to obtain the mask from the cache first. If this fails calculate it and put it in the cache for fast
// lookup in the future.
Map<Class<? extends ChannelHandler>, Integer> cache = MASKS.get();
Integer mask = cache.get(clazz)... | java | static int mask(Class<? extends ChannelHandler> clazz) {
// Try to obtain the mask from the cache first. If this fails calculate it and put it in the cache for fast
// lookup in the future.
Map<Class<? extends ChannelHandler>, Integer> cache = MASKS.get();
Integer mask = cache.get(clazz)... | [
"static",
"int",
"mask",
"(",
"Class",
"<",
"?",
"extends",
"ChannelHandler",
">",
"clazz",
")",
"{",
"// Try to obtain the mask from the cache first. If this fails calculate it and put it in the cache for fast",
"// lookup in the future.",
"Map",
"<",
"Class",
"<",
"?",
"ext... | Return the {@code executionMask}. | [
"Return",
"the",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/ChannelHandlerMask.java#L70-L80 | train | Get the mask for a channel handler. | [
30522,
10763,
20014,
7308,
1006,
2465,
1026,
1029,
8908,
3149,
11774,
3917,
1028,
18856,
10936,
2480,
1007,
1063,
1013,
1013,
3046,
2000,
6855,
1996,
7308,
2013,
1996,
17053,
2034,
1012,
2065,
2023,
11896,
18422,
2009,
1998,
2404,
2009,
199... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrService.java | InitializrService.generate | public ProjectGenerationResponse generate(ProjectGenerationRequest request)
throws IOException {
Log.info("Using service at " + request.getServiceUrl());
InitializrServiceMetadata metadata = loadMetadata(request.getServiceUrl());
URI url = request.generateUrl(metadata);
CloseableHttpResponse httpResponse = e... | java | public ProjectGenerationResponse generate(ProjectGenerationRequest request)
throws IOException {
Log.info("Using service at " + request.getServiceUrl());
InitializrServiceMetadata metadata = loadMetadata(request.getServiceUrl());
URI url = request.generateUrl(metadata);
CloseableHttpResponse httpResponse = e... | [
"public",
"ProjectGenerationResponse",
"generate",
"(",
"ProjectGenerationRequest",
"request",
")",
"throws",
"IOException",
"{",
"Log",
".",
"info",
"(",
"\"Using service at \"",
"+",
"request",
".",
"getServiceUrl",
"(",
")",
")",
";",
"InitializrServiceMetadata",
"... | Generate a project based on the specified {@link ProjectGenerationRequest}.
@param request the generation request
@return an entity defining the project
@throws IOException if generation fails | [
"Generate",
"a",
"project",
"based",
"on",
"the",
"specified",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrService.java#L89-L98 | train | Generate a project from the specified request. | [
30522,
2270,
2622,
6914,
16754,
6072,
26029,
3366,
9699,
1006,
2622,
6914,
16754,
2890,
15500,
5227,
1007,
11618,
22834,
10288,
24422,
1063,
8833,
1012,
18558,
1006,
1000,
2478,
2326,
2012,
1000,
1009,
5227,
1012,
4152,
2121,
7903,
11236,
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-db/src/main/java/cn/hutool/db/handler/HandleHelper.java | HandleHelper.getColumnValue | private static <T> Object getColumnValue(ResultSet rs, String label, int type, Type targetColumnType) throws SQLException {
Object rawValue;
switch (type) {
case Types.TIMESTAMP:
rawValue = rs.getTimestamp(label);
break;
case Types.TIME:
rawValue = rs.getTime(label);
break;
default:
r... | java | private static <T> Object getColumnValue(ResultSet rs, String label, int type, Type targetColumnType) throws SQLException {
Object rawValue;
switch (type) {
case Types.TIMESTAMP:
rawValue = rs.getTimestamp(label);
break;
case Types.TIME:
rawValue = rs.getTime(label);
break;
default:
r... | [
"private",
"static",
"<",
"T",
">",
"Object",
"getColumnValue",
"(",
"ResultSet",
"rs",
",",
"String",
"label",
",",
"int",
"type",
",",
"Type",
"targetColumnType",
")",
"throws",
"SQLException",
"{",
"Object",
"rawValue",
";",
"switch",
"(",
"type",
")",
... | 获取字段值<br>
针对日期时间等做单独处理判断
@param <T> 返回类型
@param rs {@link ResultSet}
@param label 字段标签或者字段名
@param type 字段类型,默认Object
@param targetColumnType 结果要求的类型,需进行二次转换(null或者Object不转换)
@return 字段值
@throws SQLException SQL异常 | [
"获取字段值<br",
">",
"针对日期时间等做单独处理判断"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java#L212-L231 | train | Gets the value of a column from a ResultSet. | [
30522,
2797,
10763,
1026,
1056,
1028,
4874,
2131,
25778,
2819,
2078,
10175,
5657,
1006,
3463,
3388,
12667,
1010,
5164,
3830,
1010,
20014,
2828,
1010,
2828,
4539,
25778,
2819,
29405,
5051,
1007,
11618,
29296,
10288,
24422,
1063,
4874,
6315,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/HttpRequest.java | HttpRequest.urlWithParamIfGet | private void urlWithParamIfGet() {
if (Method.GET.equals(method) && false == this.isRest) {
// 优先使用body形式的参数,不存在使用form
if (ArrayUtil.isNotEmpty(this.bodyBytes)) {
this.url = HttpUtil.urlWithForm(this.url, StrUtil.str(this.bodyBytes, this.charset), this.charset, false);
} else {
this.url = HttpU... | java | private void urlWithParamIfGet() {
if (Method.GET.equals(method) && false == this.isRest) {
// 优先使用body形式的参数,不存在使用form
if (ArrayUtil.isNotEmpty(this.bodyBytes)) {
this.url = HttpUtil.urlWithForm(this.url, StrUtil.str(this.bodyBytes, this.charset), this.charset, false);
} else {
this.url = HttpU... | [
"private",
"void",
"urlWithParamIfGet",
"(",
")",
"{",
"if",
"(",
"Method",
".",
"GET",
".",
"equals",
"(",
"method",
")",
"&&",
"false",
"==",
"this",
".",
"isRest",
")",
"{",
"// 优先使用body形式的参数,不存在使用form\r",
"if",
"(",
"ArrayUtil",
".",
"isNotEmpty",
"(",... | 对于GET请求将参数加到URL中<br>
此处不对URL中的特殊字符做单独编码 | [
"对于GET请求将参数加到URL中<br",
">",
"此处不对URL中的特殊字符做单独编码"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java#L930-L939 | train | URL with param if get. | [
30522,
2797,
11675,
24471,
2140,
24415,
28689,
4328,
2546,
18150,
1006,
1007,
1063,
2065,
1006,
4118,
1012,
2131,
1012,
19635,
1006,
4118,
1007,
1004,
1004,
6270,
1027,
1027,
2023,
1012,
2003,
28533,
1007,
1063,
1013,
1013,
100,
100,
100,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java | NetworkEnvironmentConfiguration.checkNewNetworkConfig | private static void checkNewNetworkConfig(
final int pageSize,
final float networkBufFraction,
final long networkBufMin,
final long networkBufMax) throws IllegalConfigurationException {
ConfigurationParserUtils.checkConfigParameter(networkBufFraction > 0.0f && networkBufFraction < 1.0f, networkBufFraction,
... | java | private static void checkNewNetworkConfig(
final int pageSize,
final float networkBufFraction,
final long networkBufMin,
final long networkBufMax) throws IllegalConfigurationException {
ConfigurationParserUtils.checkConfigParameter(networkBufFraction > 0.0f && networkBufFraction < 1.0f, networkBufFraction,
... | [
"private",
"static",
"void",
"checkNewNetworkConfig",
"(",
"final",
"int",
"pageSize",
",",
"final",
"float",
"networkBufFraction",
",",
"final",
"long",
"networkBufMin",
",",
"final",
"long",
"networkBufMax",
")",
"throws",
"IllegalConfigurationException",
"{",
"Conf... | Validates the (new) network buffer configuration.
@param pageSize size of memory buffers
@param networkBufFraction fraction of JVM memory to use for network buffers
@param networkBufMin minimum memory size for network buffers (in bytes)
@param networkBufMax maximum memory size for network buffers (in bytes)
@... | [
"Validates",
"the",
"(",
"new",
")",
"network",
"buffer",
"configuration",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java#L324-L348 | train | Check the configuration for a new network. | [
30522,
2797,
10763,
11675,
4638,
2638,
7962,
3388,
6198,
8663,
8873,
2290,
1006,
2345,
20014,
5530,
4697,
1010,
2345,
14257,
2897,
8569,
4246,
25533,
1010,
2345,
2146,
2897,
8569,
16715,
2378,
1010,
2345,
2146,
2897,
8569,
16715,
8528,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.convertCharset | public static File convertCharset(File file, Charset srcCharset, Charset destCharset) {
return CharsetUtil.convert(file, srcCharset, destCharset);
} | java | public static File convertCharset(File file, Charset srcCharset, Charset destCharset) {
return CharsetUtil.convert(file, srcCharset, destCharset);
} | [
"public",
"static",
"File",
"convertCharset",
"(",
"File",
"file",
",",
"Charset",
"srcCharset",
",",
"Charset",
"destCharset",
")",
"{",
"return",
"CharsetUtil",
".",
"convert",
"(",
"file",
",",
"srcCharset",
",",
"destCharset",
")",
";",
"}"
] | 转换文件编码<br>
此方法用于转换文件编码,读取的文件实际编码必须与指定的srcCharset编码一致,否则导致乱码
@param file 文件
@param srcCharset 原文件的编码,必须与文件内容的编码保持一致
@param destCharset 转码后的编码
@return 被转换编码的文件
@see CharsetUtil#convert(File, Charset, Charset)
@since 3.1.0 | [
"转换文件编码<br",
">",
"此方法用于转换文件编码,读取的文件实际编码必须与指定的srcCharset编码一致,否则导致乱码"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L3229-L3231 | train | Convert the given file to the given charset. | [
30522,
2270,
10763,
5371,
10463,
7507,
22573,
2102,
1006,
5371,
30524,
2709,
25869,
13462,
21823,
2140,
1012,
10463,
1006,
5371,
1010,
5034,
9468,
8167,
13462,
1010,
4078,
10649,
11650,
3388,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/AllGroupCombineDriver.java | AllGroupCombineDriver.setup | @Override
public void setup(TaskContext<GroupCombineFunction<IN, OUT>, OUT> context) {
this.taskContext = context;
} | java | @Override
public void setup(TaskContext<GroupCombineFunction<IN, OUT>, OUT> context) {
this.taskContext = context;
} | [
"@",
"Override",
"public",
"void",
"setup",
"(",
"TaskContext",
"<",
"GroupCombineFunction",
"<",
"IN",
",",
"OUT",
">",
",",
"OUT",
">",
"context",
")",
"{",
"this",
".",
"taskContext",
"=",
"context",
";",
"}"
] | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/AllGroupCombineDriver.java#L53-L56 | train | Set up the task context. | [
30522,
1030,
2058,
15637,
2270,
11675,
16437,
1006,
4708,
8663,
18209,
1026,
2177,
18274,
3170,
11263,
27989,
1026,
1999,
1010,
2041,
1028,
1010,
2041,
1028,
6123,
1007,
1063,
2023,
1012,
4708,
8663,
18209,
1027,
6123,
1025,
1065,
102,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/WindowedStream.java | WindowedStream.trigger | @PublicEvolving
public WindowedStream<T, K, 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.");
}
if... | java | @PublicEvolving
public WindowedStream<T, K, 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.");
}
if... | [
"@",
"PublicEvolving",
"public",
"WindowedStream",
"<",
"T",
",",
"K",
",",
"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/WindowedStream.java#L136-L148 | train | Sets the trigger for this stream. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
3332,
2098,
21422,
1026,
1056,
1010,
1047,
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,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/DeltaIteration.java | DeltaIteration.registerAggregator | @PublicEvolving
public DeltaIteration<ST, WT> registerAggregator(String name, Aggregator<?> aggregator) {
this.aggregators.registerAggregator(name, aggregator);
return this;
} | java | @PublicEvolving
public DeltaIteration<ST, WT> registerAggregator(String name, Aggregator<?> aggregator) {
this.aggregators.registerAggregator(name, aggregator);
return this;
} | [
"@",
"PublicEvolving",
"public",
"DeltaIteration",
"<",
"ST",
",",
"WT",
">",
"registerAggregator",
"(",
"String",
"name",
",",
"Aggregator",
"<",
"?",
">",
"aggregator",
")",
"{",
"this",
".",
"aggregators",
".",
"registerAggregator",
"(",
"name",
",",
"agg... | Registers an {@link Aggregator} for the iteration. Aggregators can be used to maintain simple statistics during the
iteration, such as number of elements processed. The aggregators compute global aggregates: After each iteration step,
the values are globally aggregated to produce one aggregate that represents statistic... | [
"Registers",
"an",
"{",
"@link",
"Aggregator",
"}",
"for",
"the",
"iteration",
".",
"Aggregators",
"can",
"be",
"used",
"to",
"maintain",
"simple",
"statistics",
"during",
"the",
"iteration",
"such",
"as",
"number",
"of",
"elements",
"processed",
".",
"The",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/DeltaIteration.java#L278-L282 | train | Registers an aggregator for the delta iteration. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
7160,
21646,
3370,
1026,
2358,
1010,
1059,
2102,
1028,
4236,
8490,
17603,
20697,
2953,
1006,
5164,
2171,
1010,
24089,
1026,
1029,
1028,
24089,
1007,
1063,
2023,
1012,
24089,
2015,
1012,
4236,
8490,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/KryoUtils.java | KryoUtils.copy | public static <T> T copy(T from, Kryo kryo, TypeSerializer<T> serializer) {
try {
return kryo.copy(from);
} catch (KryoException ke) {
// Kryo could not copy the object --> try to serialize/deserialize the object
try {
byte[] byteArray = InstantiationUtil.serializeToByteArray(serializer, from);
re... | java | public static <T> T copy(T from, Kryo kryo, TypeSerializer<T> serializer) {
try {
return kryo.copy(from);
} catch (KryoException ke) {
// Kryo could not copy the object --> try to serialize/deserialize the object
try {
byte[] byteArray = InstantiationUtil.serializeToByteArray(serializer, from);
re... | [
"public",
"static",
"<",
"T",
">",
"T",
"copy",
"(",
"T",
"from",
",",
"Kryo",
"kryo",
",",
"TypeSerializer",
"<",
"T",
">",
"serializer",
")",
"{",
"try",
"{",
"return",
"kryo",
".",
"copy",
"(",
"from",
")",
";",
"}",
"catch",
"(",
"KryoException... | Tries to copy the given record from using the provided Kryo instance. If this fails, then
the record from is copied by serializing it into a byte buffer and deserializing it from
there.
@param from Element to copy
@param kryo Kryo instance to use
@param serializer TypeSerializer which is used in case of a Kryo failure... | [
"Tries",
"to",
"copy",
"the",
"given",
"record",
"from",
"using",
"the",
"provided",
"Kryo",
"instance",
".",
"If",
"this",
"fails",
"then",
"the",
"record",
"from",
"is",
"copied",
"by",
"serializing",
"it",
"into",
"a",
"byte",
"buffer",
"and",
"deserial... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/KryoUtils.java#L48-L62 | train | Copy the object using the given Kryo and TypeSerializer. | [
30522,
2270,
10763,
1026,
1056,
1028,
1056,
6100,
1006,
1056,
2013,
1010,
1047,
2854,
2080,
1047,
2854,
2080,
1010,
4127,
11610,
28863,
1026,
1056,
1028,
7642,
17629,
1007,
1063,
3046,
1063,
2709,
1047,
2854,
2080,
1012,
6100,
1006,
2013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/SimpleCache.java | SimpleCache.remove | public V remove(K key) {
writeLock.lock();
try {
return cache.remove(key);
} finally {
writeLock.unlock();
}
} | java | public V remove(K key) {
writeLock.lock();
try {
return cache.remove(key);
} finally {
writeLock.unlock();
}
} | [
"public",
"V",
"remove",
"(",
"K",
"key",
")",
"{",
"writeLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"cache",
".",
"remove",
"(",
"key",
")",
";",
"}",
"finally",
"{",
"writeLock",
".",
"unlock",
"(",
")",
";",
"}",
"}"
] | 移除缓存
@param key 键
@return 移除的值 | [
"移除缓存"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/SimpleCache.java#L64-L71 | train | Removes the object from the cache. | [
30522,
2270,
1058,
6366,
1006,
1047,
3145,
1007,
1063,
4339,
7878,
1012,
5843,
1006,
1007,
1025,
3046,
1063,
2709,
17053,
1012,
6366,
1006,
3145,
1007,
1025,
1065,
2633,
1063,
4339,
7878,
1012,
19829,
1006,
1007,
1025,
1065,
1065,
102,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/DataSetUtils.java | DataSetUtils.sampleWithSize | public static <T> DataSet<T> sampleWithSize(
DataSet <T> input,
final boolean withReplacement,
final int numSamples) {
return sampleWithSize(input, withReplacement, numSamples, Utils.RNG.nextLong());
} | java | public static <T> DataSet<T> sampleWithSize(
DataSet <T> input,
final boolean withReplacement,
final int numSamples) {
return sampleWithSize(input, withReplacement, numSamples, Utils.RNG.nextLong());
} | [
"public",
"static",
"<",
"T",
">",
"DataSet",
"<",
"T",
">",
"sampleWithSize",
"(",
"DataSet",
"<",
"T",
">",
"input",
",",
"final",
"boolean",
"withReplacement",
",",
"final",
"int",
"numSamples",
")",
"{",
"return",
"sampleWithSize",
"(",
"input",
",",
... | Generate a sample of DataSet which contains fixed size elements.
<p><strong>NOTE:</strong> Sample with fixed size is not as efficient as sample with fraction, use sample with
fraction unless you need exact precision.
@param withReplacement Whether element can be selected more than once.
@param numSamples The ex... | [
"Generate",
"a",
"sample",
"of",
"DataSet",
"which",
"contains",
"fixed",
"size",
"elements",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java#L232-L238 | train | Samples a DataSet of type N with a fixed size. | [
30522,
2270,
10763,
1026,
1056,
1028,
2951,
13462,
1026,
1056,
1028,
7099,
24415,
5332,
4371,
1006,
2951,
13462,
1026,
1056,
1028,
7953,
1010,
2345,
22017,
20898,
2007,
2890,
24759,
10732,
3672,
1010,
2345,
20014,
16371,
5244,
16613,
4244,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/HttpUtil.java | HttpUtil.downloadFile | public static long downloadFile(String url, String dest) {
return downloadFile(url, FileUtil.file(dest));
} | java | public static long downloadFile(String url, String dest) {
return downloadFile(url, FileUtil.file(dest));
} | [
"public",
"static",
"long",
"downloadFile",
"(",
"String",
"url",
",",
"String",
"dest",
")",
"{",
"return",
"downloadFile",
"(",
"url",
",",
"FileUtil",
".",
"file",
"(",
"dest",
")",
")",
";",
"}"
] | 下载远程文件
@param url 请求的url
@param dest 目标文件或目录,当为目录时,取URL中的文件名,取不到使用编码后的URL做为文件名
@return 文件大小 | [
"下载远程文件"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpUtil.java#L254-L256 | train | Download file from url to dest | [
30522,
2270,
10763,
2146,
8816,
8873,
2571,
1006,
5164,
24471,
2140,
1010,
5164,
4078,
2102,
1007,
1063,
2709,
8816,
8873,
2571,
1006,
24471,
2140,
1010,
5371,
21823,
2140,
1012,
5371,
1006,
4078,
2102,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/proxy/KinesisProxy.java | KinesisProxy.isRecoverableException | protected static boolean isRecoverableException(AmazonServiceException ex) {
if (ex.getErrorType() == null) {
return false;
}
switch (ex.getErrorType()) {
case Client:
return ex instanceof ProvisionedThroughputExceededException;
case Service:
case Unknown:
return true;
default:
return ... | java | protected static boolean isRecoverableException(AmazonServiceException ex) {
if (ex.getErrorType() == null) {
return false;
}
switch (ex.getErrorType()) {
case Client:
return ex instanceof ProvisionedThroughputExceededException;
case Service:
case Unknown:
return true;
default:
return ... | [
"protected",
"static",
"boolean",
"isRecoverableException",
"(",
"AmazonServiceException",
"ex",
")",
"{",
"if",
"(",
"ex",
".",
"getErrorType",
"(",
")",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"switch",
"(",
"ex",
".",
"getErrorType",
"(",
"... | Determines whether the exception is recoverable using exponential-backoff.
@param ex Exception to inspect
@return <code>true</code> if the exception can be recovered from, else
<code>false</code> | [
"Determines",
"whether",
"the",
"exception",
"is",
"recoverable",
"using",
"exponential",
"-",
"backoff",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/proxy/KinesisProxy.java#L368-L382 | train | Returns true if the exception is recoverable. | [
30522,
5123,
10763,
22017,
20898,
2003,
2890,
3597,
26061,
3468,
10288,
24422,
1006,
9733,
8043,
7903,
4402,
2595,
24422,
4654,
1007,
1063,
2065,
1006,
4654,
1012,
2131,
2121,
29165,
13874,
1006,
1007,
1027,
1027,
19701,
1007,
1063,
2709,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/io/network/partition/consumer/RemoteInputChannel.java | RemoteInputChannel.requestSubpartition | @VisibleForTesting
@Override
public void requestSubpartition(int subpartitionIndex) throws IOException, InterruptedException {
if (partitionRequestClient == null) {
// Create a client and request the partition
partitionRequestClient = connectionManager
.createPartitionRequestClient(connectionId);
part... | java | @VisibleForTesting
@Override
public void requestSubpartition(int subpartitionIndex) throws IOException, InterruptedException {
if (partitionRequestClient == null) {
// Create a client and request the partition
partitionRequestClient = connectionManager
.createPartitionRequestClient(connectionId);
part... | [
"@",
"VisibleForTesting",
"@",
"Override",
"public",
"void",
"requestSubpartition",
"(",
"int",
"subpartitionIndex",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"if",
"(",
"partitionRequestClient",
"==",
"null",
")",
"{",
"// Create a client and requ... | Requests a remote subpartition. | [
"Requests",
"a",
"remote",
"subpartition",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/RemoteInputChannel.java#L159-L169 | train | Request a subpartition. | [
30522,
1030,
5710,
13028,
4355,
2075,
1030,
2058,
15637,
2270,
11675,
11186,
12083,
19362,
3775,
3508,
1006,
20014,
4942,
19362,
3775,
3508,
22254,
10288,
1007,
11618,
22834,
10288,
24422,
1010,
7153,
10288,
24422,
1063,
2065,
1006,
13571,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostMultipartRequestDecoder.java | HttpPostMultipartRequestDecoder.cleanMixedAttributes | private void cleanMixedAttributes() {
currentFieldAttributes.remove(HttpHeaderValues.CHARSET);
currentFieldAttributes.remove(HttpHeaderNames.CONTENT_LENGTH);
currentFieldAttributes.remove(HttpHeaderNames.CONTENT_TRANSFER_ENCODING);
currentFieldAttributes.remove(HttpHeaderNames.CONTENT_TY... | java | private void cleanMixedAttributes() {
currentFieldAttributes.remove(HttpHeaderValues.CHARSET);
currentFieldAttributes.remove(HttpHeaderNames.CONTENT_LENGTH);
currentFieldAttributes.remove(HttpHeaderNames.CONTENT_TRANSFER_ENCODING);
currentFieldAttributes.remove(HttpHeaderNames.CONTENT_TY... | [
"private",
"void",
"cleanMixedAttributes",
"(",
")",
"{",
"currentFieldAttributes",
".",
"remove",
"(",
"HttpHeaderValues",
".",
"CHARSET",
")",
";",
"currentFieldAttributes",
".",
"remove",
"(",
"HttpHeaderNames",
".",
"CONTENT_LENGTH",
")",
";",
"currentFieldAttribu... | Remove all Attributes that should be cleaned between two FileUpload in
Mixed mode | [
"Remove",
"all",
"Attributes",
"that",
"should",
"be",
"cleaned",
"between",
"two",
"FileUpload",
"in",
"Mixed",
"mode"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostMultipartRequestDecoder.java#L975-L981 | train | Remove mixed attributes. | [
30522,
2797,
11675,
4550,
4328,
19068,
19321,
3089,
8569,
4570,
1006,
1007,
1063,
2783,
3790,
19321,
3089,
8569,
4570,
1012,
6366,
1006,
8299,
4974,
2121,
10175,
15808,
1012,
25869,
13462,
1007,
1025,
2783,
3790,
19321,
3089,
8569,
4570,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/perceptron/structures/CompactArray.java | CompactArray.set | public void set(int index, float value)
{
if (index < offset + array.length && index >= offset)
{
array[index - offset] += value;
}
else if (index < offset)
{ //expand from left
int gap = offset - index;
int newSize = gap + array.length;
... | java | public void set(int index, float value)
{
if (index < offset + array.length && index >= offset)
{
array[index - offset] += value;
}
else if (index < offset)
{ //expand from left
int gap = offset - index;
int newSize = gap + array.length;
... | [
"public",
"void",
"set",
"(",
"int",
"index",
",",
"float",
"value",
")",
"{",
"if",
"(",
"index",
"<",
"offset",
"+",
"array",
".",
"length",
"&&",
"index",
">=",
"offset",
")",
"{",
"array",
"[",
"index",
"-",
"offset",
"]",
"+=",
"value",
";",
... | 将index处的元素设置为value
@param index
@param value | [
"将index处的元素设置为value"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/perceptron/structures/CompactArray.java#L33-L64 | train | Sets the value of a single element in the array at the specified index. | [
30522,
2270,
11675,
2275,
1006,
20014,
5950,
1010,
14257,
3643,
1007,
1063,
2065,
1006,
5950,
1026,
16396,
1009,
9140,
1012,
3091,
1004,
1004,
5950,
1028,
1027,
30524,
2187,
20014,
6578,
1027,
16396,
1011,
5950,
1025,
20014,
2739,
4697,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryString.java | BinaryString.toDecimal | public Decimal toDecimal(int precision, int scale) {
ensureMaterialized();
if (precision > Decimal.MAX_LONG_DIGITS || this.sizeInBytes > Decimal.MAX_LONG_DIGITS) {
return toDecimalSlow(precision, scale);
}
// Data in Decimal is stored by one long value if `precision` <= Decimal.MAX_LONG_DIGITS.
// In this... | java | public Decimal toDecimal(int precision, int scale) {
ensureMaterialized();
if (precision > Decimal.MAX_LONG_DIGITS || this.sizeInBytes > Decimal.MAX_LONG_DIGITS) {
return toDecimalSlow(precision, scale);
}
// Data in Decimal is stored by one long value if `precision` <= Decimal.MAX_LONG_DIGITS.
// In this... | [
"public",
"Decimal",
"toDecimal",
"(",
"int",
"precision",
",",
"int",
"scale",
")",
"{",
"ensureMaterialized",
"(",
")",
";",
"if",
"(",
"precision",
">",
"Decimal",
".",
"MAX_LONG_DIGITS",
"||",
"this",
".",
"sizeInBytes",
">",
"Decimal",
".",
"MAX_LONG_DI... | Parses this BinaryString to Decimal.
@return Decimal value if the parsing was successful, or null if overflow
@throws NumberFormatException if the parsing failed. | [
"Parses",
"this",
"BinaryString",
"to",
"Decimal",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryString.java#L1477-L1612 | train | Returns the decimal value of this object. | [
30522,
2270,
26066,
28681,
8586,
9581,
2140,
1006,
20014,
11718,
1010,
20014,
4094,
1007,
1063,
5676,
8585,
14482,
3550,
1006,
1007,
1025,
2065,
1006,
11718,
1028,
26066,
1012,
4098,
1035,
2146,
1035,
16648,
1064,
1064,
2023,
1012,
2946,
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... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java | CompressorHttp2ConnectionEncoder.cleanup | void cleanup(Http2Stream stream, EmbeddedChannel compressor) {
if (compressor.finish()) {
for (;;) {
final ByteBuf buf = compressor.readOutbound();
if (buf == null) {
break;
}
buf.release();
}
}
... | java | void cleanup(Http2Stream stream, EmbeddedChannel compressor) {
if (compressor.finish()) {
for (;;) {
final ByteBuf buf = compressor.readOutbound();
if (buf == null) {
break;
}
buf.release();
}
}
... | [
"void",
"cleanup",
"(",
"Http2Stream",
"stream",
",",
"EmbeddedChannel",
"compressor",
")",
"{",
"if",
"(",
"compressor",
".",
"finish",
"(",
")",
")",
"{",
"for",
"(",
";",
";",
")",
"{",
"final",
"ByteBuf",
"buf",
"=",
"compressor",
".",
"readOutbound"... | Release remaining content from {@link EmbeddedChannel} and remove the compressor from the {@link Http2Stream}.
@param stream The stream for which {@code compressor} is the compressor for
@param compressor The compressor for {@code stream} | [
"Release",
"remaining",
"content",
"from",
"{",
"@link",
"EmbeddedChannel",
"}",
"and",
"remove",
"the",
"compressor",
"from",
"the",
"{",
"@link",
"Http2Stream",
"}",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java#L286-L298 | train | Cleanup the stream. | [
30522,
11675,
27686,
1006,
8299,
2475,
21422,
5460,
1010,
11157,
26058,
29329,
1007,
1063,
2065,
1006,
29329,
1012,
3926,
1006,
1007,
1007,
1063,
2005,
1006,
1025,
1025,
1007,
1063,
2345,
24880,
8569,
2546,
20934,
2546,
1027,
29329,
1012,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Bzip2HuffmanStageEncoder.java | Bzip2HuffmanStageEncoder.generateHuffmanCodeLengths | private static void generateHuffmanCodeLengths(final int alphabetSize,
final int[] symbolFrequencies, final int[] codeLengths) {
final int[] mergedFrequenciesAndIndices = new int[alphabetSize];
final int[] sortedFrequencies = new int[alphabetSize];
... | java | private static void generateHuffmanCodeLengths(final int alphabetSize,
final int[] symbolFrequencies, final int[] codeLengths) {
final int[] mergedFrequenciesAndIndices = new int[alphabetSize];
final int[] sortedFrequencies = new int[alphabetSize];
... | [
"private",
"static",
"void",
"generateHuffmanCodeLengths",
"(",
"final",
"int",
"alphabetSize",
",",
"final",
"int",
"[",
"]",
"symbolFrequencies",
",",
"final",
"int",
"[",
"]",
"codeLengths",
")",
"{",
"final",
"int",
"[",
"]",
"mergedFrequenciesAndIndices",
"... | Generate a Huffman code length table for a given list of symbol frequencies.
@param alphabetSize The total number of symbols
@param symbolFrequencies The frequencies of the symbols
@param codeLengths The array to which the generated code lengths should be written | [
"Generate",
"a",
"Huffman",
"code",
"length",
"table",
"for",
"a",
"given",
"list",
"of",
"symbol",
"frequencies",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java#L122-L153 | train | Generate the Huffman code lengths array. | [
30522,
2797,
10763,
11675,
9699,
6979,
4246,
2386,
16044,
7770,
13512,
7898,
1006,
2345,
20014,
12440,
5332,
4371,
1010,
2345,
20014,
1031,
1033,
6454,
19699,
2063,
4226,
14767,
1010,
2345,
20014,
1031,
1033,
3642,
7770,
13512,
7898,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/crypto/AuthEngine.java | AuthEngine.checkSubArray | private void checkSubArray(byte[] test, byte[] data, int offset) {
Preconditions.checkArgument(data.length >= test.length + offset);
for (int i = 0; i < test.length; i++) {
Preconditions.checkArgument(test[i] == data[i + offset]);
}
} | java | private void checkSubArray(byte[] test, byte[] data, int offset) {
Preconditions.checkArgument(data.length >= test.length + offset);
for (int i = 0; i < test.length; i++) {
Preconditions.checkArgument(test[i] == data[i + offset]);
}
} | [
"private",
"void",
"checkSubArray",
"(",
"byte",
"[",
"]",
"test",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"data",
".",
"length",
">=",
"test",
".",
"length",
"+",
"offset",
")",
";",
... | Checks that the "test" array is in the data array starting at the given offset. | [
"Checks",
"that",
"the",
"test",
"array",
"is",
"in",
"the",
"data",
"array",
"starting",
"at",
"the",
"given",
"offset",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/crypto/AuthEngine.java#L308-L313 | train | Check sub array. | [
30522,
2797,
11675,
14148,
19761,
11335,
2100,
1006,
24880,
1031,
1033,
3231,
1010,
24880,
1031,
1033,
2951,
1010,
20014,
16396,
1007,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
2906,
22850,
4765,
1006,
2951,
1012,
3091,
1028,
1027,
3231,
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-cron/src/main/java/cn/hutool/cron/pattern/matcher/DayOfMonthValueMatcher.java | DayOfMonthValueMatcher.match | public boolean match(int value, int month, boolean isLeapYear) {
return (super.match(value) // 在约定日范围内的某一天
//匹配器中用户定义了最后一天(32表示最后一天)
|| (value > 27 && match(32) && isLastDayOfMonth(value, month, isLeapYear)));
} | java | public boolean match(int value, int month, boolean isLeapYear) {
return (super.match(value) // 在约定日范围内的某一天
//匹配器中用户定义了最后一天(32表示最后一天)
|| (value > 27 && match(32) && isLastDayOfMonth(value, month, isLeapYear)));
} | [
"public",
"boolean",
"match",
"(",
"int",
"value",
",",
"int",
"month",
",",
"boolean",
"isLeapYear",
")",
"{",
"return",
"(",
"super",
".",
"match",
"(",
"value",
")",
"// 在约定日范围内的某一天\r",
"//匹配器中用户定义了最后一天(32表示最后一天)\r",
"||",
"(",
"value",
">",
"27",
"&&",
... | 给定的日期是否匹配当前匹配器
@param value 被检查的值,此处为日
@param month 实际的月份
@param isLeapYear 是否闰年
@return 是否匹配 | [
"给定的日期是否匹配当前匹配器"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/pattern/matcher/DayOfMonthValueMatcher.java#L33-L37 | train | Match a date in a month. | [
30522,
2270,
22017,
20898,
2674,
1006,
20014,
3643,
1010,
20014,
3204,
1010,
22017,
20898,
8842,
9331,
29100,
1007,
1063,
2709,
1006,
3565,
1012,
2674,
1006,
3643,
1007,
1013,
1013,
100,
100,
1822,
1864,
100,
100,
1773,
1916,
100,
1740,
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/spark | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java | UTF8String.getByteBuffer | @Nonnull
public ByteBuffer getByteBuffer() {
if (base instanceof byte[] && offset >= BYTE_ARRAY_OFFSET) {
final byte[] bytes = (byte[]) base;
// the offset includes an object header... this is only needed for unsafe copies
final long arrayOffset = offset - BYTE_ARRAY_OFFSET;
// verify th... | java | @Nonnull
public ByteBuffer getByteBuffer() {
if (base instanceof byte[] && offset >= BYTE_ARRAY_OFFSET) {
final byte[] bytes = (byte[]) base;
// the offset includes an object header... this is only needed for unsafe copies
final long arrayOffset = offset - BYTE_ARRAY_OFFSET;
// verify th... | [
"@",
"Nonnull",
"public",
"ByteBuffer",
"getByteBuffer",
"(",
")",
"{",
"if",
"(",
"base",
"instanceof",
"byte",
"[",
"]",
"&&",
"offset",
">=",
"BYTE_ARRAY_OFFSET",
")",
"{",
"final",
"byte",
"[",
"]",
"bytes",
"=",
"(",
"byte",
"[",
"]",
")",
"base",... | Returns a {@link ByteBuffer} wrapping the base object if it is a byte array
or a copy of the data if the base object is not a byte array.
Unlike getBytes this will not create a copy the array if this is a slice. | [
"Returns",
"a",
"{",
"@link",
"ByteBuffer",
"}",
"wrapping",
"the",
"base",
"object",
"if",
"it",
"is",
"a",
"byte",
"array",
"or",
"a",
"copy",
"of",
"the",
"data",
"if",
"the",
"base",
"object",
"is",
"not",
"a",
"byte",
"array",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L189-L207 | train | Get the ByteBuffer of the object. | [
30522,
1030,
2512,
11231,
3363,
2270,
24880,
8569,
12494,
2131,
3762,
2618,
8569,
12494,
1006,
1007,
1063,
2065,
1006,
2918,
6013,
11253,
24880,
1031,
1033,
1004,
1004,
16396,
1028,
1027,
24880,
1035,
9140,
1035,
16396,
1007,
1063,
2345,
24... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.copyByNIO | public static long copyByNIO(InputStream in, OutputStream out, int bufferSize, StreamProgress streamProgress) throws IORuntimeException {
return copy(Channels.newChannel(in), Channels.newChannel(out), bufferSize, streamProgress);
} | java | public static long copyByNIO(InputStream in, OutputStream out, int bufferSize, StreamProgress streamProgress) throws IORuntimeException {
return copy(Channels.newChannel(in), Channels.newChannel(out), bufferSize, streamProgress);
} | [
"public",
"static",
"long",
"copyByNIO",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
",",
"int",
"bufferSize",
",",
"StreamProgress",
"streamProgress",
")",
"throws",
"IORuntimeException",
"{",
"return",
"copy",
"(",
"Channels",
".",
"newChannel",
"(",
... | 拷贝流 thanks to: https://github.com/venusdrogon/feilong-io/blob/master/src/main/java/com/feilong/io/IOWriteUtil.java<br>
本方法不会关闭流
@param in 输入流
@param out 输出流
@param bufferSize 缓存大小
@param streamProgress 进度条
@return 传输的byte数
@throws IORuntimeException IO异常 | [
"拷贝流",
"thanks",
"to",
":",
"https",
":",
"//",
"github",
".",
"com",
"/",
"venusdrogon",
"/",
"feilong",
"-",
"io",
"/",
"blob",
"/",
"master",
"/",
"src",
"/",
"main",
"/",
"java",
"/",
"com",
"/",
"feilong",
"/",
"io",
"/",
"IOWriteUtil",
".",
... | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L201-L203 | train | Copies the contents of the input stream to the output stream using NIO. | [
30522,
2270,
10763,
2146,
6100,
3762,
27678,
1006,
20407,
25379,
1999,
1010,
27852,
25379,
2041,
1010,
20014,
17698,
5332,
4371,
1010,
5460,
21572,
17603,
4757,
5460,
21572,
17603,
4757,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/network-common/src/main/java/org/apache/spark/network/sasl/SparkSaslClient.java | SparkSaslClient.response | public synchronized byte[] response(byte[] token) {
try {
return saslClient != null ? saslClient.evaluateChallenge(token) : new byte[0];
} catch (SaslException e) {
throw Throwables.propagate(e);
}
} | java | public synchronized byte[] response(byte[] token) {
try {
return saslClient != null ? saslClient.evaluateChallenge(token) : new byte[0];
} catch (SaslException e) {
throw Throwables.propagate(e);
}
} | [
"public",
"synchronized",
"byte",
"[",
"]",
"response",
"(",
"byte",
"[",
"]",
"token",
")",
"{",
"try",
"{",
"return",
"saslClient",
"!=",
"null",
"?",
"saslClient",
".",
"evaluateChallenge",
"(",
"token",
")",
":",
"new",
"byte",
"[",
"0",
"]",
";",
... | Respond to server's SASL token.
@param token contains server's SASL token
@return client's response SASL token | [
"Respond",
"to",
"server",
"s",
"SASL",
"token",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/sasl/SparkSaslClient.java#L96-L102 | train | Evaluate the SASL challenge. | [
30522,
2270,
25549,
24880,
1031,
1033,
3433,
1006,
24880,
1031,
1033,
19204,
1007,
1063,
3046,
1063,
2709,
21871,
15472,
8751,
3372,
999,
1027,
19701,
1029,
21871,
15472,
8751,
3372,
1012,
16157,
18598,
7770,
3351,
1006,
19204,
1007,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/util/MurmurHashUtil.java | MurmurHashUtil.hashUnsafeBytesByWords | public static int hashUnsafeBytesByWords(Object base, long offset, int lengthInBytes) {
return hashUnsafeBytesByWords(base, offset, lengthInBytes, DEFAULT_SEED);
} | java | public static int hashUnsafeBytesByWords(Object base, long offset, int lengthInBytes) {
return hashUnsafeBytesByWords(base, offset, lengthInBytes, DEFAULT_SEED);
} | [
"public",
"static",
"int",
"hashUnsafeBytesByWords",
"(",
"Object",
"base",
",",
"long",
"offset",
",",
"int",
"lengthInBytes",
")",
"{",
"return",
"hashUnsafeBytesByWords",
"(",
"base",
",",
"offset",
",",
"lengthInBytes",
",",
"DEFAULT_SEED",
")",
";",
"}"
] | Hash unsafe bytes, length must be aligned to 4 bytes.
@param base base unsafe object
@param offset offset for unsafe object
@param lengthInBytes length in bytes
@return hash code | [
"Hash",
"unsafe",
"bytes",
"length",
"must",
"be",
"aligned",
"to",
"4",
"bytes",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/MurmurHashUtil.java#L40-L42 | train | Hash unsafe bytes by words. | [
30522,
2270,
10763,
20014,
23325,
4609,
3736,
7959,
3762,
4570,
3762,
22104,
1006,
4874,
2918,
1010,
2146,
16396,
1010,
20014,
3091,
2378,
3762,
4570,
1007,
1063,
2709,
23325,
4609,
3736,
7959,
3762,
4570,
3762,
22104,
1006,
2918,
1010,
163... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/environment/LocalStreamEnvironment.java | LocalStreamEnvironment.execute | @Override
public JobExecutionResult execute(String jobName) throws Exception {
// transform the streaming program into a JobGraph
StreamGraph streamGraph = getStreamGraph();
streamGraph.setJobName(jobName);
JobGraph jobGraph = streamGraph.getJobGraph();
jobGraph.setAllowQueuedScheduling(true);
Configurat... | java | @Override
public JobExecutionResult execute(String jobName) throws Exception {
// transform the streaming program into a JobGraph
StreamGraph streamGraph = getStreamGraph();
streamGraph.setJobName(jobName);
JobGraph jobGraph = streamGraph.getJobGraph();
jobGraph.setAllowQueuedScheduling(true);
Configurat... | [
"@",
"Override",
"public",
"JobExecutionResult",
"execute",
"(",
"String",
"jobName",
")",
"throws",
"Exception",
"{",
"// transform the streaming program into a JobGraph",
"StreamGraph",
"streamGraph",
"=",
"getStreamGraph",
"(",
")",
";",
"streamGraph",
".",
"setJobName... | Executes the JobGraph of the on a mini cluster of CLusterUtil with a user
specified name.
@param jobName
name of the job
@return The result of the job execution, containing elapsed time and accumulators. | [
"Executes",
"the",
"JobGraph",
"of",
"the",
"on",
"a",
"mini",
"cluster",
"of",
"CLusterUtil",
"with",
"a",
"user",
"specified",
"name",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/LocalStreamEnvironment.java#L86-L129 | train | Execute the job on the local embedded Flink mini cluster. | [
30522,
1030,
2058,
15637,
2270,
3105,
10288,
8586,
13700,
6072,
11314,
15389,
1006,
5164,
3105,
18442,
1007,
11618,
6453,
1063,
1013,
1013,
10938,
1996,
11058,
2565,
2046,
1037,
3105,
14413,
5460,
14413,
5460,
14413,
1027,
4152,
25379,
14413,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.createTempFile | public static File createTempFile(String prefix, String suffix, File dir, boolean isReCreat) throws IORuntimeException {
int exceptionsCount = 0;
while (true) {
try {
File file = File.createTempFile(prefix, suffix, dir).getCanonicalFile();
if (isReCreat) {
file.delete();
file.createNewFi... | java | public static File createTempFile(String prefix, String suffix, File dir, boolean isReCreat) throws IORuntimeException {
int exceptionsCount = 0;
while (true) {
try {
File file = File.createTempFile(prefix, suffix, dir).getCanonicalFile();
if (isReCreat) {
file.delete();
file.createNewFi... | [
"public",
"static",
"File",
"createTempFile",
"(",
"String",
"prefix",
",",
"String",
"suffix",
",",
"File",
"dir",
",",
"boolean",
"isReCreat",
")",
"throws",
"IORuntimeException",
"{",
"int",
"exceptionsCount",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{"... | 创建临时文件<br>
创建后的文件名为 prefix[Randon].suffix From com.jodd.io.FileUtil
@param prefix 前缀,至少3个字符
@param suffix 后缀,如果null则使用默认.tmp
@param dir 临时文件创建的所在目录
@param isReCreat 是否重新创建文件(删掉原来的,创建新的)
@return 临时文件
@throws IORuntimeException IO异常 | [
"创建临时文件<br",
">",
"创建后的文件名为",
"prefix",
"[",
"Randon",
"]",
".",
"suffix",
"From",
"com",
".",
"jodd",
".",
"io",
".",
"FileUtil"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L897-L913 | train | Creates a temporary file with the specified prefix and suffix and directory. | [
30522,
2270,
10763,
5371,
3443,
18532,
14376,
9463,
1006,
5164,
17576,
1010,
5164,
16809,
1010,
5371,
16101,
1010,
22017,
20898,
2003,
2890,
16748,
4017,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
20014,
11790,
3597,
16671,
1027,
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 | handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java | AbstractTrafficShapingHandler.checkWriteSuspend | void checkWriteSuspend(ChannelHandlerContext ctx, long delay, long queueSize) {
if (queueSize > maxWriteSize || delay > maxWriteDelay) {
setUserDefinedWritability(ctx, false);
}
} | java | void checkWriteSuspend(ChannelHandlerContext ctx, long delay, long queueSize) {
if (queueSize > maxWriteSize || delay > maxWriteDelay) {
setUserDefinedWritability(ctx, false);
}
} | [
"void",
"checkWriteSuspend",
"(",
"ChannelHandlerContext",
"ctx",
",",
"long",
"delay",
",",
"long",
"queueSize",
")",
"{",
"if",
"(",
"queueSize",
">",
"maxWriteSize",
"||",
"delay",
">",
"maxWriteDelay",
")",
"{",
"setUserDefinedWritability",
"(",
"ctx",
",",
... | Check the writability according to delay and size for the channel.
Set if necessary setUserDefinedWritability status.
@param delay the computed delay
@param queueSize the current queueSize | [
"Check",
"the",
"writability",
"according",
"to",
"delay",
"and",
"size",
"for",
"the",
"channel",
".",
"Set",
"if",
"necessary",
"setUserDefinedWritability",
"status",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java#L597-L601 | train | Check if write suspend is allowed. | [
30522,
11675,
4638,
26373,
13203,
11837,
2094,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
2146,
8536,
1010,
2146,
24240,
5332,
4371,
1007,
1063,
2065,
1006,
24240,
5332,
4371,
1028,
4098,
26373,
5332,
4371,
1064,
1064,
8536,
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 | client/src/main/java/com/networknt/client/ssl/ClientX509ExtendedTrustManager.java | ClientX509ExtendedTrustManager.decorate | public static TrustManager[] decorate(TrustManager[] trustManagers, TLSConfig tlsConfig) {
if (null!=trustManagers && trustManagers.length>0) {
TrustManager[] decoratedTrustManagers = new TrustManager[trustManagers.length];
for (int i=0; i<trustManagers.length; ++i) {
TrustManager trustManager = trustMa... | java | public static TrustManager[] decorate(TrustManager[] trustManagers, TLSConfig tlsConfig) {
if (null!=trustManagers && trustManagers.length>0) {
TrustManager[] decoratedTrustManagers = new TrustManager[trustManagers.length];
for (int i=0; i<trustManagers.length; ++i) {
TrustManager trustManager = trustMa... | [
"public",
"static",
"TrustManager",
"[",
"]",
"decorate",
"(",
"TrustManager",
"[",
"]",
"trustManagers",
",",
"TLSConfig",
"tlsConfig",
")",
"{",
"if",
"(",
"null",
"!=",
"trustManagers",
"&&",
"trustManagers",
".",
"length",
">",
"0",
")",
"{",
"TrustManag... | This method converts existing X509TrustManagers to ClientX509ExtendedTrustManagers.
@param trustManagers
@param tlsConfig
@return | [
"This",
"method",
"converts",
"existing",
"X509TrustManagers",
"to",
"ClientX509ExtendedTrustManagers",
"."
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/ssl/ClientX509ExtendedTrustManager.java#L193-L211 | train | Decorate the given trust managers with ClientX509ExtendedTrustManagers | [
30522,
2270,
10763,
3404,
24805,
4590,
1031,
1033,
29460,
1006,
3404,
24805,
4590,
1031,
1033,
3404,
24805,
15776,
1010,
1056,
4877,
8663,
8873,
2290,
1056,
4877,
8663,
8873,
2290,
1007,
1063,
2065,
1006,
19701,
999,
1027,
3404,
24805,
1577... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Http2ConnectionHandler.java | Http2ConnectionHandler.resetUnknownStream | private ChannelFuture resetUnknownStream(final ChannelHandlerContext ctx, int streamId, long errorCode,
ChannelPromise promise) {
ChannelFuture future = frameWriter().writeRstStream(ctx, streamId, errorCode, promise);
if (future.isDone()) {
closeC... | java | private ChannelFuture resetUnknownStream(final ChannelHandlerContext ctx, int streamId, long errorCode,
ChannelPromise promise) {
ChannelFuture future = frameWriter().writeRstStream(ctx, streamId, errorCode, promise);
if (future.isDone()) {
closeC... | [
"private",
"ChannelFuture",
"resetUnknownStream",
"(",
"final",
"ChannelHandlerContext",
"ctx",
",",
"int",
"streamId",
",",
"long",
"errorCode",
",",
"ChannelPromise",
"promise",
")",
"{",
"ChannelFuture",
"future",
"=",
"frameWriter",
"(",
")",
".",
"writeRstStrea... | Sends a {@code RST_STREAM} frame even if we don't know about the stream. This error condition is most likely
triggered by the first frame of a stream being invalid. That is, there was an error reading the frame before
we could create a new stream. | [
"Sends",
"a",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L745-L759 | train | Reset unknown stream. | [
30522,
2797,
3149,
11263,
11244,
25141,
16814,
19779,
23808,
16416,
2213,
1006,
2345,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
20014,
5460,
3593,
1010,
2146,
7561,
16044,
1010,
3149,
21572,
28732,
4872,
1007,
1063,
3149,
11263,
1124... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/typeutils/CompositeTypeSerializerUtil.java | CompositeTypeSerializerUtil.delegateCompatibilityCheckToNewSnapshot | public static <T> TypeSerializerSchemaCompatibility<T> delegateCompatibilityCheckToNewSnapshot(
TypeSerializer<T> newSerializer,
CompositeTypeSerializerSnapshot<T, ? extends TypeSerializer> newCompositeSnapshot,
TypeSerializerSnapshot<?>... legacyNestedSnapshots) {
checkArgument(legacyNestedSnapshots.length... | java | public static <T> TypeSerializerSchemaCompatibility<T> delegateCompatibilityCheckToNewSnapshot(
TypeSerializer<T> newSerializer,
CompositeTypeSerializerSnapshot<T, ? extends TypeSerializer> newCompositeSnapshot,
TypeSerializerSnapshot<?>... legacyNestedSnapshots) {
checkArgument(legacyNestedSnapshots.length... | [
"public",
"static",
"<",
"T",
">",
"TypeSerializerSchemaCompatibility",
"<",
"T",
">",
"delegateCompatibilityCheckToNewSnapshot",
"(",
"TypeSerializer",
"<",
"T",
">",
"newSerializer",
",",
"CompositeTypeSerializerSnapshot",
"<",
"T",
",",
"?",
"extends",
"TypeSerialize... | Delegates compatibility checks to a {@link CompositeTypeSerializerSnapshot} instance.
This can be used by legacy snapshot classes, which have a newer implementation
implemented as a {@link CompositeTypeSerializerSnapshot}.
@param newSerializer the new serializer to check for compatibility.
@param newCompositeSnapshot ... | [
"Delegates",
"compatibility",
"checks",
"to",
"a",
"{",
"@link",
"CompositeTypeSerializerSnapshot",
"}",
"instance",
".",
"This",
"can",
"be",
"used",
"by",
"legacy",
"snapshot",
"classes",
"which",
"have",
"a",
"newer",
"implementation",
"implemented",
"as",
"a",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeTypeSerializerUtil.java#L46-L53 | train | Delegate compatibility check to a new composite snapshot. | [
30522,
2270,
10763,
1026,
1056,
1028,
4127,
11610,
28863,
22842,
22911,
25377,
10450,
8553,
1026,
1056,
1028,
11849,
9006,
24952,
8553,
5403,
3600,
5524,
9333,
2532,
4523,
12326,
1006,
4127,
11610,
28863,
1026,
1056,
1028,
2739,
11610,
28863,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/CommonDictionaryMaker.java | CommonDictionaryMaker.learn | public void learn(List<Sentence> sentenceList)
{
List<List<IWord>> s = new ArrayList<List<IWord>>(sentenceList.size());
for (Sentence sentence : sentenceList)
{
s.add(sentence.wordList);
}
compute(s);
} | java | public void learn(List<Sentence> sentenceList)
{
List<List<IWord>> s = new ArrayList<List<IWord>>(sentenceList.size());
for (Sentence sentence : sentenceList)
{
s.add(sentence.wordList);
}
compute(s);
} | [
"public",
"void",
"learn",
"(",
"List",
"<",
"Sentence",
">",
"sentenceList",
")",
"{",
"List",
"<",
"List",
"<",
"IWord",
">>",
"s",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"IWord",
">",
">",
"(",
"sentenceList",
".",
"size",
"(",
")",
")",
";"... | 同compute
@param sentenceList | [
"同compute"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/dictionary/CommonDictionaryMaker.java#L77-L85 | train | This method is called to learn a list of words. | [
30522,
2270,
11675,
4553,
1006,
2862,
1026,
6251,
1028,
6251,
9863,
1007,
1063,
2862,
1026,
2862,
1026,
1045,
18351,
1028,
1028,
1055,
1027,
2047,
9140,
9863,
1026,
2862,
1026,
1045,
18351,
1028,
1028,
1006,
6251,
9863,
1012,
2946,
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-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/bucketing/BucketingSink.java | BucketingSink.shouldRoll | private boolean shouldRoll(BucketState<T> bucketState, long currentProcessingTime) throws IOException {
boolean shouldRoll = false;
int subtaskIndex = getRuntimeContext().getIndexOfThisSubtask();
if (!bucketState.isWriterOpen) {
shouldRoll = true;
LOG.debug("BucketingSink {} starting new bucket.", subtaskIn... | java | private boolean shouldRoll(BucketState<T> bucketState, long currentProcessingTime) throws IOException {
boolean shouldRoll = false;
int subtaskIndex = getRuntimeContext().getIndexOfThisSubtask();
if (!bucketState.isWriterOpen) {
shouldRoll = true;
LOG.debug("BucketingSink {} starting new bucket.", subtaskIn... | [
"private",
"boolean",
"shouldRoll",
"(",
"BucketState",
"<",
"T",
">",
"bucketState",
",",
"long",
"currentProcessingTime",
")",
"throws",
"IOException",
"{",
"boolean",
"shouldRoll",
"=",
"false",
";",
"int",
"subtaskIndex",
"=",
"getRuntimeContext",
"(",
")",
... | Returns {@code true} if the current {@code part-file} should be closed and a new should be created.
This happens if:
<ol>
<li>no file is created yet for the task to write to, or</li>
<li>the current file has reached the maximum bucket size.</li>
<li>the current file is older than roll over interval</li>
</ol> | [
"Returns",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/bucketing/BucketingSink.java#L474-L500 | train | Checks if the bucket should be rolled. | [
30522,
2797,
22017,
20898,
2323,
28402,
1006,
13610,
9153,
2618,
1026,
1056,
1028,
13610,
9153,
2618,
1010,
2146,
2783,
21572,
9623,
7741,
7292,
1007,
11618,
22834,
10288,
24422,
1063,
22017,
20898,
2323,
28402,
1027,
6270,
1025,
20014,
4942,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/io/network/partition/consumer/LocalInputChannel.java | LocalInputChannel.sendTaskEvent | @Override
void sendTaskEvent(TaskEvent event) throws IOException {
checkError();
checkState(subpartitionView != null, "Tried to send task event to producer before requesting the subpartition.");
if (!taskEventPublisher.publish(partitionId, event)) {
throw new IOException("Error while publishing event " + eve... | java | @Override
void sendTaskEvent(TaskEvent event) throws IOException {
checkError();
checkState(subpartitionView != null, "Tried to send task event to producer before requesting the subpartition.");
if (!taskEventPublisher.publish(partitionId, event)) {
throw new IOException("Error while publishing event " + eve... | [
"@",
"Override",
"void",
"sendTaskEvent",
"(",
"TaskEvent",
"event",
")",
"throws",
"IOException",
"{",
"checkError",
"(",
")",
";",
"checkState",
"(",
"subpartitionView",
"!=",
"null",
",",
"\"Tried to send task event to producer before requesting the subpartition.\"",
"... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/LocalInputChannel.java#L220-L228 | train | Sends a task event to the producer. | [
30522,
1030,
2058,
15637,
11675,
4604,
10230,
3489,
15338,
1006,
4708,
18697,
3372,
2724,
1007,
11618,
22834,
10288,
24422,
1063,
4638,
2121,
29165,
1006,
1007,
1025,
14148,
12259,
1006,
4942,
19362,
3775,
3508,
8584,
999,
1027,
19701,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-shardingsphere | sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/executor/BatchPreparedStatementExecutor.java | BatchPreparedStatementExecutor.getStatements | @Override
public List<Statement> getStatements() {
List<Statement> result = new LinkedList<>();
for (ShardingExecuteGroup<StatementExecuteUnit> each : getExecuteGroups()) {
result.addAll(Lists.transform(each.getInputs(), new Function<StatementExecuteUnit, Statement>() {
... | java | @Override
public List<Statement> getStatements() {
List<Statement> result = new LinkedList<>();
for (ShardingExecuteGroup<StatementExecuteUnit> each : getExecuteGroups()) {
result.addAll(Lists.transform(each.getInputs(), new Function<StatementExecuteUnit, Statement>() {
... | [
"@",
"Override",
"public",
"List",
"<",
"Statement",
">",
"getStatements",
"(",
")",
"{",
"List",
"<",
"Statement",
">",
"result",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"for",
"(",
"ShardingExecuteGroup",
"<",
"StatementExecuteUnit",
">",
"each",
... | Get statements.
@return statements | [
"Get",
"statements",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/executor/BatchPreparedStatementExecutor.java#L206-L219 | train | Gets the statements. | [
30522,
1030,
2058,
15637,
2270,
2862,
1026,
4861,
1028,
4152,
12259,
8163,
1006,
1007,
1063,
2862,
1026,
4861,
1028,
2765,
1027,
2047,
5799,
9863,
1026,
1028,
1006,
1007,
1025,
2005,
1006,
21146,
17080,
15465,
2595,
8586,
10421,
17058,
1026... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/convert/Convert.java | Convert.digitToChinese | public static String digitToChinese(Number n) {
if(null == n) {
return "零";
}
return NumberChineseFormater.format(n.doubleValue(), true, true);
} | java | public static String digitToChinese(Number n) {
if(null == n) {
return "零";
}
return NumberChineseFormater.format(n.doubleValue(), true, true);
} | [
"public",
"static",
"String",
"digitToChinese",
"(",
"Number",
"n",
")",
"{",
"if",
"(",
"null",
"==",
"n",
")",
"{",
"return",
"\"零\";\r",
"",
"}",
"return",
"NumberChineseFormater",
".",
"format",
"(",
"n",
".",
"doubleValue",
"(",
")",
",",
"true",
... | 金额转为中文形式
@param n 数字
@return 中文大写数字
@since 3.2.3 | [
"金额转为中文形式"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java#L858-L863 | train | Converts a digit number to Chinese. | [
30522,
2270,
10763,
5164,
15340,
3406,
17231,
6810,
1006,
2193,
1050,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1050,
1007,
1063,
2709,
1000,
100,
1000,
1025,
1065,
2709,
2193,
17231,
6810,
14192,
24932,
1012,
4289,
1006,
1050,
1012,
3313,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ChannelDuplexHandler.java | ChannelDuplexHandler.bind | @Skip
@Override
public void bind(ChannelHandlerContext ctx, SocketAddress localAddress,
ChannelPromise promise) throws Exception {
ctx.bind(localAddress, promise);
} | java | @Skip
@Override
public void bind(ChannelHandlerContext ctx, SocketAddress localAddress,
ChannelPromise promise) throws Exception {
ctx.bind(localAddress, promise);
} | [
"@",
"Skip",
"@",
"Override",
"public",
"void",
"bind",
"(",
"ChannelHandlerContext",
"ctx",
",",
"SocketAddress",
"localAddress",
",",
"ChannelPromise",
"promise",
")",
"throws",
"Exception",
"{",
"ctx",
".",
"bind",
"(",
"localAddress",
",",
"promise",
")",
... | Calls {@link ChannelHandlerContext#bind(SocketAddress, ChannelPromise)} to forward
to the next {@link ChannelOutboundHandler} in the {@link ChannelPipeline}.
Sub-classes may override this method to change behavior. | [
"Calls",
"{",
"@link",
"ChannelHandlerContext#bind",
"(",
"SocketAddress",
"ChannelPromise",
")",
"}",
"to",
"forward",
"to",
"the",
"next",
"{",
"@link",
"ChannelOutboundHandler",
"}",
"in",
"the",
"{",
"@link",
"ChannelPipeline",
"}",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/ChannelDuplexHandler.java#L37-L42 | train | Override this method to bind to a local address. | [
30522,
1030,
13558,
1030,
2058,
15637,
2270,
11675,
14187,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
22278,
4215,
16200,
4757,
2334,
4215,
16200,
4757,
1010,
3149,
21572,
28732,
4872,
1007,
11618,
6453,
1063,
14931,
2595,
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... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/WindowedStream.java | WindowedStream.apply | public <R> SingleOutputStreamOperator<R> apply(WindowFunction<T, R, K, W> function, TypeInformation<R> resultType) {
function = input.getExecutionEnvironment().clean(function);
return apply(new InternalIterableWindowFunction<>(function), resultType, function);
} | java | public <R> SingleOutputStreamOperator<R> apply(WindowFunction<T, R, K, W> function, TypeInformation<R> resultType) {
function = input.getExecutionEnvironment().clean(function);
return apply(new InternalIterableWindowFunction<>(function), resultType, function);
} | [
"public",
"<",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"apply",
"(",
"WindowFunction",
"<",
"T",
",",
"R",
",",
"K",
",",
"W",
">",
"function",
",",
"TypeInformation",
"<",
"R",
">",
"resultType",
")",
"{",
"function",
"=",
"input",
".",... | 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>Note that this function requires that all data in the windows is buffered until the window
i... | [
"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/WindowedStream.java#L1036-L1039 | train | Applies a window function to the stream. | [
30522,
2270,
1026,
1054,
1028,
2309,
5833,
18780,
21422,
25918,
8844,
1026,
1054,
1028,
6611,
1006,
3332,
11263,
27989,
1026,
1056,
1010,
1054,
1010,
1047,
1010,
1059,
1028,
3853,
1010,
2828,
2378,
14192,
3370,
1026,
1054,
1028,
2765,
13874... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-json/src/main/java/cn/hutool/json/XMLTokener.java | XMLTokener.nextToken | public Object nextToken() throws JSONException {
char c;
char q;
StringBuilder sb;
do {
c = next();
} while (Character.isWhitespace(c));
switch (c) {
case 0:
throw syntaxError("Misshaped element");
case '<':
throw syntaxError("Misplaced '<'");
case '>':
return XML.GT;
case '/':
... | java | public Object nextToken() throws JSONException {
char c;
char q;
StringBuilder sb;
do {
c = next();
} while (Character.isWhitespace(c));
switch (c) {
case 0:
throw syntaxError("Misshaped element");
case '<':
throw syntaxError("Misplaced '<'");
case '>':
return XML.GT;
case '/':
... | [
"public",
"Object",
"nextToken",
"(",
")",
"throws",
"JSONException",
"{",
"char",
"c",
";",
"char",
"q",
";",
"StringBuilder",
"sb",
";",
"do",
"{",
"c",
"=",
"next",
"(",
")",
";",
"}",
"while",
"(",
"Character",
".",
"isWhitespace",
"(",
"c",
")",... | Get the next XML Token. These tokens are found inside of angle brackets. It may be one of these characters: <code>/ > = ! ?</code> or it may be a string wrapped in single quotes or double
quotes, or it may be a name.
@return a String or a Character.
@throws JSONException If the XML is not well formed. | [
"Get",
"the",
"next",
"XML",
"Token",
".",
"These",
"tokens",
"are",
"found",
"inside",
"of",
"angle",
"brackets",
".",
"It",
"may",
"be",
"one",
"of",
"these",
"characters",
":",
"<code",
">",
"/",
">",
";",
"=",
"!",
"?<",
"/",
"code",
">",
"or... | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/XMLTokener.java#L184-L257 | train | Returns the next token. | [
30522,
2270,
4874,
2279,
18715,
2368,
1006,
1007,
11618,
1046,
3385,
10288,
24422,
1063,
25869,
1039,
1025,
25869,
1053,
1025,
5164,
8569,
23891,
2099,
24829,
1025,
2079,
1063,
1039,
1027,
2279,
1006,
1007,
1025,
1065,
2096,
1006,
2839,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java | JSONArray.put | public JSONArray put(int index, Object value) throws JSONException {
if (value instanceof Number) {
// deviate from the original by checking all Numbers, not just floats &
// doubles
JSON.checkDouble(((Number) value).doubleValue());
}
while (this.values.size() <= index) {
this.values.add(null);
}
... | java | public JSONArray put(int index, Object value) throws JSONException {
if (value instanceof Number) {
// deviate from the original by checking all Numbers, not just floats &
// doubles
JSON.checkDouble(((Number) value).doubleValue());
}
while (this.values.size() <= index) {
this.values.add(null);
}
... | [
"public",
"JSONArray",
"put",
"(",
"int",
"index",
",",
"Object",
"value",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"value",
"instanceof",
"Number",
")",
"{",
"// deviate from the original by checking all Numbers, not just floats &",
"// doubles",
"JSON",
".",
... | Sets the value at {@code index} to {@code value}, null padding this array to the
required length if necessary. If a value already exists at {@code
index}, it will be replaced.
@param index the index to set the value to
@param value a {@link JSONObject}, {@link JSONArray}, String, Boolean, Integer,
Long, Double, {@link ... | [
"Sets",
"the",
"value",
"at",
"{"
] | 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/JSONArray.java#L250-L261 | train | Add a value to this JSONArray at the specified index. | [
30522,
2270,
1046,
3385,
2906,
9447,
2404,
1006,
20014,
5950,
1010,
4874,
3643,
1007,
11618,
1046,
30524,
2193,
1007,
1063,
1013,
1013,
14386,
3686,
2013,
1996,
2434,
2011,
9361,
2035,
3616,
1010,
2025,
2074,
24885,
1004,
1013,
1013,
7695,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/AtomNode.java | AtomNode.getNature | public Nature getNature()
{
Nature nature = Nature.nz;
switch (nPOS)
{
case CharType.CT_CHINESE:
break;
case CharType.CT_NUM:
case CharType.CT_INDEX:
case CharType.CT_CNUM:
nature = Nature.m;
sWor... | java | public Nature getNature()
{
Nature nature = Nature.nz;
switch (nPOS)
{
case CharType.CT_CHINESE:
break;
case CharType.CT_NUM:
case CharType.CT_INDEX:
case CharType.CT_CNUM:
nature = Nature.m;
sWor... | [
"public",
"Nature",
"getNature",
"(",
")",
"{",
"Nature",
"nature",
"=",
"Nature",
".",
"nz",
";",
"switch",
"(",
"nPOS",
")",
"{",
"case",
"CharType",
".",
"CT_CHINESE",
":",
"break",
";",
"case",
"CharType",
".",
"CT_NUM",
":",
"case",
"CharType",
".... | 原子的词性
@return | [
"原子的词性"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/NShort/Path/AtomNode.java#L45-L80 | train | Get the Nature of the class. | [
30522,
2270,
3267,
2131,
19833,
5397,
1006,
1007,
1063,
3267,
3267,
1027,
3267,
1012,
20008,
1025,
6942,
1006,
27937,
2891,
1007,
1063,
2553,
3673,
18863,
1012,
14931,
1035,
2822,
1024,
3338,
1025,
2553,
3673,
18863,
1012,
14931,
1035,
1637... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Table.java | Table.get | public String get(int x, int y)
{
if (x < 0) return HEAD + x;
if (x >= v.length) return HEAD + "+" + (x - v.length + 1);
return v[x][y];
} | java | public String get(int x, int y)
{
if (x < 0) return HEAD + x;
if (x >= v.length) return HEAD + "+" + (x - v.length + 1);
return v[x][y];
} | [
"public",
"String",
"get",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"x",
"<",
"0",
")",
"return",
"HEAD",
"+",
"x",
";",
"if",
"(",
"x",
">=",
"v",
".",
"length",
")",
"return",
"HEAD",
"+",
"\"+\"",
"+",
"(",
"x",
"-",
"v",
... | 获取表中某一个元素
@param x
@param y
@return | [
"获取表中某一个元素"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/crf/Table.java#L48-L54 | train | Gets the value of the specified key. | [
30522,
2270,
5164,
2131,
1006,
20014,
1060,
1010,
20014,
1061,
1007,
1063,
2065,
1006,
1060,
1026,
1014,
1007,
2709,
2132,
1009,
1060,
1025,
2065,
1006,
1060,
1028,
1027,
1058,
1012,
3091,
1007,
2709,
2132,
1009,
1000,
1009,
1000,
1009,
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-db/src/main/java/cn/hutool/db/Entity.java | Entity.set | @Override
public Entity set(String field, Object value) {
return (Entity) super.set(field, value);
} | java | @Override
public Entity set(String field, Object value) {
return (Entity) super.set(field, value);
} | [
"@",
"Override",
"public",
"Entity",
"set",
"(",
"String",
"field",
",",
"Object",
"value",
")",
"{",
"return",
"(",
"Entity",
")",
"super",
".",
"set",
"(",
"field",
",",
"value",
")",
";",
"}"
] | -------------------------------------------------------------------- Put and Set start | [
"--------------------------------------------------------------------",
"Put",
"and",
"Set",
"start"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/Entity.java#L240-L243 | train | Override set to set a field in the entity. | [
30522,
1030,
2058,
15637,
2270,
9178,
2275,
1006,
5164,
2492,
1010,
4874,
3643,
1007,
1063,
2709,
1006,
9178,
1007,
3565,
1012,
2275,
1006,
2492,
1010,
3643,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/internal/registry/state/schema/OrchestrationShardingSchemaGroup.java | OrchestrationShardingSchemaGroup.put | public void put(final String shardingSchemaName, final Collection<String> dataSourceNames) {
schemaGroup.put(shardingSchemaName, dataSourceNames);
} | java | public void put(final String shardingSchemaName, final Collection<String> dataSourceNames) {
schemaGroup.put(shardingSchemaName, dataSourceNames);
} | [
"public",
"void",
"put",
"(",
"final",
"String",
"shardingSchemaName",
",",
"final",
"Collection",
"<",
"String",
">",
"dataSourceNames",
")",
"{",
"schemaGroup",
".",
"put",
"(",
"shardingSchemaName",
",",
"dataSourceNames",
")",
";",
"}"
] | Put orchestration sharding schema.
@param shardingSchemaName sharding schema name
@param dataSourceNames data source names | [
"Put",
"orchestration",
"sharding",
"schema",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/internal/registry/state/schema/OrchestrationShardingSchemaGroup.java#L54-L56 | train | Put sharding schema name and data source names into the schema group. | [
30522,
2270,
11675,
2404,
1006,
2345,
5164,
21146,
17080,
3070,
22842,
24805,
4168,
1010,
2345,
3074,
1026,
5164,
1028,
2951,
6499,
3126,
27524,
14074,
2015,
1007,
1063,
8040,
28433,
17058,
1012,
2404,
1006,
21146,
17080,
3070,
22842,
24805,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/StringUtils.java | StringUtils.generateRandomAlphanumericString | public static String generateRandomAlphanumericString(Random rnd, int length) {
checkNotNull(rnd);
checkArgument(length >= 0);
StringBuilder buffer = new StringBuilder(length);
for (int i = 0; i < length; i++) {
buffer.append(nextAlphanumericChar(rnd));
}
return buffer.toString();
} | java | public static String generateRandomAlphanumericString(Random rnd, int length) {
checkNotNull(rnd);
checkArgument(length >= 0);
StringBuilder buffer = new StringBuilder(length);
for (int i = 0; i < length; i++) {
buffer.append(nextAlphanumericChar(rnd));
}
return buffer.toString();
} | [
"public",
"static",
"String",
"generateRandomAlphanumericString",
"(",
"Random",
"rnd",
",",
"int",
"length",
")",
"{",
"checkNotNull",
"(",
"rnd",
")",
";",
"checkArgument",
"(",
"length",
">=",
"0",
")",
";",
"StringBuilder",
"buffer",
"=",
"new",
"StringBui... | Creates a random alphanumeric string of given length.
@param rnd The random number generator to use.
@param length The number of alphanumeric characters to append. | [
"Creates",
"a",
"random",
"alphanumeric",
"string",
"of",
"given",
"length",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/StringUtils.java#L258-L267 | train | Generates a random alphanumeric string of the specified length. | [
30522,
2270,
10763,
5164,
9699,
13033,
9626,
14277,
4819,
17897,
7277,
3367,
4892,
1006,
6721,
29300,
2094,
1010,
20014,
3091,
1007,
1063,
4638,
17048,
11231,
3363,
1006,
29300,
2094,
1007,
1025,
4638,
2906,
22850,
4765,
1006,
3091,
1028,
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/date/BetweenFormater.java | BetweenFormater.format | public String format(){
final StringBuilder sb = new StringBuilder();
if(betweenMs > 0){
long day = betweenMs / DateUnit.DAY.getMillis();
long hour = betweenMs / DateUnit.HOUR.getMillis() - day * 24;
long minute = betweenMs / DateUnit.MINUTE.getMillis() - day * 24 * 60 - hour * 60;
long second = b... | java | public String format(){
final StringBuilder sb = new StringBuilder();
if(betweenMs > 0){
long day = betweenMs / DateUnit.DAY.getMillis();
long hour = betweenMs / DateUnit.HOUR.getMillis() - day * 24;
long minute = betweenMs / DateUnit.MINUTE.getMillis() - day * 24 * 60 - hour * 60;
long second = b... | [
"public",
"String",
"format",
"(",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"betweenMs",
">",
"0",
")",
"{",
"long",
"day",
"=",
"betweenMs",
"/",
"DateUnit",
".",
"DAY",
".",
"getMillis",
"(",
... | 格式化日期间隔输出<br>
@return 格式化后的字符串 | [
"格式化日期间隔输出<br",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/BetweenFormater.java#L45-L84 | train | Returns a string representation of the device s data. | [
30522,
2270,
5164,
4289,
1006,
1007,
1063,
2345,
5164,
8569,
23891,
2099,
24829,
1027,
2047,
5164,
8569,
23891,
2099,
1006,
1007,
1025,
2065,
1006,
2090,
5244,
1028,
1014,
1007,
1063,
2146,
2154,
1027,
2090,
5244,
1013,
3058,
19496,
2102,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-aop/src/main/java/cn/hutool/aop/ProxyUtil.java | ProxyUtil.newProxyInstance | public static <T> T newProxyInstance(InvocationHandler invocationHandler, Class<?>... interfaces) {
return newProxyInstance(ClassUtil.getClassLoader(), invocationHandler, interfaces);
} | java | public static <T> T newProxyInstance(InvocationHandler invocationHandler, Class<?>... interfaces) {
return newProxyInstance(ClassUtil.getClassLoader(), invocationHandler, interfaces);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"newProxyInstance",
"(",
"InvocationHandler",
"invocationHandler",
",",
"Class",
"<",
"?",
">",
"...",
"interfaces",
")",
"{",
"return",
"newProxyInstance",
"(",
"ClassUtil",
".",
"getClassLoader",
"(",
")",
",",
"invoca... | 创建动态代理对象
@param <T> 被代理对象类型
@param invocationHandler {@link InvocationHandler} ,被代理类通过实现此接口提供动态代理功能
@param interfaces 代理类中需要实现的被代理类的接口方法
@return 代理类 | [
"创建动态代理对象"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-aop/src/main/java/cn/hutool/aop/ProxyUtil.java#L70-L72 | train | Creates a new proxy instance with the given invocation handler and interfaces. | [
30522,
2270,
10763,
1026,
1056,
1028,
1056,
2047,
21572,
18037,
7076,
26897,
1006,
1999,
19152,
11774,
3917,
1999,
19152,
11774,
3917,
1010,
2465,
1026,
1029,
1028,
1012,
1012,
1012,
19706,
1007,
1063,
2709,
2047,
21572,
18037,
7076,
26897,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/date/DateBetween.java | DateBetween.betweenYear | public long betweenYear(boolean isReset) {
final Calendar beginCal = DateUtil.calendar(begin);
final Calendar endCal = DateUtil.calendar(end);
int result = endCal.get(Calendar.YEAR) - beginCal.get(Calendar.YEAR);
if (false == isReset) {
endCal.set(Calendar.YEAR, beginCal.get(Calendar.YEAR));
long ... | java | public long betweenYear(boolean isReset) {
final Calendar beginCal = DateUtil.calendar(begin);
final Calendar endCal = DateUtil.calendar(end);
int result = endCal.get(Calendar.YEAR) - beginCal.get(Calendar.YEAR);
if (false == isReset) {
endCal.set(Calendar.YEAR, beginCal.get(Calendar.YEAR));
long ... | [
"public",
"long",
"betweenYear",
"(",
"boolean",
"isReset",
")",
"{",
"final",
"Calendar",
"beginCal",
"=",
"DateUtil",
".",
"calendar",
"(",
"begin",
")",
";",
"final",
"Calendar",
"endCal",
"=",
"DateUtil",
".",
"calendar",
"(",
"end",
")",
";",
"int",
... | 计算两个日期相差年数<br>
在非重置情况下,如果起始日期的月小于结束日期的月,年数要少算1(不足1年)
@param isReset 是否重置时间为起始时间(重置月天时分秒)
@return 相差年数
@since 3.0.8 | [
"计算两个日期相差年数<br",
">",
"在非重置情况下,如果起始日期的月小于结束日期的月,年数要少算1(不足1年)"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateBetween.java#L129-L142 | train | Gets the number of days between the two calendar years. | [
30522,
2270,
2146,
2090,
29100,
1006,
22017,
20898,
2003,
6072,
3388,
1007,
1063,
2345,
8094,
4088,
9289,
1027,
3058,
21823,
2140,
1012,
8094,
1006,
4088,
1007,
1025,
2345,
8094,
2203,
9289,
1027,
3058,
21823,
2140,
1012,
8094,
1006,
2203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/StringUtils.java | StringUtils.getRandomString | public static String getRandomString(Random rnd, int minLength, int maxLength, char minValue, char maxValue) {
int len = rnd.nextInt(maxLength - minLength + 1) + minLength;
char[] data = new char[len];
int diff = maxValue - minValue + 1;
for (int i = 0; i < data.length; i++) {
data[i] = (char) (rnd.nextInt... | java | public static String getRandomString(Random rnd, int minLength, int maxLength, char minValue, char maxValue) {
int len = rnd.nextInt(maxLength - minLength + 1) + minLength;
char[] data = new char[len];
int diff = maxValue - minValue + 1;
for (int i = 0; i < data.length; i++) {
data[i] = (char) (rnd.nextInt... | [
"public",
"static",
"String",
"getRandomString",
"(",
"Random",
"rnd",
",",
"int",
"minLength",
",",
"int",
"maxLength",
",",
"char",
"minValue",
",",
"char",
"maxValue",
")",
"{",
"int",
"len",
"=",
"rnd",
".",
"nextInt",
"(",
"maxLength",
"-",
"minLength... | Creates a random string with a length within the given interval. The string contains only characters that
can be represented as a single code point.
@param rnd The random used to create the strings.
@param minLength The minimum string length.
@param maxLength The maximum string length (inclusive).
@param minValue The ... | [
"Creates",
"a",
"random",
"string",
"with",
"a",
"length",
"within",
"the",
"given",
"interval",
".",
"The",
"string",
"contains",
"only",
"characters",
"that",
"can",
"be",
"represented",
"as",
"a",
"single",
"code",
"point",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/StringUtils.java#L240-L250 | train | Get a random string. | [
30522,
2270,
10763,
5164,
2131,
13033,
22225,
18886,
3070,
1006,
6721,
29300,
2094,
1010,
20014,
8117,
7770,
13512,
2232,
1010,
20014,
4098,
7770,
13512,
2232,
1010,
25869,
8117,
10175,
5657,
1010,
25869,
4098,
10175,
5657,
1007,
1063,
20014,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | client/src/main/java/com/networknt/client/Http2Client.java | Http2Client.propagateHeaders | public Result propagateHeaders(ClientRequest request, final HttpServerExchange exchange) {
String tid = exchange.getRequestHeaders().getFirst(HttpStringConstants.TRACEABILITY_ID);
String token = exchange.getRequestHeaders().getFirst(Headers.AUTHORIZATION);
String cid = exchange.getRequestHeaders... | java | public Result propagateHeaders(ClientRequest request, final HttpServerExchange exchange) {
String tid = exchange.getRequestHeaders().getFirst(HttpStringConstants.TRACEABILITY_ID);
String token = exchange.getRequestHeaders().getFirst(Headers.AUTHORIZATION);
String cid = exchange.getRequestHeaders... | [
"public",
"Result",
"propagateHeaders",
"(",
"ClientRequest",
"request",
",",
"final",
"HttpServerExchange",
"exchange",
")",
"{",
"String",
"tid",
"=",
"exchange",
".",
"getRequestHeaders",
"(",
")",
".",
"getFirst",
"(",
"HttpStringConstants",
".",
"TRACEABILITY_I... | Support API to API calls with scope token. The token is the original token from consumer and
the client credentials token of caller API is added from cache.
This method is used in API to API call
@param request the http request
@param exchange the http server exchange | [
"Support",
"API",
"to",
"API",
"calls",
"with",
"scope",
"token",
".",
"The",
"token",
"is",
"the",
"original",
"token",
"from",
"consumer",
"and",
"the",
"client",
"credentials",
"token",
"of",
"caller",
"API",
"is",
"added",
"from",
"cache",
"."
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/Http2Client.java#L350-L355 | train | Propagate headers to the client. | [
30522,
2270,
2765,
17678,
16098,
2618,
4974,
2545,
1006,
7396,
2890,
15500,
5227,
1010,
2345,
16770,
2121,
28943,
2595,
22305,
2063,
3863,
1007,
1063,
5164,
14841,
2094,
1027,
3863,
1012,
2131,
2890,
15500,
4974,
2545,
1006,
1007,
1012,
213... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/SimpleDictionary.java | SimpleDictionary.combine | public void combine(SimpleDictionary<V> other)
{
if (other.trie == null)
{
logger.warning("有个词典还没加载");
return;
}
for (Map.Entry<String, V> entry : other.trie.entrySet())
{
if (trie.containsKey(entry.getKey())) continue;
trie.put... | java | public void combine(SimpleDictionary<V> other)
{
if (other.trie == null)
{
logger.warning("有个词典还没加载");
return;
}
for (Map.Entry<String, V> entry : other.trie.entrySet())
{
if (trie.containsKey(entry.getKey())) continue;
trie.put... | [
"public",
"void",
"combine",
"(",
"SimpleDictionary",
"<",
"V",
">",
"other",
")",
"{",
"if",
"(",
"other",
".",
"trie",
"==",
"null",
")",
"{",
"logger",
".",
"warning",
"(",
"\"有个词典还没加载\");",
"",
"",
"return",
";",
"}",
"for",
"(",
"Map",
".",
"E... | 以我为主词典,合并一个副词典,我有的词条不会被副词典覆盖
@param other 副词典 | [
"以我为主词典,合并一个副词典,我有的词条不会被副词典覆盖"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/dictionary/SimpleDictionary.java#L80-L92 | train | Combine two simple dictionaries into this one. | [
30522,
2270,
11675,
11506,
1006,
3722,
29201,
3258,
5649,
1026,
1058,
1028,
2060,
1007,
1063,
2065,
1006,
2060,
1012,
13012,
2063,
1027,
1027,
19701,
1007,
1063,
8833,
4590,
1012,
5432,
1006,
1000,
1873,
100,
100,
100,
100,
100,
1779,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/DeweyNumber.java | DeweyNumber.isCompatibleWith | public boolean isCompatibleWith(DeweyNumber other) {
if (length() > other.length()) {
// prefix case
for (int i = 0; i < other.length(); i++) {
if (other.deweyNumber[i] != deweyNumber[i]) {
return false;
}
}
return true;
} else if (length() == other.length()) {
// check init digits for ... | java | public boolean isCompatibleWith(DeweyNumber other) {
if (length() > other.length()) {
// prefix case
for (int i = 0; i < other.length(); i++) {
if (other.deweyNumber[i] != deweyNumber[i]) {
return false;
}
}
return true;
} else if (length() == other.length()) {
// check init digits for ... | [
"public",
"boolean",
"isCompatibleWith",
"(",
"DeweyNumber",
"other",
")",
"{",
"if",
"(",
"length",
"(",
")",
">",
"other",
".",
"length",
"(",
")",
")",
"{",
"// prefix case",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"other",
".",
"length",... | Checks whether this dewey number is compatible to the other dewey number.
<p>True iff this contains other as a prefix or iff they differ only in the last digit whereas
the last digit of this is greater than the last digit of other.
@param other The other dewey number to check compatibility against
@return Whether thi... | [
"Checks",
"whether",
"this",
"dewey",
"number",
"is",
"compatible",
"to",
"the",
"other",
"dewey",
"number",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/DeweyNumber.java#L68-L92 | train | Checks if this dewey number is compatible with another dewey number. | [
30522,
2270,
22017,
20898,
2003,
9006,
24952,
3468,
24415,
1006,
20309,
19172,
5677,
2060,
1007,
1063,
2065,
1006,
3091,
1006,
1007,
1028,
2060,
1012,
3091,
1006,
1007,
1007,
1063,
1013,
1013,
17576,
2553,
2005,
1006,
20014,
1045,
1027,
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-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.formatBetween | public static String formatBetween(long betweenMs, BetweenFormater.Level level) {
return new BetweenFormater(betweenMs, level).format();
} | java | public static String formatBetween(long betweenMs, BetweenFormater.Level level) {
return new BetweenFormater(betweenMs, level).format();
} | [
"public",
"static",
"String",
"formatBetween",
"(",
"long",
"betweenMs",
",",
"BetweenFormater",
".",
"Level",
"level",
")",
"{",
"return",
"new",
"BetweenFormater",
"(",
"betweenMs",
",",
"level",
")",
".",
"format",
"(",
")",
";",
"}"
] | 格式化日期间隔输出
@param betweenMs 日期间隔
@param level 级别,按照天、小时、分、秒、毫秒分为5个等级
@return XX天XX小时XX分XX秒XX毫秒 | [
"格式化日期间隔输出"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L1341-L1343 | train | Format between milliseconds. | [
30522,
2270,
10763,
5164,
4289,
20915,
28394,
2078,
1006,
2146,
2090,
5244,
1010,
2090,
14192,
24932,
1012,
2504,
2504,
1007,
1063,
2709,
2047,
2090,
14192,
24932,
1006,
2090,
5244,
1010,
2504,
1007,
1012,
4289,
1006,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/types/valuearray/LongValueArray.java | LongValueArray.compareTo | @Override
public int compareTo(ValueArray<LongValue> o) {
LongValueArray other = (LongValueArray) o;
int min = Math.min(position, other.position);
for (int i = 0; i < min; i++) {
int cmp = Long.compare(data[i], other.data[i]);
if (cmp != 0) {
return cmp;
}
}
return Integer.compare(position, o... | java | @Override
public int compareTo(ValueArray<LongValue> o) {
LongValueArray other = (LongValueArray) o;
int min = Math.min(position, other.position);
for (int i = 0; i < min; i++) {
int cmp = Long.compare(data[i], other.data[i]);
if (cmp != 0) {
return cmp;
}
}
return Integer.compare(position, o... | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"ValueArray",
"<",
"LongValue",
">",
"o",
")",
"{",
"LongValueArray",
"other",
"=",
"(",
"LongValueArray",
")",
"o",
";",
"int",
"min",
"=",
"Math",
".",
"min",
"(",
"position",
",",
"other",
".",
"po... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/types/valuearray/LongValueArray.java#L225-L239 | train | Compares two LongValueArrays. | [
30522,
1030,
2058,
15637,
2270,
20014,
12826,
3406,
1006,
3643,
2906,
9447,
1026,
2146,
10175,
5657,
1028,
1051,
1007,
1063,
2146,
10175,
5657,
2906,
9447,
2060,
1027,
1006,
2146,
10175,
5657,
2906,
9447,
1007,
1051,
1025,
20014,
8117,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.replaceOrRegister | private void replaceOrRegister(MDAGNode originNode, String str)
{
char transitionLabelChar = str.charAt(0);
MDAGNode relevantTargetNode = originNode.transition(transitionLabelChar);
//If relevantTargetNode has transitions and there is at least one char left to process, recursively call
... | java | private void replaceOrRegister(MDAGNode originNode, String str)
{
char transitionLabelChar = str.charAt(0);
MDAGNode relevantTargetNode = originNode.transition(transitionLabelChar);
//If relevantTargetNode has transitions and there is at least one char left to process, recursively call
... | [
"private",
"void",
"replaceOrRegister",
"(",
"MDAGNode",
"originNode",
",",
"String",
"str",
")",
"{",
"char",
"transitionLabelChar",
"=",
"str",
".",
"charAt",
"(",
"0",
")",
";",
"MDAGNode",
"relevantTargetNode",
"=",
"originNode",
".",
"transition",
"(",
"t... | 在从给定节点开始的一段路径上执行最小化<br>
Performs minimization processing on a _transition path starting from a given node.
<p/>
This entails either replacing a node in the path with one that has an equivalent right language/equivalence class
(defined as set of _transition paths that can be traversed and nodes able to be reached from i... | [
"在从给定节点开始的一段路径上执行最小化<br",
">",
"Performs",
"minimization",
"processing",
"on",
"a",
"_transition",
"path",
"starting",
"from",
"a",
"given",
"node",
".",
"<p",
"/",
">",
"This",
"entails",
"either",
"replacing",
"a",
"node",
"in",
"the",
"path",
"with",
"one",... | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L539-L564 | train | This method replaces the _transition path of the specified string with the corresponding _transition path of the specified originNode. | [
30522,
2797,
11675,
5672,
2953,
2890,
24063,
2121,
1006,
9108,
8490,
3630,
3207,
4761,
3630,
3207,
1010,
5164,
2358,
2099,
1007,
1063,
25869,
6653,
20470,
2884,
7507,
2099,
1027,
2358,
2099,
1012,
25869,
4017,
1006,
1014,
1007,
1025,
9108,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ClassScaner.java | ClassScaner.scanJavaClassPaths | private void scanJavaClassPaths() {
final String[] javaClassPaths = ClassUtil.getJavaClassPaths();
for (String classPath : javaClassPaths) {
// bug修复,由于路径中空格和中文导致的Jar找不到
classPath = URLUtil.decode(classPath, CharsetUtil.systemCharsetName());
scanFile(new File(classPath), null);
}
} | java | private void scanJavaClassPaths() {
final String[] javaClassPaths = ClassUtil.getJavaClassPaths();
for (String classPath : javaClassPaths) {
// bug修复,由于路径中空格和中文导致的Jar找不到
classPath = URLUtil.decode(classPath, CharsetUtil.systemCharsetName());
scanFile(new File(classPath), null);
}
} | [
"private",
"void",
"scanJavaClassPaths",
"(",
")",
"{",
"final",
"String",
"[",
"]",
"javaClassPaths",
"=",
"ClassUtil",
".",
"getJavaClassPaths",
"(",
")",
";",
"for",
"(",
"String",
"classPath",
":",
"javaClassPaths",
")",
"{",
"// bug修复,由于路径中空格和中文导致的Jar找不到\r",
... | 扫描Java指定的ClassPath路径
@return 扫描到的类 | [
"扫描Java指定的ClassPath路径"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/ClassScaner.java#L197-L205 | train | Scan the Java class paths. | [
30522,
2797,
11675,
13594,
3900,
24887,
27102,
15069,
2015,
1006,
1007,
1063,
2345,
5164,
1031,
1033,
9262,
26266,
15069,
2015,
1027,
2465,
21823,
2140,
1012,
2131,
3900,
24887,
27102,
15069,
2015,
1006,
1007,
1025,
2005,
1006,
5164,
2465,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReport.java | PropertiesMigrationReport.getErrorReport | public String getErrorReport() {
Map<String, List<PropertyMigration>> content = getContent(
LegacyProperties::getUnsupported);
if (content.isEmpty()) {
return null;
}
StringBuilder report = new StringBuilder();
report.append(String.format("%nThe use of configuration keys that are no longer "
+ "sup... | java | public String getErrorReport() {
Map<String, List<PropertyMigration>> content = getContent(
LegacyProperties::getUnsupported);
if (content.isEmpty()) {
return null;
}
StringBuilder report = new StringBuilder();
report.append(String.format("%nThe use of configuration keys that are no longer "
+ "sup... | [
"public",
"String",
"getErrorReport",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"PropertyMigration",
">",
">",
"content",
"=",
"getContent",
"(",
"LegacyProperties",
"::",
"getUnsupported",
")",
";",
"if",
"(",
"content",
".",
"isEmpty",
"(",
... | Return a report for all the properties that are no longer supported. If no such
properties were found, return {@code null}.
@return a report with the configurations keys that are no longer supported | [
"Return",
"a",
"report",
"for",
"all",
"the",
"properties",
"that",
"are",
"no",
"longer",
"supported",
".",
"If",
"no",
"such",
"properties",
"were",
"found",
"return",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReport.java#L65-L80 | train | Returns a string with the error report for the configuration keys that are no longer supported in the environment. | [
30522,
2270,
5164,
2131,
2121,
29165,
2890,
6442,
1006,
1007,
1063,
4949,
1026,
5164,
1010,
2862,
1026,
3200,
4328,
29397,
1028,
1028,
4180,
1027,
2131,
8663,
6528,
2102,
1006,
8027,
21572,
4842,
7368,
1024,
1024,
2131,
4609,
6342,
9397,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/messages/MessageSerializer.java | MessageSerializer.writeHeader | private static void writeHeader(final ByteBuf buf, final MessageType messageType) {
buf.writeInt(VERSION);
buf.writeInt(messageType.ordinal());
} | java | private static void writeHeader(final ByteBuf buf, final MessageType messageType) {
buf.writeInt(VERSION);
buf.writeInt(messageType.ordinal());
} | [
"private",
"static",
"void",
"writeHeader",
"(",
"final",
"ByteBuf",
"buf",
",",
"final",
"MessageType",
"messageType",
")",
"{",
"buf",
".",
"writeInt",
"(",
"VERSION",
")",
";",
"buf",
".",
"writeInt",
"(",
"messageType",
".",
"ordinal",
"(",
")",
")",
... | Helper for serializing the header.
@param buf The {@link ByteBuf} to serialize the header into.
@param messageType The {@link MessageType} of the message this header refers to. | [
"Helper",
"for",
"serializing",
"the",
"header",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/messages/MessageSerializer.java#L185-L188 | train | Write header. | [
30522,
2797,
10763,
11675,
4339,
4974,
2121,
1006,
2345,
24880,
8569,
2546,
20934,
2546,
1010,
2345,
4471,
13874,
4471,
13874,
1007,
1063,
20934,
2546,
1012,
4339,
18447,
1006,
2544,
1007,
1025,
20934,
2546,
1012,
4339,
18447,
1006,
4471,
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-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/evictors/DeltaEvictor.java | DeltaEvictor.of | public static <T, W extends Window> DeltaEvictor<T, W> of(double threshold, DeltaFunction<T> deltaFunction) {
return new DeltaEvictor<>(threshold, deltaFunction);
} | java | public static <T, W extends Window> DeltaEvictor<T, W> of(double threshold, DeltaFunction<T> deltaFunction) {
return new DeltaEvictor<>(threshold, deltaFunction);
} | [
"public",
"static",
"<",
"T",
",",
"W",
"extends",
"Window",
">",
"DeltaEvictor",
"<",
"T",
",",
"W",
">",
"of",
"(",
"double",
"threshold",
",",
"DeltaFunction",
"<",
"T",
">",
"deltaFunction",
")",
"{",
"return",
"new",
"DeltaEvictor",
"<>",
"(",
"th... | Creates a {@code DeltaEvictor} from the given threshold and {@code DeltaFunction}.
Eviction is done before the window function.
@param threshold The threshold
@param deltaFunction The {@code DeltaFunction} | [
"Creates",
"a",
"{",
"@code",
"DeltaEvictor",
"}",
"from",
"the",
"given",
"threshold",
"and",
"{",
"@code",
"DeltaFunction",
"}",
".",
"Eviction",
"is",
"done",
"before",
"the",
"window",
"function",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/evictors/DeltaEvictor.java#L94-L96 | train | Create a new delta evictor. | [
30522,
2270,
10763,
1026,
1056,
1010,
1059,
8908,
3332,
1028,
7160,
17726,
4263,
1026,
1056,
1010,
1059,
1028,
1997,
1006,
3313,
11207,
1010,
7160,
11263,
27989,
1026,
1056,
1028,
7160,
11263,
27989,
1007,
1063,
2709,
2047,
7160,
17726,
426... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Object[] wrap(Object obj) {
if (null == obj) {
return null;
}
if (isArray(obj)) {
try {
return (Object[]) obj;
} catch (Exception e) {
final String className = obj.getClass().getComponentType().getName();
switch (className) {
case "long":
return wrap((long[])... | java | public static Object[] wrap(Object obj) {
if (null == obj) {
return null;
}
if (isArray(obj)) {
try {
return (Object[]) obj;
} catch (Exception e) {
final String className = obj.getClass().getComponentType().getName();
switch (className) {
case "long":
return wrap((long[])... | [
"public",
"static",
"Object",
"[",
"]",
"wrap",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"null",
"==",
"obj",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"isArray",
"(",
"obj",
")",
")",
"{",
"try",
"{",
"return",
"(",
"Object",
"[",
"]"... | 包装数组对象
@param obj 对象,可以是对象数组或者基本类型数组
@return 包装类型数组或对象数组
@throws UtilException 对象为非数组 | [
"包装数组对象"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L1752-L1784 | train | Creates an array of objects that is not null and wraps it. | [
30522,
2270,
10763,
4874,
1031,
1033,
10236,
1006,
4874,
27885,
3501,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
27885,
3501,
1007,
1063,
2709,
19701,
1025,
1065,
2065,
1006,
18061,
11335,
2100,
1006,
27885,
3501,
1007,
1007,
1063,
3046,
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/util/ArrayUtil.java | ArrayUtil.removeEle | public static <T> T[] removeEle(T[] array, T element) throws IllegalArgumentException {
return remove(array, indexOf(array, element));
} | java | public static <T> T[] removeEle(T[] array, T element) throws IllegalArgumentException {
return remove(array, indexOf(array, element));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"removeEle",
"(",
"T",
"[",
"]",
"array",
",",
"T",
"element",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"remove",
"(",
"array",
",",
"indexOf",
"(",
"array",
",",
"element",
")",
")",
... | 移除数组中指定的元素<br>
只会移除匹配到的第一个元素 copy from commons-lang
@param <T> 数组元素类型
@param array 数组对象,可以是对象数组,也可以原始类型数组
@param element 要移除的元素
@return 去掉指定元素后的新数组或原数组
@throws IllegalArgumentException 参数对象不为数组对象
@since 3.0.8 | [
"移除数组中指定的元素<br",
">",
"只会移除匹配到的第一个元素",
"copy",
"from",
"commons",
"-",
"lang"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L2805-L2807 | train | Removes the element from the array. | [
30522,
2270,
10763,
1026,
1056,
1028,
1056,
1031,
1033,
6366,
12260,
1006,
1056,
1031,
1033,
9140,
1010,
1056,
5783,
1007,
11618,
6206,
2906,
22850,
15781,
2595,
24422,
1063,
2709,
6366,
1006,
9140,
1010,
5950,
11253,
1006,
9140,
1010,
5783... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/UniformSnapshot.java | UniformSnapshot.getValue | @Override
public double getValue(double quantile) {
if (quantile < 0.0 || quantile > 1.0 || Double.isNaN( quantile )) {
throw new IllegalArgumentException(quantile + " is not in [0..1]");
}
if (values.length == 0) {
return 0.0;
}
final double pos = q... | java | @Override
public double getValue(double quantile) {
if (quantile < 0.0 || quantile > 1.0 || Double.isNaN( quantile )) {
throw new IllegalArgumentException(quantile + " is not in [0..1]");
}
if (values.length == 0) {
return 0.0;
}
final double pos = q... | [
"@",
"Override",
"public",
"double",
"getValue",
"(",
"double",
"quantile",
")",
"{",
"if",
"(",
"quantile",
"<",
"0.0",
"||",
"quantile",
">",
"1.0",
"||",
"Double",
".",
"isNaN",
"(",
"quantile",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",... | Returns the value at the given quantile.
@param quantile a given quantile, in {@code [0..1]}
@return the value in the distribution at {@code quantile} | [
"Returns",
"the",
"value",
"at",
"the",
"given",
"quantile",
"."
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/metrics/src/main/java/io/dropwizard/metrics/UniformSnapshot.java#L81-L105 | train | Gets the value of a single attribute. | [
30522,
1030,
2058,
15637,
2270,
3313,
2131,
10175,
5657,
1006,
3313,
24110,
15286,
1007,
1063,
2065,
1006,
24110,
15286,
1026,
1014,
1012,
1014,
1064,
1064,
24110,
15286,
1028,
1015,
1012,
1014,
1064,
1064,
3313,
1012,
3475,
2319,
1006,
241... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java | Graph.addVertex | public Graph<K, VV, EV> addVertex(final Vertex<K, VV> vertex) {
List<Vertex<K, VV>> newVertex = new ArrayList<>();
newVertex.add(vertex);
return addVertices(newVertex);
} | java | public Graph<K, VV, EV> addVertex(final Vertex<K, VV> vertex) {
List<Vertex<K, VV>> newVertex = new ArrayList<>();
newVertex.add(vertex);
return addVertices(newVertex);
} | [
"public",
"Graph",
"<",
"K",
",",
"VV",
",",
"EV",
">",
"addVertex",
"(",
"final",
"Vertex",
"<",
"K",
",",
"VV",
">",
"vertex",
")",
"{",
"List",
"<",
"Vertex",
"<",
"K",
",",
"VV",
">",
">",
"newVertex",
"=",
"new",
"ArrayList",
"<>",
"(",
")... | Adds the input vertex to the graph. If the vertex already
exists in the graph, it will not be added again.
@param vertex the vertex to be added
@return the new graph containing the existing vertices as well as the one just added | [
"Adds",
"the",
"input",
"vertex",
"to",
"the",
"graph",
".",
"If",
"the",
"vertex",
"already",
"exists",
"in",
"the",
"graph",
"it",
"will",
"not",
"be",
"added",
"again",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L1365-L1370 | train | Add a vertex to the graph. | [
30522,
2270,
10629,
1026,
1047,
1010,
1058,
2615,
1010,
23408,
1028,
5587,
16874,
10288,
1006,
2345,
19449,
1026,
1047,
1010,
30524,
1007,
1025,
2709,
5587,
16874,
23522,
1006,
2047,
16874,
10288,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java | ThriftCLIService.getSessionHandle | SessionHandle getSessionHandle(TOpenSessionReq req, TOpenSessionResp res)
throws HiveSQLException, LoginException, IOException {
String userName = getUserName(req);
String ipAddress = getIpAddress();
TProtocolVersion protocol = getMinVersion(CLIService.SERVER_VERSION,
req.getClient_protocol())... | java | SessionHandle getSessionHandle(TOpenSessionReq req, TOpenSessionResp res)
throws HiveSQLException, LoginException, IOException {
String userName = getUserName(req);
String ipAddress = getIpAddress();
TProtocolVersion protocol = getMinVersion(CLIService.SERVER_VERSION,
req.getClient_protocol())... | [
"SessionHandle",
"getSessionHandle",
"(",
"TOpenSessionReq",
"req",
",",
"TOpenSessionResp",
"res",
")",
"throws",
"HiveSQLException",
",",
"LoginException",
",",
"IOException",
"{",
"String",
"userName",
"=",
"getUserName",
"(",
"req",
")",
";",
"String",
"ipAddres... | Create a session handle
@param req
@param res
@return
@throws HiveSQLException
@throws LoginException
@throws IOException | [
"Create",
"a",
"session",
"handle"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java#L341-L359 | train | Get a session handle from the input. | [
30522,
5219,
11774,
2571,
4152,
7971,
3258,
11774,
2571,
1006,
2327,
16700,
28231,
2890,
4160,
2128,
4160,
1010,
2327,
16700,
28231,
6072,
2361,
24501,
1007,
11618,
26736,
2015,
4160,
2571,
2595,
24422,
1010,
8833,
3170,
2595,
24422,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSink.java | CassandraSink.uid | @PublicEvolving
public CassandraSink<IN> uid(String uid) {
if (useDataStreamSink) {
getSinkTransformation().setUid(uid);
} else {
getStreamTransformation().setUid(uid);
}
return this;
} | java | @PublicEvolving
public CassandraSink<IN> uid(String uid) {
if (useDataStreamSink) {
getSinkTransformation().setUid(uid);
} else {
getStreamTransformation().setUid(uid);
}
return this;
} | [
"@",
"PublicEvolving",
"public",
"CassandraSink",
"<",
"IN",
">",
"uid",
"(",
"String",
"uid",
")",
"{",
"if",
"(",
"useDataStreamSink",
")",
"{",
"getSinkTransformation",
"(",
")",
".",
"setUid",
"(",
"uid",
")",
";",
"}",
"else",
"{",
"getStreamTransform... | Sets an ID for this operator.
<p>The specified ID is used to assign the same operator ID across job
submissions (for example when starting a job from a savepoint).
<p><strong>Important</strong>: this ID needs to be unique per
transformation and job. Otherwise, job submission will fail.
@param uid The unique user-spe... | [
"Sets",
"an",
"ID",
"for",
"this",
"operator",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSink.java#L99-L107 | train | Sets the UID of the sink. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
15609,
11493,
2243,
1026,
1999,
1028,
21318,
2094,
1006,
5164,
21318,
2094,
1007,
1063,
2065,
1006,
2109,
6790,
21422,
11493,
2243,
1007,
1063,
4152,
19839,
6494,
3619,
14192,
3370,
1006,
1007,
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-core/src/main/java/cn/hutool/core/bean/BeanUtil.java | BeanUtil.getPropertyDescriptor | public static PropertyDescriptor getPropertyDescriptor(Class<?> clazz, final String fieldName) throws BeanException {
return getPropertyDescriptor(clazz, fieldName, false);
} | java | public static PropertyDescriptor getPropertyDescriptor(Class<?> clazz, final String fieldName) throws BeanException {
return getPropertyDescriptor(clazz, fieldName, false);
} | [
"public",
"static",
"PropertyDescriptor",
"getPropertyDescriptor",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"String",
"fieldName",
")",
"throws",
"BeanException",
"{",
"return",
"getPropertyDescriptor",
"(",
"clazz",
",",
"fieldName",
",",
"false",
")",... | 获得Bean类属性描述,大小写敏感
@param clazz Bean类
@param fieldName 字段名
@return PropertyDescriptor
@throws BeanException 获取属性异常 | [
"获得Bean类属性描述,大小写敏感"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L228-L230 | train | Returns the PropertyDescriptor for the given field. | [
30522,
2270,
10763,
3200,
6155,
23235,
2953,
2131,
21572,
4842,
3723,
6155,
23235,
2953,
1006,
2465,
1026,
1029,
1028,
18856,
10936,
2480,
1010,
2345,
5164,
2492,
18442,
1007,
11618,
14068,
10288,
24422,
1063,
2709,
2131,
21572,
4842,
3723,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Range.java | Range.reset | public Range<T> reset() {
lock.lock();
try {
this.current = this.start;
this.index = 0;
} finally {
lock.unlock();
}
return this;
} | java | public Range<T> reset() {
lock.lock();
try {
this.current = this.start;
this.index = 0;
} finally {
lock.unlock();
}
return this;
} | [
"public",
"Range",
"<",
"T",
">",
"reset",
"(",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"this",
".",
"current",
"=",
"this",
".",
"start",
";",
"this",
".",
"index",
"=",
"0",
";",
"}",
"finally",
"{",
"lock",
".",
"unlock",
... | 重置{@link Range}
@return this | [
"重置",
"{",
"@link",
"Range",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Range.java#L172-L181 | train | Resets the range to the beginning of this range. | [
30522,
2270,
2846,
1026,
1056,
1028,
25141,
1006,
1007,
1063,
5843,
1012,
5843,
1006,
1007,
1025,
3046,
1063,
2023,
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,
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/crfpp/EncoderFeatureIndex.java | EncoderFeatureIndex.openTemplate | private boolean openTemplate(String filename)
{
InputStreamReader isr = null;
try
{
isr = new InputStreamReader(IOUtil.newInputStream(filename), "UTF-8");
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) !... | java | private boolean openTemplate(String filename)
{
InputStreamReader isr = null;
try
{
isr = new InputStreamReader(IOUtil.newInputStream(filename), "UTF-8");
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) !... | [
"private",
"boolean",
"openTemplate",
"(",
"String",
"filename",
")",
"{",
"InputStreamReader",
"isr",
"=",
"null",
";",
"try",
"{",
"isr",
"=",
"new",
"InputStreamReader",
"(",
"IOUtil",
".",
"newInputStream",
"(",
"filename",
")",
",",
"\"UTF-8\"",
")",
";... | 读取特征模板文件
@param filename
@return | [
"读取特征模板文件"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/crf/crfpp/EncoderFeatureIndex.java#L74-L121 | train | Open a template file. | [
30522,
2797,
22017,
20898,
2330,
18532,
15725,
1006,
5164,
5371,
18442,
1007,
1063,
20407,
25379,
16416,
4063,
2003,
2099,
1027,
19701,
1025,
3046,
1063,
2003,
2099,
1027,
2047,
20407,
25379,
16416,
4063,
1006,
22834,
21823,
2140,
1012,
2047,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/AhoCorasick/State.java | State.setFailure | public void setFailure(State failState, int fail[])
{
this.failure = failState;
fail[index] = failState.index;
} | java | public void setFailure(State failState, int fail[])
{
this.failure = failState;
fail[index] = failState.index;
} | [
"public",
"void",
"setFailure",
"(",
"State",
"failState",
",",
"int",
"fail",
"[",
"]",
")",
"{",
"this",
".",
"failure",
"=",
"failState",
";",
"fail",
"[",
"index",
"]",
"=",
"failState",
".",
"index",
";",
"}"
] | 设置failure状态
@param failState | [
"设置failure状态"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/AhoCorasick/State.java#L142-L146 | train | Sets the failure of the exception. | [
30522,
2270,
11675,
2275,
7011,
4014,
5397,
1006,
2110,
11896,
12259,
30524,
1025,
8246,
1031,
5950,
1033,
1027,
11896,
12259,
1012,
5950,
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,
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/bind/RelaxedNames.java | RelaxedNames.forCamelCase | public static RelaxedNames forCamelCase(String name) {
StringBuilder result = new StringBuilder();
for (char c : name.toCharArray()) {
result.append(Character.isUpperCase(c) && result.length() > 0
&& result.charAt(result.length() - 1) != '-' ? "-" + Character.toLowe... | java | public static RelaxedNames forCamelCase(String name) {
StringBuilder result = new StringBuilder();
for (char c : name.toCharArray()) {
result.append(Character.isUpperCase(c) && result.length() > 0
&& result.charAt(result.length() - 1) != '-' ? "-" + Character.toLowe... | [
"public",
"static",
"RelaxedNames",
"forCamelCase",
"(",
"String",
"name",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"char",
"c",
":",
"name",
".",
"toCharArray",
"(",
")",
")",
"{",
"result",
".",
"appe... | Return a {@link RelaxedNames} for the given source camelCase source name.
@param name the source name in camelCase
@return the relaxed names | [
"Return",
"a",
"{",
"@link",
"RelaxedNames",
"}",
"for",
"the",
"given",
"source",
"camelCase",
"source",
"name",
"."
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedNames.java#L232-L239 | train | Returns a RelaxedNames for a CamelCase name. | [
30522,
2270,
10763,
8363,
18442,
2015,
2005,
28727,
2884,
18382,
1006,
5164,
2171,
1007,
1063,
5164,
8569,
23891,
2099,
2765,
1027,
2047,
5164,
8569,
23891,
2099,
1006,
1007,
1025,
2005,
1006,
25869,
1039,
30524,
2003,
29547,
18992,
3366,
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/img/ImgUtil.java | ImgUtil.hexToColor | public static Color hexToColor(String hex) {
return getColor(Integer.parseInt(StrUtil.removePrefix("#", hex), 16));
} | java | public static Color hexToColor(String hex) {
return getColor(Integer.parseInt(StrUtil.removePrefix("#", hex), 16));
} | [
"public",
"static",
"Color",
"hexToColor",
"(",
"String",
"hex",
")",
"{",
"return",
"getColor",
"(",
"Integer",
".",
"parseInt",
"(",
"StrUtil",
".",
"removePrefix",
"(",
"\"#\"",
",",
"hex",
")",
",",
"16",
")",
")",
";",
"}"
] | 16进制的颜色值转换为Color对象,例如#fcf6d6
@param hex 16进制的颜色值,例如#fcf6d6
@return {@link Color}
@since 4.1.14 | [
"16进制的颜色值转换为Color对象,例如#fcf6d6"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1708-L1710 | train | Converts a hex string to a color. | [
30522,
2270,
10763,
3609,
2002,
18413,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/HttpConversionUtil.java | HttpConversionUtil.toHttpResponse | public static HttpResponse toHttpResponse(final int streamId,
final Http2Headers http2Headers,
final boolean validateHttpHeaders) throws Http2Exception {
final HttpResponseStatus status = parseStatus(http2Headers.status(... | java | public static HttpResponse toHttpResponse(final int streamId,
final Http2Headers http2Headers,
final boolean validateHttpHeaders) throws Http2Exception {
final HttpResponseStatus status = parseStatus(http2Headers.status(... | [
"public",
"static",
"HttpResponse",
"toHttpResponse",
"(",
"final",
"int",
"streamId",
",",
"final",
"Http2Headers",
"http2Headers",
",",
"final",
"boolean",
"validateHttpHeaders",
")",
"throws",
"Http2Exception",
"{",
"final",
"HttpResponseStatus",
"status",
"=",
"pa... | Create a new object to contain the response data.
@param streamId The stream associated with the response
@param http2Headers The initial set of HTTP/2 headers to create the response with
@param validateHttpHeaders <ul>
<li>{@code true} to validate HTTP headers in the http-codec</li>
<li>{@code false} not to validate ... | [
"Create",
"a",
"new",
"object",
"to",
"contain",
"the",
"response",
"data",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java#L312-L327 | train | Converts a Http2 headers object to a HTTP response object. | [
30522,
2270,
10763,
8299,
6072,
26029,
3366,
2000,
11039,
25856,
6072,
26029,
3366,
1006,
2345,
20014,
5460,
3593,
1010,
2345,
8299,
2475,
4974,
2545,
8299,
2475,
4974,
2545,
1010,
2345,
22017,
20898,
9398,
3686,
11039,
25856,
4974,
2545,
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/concurrent/FutureUtils.java | FutureUtils.runAfterwards | public static CompletableFuture<Void> runAfterwards(CompletableFuture<?> future, RunnableWithException runnable) {
return runAfterwardsAsync(future, runnable, Executors.directExecutor());
} | java | public static CompletableFuture<Void> runAfterwards(CompletableFuture<?> future, RunnableWithException runnable) {
return runAfterwardsAsync(future, runnable, Executors.directExecutor());
} | [
"public",
"static",
"CompletableFuture",
"<",
"Void",
">",
"runAfterwards",
"(",
"CompletableFuture",
"<",
"?",
">",
"future",
",",
"RunnableWithException",
"runnable",
")",
"{",
"return",
"runAfterwardsAsync",
"(",
"future",
",",
"runnable",
",",
"Executors",
"."... | Run the given action after the completion of the given future. The given future can be
completed normally or exceptionally. In case of an exceptional completion the, the
action's exception will be added to the initial exception.
@param future to wait for its completion
@param runnable action which is triggered after t... | [
"Run",
"the",
"given",
"action",
"after",
"the",
"completion",
"of",
"the",
"given",
"future",
".",
"The",
"given",
"future",
"can",
"be",
"completed",
"normally",
"or",
"exceptionally",
".",
"In",
"case",
"of",
"an",
"exceptional",
"completion",
"the",
"the... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java#L407-L409 | train | Run afterwards CompletableFuture. | [
30522,
2270,
10763,
4012,
10814,
10880,
11263,
11244,
1026,
11675,
1028,
2448,
10354,
3334,
7652,
2015,
1006,
4012,
10814,
10880,
11263,
11244,
1026,
1029,
1028,
2925,
1010,
2448,
22966,
24415,
10288,
24422,
2448,
22966,
1007,
1063,
2709,
244... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/DataSet.java | DataSet.reduce | public ReduceOperator<T> reduce(ReduceFunction<T> reducer) {
if (reducer == null) {
throw new NullPointerException("Reduce function must not be null.");
}
return new ReduceOperator<>(this, clean(reducer), Utils.getCallLocationName());
} | java | public ReduceOperator<T> reduce(ReduceFunction<T> reducer) {
if (reducer == null) {
throw new NullPointerException("Reduce function must not be null.");
}
return new ReduceOperator<>(this, clean(reducer), Utils.getCallLocationName());
} | [
"public",
"ReduceOperator",
"<",
"T",
">",
"reduce",
"(",
"ReduceFunction",
"<",
"T",
">",
"reducer",
")",
"{",
"if",
"(",
"reducer",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Reduce function must not be null.\"",
")",
";",
"}",
... | Applies a Reduce transformation on a non-grouped {@link DataSet}.
<p>The transformation consecutively calls a {@link org.apache.flink.api.common.functions.RichReduceFunction}
until only a single element remains which is the result of the transformation.
A ReduceFunction combines two elements into one new element of th... | [
"Applies",
"a",
"Reduce",
"transformation",
"on",
"a",
"non",
"-",
"grouped",
"{",
"@link",
"DataSet",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java#L443-L448 | train | Returns a new instance of this operator with the specified reducer applied to all operands of this operator. | [
30522,
2270,
5547,
25918,
8844,
1026,
1056,
1028,
5547,
1006,
5547,
11263,
27989,
1026,
1056,
1028,
5547,
2099,
1007,
1063,
2065,
1006,
5547,
2099,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
19701,
8400,
7869,
2595,
24422,
1006,
1000,
5547,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.