repo
stringclasses
11 values
path
stringlengths
41
214
func_name
stringlengths
7
82
original_string
stringlengths
77
11.9k
language
stringclasses
1 value
code
stringlengths
77
11.9k
code_tokens
listlengths
22
1.57k
docstring
stringlengths
2
2.27k
docstring_tokens
listlengths
1
352
sha
stringclasses
11 values
url
stringlengths
129
319
partition
stringclasses
1 value
summary
stringlengths
7
191
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
apache/spark
common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java
JavaUtils.byteStringAs
public static long byteStringAs(String str, ByteUnit unit) { String lower = str.toLowerCase(Locale.ROOT).trim(); try { Matcher m = Pattern.compile("([0-9]+)([a-z]+)?").matcher(lower); Matcher fractionMatcher = Pattern.compile("([0-9]+\\.[0-9]+)([a-z]+)?").matcher(lower); if (m.matches()) { long val = Long.parseLong(m.group(1)); String suffix = m.group(2); // Check for invalid suffixes if (suffix != null && !byteSuffixes.containsKey(suffix)) { throw new NumberFormatException("Invalid suffix: \"" + suffix + "\""); } // If suffix is valid use that, otherwise none was provided and use the default passed return unit.convertFrom(val, suffix != null ? byteSuffixes.get(suffix) : unit); } else if (fractionMatcher.matches()) { throw new NumberFormatException("Fractional values are not supported. Input was: " + fractionMatcher.group(1)); } else { throw new NumberFormatException("Failed to parse byte string: " + str); } } catch (NumberFormatException e) { String byteError = "Size must be specified as bytes (b), " + "kibibytes (k), mebibytes (m), gibibytes (g), tebibytes (t), or pebibytes(p). " + "E.g. 50b, 100k, or 250m."; throw new NumberFormatException(byteError + "\n" + e.getMessage()); } }
java
public static long byteStringAs(String str, ByteUnit unit) { String lower = str.toLowerCase(Locale.ROOT).trim(); try { Matcher m = Pattern.compile("([0-9]+)([a-z]+)?").matcher(lower); Matcher fractionMatcher = Pattern.compile("([0-9]+\\.[0-9]+)([a-z]+)?").matcher(lower); if (m.matches()) { long val = Long.parseLong(m.group(1)); String suffix = m.group(2); // Check for invalid suffixes if (suffix != null && !byteSuffixes.containsKey(suffix)) { throw new NumberFormatException("Invalid suffix: \"" + suffix + "\""); } // If suffix is valid use that, otherwise none was provided and use the default passed return unit.convertFrom(val, suffix != null ? byteSuffixes.get(suffix) : unit); } else if (fractionMatcher.matches()) { throw new NumberFormatException("Fractional values are not supported. Input was: " + fractionMatcher.group(1)); } else { throw new NumberFormatException("Failed to parse byte string: " + str); } } catch (NumberFormatException e) { String byteError = "Size must be specified as bytes (b), " + "kibibytes (k), mebibytes (m), gibibytes (g), tebibytes (t), or pebibytes(p). " + "E.g. 50b, 100k, or 250m."; throw new NumberFormatException(byteError + "\n" + e.getMessage()); } }
[ "public", "static", "long", "byteStringAs", "(", "String", "str", ",", "ByteUnit", "unit", ")", "{", "String", "lower", "=", "str", ".", "toLowerCase", "(", "Locale", ".", "ROOT", ")", ".", "trim", "(", ")", ";", "try", "{", "Matcher", "m", "=", "Pat...
Convert a passed byte string (e.g. 50b, 100kb, or 250mb) to the given. If no suffix is provided, a direct conversion to the provided unit is attempted.
[ "Convert", "a", "passed", "byte", "string", "(", "e", ".", "g", ".", "50b", "100kb", "or", "250mb", ")", "to", "the", "given", ".", "If", "no", "suffix", "is", "provided", "a", "direct", "conversion", "to", "the", "provided", "unit", "is", "attempted",...
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java#L276-L308
train
Convert a byte string to a long.
[ 30522, 2270, 10763, 2146, 27507, 18886, 13807, 2015, 1006, 5164, 2358, 2099, 1010, 24880, 19496, 2102, 3131, 1007, 1063, 5164, 2896, 1027, 2358, 2099, 1012, 2000, 27663, 18992, 3366, 1006, 2334, 2063, 1012, 7117, 1007, 1012, 12241, 1006, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolImpl.java
SlotPoolImpl.offerSlot
boolean offerSlot( final TaskManagerLocation taskManagerLocation, final TaskManagerGateway taskManagerGateway, final SlotOffer slotOffer) { componentMainThreadExecutor.assertRunningInMainThread(); // check if this TaskManager is valid final ResourceID resourceID = taskManagerLocation.getResourceID(); final AllocationID allocationID = slotOffer.getAllocationId(); if (!registeredTaskManagers.contains(resourceID)) { log.debug("Received outdated slot offering [{}] from unregistered TaskManager: {}", slotOffer.getAllocationId(), taskManagerLocation); return false; } // check whether we have already using this slot AllocatedSlot existingSlot; if ((existingSlot = allocatedSlots.get(allocationID)) != null || (existingSlot = availableSlots.get(allocationID)) != null) { // we need to figure out if this is a repeated offer for the exact same slot, // or another offer that comes from a different TaskManager after the ResourceManager // re-tried the request // we write this in terms of comparing slot IDs, because the Slot IDs are the identifiers of // the actual slots on the TaskManagers // Note: The slotOffer should have the SlotID final SlotID existingSlotId = existingSlot.getSlotId(); final SlotID newSlotId = new SlotID(taskManagerLocation.getResourceID(), slotOffer.getSlotIndex()); if (existingSlotId.equals(newSlotId)) { log.info("Received repeated offer for slot [{}]. Ignoring.", allocationID); // return true here so that the sender will get a positive acknowledgement to the retry // and mark the offering as a success return true; } else { // the allocation has been fulfilled by another slot, reject the offer so the task executor // will offer the slot to the resource manager return false; } } final AllocatedSlot allocatedSlot = new AllocatedSlot( allocationID, taskManagerLocation, slotOffer.getSlotIndex(), slotOffer.getResourceProfile(), taskManagerGateway); // check whether we have request waiting for this slot PendingRequest pendingRequest = pendingRequests.removeKeyB(allocationID); if (pendingRequest != null) { // we were waiting for this! allocatedSlots.add(pendingRequest.getSlotRequestId(), allocatedSlot); if (!pendingRequest.getAllocatedSlotFuture().complete(allocatedSlot)) { // we could not complete the pending slot future --> try to fulfill another pending request allocatedSlots.remove(pendingRequest.getSlotRequestId()); tryFulfillSlotRequestOrMakeAvailable(allocatedSlot); } else { log.debug("Fulfilled slot request [{}] with allocated slot [{}].", pendingRequest.getSlotRequestId(), allocationID); } } else { // we were actually not waiting for this: // - could be that this request had been fulfilled // - we are receiving the slots from TaskManagers after becoming leaders tryFulfillSlotRequestOrMakeAvailable(allocatedSlot); } // we accepted the request in any case. slot will be released after it idled for // too long and timed out return true; }
java
boolean offerSlot( final TaskManagerLocation taskManagerLocation, final TaskManagerGateway taskManagerGateway, final SlotOffer slotOffer) { componentMainThreadExecutor.assertRunningInMainThread(); // check if this TaskManager is valid final ResourceID resourceID = taskManagerLocation.getResourceID(); final AllocationID allocationID = slotOffer.getAllocationId(); if (!registeredTaskManagers.contains(resourceID)) { log.debug("Received outdated slot offering [{}] from unregistered TaskManager: {}", slotOffer.getAllocationId(), taskManagerLocation); return false; } // check whether we have already using this slot AllocatedSlot existingSlot; if ((existingSlot = allocatedSlots.get(allocationID)) != null || (existingSlot = availableSlots.get(allocationID)) != null) { // we need to figure out if this is a repeated offer for the exact same slot, // or another offer that comes from a different TaskManager after the ResourceManager // re-tried the request // we write this in terms of comparing slot IDs, because the Slot IDs are the identifiers of // the actual slots on the TaskManagers // Note: The slotOffer should have the SlotID final SlotID existingSlotId = existingSlot.getSlotId(); final SlotID newSlotId = new SlotID(taskManagerLocation.getResourceID(), slotOffer.getSlotIndex()); if (existingSlotId.equals(newSlotId)) { log.info("Received repeated offer for slot [{}]. Ignoring.", allocationID); // return true here so that the sender will get a positive acknowledgement to the retry // and mark the offering as a success return true; } else { // the allocation has been fulfilled by another slot, reject the offer so the task executor // will offer the slot to the resource manager return false; } } final AllocatedSlot allocatedSlot = new AllocatedSlot( allocationID, taskManagerLocation, slotOffer.getSlotIndex(), slotOffer.getResourceProfile(), taskManagerGateway); // check whether we have request waiting for this slot PendingRequest pendingRequest = pendingRequests.removeKeyB(allocationID); if (pendingRequest != null) { // we were waiting for this! allocatedSlots.add(pendingRequest.getSlotRequestId(), allocatedSlot); if (!pendingRequest.getAllocatedSlotFuture().complete(allocatedSlot)) { // we could not complete the pending slot future --> try to fulfill another pending request allocatedSlots.remove(pendingRequest.getSlotRequestId()); tryFulfillSlotRequestOrMakeAvailable(allocatedSlot); } else { log.debug("Fulfilled slot request [{}] with allocated slot [{}].", pendingRequest.getSlotRequestId(), allocationID); } } else { // we were actually not waiting for this: // - could be that this request had been fulfilled // - we are receiving the slots from TaskManagers after becoming leaders tryFulfillSlotRequestOrMakeAvailable(allocatedSlot); } // we accepted the request in any case. slot will be released after it idled for // too long and timed out return true; }
[ "boolean", "offerSlot", "(", "final", "TaskManagerLocation", "taskManagerLocation", ",", "final", "TaskManagerGateway", "taskManagerGateway", ",", "final", "SlotOffer", "slotOffer", ")", "{", "componentMainThreadExecutor", ".", "assertRunningInMainThread", "(", ")", ";", ...
Slot offering by TaskExecutor with AllocationID. The AllocationID is originally generated by this pool and transfer through the ResourceManager to TaskManager. We use it to distinguish the different allocation we issued. Slot offering may be rejected if we find something mismatching or there is actually no pending request waiting for this slot (maybe fulfilled by some other returned slot). @param taskManagerLocation location from where the offer comes from @param taskManagerGateway TaskManager gateway @param slotOffer the offered slot @return True if we accept the offering
[ "Slot", "offering", "by", "TaskExecutor", "with", "AllocationID", ".", "The", "AllocationID", "is", "originally", "generated", "by", "this", "pool", "and", "transfer", "through", "the", "ResourceManager", "to", "TaskManager", ".", "We", "use", "it", "to", "disti...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolImpl.java#L538-L614
train
Offer a slot to the TaskManager.
[ 30522, 22017, 20898, 4107, 10994, 1006, 2345, 4708, 24805, 4590, 4135, 10719, 4708, 24805, 4590, 4135, 10719, 1010, 2345, 4708, 24805, 4590, 5867, 4576, 4708, 24805, 4590, 5867, 4576, 1010, 2345, 10453, 7245, 2121, 10453, 7245, 2121, 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/util/ClassUtil.java
ClassUtil.invoke
public static <T> T invoke(String classNameWithMethodName, Object[] args) { return invoke(classNameWithMethodName, false, args); }
java
public static <T> T invoke(String classNameWithMethodName, Object[] args) { return invoke(classNameWithMethodName, false, args); }
[ "public", "static", "<", "T", ">", "T", "invoke", "(", "String", "classNameWithMethodName", ",", "Object", "[", "]", "args", ")", "{", "return", "invoke", "(", "classNameWithMethodName", ",", "false", ",", "args", ")", ";", "}" ]
执行方法<br> 可执行Private方法,也可执行static方法<br> 执行非static方法时,必须满足对象有默认构造方法<br> 非单例模式,如果是非静态方法,每次创建一个新对象 @param <T> 对象类型 @param classNameWithMethodName 类名和方法名表达式,类名与方法名用<code>.</code>或<code>#</code>连接 例如:com.xiaoleilu.hutool.StrUtil.isEmpty 或 com.xiaoleilu.hutool.StrUtil#isEmpty @param args 参数,必须严格对应指定方法的参数类型和数量 @return 返回结果
[ "执行方法<br", ">", "可执行Private方法,也可执行static方法<br", ">", "执行非static方法时,必须满足对象有默认构造方法<br", ">", "非单例模式,如果是非静态方法,每次创建一个新对象" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L619-L621
train
Invoke a method on a class with a number of arguments.
[ 30522, 2270, 10763, 1026, 1056, 1028, 1056, 1999, 6767, 3489, 1006, 5164, 2465, 18442, 24415, 11368, 6806, 28911, 4168, 1010, 4874, 1031, 1033, 12098, 5620, 1007, 1063, 2709, 1999, 6767, 3489, 1006, 2465, 18442, 24415, 11368, 6806, 28911, 4...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-native-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java
AbstractEpollStreamChannel.doWriteSingle
protected int doWriteSingle(ChannelOutboundBuffer in) throws Exception { // The outbound buffer contains only one message or it contains a file region. Object msg = in.current(); if (msg instanceof ByteBuf) { return writeBytes(in, (ByteBuf) msg); } else if (msg instanceof DefaultFileRegion) { return writeDefaultFileRegion(in, (DefaultFileRegion) msg); } else if (msg instanceof FileRegion) { return writeFileRegion(in, (FileRegion) msg); } else if (msg instanceof SpliceOutTask) { if (!((SpliceOutTask) msg).spliceOut()) { return WRITE_STATUS_SNDBUF_FULL; } in.remove(); return 1; } else { // Should never reach here. throw new Error(); } }
java
protected int doWriteSingle(ChannelOutboundBuffer in) throws Exception { // The outbound buffer contains only one message or it contains a file region. Object msg = in.current(); if (msg instanceof ByteBuf) { return writeBytes(in, (ByteBuf) msg); } else if (msg instanceof DefaultFileRegion) { return writeDefaultFileRegion(in, (DefaultFileRegion) msg); } else if (msg instanceof FileRegion) { return writeFileRegion(in, (FileRegion) msg); } else if (msg instanceof SpliceOutTask) { if (!((SpliceOutTask) msg).spliceOut()) { return WRITE_STATUS_SNDBUF_FULL; } in.remove(); return 1; } else { // Should never reach here. throw new Error(); } }
[ "protected", "int", "doWriteSingle", "(", "ChannelOutboundBuffer", "in", ")", "throws", "Exception", "{", "// The outbound buffer contains only one message or it contains a file region.", "Object", "msg", "=", "in", ".", "current", "(", ")", ";", "if", "(", "msg", "inst...
Attempt to write a single object. @param in the collection which contains objects to write. @return The value that should be decremented from the write quantum which starts at {@link ChannelConfig#getWriteSpinCount()}. The typical use cases are as follows: <ul> <li>0 - if no write was attempted. This is appropriate if an empty {@link ByteBuf} (or other empty content) is encountered</li> <li>1 - if a single call to write data was made to the OS</li> <li>{@link ChannelUtils#WRITE_STATUS_SNDBUF_FULL} - if an attempt to write data was made to the OS, but no data was accepted</li> </ul> @throws Exception If an I/O error occurs.
[ "Attempt", "to", "write", "a", "single", "object", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java#L476-L495
train
Write a single message to the outbound buffer.
[ 30522, 5123, 20014, 23268, 28884, 2075, 2571, 1006, 3149, 5833, 15494, 8569, 12494, 1999, 1007, 11618, 6453, 1063, 1013, 1013, 1996, 2041, 15494, 17698, 3397, 2069, 2028, 4471, 2030, 2009, 3397, 1037, 5371, 2555, 1012, 4874, 5796, 2290, 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...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java
FileUtil.extName
public static String extName(File file) { if (null == file) { return null; } if (file.isDirectory()) { return null; } return extName(file.getName()); }
java
public static String extName(File file) { if (null == file) { return null; } if (file.isDirectory()) { return null; } return extName(file.getName()); }
[ "public", "static", "String", "extName", "(", "File", "file", ")", "{", "if", "(", "null", "==", "file", ")", "{", "return", "null", ";", "}", "if", "(", "file", ".", "isDirectory", "(", ")", ")", "{", "return", "null", ";", "}", "return", "extName...
获取文件扩展名,扩展名不带“.” @param file 文件 @return 扩展名
[ "获取文件扩展名,扩展名不带“", ".", "”" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L1806-L1814
train
Returns the name of the file extension.
[ 30522, 2270, 10763, 5164, 4654, 2102, 18442, 1006, 5371, 5371, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 5371, 1007, 1063, 2709, 19701, 1025, 1065, 2065, 1006, 5371, 1012, 2003, 4305, 2890, 16761, 2100, 1006, 1007, 1007, 1063, 2709, 19701,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-db/src/main/java/cn/hutool/db/DaoTemplate.java
DaoTemplate.fixEntity
private Entity fixEntity(Entity entity){ if(null == entity){ entity = Entity.create(tableName); }else if(StrUtil.isBlank(entity.getTableName())){ entity.setTableName(tableName); } return entity; }
java
private Entity fixEntity(Entity entity){ if(null == entity){ entity = Entity.create(tableName); }else if(StrUtil.isBlank(entity.getTableName())){ entity.setTableName(tableName); } return entity; }
[ "private", "Entity", "fixEntity", "(", "Entity", "entity", ")", "{", "if", "(", "null", "==", "entity", ")", "{", "entity", "=", "Entity", ".", "create", "(", "tableName", ")", ";", "}", "else", "if", "(", "StrUtil", ".", "isBlank", "(", "entity", "....
修正Entity对象,避免null和填充表名 @param entity 实体类 @return 修正后的实体类
[ "修正Entity对象,避免null和填充表名" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/DaoTemplate.java#L353-L360
train
Fix entity.
[ 30522, 2797, 9178, 8081, 4765, 3012, 1006, 9178, 9178, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 9178, 1007, 1063, 9178, 1027, 9178, 1012, 3443, 1006, 2795, 18442, 1007, 1025, 1065, 2842, 2065, 1006, 2358, 22134, 4014, 1012, 2003, 28522, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java
GlobalConfiguration.loadConfiguration
public static Configuration loadConfiguration(final String configDir, @Nullable final Configuration dynamicProperties) { if (configDir == null) { throw new IllegalArgumentException("Given configuration directory is null, cannot load configuration"); } final File confDirFile = new File(configDir); if (!(confDirFile.exists())) { throw new IllegalConfigurationException( "The given configuration directory name '" + configDir + "' (" + confDirFile.getAbsolutePath() + ") does not describe an existing directory."); } // get Flink yaml configuration file final File yamlConfigFile = new File(confDirFile, FLINK_CONF_FILENAME); if (!yamlConfigFile.exists()) { throw new IllegalConfigurationException( "The Flink config file '" + yamlConfigFile + "' (" + confDirFile.getAbsolutePath() + ") does not exist."); } Configuration configuration = loadYAMLResource(yamlConfigFile); if (dynamicProperties != null) { configuration.addAll(dynamicProperties); } return configuration; }
java
public static Configuration loadConfiguration(final String configDir, @Nullable final Configuration dynamicProperties) { if (configDir == null) { throw new IllegalArgumentException("Given configuration directory is null, cannot load configuration"); } final File confDirFile = new File(configDir); if (!(confDirFile.exists())) { throw new IllegalConfigurationException( "The given configuration directory name '" + configDir + "' (" + confDirFile.getAbsolutePath() + ") does not describe an existing directory."); } // get Flink yaml configuration file final File yamlConfigFile = new File(confDirFile, FLINK_CONF_FILENAME); if (!yamlConfigFile.exists()) { throw new IllegalConfigurationException( "The Flink config file '" + yamlConfigFile + "' (" + confDirFile.getAbsolutePath() + ") does not exist."); } Configuration configuration = loadYAMLResource(yamlConfigFile); if (dynamicProperties != null) { configuration.addAll(dynamicProperties); } return configuration; }
[ "public", "static", "Configuration", "loadConfiguration", "(", "final", "String", "configDir", ",", "@", "Nullable", "final", "Configuration", "dynamicProperties", ")", "{", "if", "(", "configDir", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", ...
Loads the configuration files from the specified directory. If the dynamic properties configuration is not null, then it is added to the loaded configuration. @param configDir directory to load the configuration from @param dynamicProperties configuration file containing the dynamic properties. Null if none. @return The configuration loaded from the given configuration directory
[ "Loads", "the", "configuration", "files", "from", "the", "specified", "directory", ".", "If", "the", "dynamic", "properties", "configuration", "is", "not", "null", "then", "it", "is", "added", "to", "the", "loaded", "configuration", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java#L93-L122
train
Load the configuration from the given configuration directory.
[ 30522, 2270, 10763, 9563, 7170, 8663, 8873, 27390, 3370, 1006, 2345, 5164, 9530, 8873, 2290, 4305, 2099, 1010, 1030, 19701, 3085, 2345, 9563, 8790, 21572, 4842, 7368, 1007, 1063, 2065, 1006, 9530, 8873, 2290, 4305, 2099, 1027, 1027, 19701, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-shardingsphere
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/context/table/Tables.java
Tables.find
public Optional<Table> find(final String tableNameOrAlias) { Optional<Table> tableFromName = findTableFromName(tableNameOrAlias); return tableFromName.isPresent() ? tableFromName : findTableFromAlias(tableNameOrAlias); }
java
public Optional<Table> find(final String tableNameOrAlias) { Optional<Table> tableFromName = findTableFromName(tableNameOrAlias); return tableFromName.isPresent() ? tableFromName : findTableFromAlias(tableNameOrAlias); }
[ "public", "Optional", "<", "Table", ">", "find", "(", "final", "String", "tableNameOrAlias", ")", "{", "Optional", "<", "Table", ">", "tableFromName", "=", "findTableFromName", "(", "tableNameOrAlias", ")", ";", "return", "tableFromName", ".", "isPresent", "(", ...
Find table via table name or alias. @param tableNameOrAlias table name or alias @return table
[ "Find", "table", "via", "table", "name", "or", "alias", "." ]
f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/context/table/Tables.java#L100-L103
train
Find table by name or alias.
[ 30522, 2270, 11887, 1026, 2795, 1028, 2424, 1006, 2345, 5164, 2795, 18442, 6525, 6632, 2015, 1007, 1063, 11887, 1026, 2795, 1028, 2795, 19699, 5358, 18442, 1027, 2424, 10880, 19699, 5358, 18442, 1006, 2795, 18442, 6525, 6632, 2015, 1007, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/spark
examples/src/main/java/org/apache/spark/examples/sql/JavaUserDefinedUntypedAggregation.java
JavaUserDefinedUntypedAggregation.main
public static void main(String[] args) { SparkSession spark = SparkSession .builder() .appName("Java Spark SQL user-defined DataFrames aggregation example") .getOrCreate(); // $example on:untyped_custom_aggregation$ // Register the function to access it spark.udf().register("myAverage", new MyAverage()); Dataset<Row> df = spark.read().json("examples/src/main/resources/employees.json"); df.createOrReplaceTempView("employees"); df.show(); // +-------+------+ // | name|salary| // +-------+------+ // |Michael| 3000| // | Andy| 4500| // | Justin| 3500| // | Berta| 4000| // +-------+------+ Dataset<Row> result = spark.sql("SELECT myAverage(salary) as average_salary FROM employees"); result.show(); // +--------------+ // |average_salary| // +--------------+ // | 3750.0| // +--------------+ // $example off:untyped_custom_aggregation$ spark.stop(); }
java
public static void main(String[] args) { SparkSession spark = SparkSession .builder() .appName("Java Spark SQL user-defined DataFrames aggregation example") .getOrCreate(); // $example on:untyped_custom_aggregation$ // Register the function to access it spark.udf().register("myAverage", new MyAverage()); Dataset<Row> df = spark.read().json("examples/src/main/resources/employees.json"); df.createOrReplaceTempView("employees"); df.show(); // +-------+------+ // | name|salary| // +-------+------+ // |Michael| 3000| // | Andy| 4500| // | Justin| 3500| // | Berta| 4000| // +-------+------+ Dataset<Row> result = spark.sql("SELECT myAverage(salary) as average_salary FROM employees"); result.show(); // +--------------+ // |average_salary| // +--------------+ // | 3750.0| // +--------------+ // $example off:untyped_custom_aggregation$ spark.stop(); }
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "SparkSession", "spark", "=", "SparkSession", ".", "builder", "(", ")", ".", "appName", "(", "\"Java Spark SQL user-defined DataFrames aggregation example\"", ")", ".", "getOrCreate", "...
$example off:untyped_custom_aggregation$
[ "$example", "off", ":", "untyped_custom_aggregation$" ]
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/examples/src/main/java/org/apache/spark/examples/sql/JavaUserDefinedUntypedAggregation.java#L99-L131
train
Example of creating or updating a new Spark session.
[ 30522, 2270, 10763, 11675, 2364, 1006, 5164, 1031, 1033, 12098, 5620, 1007, 1063, 12300, 7971, 3258, 12125, 1027, 12300, 7971, 3258, 1012, 12508, 1006, 1007, 1012, 10439, 18442, 1006, 1000, 9262, 12125, 29296, 5310, 1011, 4225, 2951, 15643, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronTrainer.java
PerceptronTrainer.train
public Result train(String trainingFile, String developFile, String modelFile, final double compressRatio, final int maxIteration, final int threadNum) throws IOException { if (developFile == null) { developFile = trainingFile; } // 加载训练语料 TagSet tagSet = createTagSet(); MutableFeatureMap mutableFeatureMap = new MutableFeatureMap(tagSet); ConsoleLogger logger = new ConsoleLogger(); logger.start("开始加载训练集...\n"); Instance[] instances = loadTrainInstances(trainingFile, mutableFeatureMap); tagSet.lock(); logger.finish("\n加载完毕,实例一共%d句,特征总数%d\n", instances.length, mutableFeatureMap.size() * tagSet.size()); // 开始训练 ImmutableFeatureMap immutableFeatureMap = new ImmutableFeatureMap(mutableFeatureMap.featureIdMap, tagSet); mutableFeatureMap = null; double[] accuracy = null; if (threadNum == 1) { AveragedPerceptron model; model = new AveragedPerceptron(immutableFeatureMap); final double[] total = new double[model.parameter.length]; final int[] timestamp = new int[model.parameter.length]; int current = 0; for (int iter = 1; iter <= maxIteration; iter++) { Utility.shuffleArray(instances); for (Instance instance : instances) { ++current; int[] guessLabel = new int[instance.length()]; model.viterbiDecode(instance, guessLabel); for (int i = 0; i < instance.length(); i++) { int[] featureVector = instance.getFeatureAt(i); int[] goldFeature = new int[featureVector.length]; int[] predFeature = new int[featureVector.length]; for (int j = 0; j < featureVector.length - 1; j++) { goldFeature[j] = featureVector[j] * tagSet.size() + instance.tagArray[i]; predFeature[j] = featureVector[j] * tagSet.size() + guessLabel[i]; } goldFeature[featureVector.length - 1] = (i == 0 ? tagSet.bosId() : instance.tagArray[i - 1]) * tagSet.size() + instance.tagArray[i]; predFeature[featureVector.length - 1] = (i == 0 ? tagSet.bosId() : guessLabel[i - 1]) * tagSet.size() + guessLabel[i]; model.update(goldFeature, predFeature, total, timestamp, current); } } // 在开发集上校验 accuracy = trainingFile.equals(developFile) ? IOUtility.evaluate(instances, model) : evaluate(developFile, model); out.printf("Iter#%d - ", iter); printAccuracy(accuracy); } // 平均 model.average(total, timestamp, current); accuracy = trainingFile.equals(developFile) ? IOUtility.evaluate(instances, model) : evaluate(developFile, model); out.print("AP - "); printAccuracy(accuracy); logger.start("以压缩比 %.2f 保存模型到 %s ... ", compressRatio, modelFile); model.save(modelFile, immutableFeatureMap.featureIdMap.entrySet(), compressRatio); logger.finish(" 保存完毕\n"); if (compressRatio == 0) return new Result(model, accuracy); } else { // 多线程用Structure Perceptron StructuredPerceptron[] models = new StructuredPerceptron[threadNum]; for (int i = 0; i < models.length; i++) { models[i] = new StructuredPerceptron(immutableFeatureMap); } TrainingWorker[] workers = new TrainingWorker[threadNum]; int job = instances.length / threadNum; for (int iter = 1; iter <= maxIteration; iter++) { Utility.shuffleArray(instances); try { for (int i = 0; i < workers.length; i++) { workers[i] = new TrainingWorker(instances, i * job, i == workers.length - 1 ? instances.length : (i + 1) * job, models[i]); workers[i].start(); } for (TrainingWorker worker : workers) { worker.join(); } for (int j = 0; j < models[0].parameter.length; j++) { for (int i = 1; i < models.length; i++) { models[0].parameter[j] += models[i].parameter[j]; } models[0].parameter[j] /= threadNum; } accuracy = trainingFile.equals(developFile) ? IOUtility.evaluate(instances, models[0]) : evaluate(developFile, models[0]); out.printf("Iter#%d - ", iter); printAccuracy(accuracy); } catch (InterruptedException e) { err.printf("线程同步异常,训练失败\n"); e.printStackTrace(); return null; } } logger.start("以压缩比 %.2f 保存模型到 %s ... ", compressRatio, modelFile); models[0].save(modelFile, immutableFeatureMap.featureIdMap.entrySet(), compressRatio, HanLP.Config.DEBUG); logger.finish(" 保存完毕\n"); if (compressRatio == 0) return new Result(models[0], accuracy); } LinearModel model = new LinearModel(modelFile); if (compressRatio > 0) { accuracy = evaluate(developFile, model); out.printf("\n%.2f compressed model - ", compressRatio); printAccuracy(accuracy); } return new Result(model, accuracy); }
java
public Result train(String trainingFile, String developFile, String modelFile, final double compressRatio, final int maxIteration, final int threadNum) throws IOException { if (developFile == null) { developFile = trainingFile; } // 加载训练语料 TagSet tagSet = createTagSet(); MutableFeatureMap mutableFeatureMap = new MutableFeatureMap(tagSet); ConsoleLogger logger = new ConsoleLogger(); logger.start("开始加载训练集...\n"); Instance[] instances = loadTrainInstances(trainingFile, mutableFeatureMap); tagSet.lock(); logger.finish("\n加载完毕,实例一共%d句,特征总数%d\n", instances.length, mutableFeatureMap.size() * tagSet.size()); // 开始训练 ImmutableFeatureMap immutableFeatureMap = new ImmutableFeatureMap(mutableFeatureMap.featureIdMap, tagSet); mutableFeatureMap = null; double[] accuracy = null; if (threadNum == 1) { AveragedPerceptron model; model = new AveragedPerceptron(immutableFeatureMap); final double[] total = new double[model.parameter.length]; final int[] timestamp = new int[model.parameter.length]; int current = 0; for (int iter = 1; iter <= maxIteration; iter++) { Utility.shuffleArray(instances); for (Instance instance : instances) { ++current; int[] guessLabel = new int[instance.length()]; model.viterbiDecode(instance, guessLabel); for (int i = 0; i < instance.length(); i++) { int[] featureVector = instance.getFeatureAt(i); int[] goldFeature = new int[featureVector.length]; int[] predFeature = new int[featureVector.length]; for (int j = 0; j < featureVector.length - 1; j++) { goldFeature[j] = featureVector[j] * tagSet.size() + instance.tagArray[i]; predFeature[j] = featureVector[j] * tagSet.size() + guessLabel[i]; } goldFeature[featureVector.length - 1] = (i == 0 ? tagSet.bosId() : instance.tagArray[i - 1]) * tagSet.size() + instance.tagArray[i]; predFeature[featureVector.length - 1] = (i == 0 ? tagSet.bosId() : guessLabel[i - 1]) * tagSet.size() + guessLabel[i]; model.update(goldFeature, predFeature, total, timestamp, current); } } // 在开发集上校验 accuracy = trainingFile.equals(developFile) ? IOUtility.evaluate(instances, model) : evaluate(developFile, model); out.printf("Iter#%d - ", iter); printAccuracy(accuracy); } // 平均 model.average(total, timestamp, current); accuracy = trainingFile.equals(developFile) ? IOUtility.evaluate(instances, model) : evaluate(developFile, model); out.print("AP - "); printAccuracy(accuracy); logger.start("以压缩比 %.2f 保存模型到 %s ... ", compressRatio, modelFile); model.save(modelFile, immutableFeatureMap.featureIdMap.entrySet(), compressRatio); logger.finish(" 保存完毕\n"); if (compressRatio == 0) return new Result(model, accuracy); } else { // 多线程用Structure Perceptron StructuredPerceptron[] models = new StructuredPerceptron[threadNum]; for (int i = 0; i < models.length; i++) { models[i] = new StructuredPerceptron(immutableFeatureMap); } TrainingWorker[] workers = new TrainingWorker[threadNum]; int job = instances.length / threadNum; for (int iter = 1; iter <= maxIteration; iter++) { Utility.shuffleArray(instances); try { for (int i = 0; i < workers.length; i++) { workers[i] = new TrainingWorker(instances, i * job, i == workers.length - 1 ? instances.length : (i + 1) * job, models[i]); workers[i].start(); } for (TrainingWorker worker : workers) { worker.join(); } for (int j = 0; j < models[0].parameter.length; j++) { for (int i = 1; i < models.length; i++) { models[0].parameter[j] += models[i].parameter[j]; } models[0].parameter[j] /= threadNum; } accuracy = trainingFile.equals(developFile) ? IOUtility.evaluate(instances, models[0]) : evaluate(developFile, models[0]); out.printf("Iter#%d - ", iter); printAccuracy(accuracy); } catch (InterruptedException e) { err.printf("线程同步异常,训练失败\n"); e.printStackTrace(); return null; } } logger.start("以压缩比 %.2f 保存模型到 %s ... ", compressRatio, modelFile); models[0].save(modelFile, immutableFeatureMap.featureIdMap.entrySet(), compressRatio, HanLP.Config.DEBUG); logger.finish(" 保存完毕\n"); if (compressRatio == 0) return new Result(models[0], accuracy); } LinearModel model = new LinearModel(modelFile); if (compressRatio > 0) { accuracy = evaluate(developFile, model); out.printf("\n%.2f compressed model - ", compressRatio); printAccuracy(accuracy); } return new Result(model, accuracy); }
[ "public", "Result", "train", "(", "String", "trainingFile", ",", "String", "developFile", ",", "String", "modelFile", ",", "final", "double", "compressRatio", ",", "final", "int", "maxIteration", ",", "final", "int", "threadNum", ")", "throws", "IOException", "{...
训练 @param trainingFile 训练集 @param developFile 开发集 @param modelFile 模型保存路径 @param compressRatio 压缩比 @param maxIteration 最大迭代次数 @param threadNum 线程数 @return 一个包含模型和精度的结构 @throws IOException
[ "训练" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronTrainer.java#L109-L238
train
Train a single instance of a CIS model.
[ 30522, 2270, 2765, 3345, 1006, 5164, 2731, 8873, 2571, 1010, 5164, 4503, 8873, 2571, 1010, 5164, 2944, 8873, 2571, 1010, 2345, 3313, 4012, 20110, 8609, 3695, 1010, 2345, 20014, 21510, 14621, 3508, 1010, 2345, 20014, 11689, 19172, 1007, 1161...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/ReUtil.java
ReUtil.replaceAll
public static String replaceAll(CharSequence content, String regex, String replacementTemplate) { final Pattern pattern = Pattern.compile(regex, Pattern.DOTALL); return replaceAll(content, pattern, replacementTemplate); }
java
public static String replaceAll(CharSequence content, String regex, String replacementTemplate) { final Pattern pattern = Pattern.compile(regex, Pattern.DOTALL); return replaceAll(content, pattern, replacementTemplate); }
[ "public", "static", "String", "replaceAll", "(", "CharSequence", "content", ",", "String", "regex", ",", "String", "replacementTemplate", ")", "{", "final", "Pattern", "pattern", "=", "Pattern", ".", "compile", "(", "regex", ",", "Pattern", ".", "DOTALL", ")",...
正则替换指定值<br> 通过正则查找到字符串,然后把匹配到的字符串加入到replacementTemplate中,$1表示分组1的字符串 @param content 文本 @param regex 正则 @param replacementTemplate 替换的文本模板,可以使用$1类似的变量提取正则匹配出的内容 @return 处理后的文本
[ "正则替换指定值<br", ">", "通过正则查找到字符串,然后把匹配到的字符串加入到replacementTemplate中,$1表示分组1的字符串" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L600-L603
train
Replaces all occurrences of the given regular expression with the given replacement template.
[ 30522, 2270, 10763, 5164, 5672, 8095, 1006, 25869, 3366, 4226, 5897, 4180, 1010, 5164, 19723, 10288, 1010, 5164, 6110, 18532, 15725, 1007, 1063, 2345, 5418, 5418, 1027, 5418, 1012, 4012, 22090, 1006, 19723, 10288, 1010, 5418, 1012, 11089, 8...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/RoundRobinOperatorStateRepartitioner.java
RoundRobinOperatorStateRepartitioner.repartition
private List<Map<StreamStateHandle, OperatorStateHandle>> repartition( GroupByStateNameResults nameToStateByMode, int newParallelism) { // We will use this to merge w.r.t. StreamStateHandles for each parallel subtask inside the maps List<Map<StreamStateHandle, OperatorStateHandle>> mergeMapList = new ArrayList<>(newParallelism); // Initialize for (int i = 0; i < newParallelism; ++i) { mergeMapList.add(new HashMap<>()); } // Start with the state handles we distribute round robin by splitting by offsets Map<String, List<Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo>>> nameToDistributeState = nameToStateByMode.getByMode(OperatorStateHandle.Mode.SPLIT_DISTRIBUTE); repartitionSplitState(nameToDistributeState, newParallelism, mergeMapList); // Now we also add the state handles marked for union to all parallel instances Map<String, List<Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo>>> nameToUnionState = nameToStateByMode.getByMode(OperatorStateHandle.Mode.UNION); repartitionUnionState(nameToUnionState, mergeMapList); // Now we also add the state handles marked for uniform broadcast to all parallel instances Map<String, List<Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo>>> nameToBroadcastState = nameToStateByMode.getByMode(OperatorStateHandle.Mode.BROADCAST); repartitionBroadcastState(nameToBroadcastState, mergeMapList); return mergeMapList; }
java
private List<Map<StreamStateHandle, OperatorStateHandle>> repartition( GroupByStateNameResults nameToStateByMode, int newParallelism) { // We will use this to merge w.r.t. StreamStateHandles for each parallel subtask inside the maps List<Map<StreamStateHandle, OperatorStateHandle>> mergeMapList = new ArrayList<>(newParallelism); // Initialize for (int i = 0; i < newParallelism; ++i) { mergeMapList.add(new HashMap<>()); } // Start with the state handles we distribute round robin by splitting by offsets Map<String, List<Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo>>> nameToDistributeState = nameToStateByMode.getByMode(OperatorStateHandle.Mode.SPLIT_DISTRIBUTE); repartitionSplitState(nameToDistributeState, newParallelism, mergeMapList); // Now we also add the state handles marked for union to all parallel instances Map<String, List<Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo>>> nameToUnionState = nameToStateByMode.getByMode(OperatorStateHandle.Mode.UNION); repartitionUnionState(nameToUnionState, mergeMapList); // Now we also add the state handles marked for uniform broadcast to all parallel instances Map<String, List<Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo>>> nameToBroadcastState = nameToStateByMode.getByMode(OperatorStateHandle.Mode.BROADCAST); repartitionBroadcastState(nameToBroadcastState, mergeMapList); return mergeMapList; }
[ "private", "List", "<", "Map", "<", "StreamStateHandle", ",", "OperatorStateHandle", ">", ">", "repartition", "(", "GroupByStateNameResults", "nameToStateByMode", ",", "int", "newParallelism", ")", "{", "// We will use this to merge w.r.t. StreamStateHandles for each parallel s...
Repartition all named states.
[ "Repartition", "all", "named", "states", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/RoundRobinOperatorStateRepartitioner.java#L195-L226
train
Repartition the state handles by repartition
[ 30522, 2797, 2862, 1026, 4949, 1026, 9199, 12259, 11774, 2571, 1010, 30524, 14074, 6072, 11314, 2015, 2171, 13122, 12259, 3762, 5302, 3207, 1010, 20014, 2047, 28689, 6216, 28235, 1007, 1063, 1013, 1013, 2057, 2097, 2224, 2023, 2000, 13590, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java
CollUtil.join
public static <T> String join(Iterator<T> iterator, CharSequence conjunction) { return IterUtil.join(iterator, conjunction); }
java
public static <T> String join(Iterator<T> iterator, CharSequence conjunction) { return IterUtil.join(iterator, conjunction); }
[ "public", "static", "<", "T", ">", "String", "join", "(", "Iterator", "<", "T", ">", "iterator", ",", "CharSequence", "conjunction", ")", "{", "return", "IterUtil", ".", "join", "(", "iterator", ",", "conjunction", ")", ";", "}" ]
以 conjunction 为分隔符将集合转换为字符串<br> 如果集合元素为数组、{@link Iterable}或{@link Iterator},则递归组合其为字符串 @param <T> 集合元素类型 @param iterator 集合 @param conjunction 分隔符 @return 连接后的字符串 @see IterUtil#join(Iterator, CharSequence)
[ "以", "conjunction", "为分隔符将集合转换为字符串<br", ">", "如果集合元素为数组、", "{", "@link", "Iterable", "}", "或", "{", "@link", "Iterator", "}", ",则递归组合其为字符串" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L290-L292
train
Joins the iterator with the given conjunction.
[ 30522, 2270, 10763, 1026, 1056, 1028, 5164, 3693, 1006, 2009, 6906, 4263, 1026, 1056, 1028, 2009, 6906, 4263, 1010, 25869, 3366, 4226, 5897, 9595, 1007, 1063, 2709, 2009, 2121, 21823, 2140, 1012, 3693, 1006, 2009, 6906, 4263, 1010, 9595, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java
ZooKeeperStateHandleStore.replace
public void replace(String pathInZooKeeper, int expectedVersion, T state) throws Exception { checkNotNull(pathInZooKeeper, "Path in ZooKeeper"); checkNotNull(state, "State"); final String path = normalizePath(pathInZooKeeper); RetrievableStateHandle<T> oldStateHandle = get(path, false); RetrievableStateHandle<T> newStateHandle = storage.store(state); boolean success = false; try { // Serialize the new state handle. This writes the state to the backend. byte[] serializedStateHandle = InstantiationUtil.serializeObject(newStateHandle); // Replace state handle in ZooKeeper. client.setData() .withVersion(expectedVersion) .forPath(path, serializedStateHandle); success = true; } catch (KeeperException.NoNodeException e) { throw new ConcurrentModificationException("ZooKeeper unexpectedly modified", e); } finally { if (success) { oldStateHandle.discardState(); } else { newStateHandle.discardState(); } } }
java
public void replace(String pathInZooKeeper, int expectedVersion, T state) throws Exception { checkNotNull(pathInZooKeeper, "Path in ZooKeeper"); checkNotNull(state, "State"); final String path = normalizePath(pathInZooKeeper); RetrievableStateHandle<T> oldStateHandle = get(path, false); RetrievableStateHandle<T> newStateHandle = storage.store(state); boolean success = false; try { // Serialize the new state handle. This writes the state to the backend. byte[] serializedStateHandle = InstantiationUtil.serializeObject(newStateHandle); // Replace state handle in ZooKeeper. client.setData() .withVersion(expectedVersion) .forPath(path, serializedStateHandle); success = true; } catch (KeeperException.NoNodeException e) { throw new ConcurrentModificationException("ZooKeeper unexpectedly modified", e); } finally { if (success) { oldStateHandle.discardState(); } else { newStateHandle.discardState(); } } }
[ "public", "void", "replace", "(", "String", "pathInZooKeeper", ",", "int", "expectedVersion", ",", "T", "state", ")", "throws", "Exception", "{", "checkNotNull", "(", "pathInZooKeeper", ",", "\"Path in ZooKeeper\"", ")", ";", "checkNotNull", "(", "state", ",", "...
Replaces a state handle in ZooKeeper and discards the old state handle. @param pathInZooKeeper Destination path in ZooKeeper (expected to exist and start with a '/') @param expectedVersion Expected version of the node to replace @param state The new state to replace the old one @throws Exception If a ZooKeeper or state handle operation fails
[ "Replaces", "a", "state", "handle", "in", "ZooKeeper", "and", "discards", "the", "old", "state", "handle", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java#L179-L210
train
Replace the state handle in ZooKeeper with the given state.
[ 30522, 2270, 11675, 5672, 1006, 5164, 4130, 2378, 23221, 13106, 1010, 20014, 3517, 27774, 1010, 1056, 2110, 1007, 11618, 6453, 1063, 4638, 17048, 11231, 3363, 1006, 4130, 2378, 23221, 13106, 1010, 1000, 4130, 1999, 9201, 13106, 1000, 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-extra/src/main/java/cn/hutool/extra/mail/Mail.java
Mail.getSession
private Session getSession(boolean isSingleton) { final MailAccount mailAccount = this.mailAccount; Authenticator authenticator = null; if (mailAccount.isAuth()) { authenticator = new UserPassAuthenticator(mailAccount.getUser(), mailAccount.getPass()); } return isSingleton ? Session.getDefaultInstance(mailAccount.getSmtpProps(), authenticator) // : Session.getInstance(mailAccount.getSmtpProps(), authenticator); }
java
private Session getSession(boolean isSingleton) { final MailAccount mailAccount = this.mailAccount; Authenticator authenticator = null; if (mailAccount.isAuth()) { authenticator = new UserPassAuthenticator(mailAccount.getUser(), mailAccount.getPass()); } return isSingleton ? Session.getDefaultInstance(mailAccount.getSmtpProps(), authenticator) // : Session.getInstance(mailAccount.getSmtpProps(), authenticator); }
[ "private", "Session", "getSession", "(", "boolean", "isSingleton", ")", "{", "final", "MailAccount", "mailAccount", "=", "this", ".", "mailAccount", ";", "Authenticator", "authenticator", "=", "null", ";", "if", "(", "mailAccount", ".", "isAuth", "(", ")", ")"...
获取默认邮件会话<br> 如果为全局单例的会话,则全局只允许一个邮件帐号,否则每次发送邮件会新建一个新的会话 @param isSingleton 是否使用单例Session @return 邮件会话 {@link Session} @since 4.0.2
[ "获取默认邮件会话<br", ">", "如果为全局单例的会话,则全局只允许一个邮件帐号,否则每次发送邮件会新建一个新的会话" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/mail/Mail.java#L318-L327
train
Gets the Session.
[ 30522, 2797, 5219, 4152, 7971, 3258, 1006, 22017, 20898, 26354, 2075, 19263, 1007, 1063, 2345, 5653, 6305, 3597, 16671, 5653, 6305, 3597, 16671, 1027, 2023, 1012, 5653, 6305, 3597, 16671, 1025, 14469, 8844, 14469, 8844, 1027, 19701, 1025, 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...
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/interactions/Actions.java
Actions.moveToElement
public Actions moveToElement(WebElement target) { if (isBuildingActions()) { action.addAction(new MoveMouseAction(jsonMouse, (Locatable) target)); } return moveInTicks(target, 0, 0); }
java
public Actions moveToElement(WebElement target) { if (isBuildingActions()) { action.addAction(new MoveMouseAction(jsonMouse, (Locatable) target)); } return moveInTicks(target, 0, 0); }
[ "public", "Actions", "moveToElement", "(", "WebElement", "target", ")", "{", "if", "(", "isBuildingActions", "(", ")", ")", "{", "action", ".", "addAction", "(", "new", "MoveMouseAction", "(", "jsonMouse", ",", "(", "Locatable", ")", "target", ")", ")", ";...
Moves the mouse to the middle of the element. The element is scrolled into view and its location is calculated using getBoundingClientRect. @param target element to move to. @return A self reference.
[ "Moves", "the", "mouse", "to", "the", "middle", "of", "the", "element", ".", "The", "element", "is", "scrolled", "into", "view", "and", "its", "location", "is", "calculated", "using", "getBoundingClientRect", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L358-L364
train
Move the mouse to the specified element.
[ 30522, 2270, 4506, 2693, 3406, 12260, 3672, 1006, 4773, 12260, 3672, 4539, 1007, 1063, 2065, 1006, 2003, 25820, 18908, 8496, 1006, 1007, 1007, 1063, 2895, 1012, 5587, 18908, 3258, 1006, 2047, 2693, 27711, 5243, 7542, 1006, 1046, 3385, 27711...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/remote/HttpSessionId.java
HttpSessionId.getSessionId
public static Optional<String> getSessionId(String uri) { int sessionIndex = uri.indexOf("/session/"); if (sessionIndex != -1) { sessionIndex += "/session/".length(); int nextSlash = uri.indexOf("/", sessionIndex); if (nextSlash != -1) { return Optional.of(uri.substring(sessionIndex, nextSlash)); } return Optional.of(uri.substring(sessionIndex)); } return Optional.empty(); }
java
public static Optional<String> getSessionId(String uri) { int sessionIndex = uri.indexOf("/session/"); if (sessionIndex != -1) { sessionIndex += "/session/".length(); int nextSlash = uri.indexOf("/", sessionIndex); if (nextSlash != -1) { return Optional.of(uri.substring(sessionIndex, nextSlash)); } return Optional.of(uri.substring(sessionIndex)); } return Optional.empty(); }
[ "public", "static", "Optional", "<", "String", ">", "getSessionId", "(", "String", "uri", ")", "{", "int", "sessionIndex", "=", "uri", ".", "indexOf", "(", "\"/session/\"", ")", ";", "if", "(", "sessionIndex", "!=", "-", "1", ")", "{", "sessionIndex", "+...
Scan {@code uri} for a session ID. This is identified by scanning for "{code /session/}" and then extracting the next fragment of the URL. This means that both "{@code /session/foo}" and "{@code /wd/hub/session/foo/bar}" would both identify the session id as being "foo".
[ "Scan", "{" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/HttpSessionId.java#L34-L45
train
Get the session id from the URI
[ 30522, 2270, 10763, 11887, 1026, 5164, 1028, 4152, 7971, 3258, 3593, 1006, 5164, 24471, 2072, 1007, 1063, 20014, 5219, 22254, 10288, 1027, 24471, 2072, 1012, 5950, 11253, 1006, 1000, 1013, 5219, 1013, 1000, 1007, 1025, 2065, 1006, 5219, 222...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.convert
@Deprecated public static void convert(ImageInputStream srcStream, String formatName, ImageOutputStream destStream) { write(read(srcStream), formatName, destStream); }
java
@Deprecated public static void convert(ImageInputStream srcStream, String formatName, ImageOutputStream destStream) { write(read(srcStream), formatName, destStream); }
[ "@", "Deprecated", "public", "static", "void", "convert", "(", "ImageInputStream", "srcStream", ",", "String", "formatName", ",", "ImageOutputStream", "destStream", ")", "{", "write", "(", "read", "(", "srcStream", ")", ",", "formatName", ",", "destStream", ")",...
图像类型转换:GIF=》JPG、GIF=》PNG、PNG=》JPG、PNG=》GIF(X)、BMP=》PNG<br> 此方法并不关闭流 @param srcStream 源图像流 @param formatName 包含格式非正式名称的 String:如JPG、JPEG、GIF等 @param destStream 目标图像输出流 @since 3.0.9 @deprecated 请使用{@link #write(Image, String, ImageOutputStream)}
[ "图像类型转换:GIF", "=", "》JPG、GIF", "=", "》PNG、PNG", "=", "》JPG、PNG", "=", "》GIF", "(", "X", ")", "、BMP", "=", "》PNG<br", ">", "此方法并不关闭流" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L535-L538
train
Convert the image from srcStream to destStream using the specified format name.
[ 30522, 1030, 2139, 28139, 12921, 2270, 10763, 11675, 10463, 1006, 3746, 2378, 18780, 21422, 5034, 6169, 25379, 1010, 5164, 4289, 18442, 1010, 3746, 5833, 18780, 21422, 4078, 3215, 25379, 1007, 1063, 4339, 1006, 3191, 1006, 5034, 6169, 25379, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java
QrCodeUtil.encode
public static BitMatrix encode(String content, QrConfig config) { return encode(content, BarcodeFormat.QR_CODE, config); }
java
public static BitMatrix encode(String content, QrConfig config) { return encode(content, BarcodeFormat.QR_CODE, config); }
[ "public", "static", "BitMatrix", "encode", "(", "String", "content", ",", "QrConfig", "config", ")", "{", "return", "encode", "(", "content", ",", "BarcodeFormat", ".", "QR_CODE", ",", "config", ")", ";", "}" ]
将文本内容编码为二维码 @param content 文本内容 @param config 二维码配置,包括长、宽、边距、颜色等 @return {@link BitMatrix} @since 4.1.2
[ "将文本内容编码为二维码" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java#L221-L223
train
Encodes the given string using the QR code format and returns the encoded BitMatrix.
[ 30522, 2270, 10763, 2978, 18900, 17682, 4372, 16044, 1006, 5164, 4180, 1010, 1053, 29566, 2078, 8873, 2290, 9530, 8873, 2290, 1007, 1063, 2709, 4372, 16044, 1006, 4180, 1010, 3347, 16044, 14192, 4017, 1012, 1053, 2099, 1035, 3642, 1010, 953...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java
TaskSlotTable.createSlotReport
public SlotReport createSlotReport(ResourceID resourceId) { final int numberSlots = taskSlots.size(); List<SlotStatus> slotStatuses = Arrays.asList(new SlotStatus[numberSlots]); for (int i = 0; i < numberSlots; i++) { TaskSlot taskSlot = taskSlots.get(i); SlotID slotId = new SlotID(resourceId, taskSlot.getIndex()); SlotStatus slotStatus = new SlotStatus( slotId, taskSlot.getResourceProfile(), taskSlot.getJobId(), taskSlot.getAllocationId()); slotStatuses.set(i, slotStatus); } final SlotReport slotReport = new SlotReport(slotStatuses); return slotReport; }
java
public SlotReport createSlotReport(ResourceID resourceId) { final int numberSlots = taskSlots.size(); List<SlotStatus> slotStatuses = Arrays.asList(new SlotStatus[numberSlots]); for (int i = 0; i < numberSlots; i++) { TaskSlot taskSlot = taskSlots.get(i); SlotID slotId = new SlotID(resourceId, taskSlot.getIndex()); SlotStatus slotStatus = new SlotStatus( slotId, taskSlot.getResourceProfile(), taskSlot.getJobId(), taskSlot.getAllocationId()); slotStatuses.set(i, slotStatus); } final SlotReport slotReport = new SlotReport(slotStatuses); return slotReport; }
[ "public", "SlotReport", "createSlotReport", "(", "ResourceID", "resourceId", ")", "{", "final", "int", "numberSlots", "=", "taskSlots", ".", "size", "(", ")", ";", "List", "<", "SlotStatus", ">", "slotStatuses", "=", "Arrays", ".", "asList", "(", "new", "Slo...
---------------------------------------------------------------------
[ "---------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L156-L177
train
Creates a slot report.
[ 30522, 2270, 10453, 2890, 6442, 9005, 10994, 2890, 6442, 1006, 7692, 3593, 7692, 3593, 1007, 1063, 2345, 20014, 3616, 10994, 2015, 1027, 8518, 10994, 2015, 1012, 2946, 1006, 1007, 1025, 2862, 1026, 19832, 29336, 2271, 1028, 19832, 29336, 25...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBOperationUtils.java
RocksDBOperationUtils.createColumnFamilyDescriptor
public static ColumnFamilyDescriptor createColumnFamilyDescriptor( RegisteredStateMetaInfoBase metaInfoBase, Function<String, ColumnFamilyOptions> columnFamilyOptionsFactory, @Nullable RocksDbTtlCompactFiltersManager ttlCompactFiltersManager) { ColumnFamilyOptions options = createColumnFamilyOptions(columnFamilyOptionsFactory, metaInfoBase.getName()); if (ttlCompactFiltersManager != null) { ttlCompactFiltersManager.setAndRegisterCompactFilterIfStateTtl(metaInfoBase, options); } byte[] nameBytes = metaInfoBase.getName().getBytes(ConfigConstants.DEFAULT_CHARSET); Preconditions.checkState(!Arrays.equals(RocksDB.DEFAULT_COLUMN_FAMILY, nameBytes), "The chosen state name 'default' collides with the name of the default column family!"); return new ColumnFamilyDescriptor(nameBytes, options); }
java
public static ColumnFamilyDescriptor createColumnFamilyDescriptor( RegisteredStateMetaInfoBase metaInfoBase, Function<String, ColumnFamilyOptions> columnFamilyOptionsFactory, @Nullable RocksDbTtlCompactFiltersManager ttlCompactFiltersManager) { ColumnFamilyOptions options = createColumnFamilyOptions(columnFamilyOptionsFactory, metaInfoBase.getName()); if (ttlCompactFiltersManager != null) { ttlCompactFiltersManager.setAndRegisterCompactFilterIfStateTtl(metaInfoBase, options); } byte[] nameBytes = metaInfoBase.getName().getBytes(ConfigConstants.DEFAULT_CHARSET); Preconditions.checkState(!Arrays.equals(RocksDB.DEFAULT_COLUMN_FAMILY, nameBytes), "The chosen state name 'default' collides with the name of the default column family!"); return new ColumnFamilyDescriptor(nameBytes, options); }
[ "public", "static", "ColumnFamilyDescriptor", "createColumnFamilyDescriptor", "(", "RegisteredStateMetaInfoBase", "metaInfoBase", ",", "Function", "<", "String", ",", "ColumnFamilyOptions", ">", "columnFamilyOptionsFactory", ",", "@", "Nullable", "RocksDbTtlCompactFiltersManager"...
Creates a column descriptor for sate column family. <p>Sets TTL compaction filter if {@code ttlCompactFiltersManager} is not {@code null}.
[ "Creates", "a", "column", "descriptor", "for", "sate", "column", "family", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBOperationUtils.java#L125-L139
train
Creates a column family descriptor for the given state meta info base.
[ 30522, 2270, 10763, 5930, 7011, 4328, 2135, 6155, 23235, 2953, 3443, 30524, 3853, 1026, 5164, 1010, 5930, 7011, 4328, 2135, 7361, 9285, 1028, 5930, 7011, 4328, 2135, 7361, 9285, 21450, 1010, 1030, 19701, 3085, 5749, 18939, 4779, 22499, 8737...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastProperties.java
HazelcastProperties.resolveConfigLocation
public Resource resolveConfigLocation() { if (this.config == null) { return null; } Assert.isTrue(this.config.exists(), () -> "Hazelcast configuration does not " + "exist '" + this.config.getDescription() + "'"); return this.config; }
java
public Resource resolveConfigLocation() { if (this.config == null) { return null; } Assert.isTrue(this.config.exists(), () -> "Hazelcast configuration does not " + "exist '" + this.config.getDescription() + "'"); return this.config; }
[ "public", "Resource", "resolveConfigLocation", "(", ")", "{", "if", "(", "this", ".", "config", "==", "null", ")", "{", "return", "null", ";", "}", "Assert", ".", "isTrue", "(", "this", ".", "config", ".", "exists", "(", ")", ",", "(", ")", "->", "...
Resolve the config location if set. @return the location or {@code null} if it is not set @throws IllegalArgumentException if the config attribute is set to an unknown location
[ "Resolve", "the", "config", "location", "if", "set", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastProperties.java#L51-L58
train
Resolves the configuration location.
[ 30522, 2270, 7692, 10663, 8663, 8873, 23296, 23909, 1006, 1007, 1063, 2065, 1006, 2023, 1012, 9530, 8873, 2290, 1027, 1027, 19701, 1007, 1063, 2709, 19701, 1025, 1065, 20865, 1012, 21541, 6820, 2063, 1006, 2023, 1012, 9530, 8873, 2290, 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/spark
common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
UTF8String.writeToMemory
public void writeToMemory(Object target, long targetOffset) { Platform.copyMemory(base, offset, target, targetOffset, numBytes); }
java
public void writeToMemory(Object target, long targetOffset) { Platform.copyMemory(base, offset, target, targetOffset, numBytes); }
[ "public", "void", "writeToMemory", "(", "Object", "target", ",", "long", "targetOffset", ")", "{", "Platform", ".", "copyMemory", "(", "base", ",", "offset", ",", "target", ",", "targetOffset", ",", "numBytes", ")", ";", "}" ]
Writes the content of this string into a memory address, identified by an object and an offset. The target memory address must already been allocated, and have enough space to hold all the bytes in this string.
[ "Writes", "the", "content", "of", "this", "string", "into", "a", "memory", "address", "identified", "by", "an", "object", "and", "an", "offset", ".", "The", "target", "memory", "address", "must", "already", "been", "allocated", "and", "have", "enough", "spac...
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L170-L172
train
Write the contents of this object to the given target object.
[ 30522, 2270, 11675, 4339, 20389, 6633, 10253, 1006, 4874, 4539, 1010, 2146, 4539, 27475, 3388, 1007, 1063, 4132, 1012, 6100, 4168, 5302, 2854, 1006, 2918, 1010, 16396, 1010, 4539, 1010, 4539, 27475, 3388, 1010, 15903, 17250, 2015, 1007, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-java/src/main/java/org/apache/flink/api/java/DataSet.java
DataSet.writeAsCsv
public DataSink<T> writeAsCsv(String filePath) { return writeAsCsv(filePath, CsvOutputFormat.DEFAULT_LINE_DELIMITER, CsvOutputFormat.DEFAULT_FIELD_DELIMITER); }
java
public DataSink<T> writeAsCsv(String filePath) { return writeAsCsv(filePath, CsvOutputFormat.DEFAULT_LINE_DELIMITER, CsvOutputFormat.DEFAULT_FIELD_DELIMITER); }
[ "public", "DataSink", "<", "T", ">", "writeAsCsv", "(", "String", "filePath", ")", "{", "return", "writeAsCsv", "(", "filePath", ",", "CsvOutputFormat", ".", "DEFAULT_LINE_DELIMITER", ",", "CsvOutputFormat", ".", "DEFAULT_FIELD_DELIMITER", ")", ";", "}" ]
Writes a {@link Tuple} DataSet as CSV file(s) to the specified location. <p><b>Note: Only a Tuple DataSet can written as a CSV file.</b> <p>For each Tuple field the result of {@link Object#toString()} is written. Tuple fields are separated by the default field delimiter {@code "comma" (,)}. <p>Tuples are are separated by the newline character ({@code \n}). @param filePath The path pointing to the location the CSV file is written to. @return The DataSink that writes the DataSet. @see Tuple @see CsvOutputFormat @see DataSet#writeAsText(String) Output files and directories
[ "Writes", "a", "{", "@link", "Tuple", "}", "DataSet", "as", "CSV", "file", "(", "s", ")", "to", "the", "specified", "location", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java#L1564-L1566
train
Write the data sink to a file using CSV.
[ 30522, 2270, 2951, 11493, 2243, 1026, 1056, 1028, 4339, 3022, 6169, 2615, 1006, 5164, 5371, 15069, 1007, 1063, 2709, 4339, 3022, 6169, 2615, 1006, 5371, 15069, 1010, 20116, 6767, 4904, 18780, 14192, 4017, 1012, 12398, 1035, 2240, 1035, 3972...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ExceptionProxy.java
ExceptionProxy.checkAndThrowException
public void checkAndThrowException() throws Exception { Throwable t = exception.get(); if (t != null) { if (t instanceof Exception) { throw (Exception) t; } else if (t instanceof Error) { throw (Error) t; } else { throw new Exception(t); } } }
java
public void checkAndThrowException() throws Exception { Throwable t = exception.get(); if (t != null) { if (t instanceof Exception) { throw (Exception) t; } else if (t instanceof Error) { throw (Error) t; } else { throw new Exception(t); } } }
[ "public", "void", "checkAndThrowException", "(", ")", "throws", "Exception", "{", "Throwable", "t", "=", "exception", ".", "get", "(", ")", ";", "if", "(", "t", "!=", "null", ")", "{", "if", "(", "t", "instanceof", "Exception", ")", "{", "throw", "(", ...
Checks whether an exception has been set via {@link #reportError(Throwable)}. If yes, that exception if re-thrown by this method. @throws Exception This method re-throws the exception, if set.
[ "Checks", "whether", "an", "exception", "has", "been", "set", "via", "{", "@link", "#reportError", "(", "Throwable", ")", "}", ".", "If", "yes", "that", "exception", "if", "re", "-", "thrown", "by", "this", "method", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ExceptionProxy.java#L115-L128
train
Check if the exception is an exception and throw it.
[ 30522, 2270, 11675, 4638, 5685, 2705, 10524, 10288, 24422, 1006, 1007, 11618, 6453, 1063, 5466, 3085, 1056, 1027, 6453, 1012, 2131, 1006, 1007, 1025, 2065, 1006, 1056, 999, 1027, 19701, 1007, 1063, 2065, 1006, 1056, 6013, 11253, 6453, 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...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/MDAG/MDAGNode.java
MDAGNode.reassignOutgoingTransition
public void reassignOutgoingTransition(char letter, MDAGNode oldTargetNode, MDAGNode newTargetNode) { oldTargetNode.incomingTransitionCount--; newTargetNode.incomingTransitionCount++; outgoingTransitionTreeMap.put(letter, newTargetNode); }
java
public void reassignOutgoingTransition(char letter, MDAGNode oldTargetNode, MDAGNode newTargetNode) { oldTargetNode.incomingTransitionCount--; newTargetNode.incomingTransitionCount++; outgoingTransitionTreeMap.put(letter, newTargetNode); }
[ "public", "void", "reassignOutgoingTransition", "(", "char", "letter", ",", "MDAGNode", "oldTargetNode", ",", "MDAGNode", "newTargetNode", ")", "{", "oldTargetNode", ".", "incomingTransitionCount", "--", ";", "newTargetNode", ".", "incomingTransitionCount", "++", ";", ...
重新设置转移状态函数的目标 Reassigns the target node of one of this node's outgoing transitions. @param letter the char which labels the outgoing _transition of interest @param oldTargetNode the MDAGNode that is currently the target of the _transition of interest @param newTargetNode the MDAGNode that is to be the target of the _transition of interest
[ "重新设置转移状态函数的目标", "Reassigns", "the", "target", "node", "of", "one", "of", "this", "node", "s", "outgoing", "transitions", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAGNode.java#L387-L393
train
Reassign an outgoing transition.
[ 30522, 2270, 11675, 2128, 12054, 23773, 5833, 26966, 6494, 3619, 22753, 1006, 25869, 3661, 1010, 9108, 8490, 3630, 3207, 2214, 7559, 18150, 3630, 3207, 1010, 9108, 8490, 3630, 3207, 25597, 2906, 18150, 3630, 3207, 1007, 1063, 2214, 7559, 18...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.put
public V put(K key, V value){ writeLock.lock(); try { cache.put(key, value); } finally { writeLock.unlock(); } return value; }
java
public V put(K key, V value){ writeLock.lock(); try { cache.put(key, value); } finally { writeLock.unlock(); } return value; }
[ "public", "V", "put", "(", "K", "key", ",", "V", "value", ")", "{", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "cache", ".", "put", "(", "key", ",", "value", ")", ";", "}", "finally", "{", "writeLock", ".", "unlock", "(", ")", ";", ...
放入缓存 @param key 键 @param value 值 @return 值
[ "放入缓存" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/SimpleCache.java#L48-L56
train
Associates the specified value with the specified key in the cache. If the mapping already contains a mapping for the key the old value is replaced.
[ 30522, 2270, 1058, 2404, 1006, 1047, 3145, 1010, 1058, 3643, 1007, 1063, 4339, 7878, 1012, 5843, 1006, 1007, 1025, 3046, 1063, 17053, 1012, 2404, 1006, 3145, 1010, 3643, 1007, 1025, 1065, 2633, 1063, 4339, 7878, 1012, 19829, 1006, 1007, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java
CollUtil.sort
public static <T> List<T> sort(Collection<T> collection, Comparator<? super T> comparator) { List<T> list = new ArrayList<T>(collection); Collections.sort(list, comparator); return list; }
java
public static <T> List<T> sort(Collection<T> collection, Comparator<? super T> comparator) { List<T> list = new ArrayList<T>(collection); Collections.sort(list, comparator); return list; }
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "sort", "(", "Collection", "<", "T", ">", "collection", ",", "Comparator", "<", "?", "super", "T", ">", "comparator", ")", "{", "List", "<", "T", ">", "list", "=", "new", "ArrayList", "<", ...
排序集合,排序不会修改原集合 @param <T> 集合元素类型 @param collection 集合 @param comparator 比较器 @return treeSet
[ "排序集合,排序不会修改原集合" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L2083-L2087
train
Creates a list of objects that is sorted using the specified comparator.
[ 30522, 2270, 10763, 1026, 1056, 1028, 2862, 1026, 1056, 1028, 4066, 1006, 3074, 1026, 1056, 1028, 3074, 1010, 4012, 28689, 4263, 1026, 1029, 3565, 1056, 1028, 4012, 28689, 4263, 1007, 1063, 2862, 1026, 1056, 1028, 2862, 1027, 2047, 9140, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/compiler/NFAStateNameHandler.java
NFAStateNameHandler.getOriginalNameFromInternal
public static String getOriginalNameFromInternal(String internalName) { Preconditions.checkNotNull(internalName); return internalName.split(STATE_NAME_DELIM)[0]; }
java
public static String getOriginalNameFromInternal(String internalName) { Preconditions.checkNotNull(internalName); return internalName.split(STATE_NAME_DELIM)[0]; }
[ "public", "static", "String", "getOriginalNameFromInternal", "(", "String", "internalName", ")", "{", "Preconditions", ".", "checkNotNull", "(", "internalName", ")", ";", "return", "internalName", ".", "split", "(", "STATE_NAME_DELIM", ")", "[", "0", "]", ";", "...
Implements the reverse process of the {@link #getUniqueInternalName(String)}. @param internalName The name to be decoded. @return The original, user-specified name for the state.
[ "Implements", "the", "reverse", "process", "of", "the", "{", "@link", "#getUniqueInternalName", "(", "String", ")", "}", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/compiler/NFAStateNameHandler.java#L43-L46
train
Returns the original name of the state from the given internal name.
[ 30522, 2270, 10763, 5164, 2131, 10050, 24965, 18442, 19699, 20936, 10111, 12789, 2140, 1006, 5164, 4722, 18442, 1007, 1063, 3653, 8663, 20562, 2015, 1012, 4638, 17048, 11231, 3363, 1006, 4722, 18442, 1007, 1025, 2709, 4722, 18442, 1012, 3975,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/HttpPostRequestEncoder.java
HttpPostRequestEncoder.addBodyAttribute
public void addBodyAttribute(String name, String value) throws ErrorDataEncoderException { String svalue = value != null? value : StringUtil.EMPTY_STRING; Attribute data = factory.createAttribute(request, checkNotNull(name, "name"), svalue); addBodyHttpData(data); }
java
public void addBodyAttribute(String name, String value) throws ErrorDataEncoderException { String svalue = value != null? value : StringUtil.EMPTY_STRING; Attribute data = factory.createAttribute(request, checkNotNull(name, "name"), svalue); addBodyHttpData(data); }
[ "public", "void", "addBodyAttribute", "(", "String", "name", ",", "String", "value", ")", "throws", "ErrorDataEncoderException", "{", "String", "svalue", "=", "value", "!=", "null", "?", "value", ":", "StringUtil", ".", "EMPTY_STRING", ";", "Attribute", "data", ...
Add a simple attribute in the body as Name=Value @param name name of the parameter @param value the value of the parameter @throws NullPointerException for name @throws ErrorDataEncoderException if the encoding is in error or if the finalize were already done
[ "Add", "a", "simple", "attribute", "in", "the", "body", "as", "Name", "=", "Value" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L338-L342
train
Add a body attribute.
[ 30522, 2270, 11675, 5587, 23684, 19321, 3089, 8569, 2618, 1006, 5164, 2171, 1010, 5164, 3643, 1007, 11618, 7561, 2850, 2696, 2368, 16044, 2890, 2595, 24422, 1063, 5164, 17917, 2389, 5657, 1027, 3643, 999, 1027, 19701, 1029, 3643, 1024, 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.getRandomFilename
public static String getRandomFilename(final String prefix) { final Random rnd = new Random(); final StringBuilder stringBuilder = new StringBuilder(prefix); for (int i = 0; i < RANDOM_FILE_NAME_LENGTH; i++) { stringBuilder.append(ALPHABET[rnd.nextInt(ALPHABET.length)]); } return stringBuilder.toString(); }
java
public static String getRandomFilename(final String prefix) { final Random rnd = new Random(); final StringBuilder stringBuilder = new StringBuilder(prefix); for (int i = 0; i < RANDOM_FILE_NAME_LENGTH; i++) { stringBuilder.append(ALPHABET[rnd.nextInt(ALPHABET.length)]); } return stringBuilder.toString(); }
[ "public", "static", "String", "getRandomFilename", "(", "final", "String", "prefix", ")", "{", "final", "Random", "rnd", "=", "new", "Random", "(", ")", ";", "final", "StringBuilder", "stringBuilder", "=", "new", "StringBuilder", "(", "prefix", ")", ";", "fo...
Constructs a random filename with the given prefix and a random part generated from hex characters. @param prefix the prefix to the filename to be constructed @return the generated random filename with the given prefix
[ "Constructs", "a", "random", "filename", "with", "the", "given", "prefix", "and", "a", "random", "part", "generated", "from", "hex", "characters", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/FileUtils.java#L90-L99
train
Get a random filename.
[ 30522, 2270, 10763, 5164, 2131, 13033, 5358, 8873, 20844, 4168, 1006, 2345, 5164, 17576, 1007, 1063, 2345, 6721, 29300, 2094, 1027, 2047, 6721, 1006, 1007, 1025, 2345, 5164, 8569, 23891, 2099, 5164, 8569, 23891, 2099, 1027, 2047, 5164, 8569...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/io/IOUtil.java
IOUtil.saveObjectTo
public static boolean saveObjectTo(Object o, String path) { try { ObjectOutputStream oos = new ObjectOutputStream(IOUtil.newOutputStream(path)); oos.writeObject(o); oos.close(); } catch (IOException e) { logger.warning("在保存对象" + o + "到" + path + "时发生异常" + e); return false; } return true; }
java
public static boolean saveObjectTo(Object o, String path) { try { ObjectOutputStream oos = new ObjectOutputStream(IOUtil.newOutputStream(path)); oos.writeObject(o); oos.close(); } catch (IOException e) { logger.warning("在保存对象" + o + "到" + path + "时发生异常" + e); return false; } return true; }
[ "public", "static", "boolean", "saveObjectTo", "(", "Object", "o", ",", "String", "path", ")", "{", "try", "{", "ObjectOutputStream", "oos", "=", "new", "ObjectOutputStream", "(", "IOUtil", ".", "newOutputStream", "(", "path", ")", ")", ";", "oos", ".", "w...
序列化对象 @param o @param path @return
[ "序列化对象" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/io/IOUtil.java#L43-L58
train
Save object to a file
[ 30522, 2270, 10763, 22017, 20898, 3828, 16429, 20614, 3406, 1006, 4874, 1051, 1010, 5164, 4130, 1007, 1063, 3046, 1063, 4874, 5833, 18780, 21422, 1051, 2891, 1027, 2047, 4874, 5833, 18780, 21422, 1006, 22834, 21823, 2140, 1012, 2047, 5833, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/registration/RetryingRegistration.java
RetryingRegistration.register
@SuppressWarnings("unchecked") private void register(final G gateway, final int attempt, final long timeoutMillis) { // eager check for canceling to avoid some unnecessary work if (canceled) { return; } try { log.info("Registration at {} attempt {} (timeout={}ms)", targetName, attempt, timeoutMillis); CompletableFuture<RegistrationResponse> registrationFuture = invokeRegistration(gateway, fencingToken, timeoutMillis); // if the registration was successful, let the TaskExecutor know CompletableFuture<Void> registrationAcceptFuture = registrationFuture.thenAcceptAsync( (RegistrationResponse result) -> { if (!isCanceled()) { if (result instanceof RegistrationResponse.Success) { // registration successful! S success = (S) result; completionFuture.complete(Tuple2.of(gateway, success)); } else { // registration refused or unknown if (result instanceof RegistrationResponse.Decline) { RegistrationResponse.Decline decline = (RegistrationResponse.Decline) result; log.info("Registration at {} was declined: {}", targetName, decline.getReason()); } else { log.error("Received unknown response to registration attempt: {}", result); } log.info("Pausing and re-attempting registration in {} ms", retryingRegistrationConfiguration.getRefusedDelayMillis()); registerLater(gateway, 1, retryingRegistrationConfiguration.getInitialRegistrationTimeoutMillis(), retryingRegistrationConfiguration.getRefusedDelayMillis()); } } }, rpcService.getExecutor()); // upon failure, retry registrationAcceptFuture.whenCompleteAsync( (Void v, Throwable failure) -> { if (failure != null && !isCanceled()) { if (ExceptionUtils.stripCompletionException(failure) instanceof TimeoutException) { // we simply have not received a response in time. maybe the timeout was // very low (initial fast registration attempts), maybe the target endpoint is // currently down. if (log.isDebugEnabled()) { log.debug("Registration at {} ({}) attempt {} timed out after {} ms", targetName, targetAddress, attempt, timeoutMillis); } long newTimeoutMillis = Math.min(2 * timeoutMillis, retryingRegistrationConfiguration.getMaxRegistrationTimeoutMillis()); register(gateway, attempt + 1, newTimeoutMillis); } else { // a serious failure occurred. we still should not give up, but keep trying log.error("Registration at {} failed due to an error", targetName, failure); log.info("Pausing and re-attempting registration in {} ms", retryingRegistrationConfiguration.getErrorDelayMillis()); registerLater(gateway, 1, retryingRegistrationConfiguration.getInitialRegistrationTimeoutMillis(), retryingRegistrationConfiguration.getErrorDelayMillis()); } } }, rpcService.getExecutor()); } catch (Throwable t) { completionFuture.completeExceptionally(t); cancel(); } }
java
@SuppressWarnings("unchecked") private void register(final G gateway, final int attempt, final long timeoutMillis) { // eager check for canceling to avoid some unnecessary work if (canceled) { return; } try { log.info("Registration at {} attempt {} (timeout={}ms)", targetName, attempt, timeoutMillis); CompletableFuture<RegistrationResponse> registrationFuture = invokeRegistration(gateway, fencingToken, timeoutMillis); // if the registration was successful, let the TaskExecutor know CompletableFuture<Void> registrationAcceptFuture = registrationFuture.thenAcceptAsync( (RegistrationResponse result) -> { if (!isCanceled()) { if (result instanceof RegistrationResponse.Success) { // registration successful! S success = (S) result; completionFuture.complete(Tuple2.of(gateway, success)); } else { // registration refused or unknown if (result instanceof RegistrationResponse.Decline) { RegistrationResponse.Decline decline = (RegistrationResponse.Decline) result; log.info("Registration at {} was declined: {}", targetName, decline.getReason()); } else { log.error("Received unknown response to registration attempt: {}", result); } log.info("Pausing and re-attempting registration in {} ms", retryingRegistrationConfiguration.getRefusedDelayMillis()); registerLater(gateway, 1, retryingRegistrationConfiguration.getInitialRegistrationTimeoutMillis(), retryingRegistrationConfiguration.getRefusedDelayMillis()); } } }, rpcService.getExecutor()); // upon failure, retry registrationAcceptFuture.whenCompleteAsync( (Void v, Throwable failure) -> { if (failure != null && !isCanceled()) { if (ExceptionUtils.stripCompletionException(failure) instanceof TimeoutException) { // we simply have not received a response in time. maybe the timeout was // very low (initial fast registration attempts), maybe the target endpoint is // currently down. if (log.isDebugEnabled()) { log.debug("Registration at {} ({}) attempt {} timed out after {} ms", targetName, targetAddress, attempt, timeoutMillis); } long newTimeoutMillis = Math.min(2 * timeoutMillis, retryingRegistrationConfiguration.getMaxRegistrationTimeoutMillis()); register(gateway, attempt + 1, newTimeoutMillis); } else { // a serious failure occurred. we still should not give up, but keep trying log.error("Registration at {} failed due to an error", targetName, failure); log.info("Pausing and re-attempting registration in {} ms", retryingRegistrationConfiguration.getErrorDelayMillis()); registerLater(gateway, 1, retryingRegistrationConfiguration.getInitialRegistrationTimeoutMillis(), retryingRegistrationConfiguration.getErrorDelayMillis()); } } }, rpcService.getExecutor()); } catch (Throwable t) { completionFuture.completeExceptionally(t); cancel(); } }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "void", "register", "(", "final", "G", "gateway", ",", "final", "int", "attempt", ",", "final", "long", "timeoutMillis", ")", "{", "// eager check for canceling to avoid some unnecessary work", "if", "(", ...
This method performs a registration attempt and triggers either a success notification or a retry, depending on the result.
[ "This", "method", "performs", "a", "registration", "attempt", "and", "triggers", "either", "a", "success", "notification", "or", "a", "retry", "depending", "on", "the", "result", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/registration/RetryingRegistration.java#L196-L263
train
Register with the Gateway.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 2797, 11675, 4236, 1006, 2345, 1043, 11909, 1010, 2345, 20014, 3535, 1010, 2345, 2146, 2051, 5833, 19912, 2483, 1007, 1063, 1013, 1013, 9461, 4638, 2005, 17542...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/api/java/tuple/Tuple6.java
Tuple6.of
public static <T0, T1, T2, T3, T4, T5> Tuple6<T0, T1, T2, T3, T4, T5> of(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5) { return new Tuple6<>(value0, value1, value2, value3, value4, value5); }
java
public static <T0, T1, T2, T3, T4, T5> Tuple6<T0, T1, T2, T3, T4, T5> of(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5) { return new Tuple6<>(value0, value1, value2, value3, value4, value5); }
[ "public", "static", "<", "T0", ",", "T1", ",", "T2", ",", "T3", ",", "T4", ",", "T5", ">", "Tuple6", "<", "T0", ",", "T1", ",", "T2", ",", "T3", ",", "T4", ",", "T5", ">", "of", "(", "T0", "value0", ",", "T1", "value1", ",", "T2", "value2",...
Creates a new tuple and assigns the given values to the tuple's fields. This is more convenient than using the constructor, because the compiler can infer the generic type arguments implicitly. For example: {@code Tuple3.of(n, x, s)} instead of {@code new Tuple3<Integer, Double, String>(n, x, s)}
[ "Creates", "a", "new", "tuple", "and", "assigns", "the", "given", "values", "to", "the", "tuple", "s", "fields", ".", "This", "is", "more", "convenient", "than", "using", "the", "constructor", "because", "the", "compiler", "can", "infer", "the", "generic", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/tuple/Tuple6.java#L251-L258
train
Construct a tuple with the specified values.
[ 30522, 2270, 10763, 1026, 1056, 2692, 1010, 1056, 2487, 1010, 1056, 2475, 1010, 1056, 2509, 1010, 1056, 2549, 1010, 1056, 2629, 1028, 10722, 10814, 2575, 1026, 1056, 2692, 1010, 1056, 2487, 1010, 1056, 2475, 1010, 1056, 2509, 1010, 1056, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/connection/BackendConnection.java
BackendConnection.setTransactionType
public void setTransactionType(final TransactionType transactionType) { if (null == schemaName) { throw new ShardingException("Please select database, then switch transaction type."); } if (isSwitchFailed()) { throw new ShardingException("Failed to switch transaction type, please terminate current transaction."); } this.transactionType = transactionType; }
java
public void setTransactionType(final TransactionType transactionType) { if (null == schemaName) { throw new ShardingException("Please select database, then switch transaction type."); } if (isSwitchFailed()) { throw new ShardingException("Failed to switch transaction type, please terminate current transaction."); } this.transactionType = transactionType; }
[ "public", "void", "setTransactionType", "(", "final", "TransactionType", "transactionType", ")", "{", "if", "(", "null", "==", "schemaName", ")", "{", "throw", "new", "ShardingException", "(", "\"Please select database, then switch transaction type.\"", ")", ";", "}", ...
Change transaction type of current channel. @param transactionType transaction type
[ "Change", "transaction", "type", "of", "current", "channel", "." ]
f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/connection/BackendConnection.java#L90-L98
train
Sets the transaction type.
[ 30522, 2270, 11675, 2275, 6494, 30524, 1063, 2065, 1006, 19701, 1027, 1027, 8040, 28433, 18442, 1007, 1063, 5466, 2047, 21146, 17080, 15465, 2595, 24422, 1006, 1000, 3531, 7276, 7809, 1010, 2059, 6942, 12598, 2828, 1012, 1000, 1007, 1025, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-connectors/flink-hcatalog/src/main/java/org/apache/flink/hcatalog/HCatInputFormatBase.java
HCatInputFormatBase.asFlinkTuples
public HCatInputFormatBase<T> asFlinkTuples() throws HCatException { // build type information int numFields = outputSchema.getFields().size(); if (numFields > this.getMaxFlinkTupleSize()) { throw new IllegalArgumentException("Only up to " + this.getMaxFlinkTupleSize() + " fields can be returned as Flink tuples."); } TypeInformation[] fieldTypes = new TypeInformation[numFields]; fieldNames = new String[numFields]; for (String fieldName : outputSchema.getFieldNames()) { HCatFieldSchema field = outputSchema.get(fieldName); int fieldPos = outputSchema.getPosition(fieldName); TypeInformation fieldType = getFieldType(field); fieldTypes[fieldPos] = fieldType; fieldNames[fieldPos] = fieldName; } this.resultType = new TupleTypeInfo(fieldTypes); return this; }
java
public HCatInputFormatBase<T> asFlinkTuples() throws HCatException { // build type information int numFields = outputSchema.getFields().size(); if (numFields > this.getMaxFlinkTupleSize()) { throw new IllegalArgumentException("Only up to " + this.getMaxFlinkTupleSize() + " fields can be returned as Flink tuples."); } TypeInformation[] fieldTypes = new TypeInformation[numFields]; fieldNames = new String[numFields]; for (String fieldName : outputSchema.getFieldNames()) { HCatFieldSchema field = outputSchema.get(fieldName); int fieldPos = outputSchema.getPosition(fieldName); TypeInformation fieldType = getFieldType(field); fieldTypes[fieldPos] = fieldType; fieldNames[fieldPos] = fieldName; } this.resultType = new TupleTypeInfo(fieldTypes); return this; }
[ "public", "HCatInputFormatBase", "<", "T", ">", "asFlinkTuples", "(", ")", "throws", "HCatException", "{", "// build type information", "int", "numFields", "=", "outputSchema", ".", "getFields", "(", ")", ".", "size", "(", ")", ";", "if", "(", "numFields", ">"...
Specifies that the InputFormat returns Flink tuples instead of {@link org.apache.hive.hcatalog.data.HCatRecord}. <p>Note: Flink tuples might only support a limited number of fields (depending on the API). @return This InputFormat. @throws org.apache.hive.hcatalog.common.HCatException
[ "Specifies", "that", "the", "InputFormat", "returns", "Flink", "tuples", "instead", "of", "{", "@link", "org", ".", "apache", ".", "hive", ".", "hcatalog", ".", "data", ".", "HCatRecord", "}", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hcatalog/src/main/java/org/apache/flink/hcatalog/HCatInputFormatBase.java#L175-L199
train
Returns the output as Flink tuples.
[ 30522, 2270, 16731, 20363, 18780, 14192, 4017, 15058, 1026, 1056, 1028, 2004, 10258, 19839, 8525, 21112, 1006, 1007, 11618, 16731, 3686, 2595, 24422, 1063, 1013, 1013, 3857, 2828, 2592, 20014, 16371, 2213, 15155, 1027, 27852, 5403, 2863, 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...
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
SpringApplication.run
public static ConfigurableApplicationContext run(Class<?>[] primarySources, String[] args) { return new SpringApplication(primarySources).run(args); }
java
public static ConfigurableApplicationContext run(Class<?>[] primarySources, String[] args) { return new SpringApplication(primarySources).run(args); }
[ "public", "static", "ConfigurableApplicationContext", "run", "(", "Class", "<", "?", ">", "[", "]", "primarySources", ",", "String", "[", "]", "args", ")", "{", "return", "new", "SpringApplication", "(", "primarySources", ")", ".", "run", "(", "args", ")", ...
Static helper that can be used to run a {@link SpringApplication} from the specified sources using default settings and user supplied arguments. @param primarySources the primary sources to load @param args the application arguments (usually passed from a Java main method) @return the running {@link ApplicationContext}
[ "Static", "helper", "that", "can", "be", "used", "to", "run", "a", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java#L1273-L1276
train
Run application with given primary sources and command line arguments.
[ 30522, 2270, 10763, 9530, 8873, 27390, 3085, 29098, 19341, 3508, 8663, 18209, 2448, 1006, 2465, 1026, 1029, 1028, 1031, 1033, 3078, 6499, 3126, 9623, 1010, 5164, 1031, 1033, 12098, 5620, 1007, 1063, 2709, 2047, 3500, 29098, 19341, 3508, 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-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java
AllWindowedStream.aggregate
@PublicEvolving public <ACC, V, R> SingleOutputStreamOperator<R> aggregate( AggregateFunction<T, ACC, V> aggFunction, ProcessAllWindowFunction<V, R, W> windowFunction) { checkNotNull(aggFunction, "aggFunction"); checkNotNull(windowFunction, "windowFunction"); TypeInformation<ACC> accumulatorType = TypeExtractor.getAggregateFunctionAccumulatorType( aggFunction, input.getType(), null, false); TypeInformation<V> aggResultType = TypeExtractor.getAggregateFunctionReturnType( aggFunction, input.getType(), null, false); TypeInformation<R> resultType = getProcessAllWindowFunctionReturnType(windowFunction, aggResultType); return aggregate(aggFunction, windowFunction, accumulatorType, aggResultType, resultType); }
java
@PublicEvolving public <ACC, V, R> SingleOutputStreamOperator<R> aggregate( AggregateFunction<T, ACC, V> aggFunction, ProcessAllWindowFunction<V, R, W> windowFunction) { checkNotNull(aggFunction, "aggFunction"); checkNotNull(windowFunction, "windowFunction"); TypeInformation<ACC> accumulatorType = TypeExtractor.getAggregateFunctionAccumulatorType( aggFunction, input.getType(), null, false); TypeInformation<V> aggResultType = TypeExtractor.getAggregateFunctionReturnType( aggFunction, input.getType(), null, false); TypeInformation<R> resultType = getProcessAllWindowFunctionReturnType(windowFunction, aggResultType); return aggregate(aggFunction, windowFunction, accumulatorType, aggResultType, resultType); }
[ "@", "PublicEvolving", "public", "<", "ACC", ",", "V", ",", "R", ">", "SingleOutputStreamOperator", "<", "R", ">", "aggregate", "(", "AggregateFunction", "<", "T", ",", "ACC", ",", "V", ">", "aggFunction", ",", "ProcessAllWindowFunction", "<", "V", ",", "R...
Applies the given window function to each window. The window function is called for each evaluation of the window for each key individually. The output of the window function is interpreted as a regular non-windowed stream. <p>Arriving data is incrementally aggregated using the given aggregate function. This means that the window function typically has only a single value to process when called. @param aggFunction The aggregate function that is used for incremental aggregation. @param windowFunction The process window function. @return The data stream that is the result of applying the window function to the window. @param <ACC> The type of the AggregateFunction's accumulator @param <V> The type of AggregateFunction's result, and the WindowFunction's input @param <R> The type of the elements in the resulting stream, equal to the WindowFunction's result type
[ "Applies", "the", "given", "window", "function", "to", "each", "window", ".", "The", "window", "function", "is", "called", "for", "each", "evaluation", "of", "the", "window", "for", "each", "key", "individually", ".", "The", "output", "of", "the", "window", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java#L657-L674
train
Returns a new DataSet aggregation using the specified aggregate function and process all window functions.
[ 30522, 1030, 2270, 6777, 4747, 6455, 2270, 1026, 16222, 1010, 1058, 1010, 1054, 1028, 2309, 5833, 18780, 21422, 25918, 8844, 1026, 1054, 1028, 9572, 1006, 9572, 11263, 27989, 1026, 1056, 1010, 16222, 1010, 1058, 1028, 12943, 25708, 4609, 75...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/recognition/nr/TranslatedPersonRecognition.java
TranslatedPersonRecognition.recognition
public static void recognition(List<Vertex> segResult, WordNet wordNetOptimum, WordNet wordNetAll) { StringBuilder sbName = new StringBuilder(); int appendTimes = 0; ListIterator<Vertex> listIterator = segResult.listIterator(); listIterator.next(); int line = 1; int activeLine = 1; while (listIterator.hasNext()) { Vertex vertex = listIterator.next(); if (appendTimes > 0) { if (vertex.guessNature() == Nature.nrf || TranslatedPersonDictionary.containsKey(vertex.realWord)) { sbName.append(vertex.realWord); ++appendTimes; } else { // 识别结束 if (appendTimes > 1) { if (HanLP.Config.DEBUG) { System.out.println("音译人名识别出:" + sbName.toString()); } wordNetOptimum.insert(activeLine, new Vertex(Predefine.TAG_PEOPLE, sbName.toString(), new CoreDictionary.Attribute(Nature.nrf), WORD_ID), wordNetAll); } sbName.setLength(0); appendTimes = 0; } } else { // nrf触发识别 if (vertex.guessNature() == Nature.nrf // || TranslatedPersonDictionary.containsKey(vertex.realWord) ) { sbName.append(vertex.realWord); ++appendTimes; activeLine = line; } } line += vertex.realWord.length(); } }
java
public static void recognition(List<Vertex> segResult, WordNet wordNetOptimum, WordNet wordNetAll) { StringBuilder sbName = new StringBuilder(); int appendTimes = 0; ListIterator<Vertex> listIterator = segResult.listIterator(); listIterator.next(); int line = 1; int activeLine = 1; while (listIterator.hasNext()) { Vertex vertex = listIterator.next(); if (appendTimes > 0) { if (vertex.guessNature() == Nature.nrf || TranslatedPersonDictionary.containsKey(vertex.realWord)) { sbName.append(vertex.realWord); ++appendTimes; } else { // 识别结束 if (appendTimes > 1) { if (HanLP.Config.DEBUG) { System.out.println("音译人名识别出:" + sbName.toString()); } wordNetOptimum.insert(activeLine, new Vertex(Predefine.TAG_PEOPLE, sbName.toString(), new CoreDictionary.Attribute(Nature.nrf), WORD_ID), wordNetAll); } sbName.setLength(0); appendTimes = 0; } } else { // nrf触发识别 if (vertex.guessNature() == Nature.nrf // || TranslatedPersonDictionary.containsKey(vertex.realWord) ) { sbName.append(vertex.realWord); ++appendTimes; activeLine = line; } } line += vertex.realWord.length(); } }
[ "public", "static", "void", "recognition", "(", "List", "<", "Vertex", ">", "segResult", ",", "WordNet", "wordNetOptimum", ",", "WordNet", "wordNetAll", ")", "{", "StringBuilder", "sbName", "=", "new", "StringBuilder", "(", ")", ";", "int", "appendTimes", "=",...
执行识别 @param segResult 粗分结果 @param wordNetOptimum 粗分结果对应的词图 @param wordNetAll 全词图
[ "执行识别" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/recognition/nr/TranslatedPersonRecognition.java#L39-L87
train
Recognition method.
[ 30522, 2270, 10763, 11675, 5038, 1006, 2862, 1026, 19449, 1028, 7367, 17603, 23722, 2102, 1010, 2773, 7159, 2773, 7159, 7361, 3775, 27147, 1010, 2773, 7159, 2773, 7159, 8095, 1007, 1063, 5164, 8569, 23891, 2099, 24829, 18442, 1027, 2047, 51...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.getFloat
public float getFloat(String key) { addToDefaults(key, null); String value = getRequired(key); return Float.valueOf(value); }
java
public float getFloat(String key) { addToDefaults(key, null); String value = getRequired(key); return Float.valueOf(value); }
[ "public", "float", "getFloat", "(", "String", "key", ")", "{", "addToDefaults", "(", "key", ",", "null", ")", ";", "String", "value", "=", "getRequired", "(", "key", ")", ";", "return", "Float", ".", "valueOf", "(", "value", ")", ";", "}" ]
Returns the Float value for the given key. The method fails if the key does not exist.
[ "Returns", "the", "Float", "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#L335-L339
train
Returns the float value for the given key. If the key does not exist it will be created and returned.
[ 30522, 2270, 14257, 2131, 10258, 16503, 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, 14257, 1012, 3643, 1125...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
common/src/main/java/io/netty/util/internal/logging/MessageFormatter.java
MessageFormatter.format
static FormattingTuple format(final String messagePattern, Object argA, Object argB) { return arrayFormat(messagePattern, new Object[]{argA, argB}); }
java
static FormattingTuple format(final String messagePattern, Object argA, Object argB) { return arrayFormat(messagePattern, new Object[]{argA, argB}); }
[ "static", "FormattingTuple", "format", "(", "final", "String", "messagePattern", ",", "Object", "argA", ",", "Object", "argB", ")", "{", "return", "arrayFormat", "(", "messagePattern", ",", "new", "Object", "[", "]", "{", "argA", ",", "argB", "}", ")", ";"...
Performs a two argument substitution for the 'messagePattern' passed as parameter. <p/> For example, <p/> <pre> MessageFormatter.format(&quot;Hi {}. My name is {}.&quot;, &quot;Alice&quot;, &quot;Bob&quot;); </pre> <p/> will return the string "Hi Alice. My name is Bob.". @param messagePattern The message pattern which will be parsed and formatted @param argA The argument to be substituted in place of the first formatting anchor @param argB The argument to be substituted in place of the second formatting anchor @return The formatted message
[ "Performs", "a", "two", "argument", "substitution", "for", "the", "messagePattern", "passed", "as", "parameter", ".", "<p", "/", ">", "For", "example", "<p", "/", ">", "<pre", ">", "MessageFormatter", ".", "format", "(", "&quot", ";", "Hi", "{}", ".", "M...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/logging/MessageFormatter.java#L155-L158
train
Format the message pattern with the given arguments.
[ 30522, 10763, 4289, 3436, 8525, 10814, 4289, 1006, 2345, 5164, 4471, 4502, 12079, 2078, 1010, 4874, 12098, 3654, 1010, 4874, 12098, 18259, 1007, 1063, 2709, 9140, 14192, 4017, 1006, 4471, 4502, 12079, 2078, 1010, 2047, 4874, 1031, 1033, 106...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/types/Record.java
Record.getFieldInto
public boolean getFieldInto(int fieldNum, Value target) { // range check if (fieldNum < 0 || fieldNum >= this.numFields) { throw new IndexOutOfBoundsException(); } // get offset and check for null int offset = this.offsets[fieldNum]; if (offset == NULL_INDICATOR_OFFSET) { return false; } else if (offset == MODIFIED_INDICATOR_OFFSET) { // value that has been set is new or modified // bring the binary in sync so that the deserialization gives the correct result updateBinaryRepresenation(); offset = this.offsets[fieldNum]; } final int limit = offset + this.lengths[fieldNum]; deserialize(target, offset, limit, fieldNum); return true; }
java
public boolean getFieldInto(int fieldNum, Value target) { // range check if (fieldNum < 0 || fieldNum >= this.numFields) { throw new IndexOutOfBoundsException(); } // get offset and check for null int offset = this.offsets[fieldNum]; if (offset == NULL_INDICATOR_OFFSET) { return false; } else if (offset == MODIFIED_INDICATOR_OFFSET) { // value that has been set is new or modified // bring the binary in sync so that the deserialization gives the correct result updateBinaryRepresenation(); offset = this.offsets[fieldNum]; } final int limit = offset + this.lengths[fieldNum]; deserialize(target, offset, limit, fieldNum); return true; }
[ "public", "boolean", "getFieldInto", "(", "int", "fieldNum", ",", "Value", "target", ")", "{", "// range check", "if", "(", "fieldNum", "<", "0", "||", "fieldNum", ">=", "this", ".", "numFields", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", ")...
Gets the field at the given position. If the field at that position is null, then this method leaves the target field unchanged and returns false. @param fieldNum The position of the field. @param target The value to deserialize the field into. @return True, if the field was deserialized properly, false, if the field was null.
[ "Gets", "the", "field", "at", "the", "given", "position", ".", "If", "the", "field", "at", "that", "position", "is", "null", "then", "this", "method", "leaves", "the", "target", "field", "unchanged", "and", "returns", "false", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/Record.java#L303-L324
train
Gets the value of the specified field in the given target object.
[ 30522, 2270, 22017, 20898, 2131, 3790, 18447, 2080, 1006, 20014, 2492, 19172, 1010, 3643, 4539, 1007, 1063, 1013, 1013, 2846, 4638, 2065, 1006, 2492, 19172, 1026, 1014, 1064, 1064, 2492, 19172, 1028, 1027, 2023, 1012, 16371, 2213, 15155, 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/suggest/scorer/pinyin/PinyinKey.java
PinyinKey.size
public int size() { int length = 0; for (Pinyin pinyin : pinyinArray) { if (pinyin != Pinyin.none5) ++length; } return length; }
java
public int size() { int length = 0; for (Pinyin pinyin : pinyinArray) { if (pinyin != Pinyin.none5) ++length; } return length; }
[ "public", "int", "size", "(", ")", "{", "int", "length", "=", "0", ";", "for", "(", "Pinyin", "pinyin", ":", "pinyinArray", ")", "{", "if", "(", "pinyin", "!=", "Pinyin", ".", "none5", ")", "++", "length", ";", "}", "return", "length", ";", "}" ]
拼音的个数 @return
[ "拼音的个数" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/suggest/scorer/pinyin/PinyinKey.java#L120-L129
train
Get the size of the array of CID .
[ 30522, 2270, 20014, 2946, 1006, 1007, 1063, 20014, 3091, 1027, 1014, 1025, 2005, 1006, 9973, 9973, 1024, 9973, 2906, 9447, 1007, 1063, 2065, 1006, 9973, 999, 1027, 9973, 1012, 3904, 2629, 1007, 1009, 1009, 3091, 1025, 1065, 2709, 3091, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java
SegmentsUtil.setFloat
public static void setFloat(MemorySegment[] segments, int offset, float value) { if (inFirstSegment(segments, offset, 4)) { segments[0].putFloat(offset, value); } else { setFloatMultiSegments(segments, offset, value); } }
java
public static void setFloat(MemorySegment[] segments, int offset, float value) { if (inFirstSegment(segments, offset, 4)) { segments[0].putFloat(offset, value); } else { setFloatMultiSegments(segments, offset, value); } }
[ "public", "static", "void", "setFloat", "(", "MemorySegment", "[", "]", "segments", ",", "int", "offset", ",", "float", "value", ")", "{", "if", "(", "inFirstSegment", "(", "segments", ",", "offset", ",", "4", ")", ")", "{", "segments", "[", "0", "]", ...
set float from segments. @param segments target segments. @param offset value offset.
[ "set", "float", "from", "segments", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L878-L884
train
set float from segments.
[ 30522, 2270, 10763, 11675, 2275, 10258, 16503, 1006, 3638, 3366, 21693, 4765, 1031, 1033, 9214, 1010, 20014, 16396, 1010, 14257, 3643, 1007, 1063, 2065, 1006, 1999, 8873, 12096, 3366, 21693, 4765, 1006, 9214, 1010, 16396, 1010, 1018, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java
ByteToMessageDecoder.fireChannelRead
static void fireChannelRead(ChannelHandlerContext ctx, CodecOutputList msgs, int numElements) { for (int i = 0; i < numElements; i ++) { ctx.fireChannelRead(msgs.getUnsafe(i)); } }
java
static void fireChannelRead(ChannelHandlerContext ctx, CodecOutputList msgs, int numElements) { for (int i = 0; i < numElements; i ++) { ctx.fireChannelRead(msgs.getUnsafe(i)); } }
[ "static", "void", "fireChannelRead", "(", "ChannelHandlerContext", "ctx", ",", "CodecOutputList", "msgs", ",", "int", "numElements", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numElements", ";", "i", "++", ")", "{", "ctx", ".", "fireChan...
Get {@code numElements} out of the {@link CodecOutputList} and forward these through the pipeline.
[ "Get", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java#L321-L325
train
Fire channel read events.
[ 30522, 10763, 11675, 2543, 26058, 16416, 2094, 1006, 3149, 11774, 3917, 8663, 18209, 14931, 2595, 1010, 3642, 3597, 4904, 18780, 9863, 5796, 5620, 1010, 20014, 16371, 10199, 13665, 2015, 1007, 1063, 2005, 1006, 20014, 1045, 1027, 1014, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryString.java
BinaryString.indexOf
public int indexOf(BinaryString subStr, int start) { ensureMaterialized(); subStr.ensureMaterialized(); if (subStr.sizeInBytes == 0) { return 0; } if (inFirstSegment()) { // position in byte int byteIdx = 0; // position is char int charIdx = 0; while (byteIdx < sizeInBytes && charIdx < start) { byteIdx += numBytesForFirstByte(getByteOneSegment(byteIdx)); charIdx++; } do { if (byteIdx + subStr.sizeInBytes > sizeInBytes) { return -1; } if (SegmentsUtil.equals(segments, offset + byteIdx, subStr.segments, subStr.offset, subStr.sizeInBytes)) { return charIdx; } byteIdx += numBytesForFirstByte(getByteOneSegment(byteIdx)); charIdx++; } while (byteIdx < sizeInBytes); return -1; } else { return indexOfSlow(subStr, start); } }
java
public int indexOf(BinaryString subStr, int start) { ensureMaterialized(); subStr.ensureMaterialized(); if (subStr.sizeInBytes == 0) { return 0; } if (inFirstSegment()) { // position in byte int byteIdx = 0; // position is char int charIdx = 0; while (byteIdx < sizeInBytes && charIdx < start) { byteIdx += numBytesForFirstByte(getByteOneSegment(byteIdx)); charIdx++; } do { if (byteIdx + subStr.sizeInBytes > sizeInBytes) { return -1; } if (SegmentsUtil.equals(segments, offset + byteIdx, subStr.segments, subStr.offset, subStr.sizeInBytes)) { return charIdx; } byteIdx += numBytesForFirstByte(getByteOneSegment(byteIdx)); charIdx++; } while (byteIdx < sizeInBytes); return -1; } else { return indexOfSlow(subStr, start); } }
[ "public", "int", "indexOf", "(", "BinaryString", "subStr", ",", "int", "start", ")", "{", "ensureMaterialized", "(", ")", ";", "subStr", ".", "ensureMaterialized", "(", ")", ";", "if", "(", "subStr", ".", "sizeInBytes", "==", "0", ")", "{", "return", "0"...
Returns the position of the first occurence of substr in current string starting from given position. @param subStr subStr to be searched @param start start position @return the position of the first occurence of substring. Return -1 if not found.
[ "Returns", "the", "position", "of", "the", "first", "occurence", "of", "substr", "in", "current", "string", "starting", "from", "given", "position", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryString.java#L1045-L1076
train
Returns the index of the first occurrence of the specified substring in this string.
[ 30522, 2270, 20014, 5950, 11253, 1006, 12441, 3367, 4892, 4942, 3367, 2099, 1010, 20014, 2707, 1007, 1063, 5676, 8585, 14482, 3550, 1006, 1007, 1025, 4942, 3367, 2099, 1012, 5676, 8585, 14482, 3550, 1006, 1007, 1025, 2065, 1006, 4942, 3367,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.setOrAppend
public static Object setOrAppend(Object array, int index, Object value) { if(index < length(array)) { Array.set(array, index, value); return array; }else { return append(array, value); } }
java
public static Object setOrAppend(Object array, int index, Object value) { if(index < length(array)) { Array.set(array, index, value); return array; }else { return append(array, value); } }
[ "public", "static", "Object", "setOrAppend", "(", "Object", "array", ",", "int", "index", ",", "Object", "value", ")", "{", "if", "(", "index", "<", "length", "(", "array", ")", ")", "{", "Array", ".", "set", "(", "array", ",", "index", ",", "value",...
将元素值设置为数组的某个位置,当给定的index大于数组长度,则追加 @param array 已有数组 @param index 位置,大于长度追加,否则替换 @param value 新值 @return 新数组或原有数组 @since 4.1.2
[ "将元素值设置为数组的某个位置,当给定的index大于数组长度,则追加" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L435-L442
train
Sets the value of the specified index in the array or appends the value to the end of the array.
[ 30522, 2270, 10763, 4874, 2275, 6525, 21512, 4859, 1006, 4874, 9140, 1010, 20014, 5950, 1010, 4874, 3643, 1007, 1063, 2065, 1006, 5950, 1026, 3091, 1006, 9140, 1007, 1007, 1063, 9140, 1012, 2275, 1006, 9140, 1010, 5950, 1010, 3643, 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...
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java
TomcatServletWebServerFactory.addContextValves
public void addContextValves(Valve... contextValves) { Assert.notNull(contextValves, "Valves must not be null"); this.contextValves.addAll(Arrays.asList(contextValves)); }
java
public void addContextValves(Valve... contextValves) { Assert.notNull(contextValves, "Valves must not be null"); this.contextValves.addAll(Arrays.asList(contextValves)); }
[ "public", "void", "addContextValves", "(", "Valve", "...", "contextValves", ")", "{", "Assert", ".", "notNull", "(", "contextValves", ",", "\"Valves must not be null\"", ")", ";", "this", ".", "contextValves", ".", "addAll", "(", "Arrays", ".", "asList", "(", ...
Add {@link Valve}s that should be applied to the Tomcat {@link Context}. @param contextValves the valves to add
[ "Add", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java#L540-L543
train
Add a list of context valves to the context.
[ 30522, 2270, 11675, 5587, 8663, 18209, 10175, 6961, 1006, 10764, 1012, 1012, 1012, 6123, 10175, 6961, 1007, 1063, 20865, 1012, 2025, 11231, 3363, 1006, 6123, 10175, 6961, 1010, 1000, 17355, 2442, 2025, 2022, 19701, 1000, 1007, 1025, 2023, 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...
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java
TouchActions.scroll
public TouchActions scroll(WebElement onElement, int xOffset, int yOffset) { if (touchScreen != null) { action.addAction(new ScrollAction(touchScreen, (Locatable) onElement, xOffset, yOffset)); } return this; }
java
public TouchActions scroll(WebElement onElement, int xOffset, int yOffset) { if (touchScreen != null) { action.addAction(new ScrollAction(touchScreen, (Locatable) onElement, xOffset, yOffset)); } return this; }
[ "public", "TouchActions", "scroll", "(", "WebElement", "onElement", ",", "int", "xOffset", ",", "int", "yOffset", ")", "{", "if", "(", "touchScreen", "!=", "null", ")", "{", "action", ".", "addAction", "(", "new", "ScrollAction", "(", "touchScreen", ",", "...
Creates a scroll gesture that starts on a particular screen location. @param onElement the {@link WebElement} where the scroll starts. @param xOffset The x offset to scroll @param yOffset The y offset to scroll @return self
[ "Creates", "a", "scroll", "gesture", "that", "starts", "on", "a", "particular", "screen", "location", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L115-L120
train
Scroll the specified element.
[ 30522, 2270, 3543, 18908, 8496, 17186, 1006, 4773, 12260, 3672, 2028, 16930, 4765, 1010, 20014, 1060, 27475, 3388, 1010, 20014, 10930, 21807, 3388, 1007, 1063, 2065, 1006, 3543, 18182, 999, 1027, 19701, 1007, 1063, 2895, 1012, 5587, 18908, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStateDownloader.java
RocksDBStateDownloader.transferAllStateDataToDirectory
public void transferAllStateDataToDirectory( IncrementalRemoteKeyedStateHandle restoreStateHandle, Path dest, CloseableRegistry closeableRegistry) throws Exception { final Map<StateHandleID, StreamStateHandle> sstFiles = restoreStateHandle.getSharedState(); final Map<StateHandleID, StreamStateHandle> miscFiles = restoreStateHandle.getPrivateState(); downloadDataForAllStateHandles(sstFiles, dest, closeableRegistry); downloadDataForAllStateHandles(miscFiles, dest, closeableRegistry); }
java
public void transferAllStateDataToDirectory( IncrementalRemoteKeyedStateHandle restoreStateHandle, Path dest, CloseableRegistry closeableRegistry) throws Exception { final Map<StateHandleID, StreamStateHandle> sstFiles = restoreStateHandle.getSharedState(); final Map<StateHandleID, StreamStateHandle> miscFiles = restoreStateHandle.getPrivateState(); downloadDataForAllStateHandles(sstFiles, dest, closeableRegistry); downloadDataForAllStateHandles(miscFiles, dest, closeableRegistry); }
[ "public", "void", "transferAllStateDataToDirectory", "(", "IncrementalRemoteKeyedStateHandle", "restoreStateHandle", ",", "Path", "dest", ",", "CloseableRegistry", "closeableRegistry", ")", "throws", "Exception", "{", "final", "Map", "<", "StateHandleID", ",", "StreamStateH...
Transfer all state data to the target directory using specified number of threads. @param restoreStateHandle Handles used to retrieve the state data. @param dest The target directory which the state data will be stored. @throws Exception Thrown if can not transfer all the state data.
[ "Transfer", "all", "state", "data", "to", "the", "target", "directory", "using", "specified", "number", "of", "threads", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStateDownloader.java#L56-L68
train
Transfer all state data to the directory specified by the given restore state handle.
[ 30522, 2270, 11675, 4651, 8095, 9153, 3064, 6790, 3406, 4305, 2890, 16761, 2100, 1006, 4297, 28578, 21050, 28578, 12184, 14839, 2098, 9153, 2618, 11774, 2571, 9239, 9153, 2618, 11774, 2571, 1010, 4130, 4078, 2102, 1010, 2485, 3085, 2890, 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...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/util/DependencyVisitor.java
DependencyVisitor.addNameSpace
public void addNameSpace(Set<String> names) { for (String name : names) { this.nameSpace.add(name.replace('.', '/')); } }
java
public void addNameSpace(Set<String> names) { for (String name : names) { this.nameSpace.add(name.replace('.', '/')); } }
[ "public", "void", "addNameSpace", "(", "Set", "<", "String", ">", "names", ")", "{", "for", "(", "String", "name", ":", "names", ")", "{", "this", ".", "nameSpace", ".", "add", "(", "name", ".", "replace", "(", "'", "'", ",", "'", "'", ")", ")", ...
---------------------------------------------------------------------------------------------
[ "---------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/DependencyVisitor.java#L98-L102
train
Add a set of names to the name space.
[ 30522, 2270, 11675, 5587, 18442, 23058, 1006, 2275, 1026, 5164, 1028, 3415, 1007, 1063, 2005, 1006, 5164, 2171, 1024, 3415, 1007, 1063, 2023, 1012, 3415, 15327, 1012, 5587, 1006, 2171, 1012, 5672, 1006, 1005, 1012, 1005, 1010, 1005, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/Checkpoints.java
Checkpoints.loadCheckpointMetadata
public static Savepoint loadCheckpointMetadata(DataInputStream in, ClassLoader classLoader) throws IOException { checkNotNull(in, "input stream"); checkNotNull(classLoader, "classLoader"); final int magicNumber = in.readInt(); if (magicNumber == HEADER_MAGIC_NUMBER) { final int version = in.readInt(); final SavepointSerializer<?> serializer = SavepointSerializers.getSerializer(version); if (serializer != null) { return serializer.deserialize(in, classLoader); } else { throw new IOException("Unrecognized checkpoint version number: " + version); } } else { throw new IOException("Unexpected magic number. This can have multiple reasons: " + "(1) You are trying to load a Flink 1.0 savepoint, which is not supported by this " + "version of Flink. (2) The file you were pointing to is not a savepoint at all. " + "(3) The savepoint file has been corrupted."); } }
java
public static Savepoint loadCheckpointMetadata(DataInputStream in, ClassLoader classLoader) throws IOException { checkNotNull(in, "input stream"); checkNotNull(classLoader, "classLoader"); final int magicNumber = in.readInt(); if (magicNumber == HEADER_MAGIC_NUMBER) { final int version = in.readInt(); final SavepointSerializer<?> serializer = SavepointSerializers.getSerializer(version); if (serializer != null) { return serializer.deserialize(in, classLoader); } else { throw new IOException("Unrecognized checkpoint version number: " + version); } } else { throw new IOException("Unexpected magic number. This can have multiple reasons: " + "(1) You are trying to load a Flink 1.0 savepoint, which is not supported by this " + "version of Flink. (2) The file you were pointing to is not a savepoint at all. " + "(3) The savepoint file has been corrupted."); } }
[ "public", "static", "Savepoint", "loadCheckpointMetadata", "(", "DataInputStream", "in", ",", "ClassLoader", "classLoader", ")", "throws", "IOException", "{", "checkNotNull", "(", "in", ",", "\"input stream\"", ")", ";", "checkNotNull", "(", "classLoader", ",", "\"c...
------------------------------------------------------------------------
[ "------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/Checkpoints.java#L98-L121
train
Load the checkpoint metadata from the given input stream.
[ 30522, 2270, 10763, 3828, 8400, 7170, 5403, 3600, 8400, 11368, 8447, 2696, 1006, 2951, 2378, 18780, 21422, 1999, 1010, 2465, 11066, 2121, 2465, 11066, 2121, 1007, 11618, 22834, 10288, 24422, 1063, 4638, 17048, 11231, 3363, 1006, 1999, 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-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
SqlValidatorImpl.validateAccess
private void validateAccess( SqlNode node, SqlValidatorTable table, SqlAccessEnum requiredAccess) { if (table != null) { SqlAccessType access = table.getAllowedAccess(); if (!access.allowsAccess(requiredAccess)) { throw newValidationError(node, RESOURCE.accessNotAllowed(requiredAccess.name(), table.getQualifiedName().toString())); } } }
java
private void validateAccess( SqlNode node, SqlValidatorTable table, SqlAccessEnum requiredAccess) { if (table != null) { SqlAccessType access = table.getAllowedAccess(); if (!access.allowsAccess(requiredAccess)) { throw newValidationError(node, RESOURCE.accessNotAllowed(requiredAccess.name(), table.getQualifiedName().toString())); } } }
[ "private", "void", "validateAccess", "(", "SqlNode", "node", ",", "SqlValidatorTable", "table", ",", "SqlAccessEnum", "requiredAccess", ")", "{", "if", "(", "table", "!=", "null", ")", "{", "SqlAccessType", "access", "=", "table", ".", "getAllowedAccess", "(", ...
Validates access to a table. @param table Table @param requiredAccess Access requested on table
[ "Validates", "access", "to", "a", "table", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L4635-L4647
train
Validate access.
[ 30522, 2797, 11675, 9398, 3686, 6305, 9623, 2015, 1006, 29296, 3630, 3207, 13045, 1010, 29296, 10175, 8524, 25485, 3085, 2795, 1010, 29296, 6305, 9623, 5054, 2819, 3223, 6305, 9623, 2015, 1007, 1063, 2065, 1006, 2795, 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...
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java
LogBuffer.getInt16
public final int getInt16(final int pos) { final int position = origin + pos; if (pos + 1 >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + (pos < 0 ? pos : (pos + 1))); byte[] buf = buffer; return (0xff & buf[position]) | ((buf[position + 1]) << 8); }
java
public final int getInt16(final int pos) { final int position = origin + pos; if (pos + 1 >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + (pos < 0 ? pos : (pos + 1))); byte[] buf = buffer; return (0xff & buf[position]) | ((buf[position + 1]) << 8); }
[ "public", "final", "int", "getInt16", "(", "final", "int", "pos", ")", "{", "final", "int", "position", "=", "origin", "+", "pos", ";", "if", "(", "pos", "+", "1", ">=", "limit", "||", "pos", "<", "0", ")", "throw", "new", "IllegalArgumentException", ...
Return 16-bit signed int from buffer. (little-endian) @see mysql-5.1.60/include/my_global.h - sint2korr
[ "Return", "16", "-", "bit", "signed", "int", "from", "buffer", ".", "(", "little", "-", "endian", ")" ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L245-L253
train
Gets an 16 - bit integer from the buffer.
[ 30522, 2270, 2345, 20014, 2131, 18447, 16048, 1006, 2345, 20014, 13433, 2015, 1007, 1063, 2345, 20014, 2597, 1027, 4761, 1009, 13433, 2015, 1025, 2065, 1006, 13433, 2015, 1009, 1015, 1028, 1027, 5787, 1064, 1064, 13433, 2015, 1026, 1014, 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/io/FileUtil.java
FileUtil.isDirectory
public static boolean isDirectory(Path path, boolean isFollowLinks) { if (null == path) { return false; } final LinkOption[] options = isFollowLinks ? new LinkOption[0] : new LinkOption[] { LinkOption.NOFOLLOW_LINKS }; return Files.isDirectory(path, options); }
java
public static boolean isDirectory(Path path, boolean isFollowLinks) { if (null == path) { return false; } final LinkOption[] options = isFollowLinks ? new LinkOption[0] : new LinkOption[] { LinkOption.NOFOLLOW_LINKS }; return Files.isDirectory(path, options); }
[ "public", "static", "boolean", "isDirectory", "(", "Path", "path", ",", "boolean", "isFollowLinks", ")", "{", "if", "(", "null", "==", "path", ")", "{", "return", "false", ";", "}", "final", "LinkOption", "[", "]", "options", "=", "isFollowLinks", "?", "...
判断是否为目录,如果file为null,则返回false @param path {@link Path} @param isFollowLinks 是否追踪到软链对应的真实地址 @return 如果为目录true @since 3.1.0
[ "判断是否为目录,如果file为null,则返回false" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L1257-L1263
train
Checks if the given path points to a directory.
[ 30522, 2270, 10763, 22017, 20898, 2003, 4305, 2890, 16761, 2100, 1006, 4130, 4130, 1010, 22017, 20898, 2003, 14876, 7174, 13668, 19839, 2015, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 4130, 1007, 1063, 2709, 6270, 1025, 1065, 2345, 4957, 7...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.newerThan
public static boolean newerThan(File file, long timeMillis) { if (null == file || false == file.exists()) { return false;// 不存在的文件一定比任何时间旧 } return file.lastModified() > timeMillis; }
java
public static boolean newerThan(File file, long timeMillis) { if (null == file || false == file.exists()) { return false;// 不存在的文件一定比任何时间旧 } return file.lastModified() > timeMillis; }
[ "public", "static", "boolean", "newerThan", "(", "File", "file", ",", "long", "timeMillis", ")", "{", "if", "(", "null", "==", "file", "||", "false", "==", "file", ".", "exists", "(", ")", ")", "{", "return", "false", ";", "// 不存在的文件一定比任何时间旧\r", "}", "...
给定文件或目录的最后修改时间是否晚于给定时间 @param file 文件或目录 @param timeMillis 做为对比的时间 @return 是否晚于给定时间
[ "给定文件或目录的最后修改时间是否晚于给定时间" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L580-L585
train
Checks if the given file is newer than the given time.
[ 30522, 2270, 10763, 22017, 20898, 10947, 21604, 1006, 5371, 5371, 1010, 2146, 2051, 19912, 2483, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 5371, 1064, 1064, 6270, 1027, 1027, 5371, 1012, 6526, 1006, 1007, 1007, 1063, 2709, 6270, 1025, 1013...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
handler/src/main/java/io/netty/handler/ssl/SslHandler.java
SslHandler.renegotiate
public Future<Channel> renegotiate() { ChannelHandlerContext ctx = this.ctx; if (ctx == null) { throw new IllegalStateException(); } return renegotiate(ctx.executor().<Channel>newPromise()); }
java
public Future<Channel> renegotiate() { ChannelHandlerContext ctx = this.ctx; if (ctx == null) { throw new IllegalStateException(); } return renegotiate(ctx.executor().<Channel>newPromise()); }
[ "public", "Future", "<", "Channel", ">", "renegotiate", "(", ")", "{", "ChannelHandlerContext", "ctx", "=", "this", ".", "ctx", ";", "if", "(", "ctx", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "return", "renegot...
Performs TLS renegotiation.
[ "Performs", "TLS", "renegotiation", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslHandler.java#L1895-L1902
train
Renders the channel to the current user.
[ 30522, 2270, 2925, 1026, 3149, 1028, 10731, 3995, 10711, 2618, 1006, 1007, 1063, 3149, 11774, 3917, 8663, 18209, 14931, 2595, 1027, 2023, 1012, 14931, 2595, 1025, 2065, 1006, 14931, 2595, 1027, 1027, 19701, 1007, 1063, 5466, 2047, 6206, 915...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/word2vec/AbstractVectorModel.java
AbstractVectorModel.nearest
public List<Map.Entry<K, Float>> nearest(Vector vector, int size) { MaxHeap<Map.Entry<K, Float>> maxHeap = new MaxHeap<Map.Entry<K, Float>>(size, new Comparator<Map.Entry<K, Float>>() { @Override public int compare(Map.Entry<K, Float> o1, Map.Entry<K, Float> o2) { return o1.getValue().compareTo(o2.getValue()); } }); for (Map.Entry<K, Vector> entry : storage.entrySet()) { maxHeap.add(new AbstractMap.SimpleEntry<K, Float>(entry.getKey(), entry.getValue().cosineForUnitVector(vector))); } return maxHeap.toList(); }
java
public List<Map.Entry<K, Float>> nearest(Vector vector, int size) { MaxHeap<Map.Entry<K, Float>> maxHeap = new MaxHeap<Map.Entry<K, Float>>(size, new Comparator<Map.Entry<K, Float>>() { @Override public int compare(Map.Entry<K, Float> o1, Map.Entry<K, Float> o2) { return o1.getValue().compareTo(o2.getValue()); } }); for (Map.Entry<K, Vector> entry : storage.entrySet()) { maxHeap.add(new AbstractMap.SimpleEntry<K, Float>(entry.getKey(), entry.getValue().cosineForUnitVector(vector))); } return maxHeap.toList(); }
[ "public", "List", "<", "Map", ".", "Entry", "<", "K", ",", "Float", ">", ">", "nearest", "(", "Vector", "vector", ",", "int", "size", ")", "{", "MaxHeap", "<", "Map", ".", "Entry", "<", "K", ",", "Float", ">", ">", "maxHeap", "=", "new", "MaxHeap...
获取与向量最相似的词语 @param vector 向量 @param size topN个 @return 键值对列表, 键是相似词语, 值是相似度, 按相似度降序排列
[ "获取与向量最相似的词语" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/AbstractVectorModel.java#L125-L141
train
Get the nearest list of entries in the storage.
[ 30522, 2270, 2862, 1026, 4949, 1012, 4443, 1026, 1047, 1010, 14257, 1028, 1028, 7205, 1006, 9207, 9207, 1010, 20014, 2946, 1007, 1063, 4098, 20192, 2361, 1026, 4949, 1012, 4443, 1026, 1047, 1010, 14257, 1028, 1028, 4098, 20192, 2361, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStateUploader.java
RocksDBStateUploader.uploadFilesToCheckpointFs
public Map<StateHandleID, StreamStateHandle> uploadFilesToCheckpointFs( @Nonnull Map<StateHandleID, Path> files, CheckpointStreamFactory checkpointStreamFactory, CloseableRegistry closeableRegistry) throws Exception { Map<StateHandleID, StreamStateHandle> handles = new HashMap<>(); Map<StateHandleID, CompletableFuture<StreamStateHandle>> futures = createUploadFutures(files, checkpointStreamFactory, closeableRegistry); try { FutureUtils.waitForAll(futures.values()).get(); for (Map.Entry<StateHandleID, CompletableFuture<StreamStateHandle>> entry : futures.entrySet()) { handles.put(entry.getKey(), entry.getValue().get()); } } catch (ExecutionException e) { Throwable throwable = ExceptionUtils.stripExecutionException(e); throwable = ExceptionUtils.stripException(throwable, RuntimeException.class); if (throwable instanceof IOException) { throw (IOException) throwable; } else { throw new FlinkRuntimeException("Failed to download data for state handles.", e); } } return handles; }
java
public Map<StateHandleID, StreamStateHandle> uploadFilesToCheckpointFs( @Nonnull Map<StateHandleID, Path> files, CheckpointStreamFactory checkpointStreamFactory, CloseableRegistry closeableRegistry) throws Exception { Map<StateHandleID, StreamStateHandle> handles = new HashMap<>(); Map<StateHandleID, CompletableFuture<StreamStateHandle>> futures = createUploadFutures(files, checkpointStreamFactory, closeableRegistry); try { FutureUtils.waitForAll(futures.values()).get(); for (Map.Entry<StateHandleID, CompletableFuture<StreamStateHandle>> entry : futures.entrySet()) { handles.put(entry.getKey(), entry.getValue().get()); } } catch (ExecutionException e) { Throwable throwable = ExceptionUtils.stripExecutionException(e); throwable = ExceptionUtils.stripException(throwable, RuntimeException.class); if (throwable instanceof IOException) { throw (IOException) throwable; } else { throw new FlinkRuntimeException("Failed to download data for state handles.", e); } } return handles; }
[ "public", "Map", "<", "StateHandleID", ",", "StreamStateHandle", ">", "uploadFilesToCheckpointFs", "(", "@", "Nonnull", "Map", "<", "StateHandleID", ",", "Path", ">", "files", ",", "CheckpointStreamFactory", "checkpointStreamFactory", ",", "CloseableRegistry", "closeabl...
Upload all the files to checkpoint fileSystem using specified number of threads. @param files The files will be uploaded to checkpoint filesystem. @param checkpointStreamFactory The checkpoint streamFactory used to create outputstream. @throws Exception Thrown if can not upload all the files.
[ "Upload", "all", "the", "files", "to", "checkpoint", "fileSystem", "using", "specified", "number", "of", "threads", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStateUploader.java#L62-L89
train
Upload a list of files to the checkpoint fs.
[ 30522, 2270, 4949, 1026, 2110, 11774, 23057, 2094, 1010, 9199, 12259, 11774, 2571, 1028, 2039, 11066, 8873, 4244, 3406, 5403, 3600, 8400, 10343, 1006, 1030, 2512, 11231, 3363, 4949, 1026, 2110, 11774, 23057, 2094, 1010, 4130, 1028, 6764, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java
Graph.groupReduceOnNeighbors
public <T> DataSet<T> groupReduceOnNeighbors(NeighborsFunction<K, VV, EV, T> neighborsFunction, EdgeDirection direction, TypeInformation<T> typeInfo) throws IllegalArgumentException { switch (direction) { case IN: // create <edge-sourceVertex> pairs DataSet<Tuple3<K, Edge<K, EV>, Vertex<K, VV>>> edgesWithSources = edges .join(this.vertices).where(0).equalTo(0) .with(new ProjectVertexIdJoin<>(1)) .withForwardedFieldsFirst("f1->f0").name("Edge with source vertex ID"); return edgesWithSources.groupBy(0).reduceGroup( new ApplyNeighborGroupReduceFunction<>(neighborsFunction)) .name("Neighbors function").returns(typeInfo); case OUT: // create <edge-targetVertex> pairs DataSet<Tuple3<K, Edge<K, EV>, Vertex<K, VV>>> edgesWithTargets = edges .join(this.vertices).where(1).equalTo(0) .with(new ProjectVertexIdJoin<>(0)) .withForwardedFieldsFirst("f0").name("Edge with target vertex ID"); return edgesWithTargets.groupBy(0).reduceGroup( new ApplyNeighborGroupReduceFunction<>(neighborsFunction)) .name("Neighbors function").returns(typeInfo); case ALL: // create <edge-sourceOrTargetVertex> pairs DataSet<Tuple3<K, Edge<K, EV>, Vertex<K, VV>>> edgesWithNeighbors = edges .flatMap(new EmitOneEdgeWithNeighborPerNode<>()) .join(this.vertices).where(1).equalTo(0) .with(new ProjectEdgeWithNeighbor<>()).name("Edge with vertex ID"); return edgesWithNeighbors.groupBy(0).reduceGroup( new ApplyNeighborGroupReduceFunction<>(neighborsFunction)) .name("Neighbors function").returns(typeInfo); default: throw new IllegalArgumentException("Illegal edge direction"); } }
java
public <T> DataSet<T> groupReduceOnNeighbors(NeighborsFunction<K, VV, EV, T> neighborsFunction, EdgeDirection direction, TypeInformation<T> typeInfo) throws IllegalArgumentException { switch (direction) { case IN: // create <edge-sourceVertex> pairs DataSet<Tuple3<K, Edge<K, EV>, Vertex<K, VV>>> edgesWithSources = edges .join(this.vertices).where(0).equalTo(0) .with(new ProjectVertexIdJoin<>(1)) .withForwardedFieldsFirst("f1->f0").name("Edge with source vertex ID"); return edgesWithSources.groupBy(0).reduceGroup( new ApplyNeighborGroupReduceFunction<>(neighborsFunction)) .name("Neighbors function").returns(typeInfo); case OUT: // create <edge-targetVertex> pairs DataSet<Tuple3<K, Edge<K, EV>, Vertex<K, VV>>> edgesWithTargets = edges .join(this.vertices).where(1).equalTo(0) .with(new ProjectVertexIdJoin<>(0)) .withForwardedFieldsFirst("f0").name("Edge with target vertex ID"); return edgesWithTargets.groupBy(0).reduceGroup( new ApplyNeighborGroupReduceFunction<>(neighborsFunction)) .name("Neighbors function").returns(typeInfo); case ALL: // create <edge-sourceOrTargetVertex> pairs DataSet<Tuple3<K, Edge<K, EV>, Vertex<K, VV>>> edgesWithNeighbors = edges .flatMap(new EmitOneEdgeWithNeighborPerNode<>()) .join(this.vertices).where(1).equalTo(0) .with(new ProjectEdgeWithNeighbor<>()).name("Edge with vertex ID"); return edgesWithNeighbors.groupBy(0).reduceGroup( new ApplyNeighborGroupReduceFunction<>(neighborsFunction)) .name("Neighbors function").returns(typeInfo); default: throw new IllegalArgumentException("Illegal edge direction"); } }
[ "public", "<", "T", ">", "DataSet", "<", "T", ">", "groupReduceOnNeighbors", "(", "NeighborsFunction", "<", "K", ",", "VV", ",", "EV", ",", "T", ">", "neighborsFunction", ",", "EdgeDirection", "direction", ",", "TypeInformation", "<", "T", ">", "typeInfo", ...
Groups by vertex and computes a GroupReduce transformation over the neighbors (both edges and vertices) of each vertex. The neighborsFunction applied on the neighbors only has access to the vertex id (not the vertex value) of the grouping vertex. <p>For each vertex, the neighborsFunction can iterate over all neighbors of this vertex with the specified direction, and emit any number of output elements, including none. @param neighborsFunction the group reduce function to apply to the neighboring edges and vertices of each vertex. @param direction the edge direction (in-, out-, all-). @param <T> the output type @param typeInfo the explicit return type @return a DataSet containing elements of type T @throws IllegalArgumentException
[ "Groups", "by", "vertex", "and", "computes", "a", "GroupReduce", "transformation", "over", "the", "neighbors", "(", "both", "edges", "and", "vertices", ")", "of", "each", "vertex", ".", "The", "neighborsFunction", "applied", "on", "the", "neighbors", "only", "...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L2042-L2076
train
Group reduce on neighbors DataSet.
[ 30522, 2270, 1026, 1056, 1028, 2951, 13462, 1026, 1056, 1028, 2177, 5596, 18796, 18256, 18377, 12821, 2015, 1006, 10638, 11263, 27989, 1026, 1047, 1010, 1058, 2615, 1010, 23408, 1010, 1056, 1028, 10638, 11263, 27989, 1010, 13011, 7442, 7542, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.validate
public Boolean validate(GraphValidator<K, VV, EV> validator) throws Exception { return validator.validate(this); }
java
public Boolean validate(GraphValidator<K, VV, EV> validator) throws Exception { return validator.validate(this); }
[ "public", "Boolean", "validate", "(", "GraphValidator", "<", "K", ",", "VV", ",", "EV", ">", "validator", ")", "throws", "Exception", "{", "return", "validator", ".", "validate", "(", "this", ")", ";", "}" ]
Function that checks whether a Graph is a valid Graph, as defined by the given {@link GraphValidator}. @return true if the Graph is valid.
[ "Function", "that", "checks", "whether", "a", "Graph", "is", "a", "valid", "Graph", "as", "defined", "by", "the", "given", "{", "@link", "GraphValidator", "}", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L446-L448
train
Validate the graph.
[ 30522, 2270, 22017, 20898, 9398, 3686, 1006, 10629, 10175, 8524, 4263, 1026, 1047, 1010, 1058, 2615, 1010, 23408, 1028, 9398, 8844, 1007, 11618, 6453, 1063, 2709, 9398, 8844, 1012, 9398, 3686, 1006, 2023, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/IOUtils.java
IOUtils.skipFully
public static void skipFully(final InputStream in, long len) throws IOException { while (len > 0) { final long ret = in.skip(len); if (ret < 0) { throw new IOException("Premeture EOF from inputStream"); } len -= ret; } }
java
public static void skipFully(final InputStream in, long len) throws IOException { while (len > 0) { final long ret = in.skip(len); if (ret < 0) { throw new IOException("Premeture EOF from inputStream"); } len -= ret; } }
[ "public", "static", "void", "skipFully", "(", "final", "InputStream", "in", ",", "long", "len", ")", "throws", "IOException", "{", "while", "(", "len", ">", "0", ")", "{", "final", "long", "ret", "=", "in", ".", "skip", "(", "len", ")", ";", "if", ...
Similar to readFully(). Skips bytes in a loop. @param in The InputStream to skip bytes from @param len number of bytes to skip @throws IOException if it could not skip requested number of bytes for any reason (including EOF)
[ "Similar", "to", "readFully", "()", ".", "Skips", "bytes", "in", "a", "loop", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/IOUtils.java#L152-L160
train
Skips the given number of bytes from the given input stream.
[ 30522, 2270, 10763, 11675, 13558, 7699, 1006, 2345, 20407, 25379, 1999, 1010, 2146, 30524, 1007, 1025, 2065, 1006, 2128, 2102, 1026, 1014, 1007, 1063, 5466, 2047, 22834, 10288, 24422, 1006, 1000, 26563, 3388, 5397, 1041, 11253, 2013, 20407, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
handler/src/main/java/io/netty/handler/ssl/SslUtils.java
SslUtils.toBase64
static ByteBuf toBase64(ByteBufAllocator allocator, ByteBuf src) { ByteBuf dst = Base64.encode(src, src.readerIndex(), src.readableBytes(), true, Base64Dialect.STANDARD, allocator); src.readerIndex(src.writerIndex()); return dst; }
java
static ByteBuf toBase64(ByteBufAllocator allocator, ByteBuf src) { ByteBuf dst = Base64.encode(src, src.readerIndex(), src.readableBytes(), true, Base64Dialect.STANDARD, allocator); src.readerIndex(src.writerIndex()); return dst; }
[ "static", "ByteBuf", "toBase64", "(", "ByteBufAllocator", "allocator", ",", "ByteBuf", "src", ")", "{", "ByteBuf", "dst", "=", "Base64", ".", "encode", "(", "src", ",", "src", ".", "readerIndex", "(", ")", ",", "src", ".", "readableBytes", "(", ")", ",",...
Same as {@link Base64#encode(ByteBuf, boolean)} but allows the use of a custom {@link ByteBufAllocator}. @see Base64#encode(ByteBuf, boolean)
[ "Same", "as", "{", "@link", "Base64#encode", "(", "ByteBuf", "boolean", ")", "}", "but", "allows", "the", "use", "of", "a", "custom", "{", "@link", "ByteBufAllocator", "}", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslUtils.java#L375-L380
train
Convert a byte buffer to a Base64 encoded version.
[ 30522, 10763, 24880, 8569, 2546, 2000, 15058, 21084, 1006, 24880, 8569, 13976, 24755, 4263, 2035, 24755, 4263, 1010, 24880, 8569, 2546, 5034, 2278, 1007, 1063, 24880, 8569, 2546, 16233, 2102, 1027, 2918, 21084, 1012, 4372, 16044, 1006, 5034, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/SslServerCustomizer.java
SslServerCustomizer.configureSsl
protected void configureSsl(SslContextFactory factory, Ssl ssl, SslStoreProvider sslStoreProvider) { factory.setProtocol(ssl.getProtocol()); configureSslClientAuth(factory, ssl); configureSslPasswords(factory, ssl); factory.setCertAlias(ssl.getKeyAlias()); if (!ObjectUtils.isEmpty(ssl.getCiphers())) { factory.setIncludeCipherSuites(ssl.getCiphers()); factory.setExcludeCipherSuites(); } if (ssl.getEnabledProtocols() != null) { factory.setIncludeProtocols(ssl.getEnabledProtocols()); } if (sslStoreProvider != null) { try { factory.setKeyStore(sslStoreProvider.getKeyStore()); factory.setTrustStore(sslStoreProvider.getTrustStore()); } catch (Exception ex) { throw new IllegalStateException("Unable to set SSL store", ex); } } else { configureSslKeyStore(factory, ssl); configureSslTrustStore(factory, ssl); } }
java
protected void configureSsl(SslContextFactory factory, Ssl ssl, SslStoreProvider sslStoreProvider) { factory.setProtocol(ssl.getProtocol()); configureSslClientAuth(factory, ssl); configureSslPasswords(factory, ssl); factory.setCertAlias(ssl.getKeyAlias()); if (!ObjectUtils.isEmpty(ssl.getCiphers())) { factory.setIncludeCipherSuites(ssl.getCiphers()); factory.setExcludeCipherSuites(); } if (ssl.getEnabledProtocols() != null) { factory.setIncludeProtocols(ssl.getEnabledProtocols()); } if (sslStoreProvider != null) { try { factory.setKeyStore(sslStoreProvider.getKeyStore()); factory.setTrustStore(sslStoreProvider.getTrustStore()); } catch (Exception ex) { throw new IllegalStateException("Unable to set SSL store", ex); } } else { configureSslKeyStore(factory, ssl); configureSslTrustStore(factory, ssl); } }
[ "protected", "void", "configureSsl", "(", "SslContextFactory", "factory", ",", "Ssl", "ssl", ",", "SslStoreProvider", "sslStoreProvider", ")", "{", "factory", ".", "setProtocol", "(", "ssl", ".", "getProtocol", "(", ")", ")", ";", "configureSslClientAuth", "(", ...
Configure the SSL connection. @param factory the Jetty {@link SslContextFactory}. @param ssl the ssl details. @param sslStoreProvider the ssl store provider
[ "Configure", "the", "SSL", "connection", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/SslServerCustomizer.java#L141-L167
train
Configure the SSL.
[ 30522, 5123, 11675, 9530, 8873, 27390, 7971, 2140, 1006, 7020, 22499, 10111, 18413, 21450, 4713, 1010, 30524, 1006, 4713, 1010, 7020, 2140, 1007, 1025, 9530, 8873, 27390, 7971, 14277, 12054, 22104, 1006, 4713, 1010, 7020, 2140, 1007, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/NeuralNetworkParser.java
NeuralNetworkParser.build_feature_space
void build_feature_space() { kFormInFeaturespace = 0; kNilForm = forms_alphabet.idOf(SpecialOption.NIL); kFeatureSpaceEnd = forms_alphabet.size(); kPostagInFeaturespace = kFeatureSpaceEnd; kNilPostag = kFeatureSpaceEnd + postags_alphabet.idOf(SpecialOption.NIL); kFeatureSpaceEnd += postags_alphabet.size(); kDeprelInFeaturespace = kFeatureSpaceEnd; kNilDeprel = kFeatureSpaceEnd + deprels_alphabet.idOf(SpecialOption.NIL); kFeatureSpaceEnd += deprels_alphabet.size(); kDistanceInFeaturespace = kFeatureSpaceEnd; kNilDistance = kFeatureSpaceEnd + (use_distance ? 8 : 0); kFeatureSpaceEnd += (use_distance ? 9 : 0); kValencyInFeaturespace = kFeatureSpaceEnd; kNilValency = kFeatureSpaceEnd + (use_valency ? 8 : 0); kFeatureSpaceEnd += (use_valency ? 9 : 0); kCluster4InFeaturespace = kFeatureSpaceEnd; if (use_cluster) { kNilCluster4 = kFeatureSpaceEnd + cluster4_types_alphabet.idOf(SpecialOption.NIL); kFeatureSpaceEnd += cluster4_types_alphabet.size(); } else { kNilCluster4 = kFeatureSpaceEnd; } kCluster6InFeaturespace = kFeatureSpaceEnd; if (use_cluster) { kNilCluster6 = kFeatureSpaceEnd + cluster6_types_alphabet.idOf(SpecialOption.NIL); kFeatureSpaceEnd += cluster6_types_alphabet.size(); } else { kNilCluster6 = kFeatureSpaceEnd; } kClusterInFeaturespace = kFeatureSpaceEnd; if (use_cluster) { kNilCluster = kFeatureSpaceEnd + cluster_types_alphabet.idOf(SpecialOption.NIL); kFeatureSpaceEnd += cluster_types_alphabet.size(); } else { kNilCluster = kFeatureSpaceEnd; } }
java
void build_feature_space() { kFormInFeaturespace = 0; kNilForm = forms_alphabet.idOf(SpecialOption.NIL); kFeatureSpaceEnd = forms_alphabet.size(); kPostagInFeaturespace = kFeatureSpaceEnd; kNilPostag = kFeatureSpaceEnd + postags_alphabet.idOf(SpecialOption.NIL); kFeatureSpaceEnd += postags_alphabet.size(); kDeprelInFeaturespace = kFeatureSpaceEnd; kNilDeprel = kFeatureSpaceEnd + deprels_alphabet.idOf(SpecialOption.NIL); kFeatureSpaceEnd += deprels_alphabet.size(); kDistanceInFeaturespace = kFeatureSpaceEnd; kNilDistance = kFeatureSpaceEnd + (use_distance ? 8 : 0); kFeatureSpaceEnd += (use_distance ? 9 : 0); kValencyInFeaturespace = kFeatureSpaceEnd; kNilValency = kFeatureSpaceEnd + (use_valency ? 8 : 0); kFeatureSpaceEnd += (use_valency ? 9 : 0); kCluster4InFeaturespace = kFeatureSpaceEnd; if (use_cluster) { kNilCluster4 = kFeatureSpaceEnd + cluster4_types_alphabet.idOf(SpecialOption.NIL); kFeatureSpaceEnd += cluster4_types_alphabet.size(); } else { kNilCluster4 = kFeatureSpaceEnd; } kCluster6InFeaturespace = kFeatureSpaceEnd; if (use_cluster) { kNilCluster6 = kFeatureSpaceEnd + cluster6_types_alphabet.idOf(SpecialOption.NIL); kFeatureSpaceEnd += cluster6_types_alphabet.size(); } else { kNilCluster6 = kFeatureSpaceEnd; } kClusterInFeaturespace = kFeatureSpaceEnd; if (use_cluster) { kNilCluster = kFeatureSpaceEnd + cluster_types_alphabet.idOf(SpecialOption.NIL); kFeatureSpaceEnd += cluster_types_alphabet.size(); } else { kNilCluster = kFeatureSpaceEnd; } }
[ "void", "build_feature_space", "(", ")", "{", "kFormInFeaturespace", "=", "0", ";", "kNilForm", "=", "forms_alphabet", ".", "idOf", "(", "SpecialOption", ".", "NIL", ")", ";", "kFeatureSpaceEnd", "=", "forms_alphabet", ".", "size", "(", ")", ";", "kPostagInFea...
初始化特征空间的长度等信息
[ "初始化特征空间的长度等信息" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/NeuralNetworkParser.java#L385-L440
train
Build the feature space.
[ 30522, 11675, 3857, 1035, 3444, 1035, 2686, 1006, 1007, 1063, 1047, 14192, 2378, 7959, 4017, 14900, 15327, 1027, 1014, 1025, 14161, 4014, 14192, 1027, 3596, 1035, 12440, 1012, 8909, 11253, 1006, 2569, 7361, 3508, 1012, 9152, 2140, 1007, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java
DnsNameResolver.resolve
public final Future<InetAddress> resolve(String inetHost, Iterable<DnsRecord> additionals) { return resolve(inetHost, additionals, executor().<InetAddress>newPromise()); }
java
public final Future<InetAddress> resolve(String inetHost, Iterable<DnsRecord> additionals) { return resolve(inetHost, additionals, executor().<InetAddress>newPromise()); }
[ "public", "final", "Future", "<", "InetAddress", ">", "resolve", "(", "String", "inetHost", ",", "Iterable", "<", "DnsRecord", ">", "additionals", ")", "{", "return", "resolve", "(", "inetHost", ",", "additionals", ",", "executor", "(", ")", ".", "<", "Ine...
Resolves the specified name into an address. @param inetHost the name to resolve @param additionals additional records ({@code OPT}) @return the address as the result of the resolution
[ "Resolves", "the", "specified", "name", "into", "an", "address", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java#L637-L639
train
Resolve the given list of DNS records to an Inet4Address.
[ 30522, 2270, 2345, 2925, 1026, 1999, 12928, 14141, 8303, 1028, 10663, 1006, 5164, 1999, 11031, 14122, 1010, 2009, 6906, 3468, 1026, 1040, 3619, 2890, 27108, 2094, 1028, 3176, 2015, 1007, 1063, 2709, 10663, 1006, 1999, 11031, 14122, 1010, 31...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/internals/ShardConsumer.java
ShardConsumer.deserializeRecordForCollectionAndUpdateState
private void deserializeRecordForCollectionAndUpdateState(UserRecord record) throws IOException { ByteBuffer recordData = record.getData(); byte[] dataBytes = new byte[recordData.remaining()]; recordData.get(dataBytes); final long approxArrivalTimestamp = record.getApproximateArrivalTimestamp().getTime(); final T value = deserializer.deserialize( dataBytes, record.getPartitionKey(), record.getSequenceNumber(), approxArrivalTimestamp, subscribedShard.getStreamName(), subscribedShard.getShard().getShardId()); SequenceNumber collectedSequenceNumber = (record.isAggregated()) ? new SequenceNumber(record.getSequenceNumber(), record.getSubSequenceNumber()) : new SequenceNumber(record.getSequenceNumber()); fetcherRef.emitRecordAndUpdateState( value, approxArrivalTimestamp, subscribedShardStateIndex, collectedSequenceNumber); lastSequenceNum = collectedSequenceNumber; }
java
private void deserializeRecordForCollectionAndUpdateState(UserRecord record) throws IOException { ByteBuffer recordData = record.getData(); byte[] dataBytes = new byte[recordData.remaining()]; recordData.get(dataBytes); final long approxArrivalTimestamp = record.getApproximateArrivalTimestamp().getTime(); final T value = deserializer.deserialize( dataBytes, record.getPartitionKey(), record.getSequenceNumber(), approxArrivalTimestamp, subscribedShard.getStreamName(), subscribedShard.getShard().getShardId()); SequenceNumber collectedSequenceNumber = (record.isAggregated()) ? new SequenceNumber(record.getSequenceNumber(), record.getSubSequenceNumber()) : new SequenceNumber(record.getSequenceNumber()); fetcherRef.emitRecordAndUpdateState( value, approxArrivalTimestamp, subscribedShardStateIndex, collectedSequenceNumber); lastSequenceNum = collectedSequenceNumber; }
[ "private", "void", "deserializeRecordForCollectionAndUpdateState", "(", "UserRecord", "record", ")", "throws", "IOException", "{", "ByteBuffer", "recordData", "=", "record", ".", "getData", "(", ")", ";", "byte", "[", "]", "dataBytes", "=", "new", "byte", "[", "...
Deserializes a record for collection, and accordingly updates the shard state in the fetcher. The last successfully collected sequence number in this shard consumer is also updated so that {@link ShardConsumer#getRecords(String, int)} may be able to use the correct sequence number to refresh shard iterators if necessary. <p>Note that the server-side Kinesis timestamp is attached to the record when collected. When the user programs uses {@link TimeCharacteristic#EventTime}, this timestamp will be used by default. @param record record to deserialize and collect @throws IOException
[ "Deserializes", "a", "record", "for", "collection", "and", "accordingly", "updates", "the", "shard", "state", "in", "the", "fetcher", ".", "The", "last", "successfully", "collected", "sequence", "number", "in", "this", "shard", "consumer", "is", "also", "updated...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/ShardConsumer.java#L350-L378
train
Deserialize a user record for collection and update state.
[ 30522, 2797, 11675, 4078, 11610, 28863, 8586, 8551, 29278, 26895, 18491, 5685, 6279, 27122, 12259, 1006, 5310, 2890, 27108, 2094, 2501, 1007, 11618, 22834, 10288, 24422, 1063, 24880, 8569, 12494, 2501, 2850, 2696, 1027, 2501, 1012, 2131, 2850...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java
CollUtil.filter
public static <T> Collection<T> filter(Collection<T> collection, Filter<T> filter) { if (null == collection || null == filter) { return collection; } Collection<T> collection2 = ObjectUtil.clone(collection); try { collection2.clear(); } catch (UnsupportedOperationException e) { // 克隆后的对象不支持清空,说明为不可变集合对象,使用默认的ArrayList保存结果 collection2 = new ArrayList<>(); } for (T t : collection) { if (filter.accept(t)) { collection2.add(t); } } return collection2; }
java
public static <T> Collection<T> filter(Collection<T> collection, Filter<T> filter) { if (null == collection || null == filter) { return collection; } Collection<T> collection2 = ObjectUtil.clone(collection); try { collection2.clear(); } catch (UnsupportedOperationException e) { // 克隆后的对象不支持清空,说明为不可变集合对象,使用默认的ArrayList保存结果 collection2 = new ArrayList<>(); } for (T t : collection) { if (filter.accept(t)) { collection2.add(t); } } return collection2; }
[ "public", "static", "<", "T", ">", "Collection", "<", "T", ">", "filter", "(", "Collection", "<", "T", ">", "collection", ",", "Filter", "<", "T", ">", "filter", ")", "{", "if", "(", "null", "==", "collection", "||", "null", "==", "filter", ")", "{...
过滤<br> 过滤过程通过传入的Filter实现来过滤返回需要的元素内容,这个Filter实现可以实现以下功能: <pre> 1、过滤出需要的对象,{@link Filter#accept(Object)}方法返回true的对象将被加入结果集合中 </pre> @param <T> 集合元素类型 @param collection 集合 @param filter 过滤器 @return 过滤后的数组 @since 3.1.0
[ "过滤<br", ">", "过滤过程通过传入的Filter实现来过滤返回需要的元素内容,这个Filter实现可以实现以下功能:" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1004-L1023
train
Returns a new collection with all the items in the given collection that match the criteria specified in the given filter.
[ 30522, 2270, 10763, 1026, 1056, 1028, 3074, 1026, 1056, 1028, 11307, 1006, 3074, 1026, 1056, 1028, 3074, 1010, 11307, 1026, 1056, 1028, 11307, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 3074, 1064, 1064, 19701, 1027, 1027, 11307, 1007, 1063...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/QueryableStateClient.java
QueryableStateClient.shutdownAndWait
public void shutdownAndWait() { try { client.shutdown().get(); LOG.info("The Queryable State Client was shutdown successfully."); } catch (Exception e) { LOG.warn("The Queryable State Client shutdown failed: ", e); } }
java
public void shutdownAndWait() { try { client.shutdown().get(); LOG.info("The Queryable State Client was shutdown successfully."); } catch (Exception e) { LOG.warn("The Queryable State Client shutdown failed: ", e); } }
[ "public", "void", "shutdownAndWait", "(", ")", "{", "try", "{", "client", ".", "shutdown", "(", ")", ".", "get", "(", ")", ";", "LOG", ".", "info", "(", "\"The Queryable State Client was shutdown successfully.\"", ")", ";", "}", "catch", "(", "Exception", "e...
Shuts down the client and waits until shutdown is completed. <p>If an exception is thrown, a warning is logged containing the exception message.
[ "Shuts", "down", "the", "client", "and", "waits", "until", "shutdown", "is", "completed", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/QueryableStateClient.java#L160-L167
train
Shutdown the Queryable State Client and wait for it to complete.
[ 30522, 2270, 11675, 3844, 7698, 5685, 21547, 2102, 1006, 1007, 1063, 3046, 1063, 7396, 1012, 3844, 7698, 1006, 1007, 1012, 2131, 1006, 1007, 1025, 8833, 1012, 18558, 1006, 1000, 1996, 23032, 3085, 2110, 7396, 2001, 3844, 7698, 5147, 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...
netty/netty
codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDynamicTable.java
HpackDynamicTable.remove
public HpackHeaderField remove() { HpackHeaderField removed = hpackHeaderFields[tail]; if (removed == null) { return null; } size -= removed.size(); hpackHeaderFields[tail++] = null; if (tail == hpackHeaderFields.length) { tail = 0; } return removed; }
java
public HpackHeaderField remove() { HpackHeaderField removed = hpackHeaderFields[tail]; if (removed == null) { return null; } size -= removed.size(); hpackHeaderFields[tail++] = null; if (tail == hpackHeaderFields.length) { tail = 0; } return removed; }
[ "public", "HpackHeaderField", "remove", "(", ")", "{", "HpackHeaderField", "removed", "=", "hpackHeaderFields", "[", "tail", "]", ";", "if", "(", "removed", "==", "null", ")", "{", "return", "null", ";", "}", "size", "-=", "removed", ".", "size", "(", ")...
Remove and return the oldest header field from the dynamic table.
[ "Remove", "and", "return", "the", "oldest", "header", "field", "from", "the", "dynamic", "table", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDynamicTable.java#L121-L132
train
Removes the first instance of the HpackHeaderField from this array.
[ 30522, 2270, 6522, 8684, 4974, 2121, 3790, 6366, 1006, 1007, 1063, 6522, 8684, 4974, 2121, 3790, 3718, 1027, 6522, 8684, 4974, 2121, 15155, 1031, 5725, 1033, 1025, 2065, 1006, 3718, 1027, 1027, 19701, 1007, 1063, 2709, 19701, 1025, 1065, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
alibaba/canal
client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/YmlConfigBinder.java
YmlConfigBinder.bindYmlToObj
public static <T> T bindYmlToObj(String prefix, String content, Class<T> clazz, String charset, Properties baseProperties) { try { byte[] contentBytes; if (charset == null) { contentBytes = content.getBytes("UTF-8"); } else { contentBytes = content.getBytes(charset); } YamlPropertySourceLoader propertySourceLoader = new YamlPropertySourceLoader(); Resource configResource = new ByteArrayResource(contentBytes); PropertySource<?> propertySource = propertySourceLoader.load("manualBindConfig", configResource, null); if (propertySource == null) { return null; } Properties properties = new Properties(); Map<String, Object> propertiesRes = new LinkedHashMap<>(); if (!StringUtils.isEmpty(prefix) && !prefix.endsWith(".")) { prefix = prefix + "."; } properties.putAll((Map<?, ?>) propertySource.getSource()); if (baseProperties != null) { baseProperties.putAll(properties); properties = baseProperties; } for (Map.Entry<?, ?> entry : ((Map<?, ?>) propertySource.getSource()).entrySet()) { String key = (String) entry.getKey(); Object value = entry.getValue(); if (prefix != null) { if (key != null && key.startsWith(prefix)) { key = key.substring(prefix.length()); } else { continue; } } if (value instanceof String && ((String) value).contains("${") && ((String) value).contains("}")) { PropertyPlaceholderHelper propertyPlaceholderHelper = new PropertyPlaceholderHelper("${", "}"); value = propertyPlaceholderHelper.replacePlaceholders((String) value, properties); } propertiesRes.put(key, value); } if (propertiesRes.isEmpty()) { return null; } propertySource = new MapPropertySource(propertySource.getName(), propertiesRes); T target = clazz.newInstance(); MutablePropertySources propertySources = new MutablePropertySources(); propertySources.addFirst(propertySource); PropertiesConfigurationFactory<Object> factory = new PropertiesConfigurationFactory<Object>(target); factory.setPropertySources(propertySources); factory.setIgnoreInvalidFields(true); factory.setIgnoreUnknownFields(true); factory.bindPropertiesToTarget(); return target; } catch (Exception e) { throw new RuntimeException(e); } }
java
public static <T> T bindYmlToObj(String prefix, String content, Class<T> clazz, String charset, Properties baseProperties) { try { byte[] contentBytes; if (charset == null) { contentBytes = content.getBytes("UTF-8"); } else { contentBytes = content.getBytes(charset); } YamlPropertySourceLoader propertySourceLoader = new YamlPropertySourceLoader(); Resource configResource = new ByteArrayResource(contentBytes); PropertySource<?> propertySource = propertySourceLoader.load("manualBindConfig", configResource, null); if (propertySource == null) { return null; } Properties properties = new Properties(); Map<String, Object> propertiesRes = new LinkedHashMap<>(); if (!StringUtils.isEmpty(prefix) && !prefix.endsWith(".")) { prefix = prefix + "."; } properties.putAll((Map<?, ?>) propertySource.getSource()); if (baseProperties != null) { baseProperties.putAll(properties); properties = baseProperties; } for (Map.Entry<?, ?> entry : ((Map<?, ?>) propertySource.getSource()).entrySet()) { String key = (String) entry.getKey(); Object value = entry.getValue(); if (prefix != null) { if (key != null && key.startsWith(prefix)) { key = key.substring(prefix.length()); } else { continue; } } if (value instanceof String && ((String) value).contains("${") && ((String) value).contains("}")) { PropertyPlaceholderHelper propertyPlaceholderHelper = new PropertyPlaceholderHelper("${", "}"); value = propertyPlaceholderHelper.replacePlaceholders((String) value, properties); } propertiesRes.put(key, value); } if (propertiesRes.isEmpty()) { return null; } propertySource = new MapPropertySource(propertySource.getName(), propertiesRes); T target = clazz.newInstance(); MutablePropertySources propertySources = new MutablePropertySources(); propertySources.addFirst(propertySource); PropertiesConfigurationFactory<Object> factory = new PropertiesConfigurationFactory<Object>(target); factory.setPropertySources(propertySources); factory.setIgnoreInvalidFields(true); factory.setIgnoreUnknownFields(true); factory.bindPropertiesToTarget(); return target; } catch (Exception e) { throw new RuntimeException(e); } }
[ "public", "static", "<", "T", ">", "T", "bindYmlToObj", "(", "String", "prefix", ",", "String", "content", ",", "Class", "<", "T", ">", "clazz", ",", "String", "charset", ",", "Properties", "baseProperties", ")", "{", "try", "{", "byte", "[", "]", "con...
将当前内容指定前缀部分绑定到指定对象并用环境变量中的属性替换占位符, 例: 当前内容有属性 zkServers: ${zookeeper.servers} 在envProperties中有属性 zookeeper.servers: 192.168.0.1:2181,192.168.0.1:2181,192.168.0.1:2181 则当前内容 zkServers 会被替换为 zkServers: 192.168.0.1:2181,192.168.0.1:2181,192.168.0.1:2181 注: 假设绑定的类中 zkServers 属性是 List<String> 对象, 则会自动映射成List @param prefix 指定前缀 @param content yml内容 @param clazz 指定对象类型 @param charset yml内容编码格式 @return 对象
[ "将当前内容指定前缀部分绑定到指定对象并用环境变量中的属性替换占位符", "例", ":", "当前内容有属性", "zkServers", ":", "$", "{", "zookeeper", ".", "servers", "}", "在envProperties中有属性", "zookeeper", ".", "servers", ":", "192", ".", "168", ".", "0", ".", "1", ":", "2181", "192", ".", "168", ".", "0",...
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/YmlConfigBinder.java#L82-L154
train
Bind a yml string to an object.
[ 30522, 2270, 10763, 1026, 1056, 1028, 1056, 14187, 24335, 23223, 16429, 3501, 1006, 5164, 17576, 1010, 5164, 4180, 1010, 2465, 1026, 1056, 1028, 18856, 10936, 2480, 1010, 5164, 25869, 13462, 1010, 5144, 2918, 21572, 4842, 7368, 1007, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/accumulators/AccumulatorHelper.java
AccumulatorHelper.mergeSingle
private static <V, R extends Serializable> Accumulator<V, R> mergeSingle(Accumulator<?, ?> target, Accumulator<?, ?> toMerge) { @SuppressWarnings("unchecked") Accumulator<V, R> typedTarget = (Accumulator<V, R>) target; @SuppressWarnings("unchecked") Accumulator<V, R> typedToMerge = (Accumulator<V, R>) toMerge; typedTarget.merge(typedToMerge); return typedTarget; }
java
private static <V, R extends Serializable> Accumulator<V, R> mergeSingle(Accumulator<?, ?> target, Accumulator<?, ?> toMerge) { @SuppressWarnings("unchecked") Accumulator<V, R> typedTarget = (Accumulator<V, R>) target; @SuppressWarnings("unchecked") Accumulator<V, R> typedToMerge = (Accumulator<V, R>) toMerge; typedTarget.merge(typedToMerge); return typedTarget; }
[ "private", "static", "<", "V", ",", "R", "extends", "Serializable", ">", "Accumulator", "<", "V", ",", "R", ">", "mergeSingle", "(", "Accumulator", "<", "?", ",", "?", ">", "target", ",", "Accumulator", "<", "?", ",", "?", ">", "toMerge", ")", "{", ...
Workaround method for type safety.
[ "Workaround", "method", "for", "type", "safety", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/accumulators/AccumulatorHelper.java#L83-L94
train
Merge two accumulator instances into one.
[ 30522, 2797, 10763, 1026, 1058, 1010, 1054, 8908, 7642, 21335, 3468, 1028, 16222, 2819, 20350, 1026, 1058, 1010, 1054, 1028, 13590, 7741, 2571, 1006, 16222, 2819, 20350, 1026, 1029, 30524, 1010, 1054, 1028, 21189, 7559, 18150, 1027, 1006, 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-http/src/main/java/cn/hutool/http/HttpUtil.java
HttpUtil.urlWithForm
public static String urlWithForm(String url, String queryString, Charset charset, boolean isEncode) { if (StrUtil.isBlank(queryString)) { // 无额外参数 if (StrUtil.contains(url, '?')) { // url中包含参数 return isEncode ? encodeParams(url, charset) : url; } return url; } // 始终有参数 final StrBuilder urlBuilder = StrBuilder.create(url.length() + queryString.length() + 16); int qmIndex = url.indexOf('?'); if (qmIndex > 0) { // 原URL带参数,则对这部分参数单独编码(如果选项为进行编码) urlBuilder.append(isEncode ? encodeParams(url, charset) : url); if (false == StrUtil.endWith(url, '&')) { // 已经带参数的情况下追加参数 urlBuilder.append('&'); } } else { // 原url无参数,则不做编码 urlBuilder.append(url); if (qmIndex < 0) { // 无 '?' 追加之 urlBuilder.append('?'); } } urlBuilder.append(isEncode ? encodeParams(queryString, charset) : queryString); return urlBuilder.toString(); }
java
public static String urlWithForm(String url, String queryString, Charset charset, boolean isEncode) { if (StrUtil.isBlank(queryString)) { // 无额外参数 if (StrUtil.contains(url, '?')) { // url中包含参数 return isEncode ? encodeParams(url, charset) : url; } return url; } // 始终有参数 final StrBuilder urlBuilder = StrBuilder.create(url.length() + queryString.length() + 16); int qmIndex = url.indexOf('?'); if (qmIndex > 0) { // 原URL带参数,则对这部分参数单独编码(如果选项为进行编码) urlBuilder.append(isEncode ? encodeParams(url, charset) : url); if (false == StrUtil.endWith(url, '&')) { // 已经带参数的情况下追加参数 urlBuilder.append('&'); } } else { // 原url无参数,则不做编码 urlBuilder.append(url); if (qmIndex < 0) { // 无 '?' 追加之 urlBuilder.append('?'); } } urlBuilder.append(isEncode ? encodeParams(queryString, charset) : queryString); return urlBuilder.toString(); }
[ "public", "static", "String", "urlWithForm", "(", "String", "url", ",", "String", "queryString", ",", "Charset", "charset", ",", "boolean", "isEncode", ")", "{", "if", "(", "StrUtil", ".", "isBlank", "(", "queryString", ")", ")", "{", "// 无额外参数\r", "if", "...
将表单数据字符串加到URL中(用于GET表单提交) @param url URL @param queryString 表单数据字符串 @param charset 编码 @param isEncode 是否对键和值做转义处理 @return 拼接后的字符串
[ "将表单数据字符串加到URL中(用于GET表单提交)" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpUtil.java#L623-L653
train
Returns a URL with the specified query string and encoding.
[ 30522, 2270, 10763, 5164, 24471, 2140, 24415, 14192, 1006, 5164, 24471, 2140, 1010, 5164, 23032, 3367, 4892, 1010, 25869, 13462, 25869, 13462, 1010, 22017, 20898, 2003, 2368, 16044, 1007, 1063, 2065, 1006, 2358, 22134, 4014, 1012, 2003, 28522...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
networknt/light-4j
handler/src/main/java/com/networknt/handler/Handler.java
Handler.setConfig
static void setConfig(String configName) throws Exception { Handler.configName = configName; config = (HandlerConfig) Config.getInstance().getJsonObjectConfig(configName, HandlerConfig.class); initHandlers(); initPaths(); }
java
static void setConfig(String configName) throws Exception { Handler.configName = configName; config = (HandlerConfig) Config.getInstance().getJsonObjectConfig(configName, HandlerConfig.class); initHandlers(); initPaths(); }
[ "static", "void", "setConfig", "(", "String", "configName", ")", "throws", "Exception", "{", "Handler", ".", "configName", "=", "configName", ";", "config", "=", "(", "HandlerConfig", ")", "Config", ".", "getInstance", "(", ")", ".", "getJsonObjectConfig", "("...
Exposed for testing only.
[ "Exposed", "for", "testing", "only", "." ]
2a60257c60663684c8f6dc8b5ea3cf184e534db6
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/handler/src/main/java/com/networknt/handler/Handler.java#L514-L519
train
Sets the config name.
[ 30522, 10763, 11675, 2275, 8663, 8873, 2290, 1006, 5164, 9530, 8873, 16989, 4168, 1007, 11618, 6453, 1063, 28213, 1012, 9530, 8873, 16989, 4168, 1027, 9530, 8873, 16989, 4168, 1025, 9530, 8873, 2290, 1027, 1006, 28213, 8663, 8873, 2290, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.getMatrix
public Matrix getMatrix(int[] r, int[] c) { Matrix X = new Matrix(r.length, c.length); double[][] B = X.getArray(); try { for (int i = 0; i < r.length; i++) { for (int j = 0; j < c.length; j++) { B[i][j] = A[r[i]][c[j]]; } } } catch (ArrayIndexOutOfBoundsException e) { throw new ArrayIndexOutOfBoundsException("Submatrix indices"); } return X; }
java
public Matrix getMatrix(int[] r, int[] c) { Matrix X = new Matrix(r.length, c.length); double[][] B = X.getArray(); try { for (int i = 0; i < r.length; i++) { for (int j = 0; j < c.length; j++) { B[i][j] = A[r[i]][c[j]]; } } } catch (ArrayIndexOutOfBoundsException e) { throw new ArrayIndexOutOfBoundsException("Submatrix indices"); } return X; }
[ "public", "Matrix", "getMatrix", "(", "int", "[", "]", "r", ",", "int", "[", "]", "c", ")", "{", "Matrix", "X", "=", "new", "Matrix", "(", "r", ".", "length", ",", "c", ".", "length", ")", ";", "double", "[", "]", "[", "]", "B", "=", "X", "...
Get a submatrix. @param r Array of row indices. @param c Array of column indices. @return A(r(:), c(:)) @throws ArrayIndexOutOfBoundsException Submatrix indices
[ "Get", "a", "submatrix", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L392-L411
train
Get a matrix of the 2D matrix.
[ 30522, 2270, 8185, 2131, 18900, 17682, 1006, 20014, 1031, 1033, 1054, 1010, 20014, 1031, 1033, 1039, 1007, 1063, 8185, 1060, 1027, 2047, 8185, 1006, 1054, 1012, 3091, 1010, 1039, 1012, 3091, 1007, 1025, 3313, 1031, 1033, 1031, 1033, 1038, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/algorithm/ahocorasick/trie/Trie.java
Trie.hasKeyword
public boolean hasKeyword(String text) { checkForConstructedFailureStates(); State currentState = this.rootState; for (int i = 0; i < text.length(); ++i) { State nextState = getState(currentState, text.charAt(i)); if (nextState != null && nextState != currentState && nextState.emit().size() != 0) { return true; } currentState = nextState; } return false; }
java
public boolean hasKeyword(String text) { checkForConstructedFailureStates(); State currentState = this.rootState; for (int i = 0; i < text.length(); ++i) { State nextState = getState(currentState, text.charAt(i)); if (nextState != null && nextState != currentState && nextState.emit().size() != 0) { return true; } currentState = nextState; } return false; }
[ "public", "boolean", "hasKeyword", "(", "String", "text", ")", "{", "checkForConstructedFailureStates", "(", ")", ";", "State", "currentState", "=", "this", ".", "rootState", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "text", ".", "length", "(...
文本是否包含任何模式 @param text 待匹配的文本 @return 文本包含模式時回傳true
[ "文本是否包含任何模式" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/algorithm/ahocorasick/trie/Trie.java#L319-L333
train
Checks if a text contains a keyword.
[ 30522, 2270, 22017, 20898, 2038, 14839, 18351, 1006, 5164, 3793, 1007, 1063, 4638, 29278, 8663, 3367, 6820, 10985, 7011, 4014, 14900, 12259, 2015, 1006, 1007, 1025, 2110, 14731, 12259, 1027, 2023, 1012, 6147, 12259, 1025, 2005, 1006, 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...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/BatchTask.java
BatchTask.openChainedTasks
public static void openChainedTasks(List<ChainedDriver<?, ?>> tasks, AbstractInvokable parent) throws Exception { // start all chained tasks for (int i = 0; i < tasks.size(); i++) { final ChainedDriver<?, ?> task = tasks.get(i); if (LOG.isDebugEnabled()) { LOG.debug(constructLogString("Start task code", task.getTaskName(), parent)); } task.openTask(); } }
java
public static void openChainedTasks(List<ChainedDriver<?, ?>> tasks, AbstractInvokable parent) throws Exception { // start all chained tasks for (int i = 0; i < tasks.size(); i++) { final ChainedDriver<?, ?> task = tasks.get(i); if (LOG.isDebugEnabled()) { LOG.debug(constructLogString("Start task code", task.getTaskName(), parent)); } task.openTask(); } }
[ "public", "static", "void", "openChainedTasks", "(", "List", "<", "ChainedDriver", "<", "?", ",", "?", ">", ">", "tasks", ",", "AbstractInvokable", "parent", ")", "throws", "Exception", "{", "// start all chained tasks", "for", "(", "int", "i", "=", "0", ";"...
Opens all chained tasks, in the order as they are stored in the array. The opening process creates a standardized log info message. @param tasks The tasks to be opened. @param parent The parent task, used to obtain parameters to include in the log message. @throws Exception Thrown, if the opening encounters an exception.
[ "Opens", "all", "chained", "tasks", "in", "the", "order", "as", "they", "are", "stored", "in", "the", "array", ".", "The", "opening", "process", "creates", "a", "standardized", "log", "info", "message", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/BatchTask.java#L1384-L1393
train
Open all chained tasks.
[ 30522, 2270, 10763, 11675, 2330, 24925, 7228, 10230, 5705, 1006, 2862, 1026, 22075, 23663, 2099, 1026, 1029, 1010, 1029, 1028, 1028, 8518, 1010, 10061, 2378, 6767, 2912, 3468, 6687, 1007, 11618, 6453, 1063, 1013, 1013, 2707, 2035, 22075, 85...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.post
public static String post(String urlString, Map<String, Object> paramMap) { return post(urlString, paramMap, HttpRequest.TIMEOUT_DEFAULT); }
java
public static String post(String urlString, Map<String, Object> paramMap) { return post(urlString, paramMap, HttpRequest.TIMEOUT_DEFAULT); }
[ "public", "static", "String", "post", "(", "String", "urlString", ",", "Map", "<", "String", ",", "Object", ">", "paramMap", ")", "{", "return", "post", "(", "urlString", ",", "paramMap", ",", "HttpRequest", ".", "TIMEOUT_DEFAULT", ")", ";", "}" ]
发送post请求 @param urlString 网址 @param paramMap post表单数据 @return 返回数据
[ "发送post请求" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpUtil.java#L153-L155
train
Perform a HTTP POST request with the given parameters.
[ 30522, 2270, 10763, 5164, 2695, 1006, 5164, 24471, 4877, 18886, 3070, 1010, 4949, 1026, 5164, 1010, 4874, 1028, 11498, 14760, 2361, 1007, 1063, 2709, 2695, 1006, 24471, 4877, 18886, 3070, 1010, 11498, 14760, 2361, 1010, 8299, 2890, 15500, 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/util/ReusingKeyGroupedIterator.java
ReusingKeyGroupedIterator.nextKey
@Override public boolean nextKey() throws IOException { // first element (or empty) if (this.current == null) { if (this.done) { this.valuesIterator = null; return false; } this.current = this.reuse; if ((this.current = this.iterator.next(this.current)) != null) { this.comparator.setReference(this.current); this.lookAheadHasNext = false; this.valuesIterator = new ValuesIterator(); this.valuesIterator.currentIsUnconsumed = true; return true; } else { // empty input, set everything null this.valuesIterator = null; this.current = null; this.done = true; return false; } } this.valuesIterator.iteratorAvailable = true; // Whole value-iterator was read and a new key is available. if (this.lookAheadHasNext) { this.lookAheadHasNext = false; this.current = this.lookahead; this.lookahead = null; this.comparator.setReference(this.current); this.valuesIterator.currentIsUnconsumed = true; return true; } // try to move to next key. // Required if user code / reduce() method did not read the whole value iterator. while (true) { if (!this.done && ((this.current = this.iterator.next(this.current)) != null)) { if (!this.comparator.equalToReference(this.current)) { // the keys do not match, so we have a new group. store the current keys this.comparator.setReference(this.current); this.lookAheadHasNext = false; this.valuesIterator.currentIsUnconsumed = true; return true; } } else { this.valuesIterator = null; this.current = null; this.done = true; return false; } } }
java
@Override public boolean nextKey() throws IOException { // first element (or empty) if (this.current == null) { if (this.done) { this.valuesIterator = null; return false; } this.current = this.reuse; if ((this.current = this.iterator.next(this.current)) != null) { this.comparator.setReference(this.current); this.lookAheadHasNext = false; this.valuesIterator = new ValuesIterator(); this.valuesIterator.currentIsUnconsumed = true; return true; } else { // empty input, set everything null this.valuesIterator = null; this.current = null; this.done = true; return false; } } this.valuesIterator.iteratorAvailable = true; // Whole value-iterator was read and a new key is available. if (this.lookAheadHasNext) { this.lookAheadHasNext = false; this.current = this.lookahead; this.lookahead = null; this.comparator.setReference(this.current); this.valuesIterator.currentIsUnconsumed = true; return true; } // try to move to next key. // Required if user code / reduce() method did not read the whole value iterator. while (true) { if (!this.done && ((this.current = this.iterator.next(this.current)) != null)) { if (!this.comparator.equalToReference(this.current)) { // the keys do not match, so we have a new group. store the current keys this.comparator.setReference(this.current); this.lookAheadHasNext = false; this.valuesIterator.currentIsUnconsumed = true; return true; } } else { this.valuesIterator = null; this.current = null; this.done = true; return false; } } }
[ "@", "Override", "public", "boolean", "nextKey", "(", ")", "throws", "IOException", "{", "// first element (or empty)", "if", "(", "this", ".", "current", "==", "null", ")", "{", "if", "(", "this", ".", "done", ")", "{", "this", ".", "valuesIterator", "=",...
Moves the iterator to the next key. This method may skip any values that have not yet been returned by the iterator created by the {@link #getValues()} method. Hence, if called multiple times it "removes" pairs. @return true if the input iterator has an other group of key-value pairs that share the same key.
[ "Moves", "the", "iterator", "to", "the", "next", "key", ".", "This", "method", "may", "skip", "any", "values", "that", "have", "not", "yet", "been", "returned", "by", "the", "iterator", "created", "by", "the", "{", "@link", "#getValues", "()", "}", "meth...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ReusingKeyGroupedIterator.java#L81-L137
train
This method returns true if the next key is available.
[ 30522, 1030, 2058, 15637, 2270, 22017, 20898, 2279, 30524, 1012, 5300, 21646, 8844, 1027, 19701, 1025, 2709, 6270, 1025, 1065, 2023, 1012, 2783, 1027, 2023, 1012, 2128, 8557, 1025, 2065, 1006, 1006, 2023, 1012, 2783, 1027, 2023, 1012, 2009,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/PatternStream.java
PatternStream.flatSelect
public <R> SingleOutputStreamOperator<R> flatSelect(final PatternFlatSelectFunction<T, R> patternFlatSelectFunction) { // we have to extract the output type from the provided pattern selection function manually // because the TypeExtractor cannot do that if the method is wrapped in a MapFunction final TypeInformation<R> outTypeInfo = TypeExtractor.getUnaryOperatorReturnType( patternFlatSelectFunction, PatternFlatSelectFunction.class, 0, 1, new int[]{1, 0}, builder.getInputType(), null, false); return flatSelect(patternFlatSelectFunction, outTypeInfo); }
java
public <R> SingleOutputStreamOperator<R> flatSelect(final PatternFlatSelectFunction<T, R> patternFlatSelectFunction) { // we have to extract the output type from the provided pattern selection function manually // because the TypeExtractor cannot do that if the method is wrapped in a MapFunction final TypeInformation<R> outTypeInfo = TypeExtractor.getUnaryOperatorReturnType( patternFlatSelectFunction, PatternFlatSelectFunction.class, 0, 1, new int[]{1, 0}, builder.getInputType(), null, false); return flatSelect(patternFlatSelectFunction, outTypeInfo); }
[ "public", "<", "R", ">", "SingleOutputStreamOperator", "<", "R", ">", "flatSelect", "(", "final", "PatternFlatSelectFunction", "<", "T", ",", "R", ">", "patternFlatSelectFunction", ")", "{", "// we have to extract the output type from the provided pattern selection function m...
Applies a flat select function to the detected pattern sequence. For each pattern sequence the provided {@link PatternFlatSelectFunction} is called. The pattern flat select function can produce an arbitrary number of resulting elements. @param patternFlatSelectFunction The pattern flat select function which is called for each detected pattern sequence. @param <R> Type of the resulting elements @return {@link DataStream} which contains the resulting elements from the pattern flat select function.
[ "Applies", "a", "flat", "select", "function", "to", "the", "detected", "pattern", "sequence", ".", "For", "each", "pattern", "sequence", "the", "provided", "{", "@link", "PatternFlatSelectFunction", "}", "is", "called", ".", "The", "pattern", "flat", "select", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/PatternStream.java#L329-L344
train
Flat select the output of a pattern selection function.
[ 30522, 2270, 1026, 1054, 1028, 2309, 5833, 18780, 21422, 25918, 8844, 1026, 1054, 1028, 14201, 12260, 6593, 1006, 2345, 5418, 10258, 11149, 12260, 6593, 11263, 27989, 1026, 1056, 1010, 1054, 1028, 5418, 10258, 11149, 12260, 6593, 11263, 27989...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/seg/Segment.java
Segment.mergeNumberQuantifier
protected void mergeNumberQuantifier(List<Vertex> termList, WordNet wordNetAll, Config config) { if (termList.size() < 4) return; StringBuilder sbQuantifier = new StringBuilder(); ListIterator<Vertex> iterator = termList.listIterator(); iterator.next(); int line = 1; while (iterator.hasNext()) { Vertex pre = iterator.next(); if (pre.hasNature(Nature.m)) { sbQuantifier.append(pre.realWord); Vertex cur = null; while (iterator.hasNext() && (cur = iterator.next()).hasNature(Nature.m)) { sbQuantifier.append(cur.realWord); iterator.remove(); removeFromWordNet(cur, wordNetAll, line, sbQuantifier.length()); } if (cur != null) { if ((cur.hasNature(Nature.q) || cur.hasNature(Nature.qv) || cur.hasNature(Nature.qt))) { if (config.indexMode > 0) { wordNetAll.add(line, new Vertex(sbQuantifier.toString(), new CoreDictionary.Attribute(Nature.m))); } sbQuantifier.append(cur.realWord); iterator.remove(); removeFromWordNet(cur, wordNetAll, line, sbQuantifier.length()); } else { line += cur.realWord.length(); // (cur = iterator.next()).hasNature(Nature.m) 最后一个next可能不含q词性 } } if (sbQuantifier.length() != pre.realWord.length()) { for (Vertex vertex : wordNetAll.get(line + pre.realWord.length())) { vertex.from = null; } pre.realWord = sbQuantifier.toString(); pre.word = Predefine.TAG_NUMBER; pre.attribute = new CoreDictionary.Attribute(Nature.mq); pre.wordID = CoreDictionary.M_WORD_ID; sbQuantifier.setLength(0); } } sbQuantifier.setLength(0); line += pre.realWord.length(); } // System.out.println(wordNetAll); }
java
protected void mergeNumberQuantifier(List<Vertex> termList, WordNet wordNetAll, Config config) { if (termList.size() < 4) return; StringBuilder sbQuantifier = new StringBuilder(); ListIterator<Vertex> iterator = termList.listIterator(); iterator.next(); int line = 1; while (iterator.hasNext()) { Vertex pre = iterator.next(); if (pre.hasNature(Nature.m)) { sbQuantifier.append(pre.realWord); Vertex cur = null; while (iterator.hasNext() && (cur = iterator.next()).hasNature(Nature.m)) { sbQuantifier.append(cur.realWord); iterator.remove(); removeFromWordNet(cur, wordNetAll, line, sbQuantifier.length()); } if (cur != null) { if ((cur.hasNature(Nature.q) || cur.hasNature(Nature.qv) || cur.hasNature(Nature.qt))) { if (config.indexMode > 0) { wordNetAll.add(line, new Vertex(sbQuantifier.toString(), new CoreDictionary.Attribute(Nature.m))); } sbQuantifier.append(cur.realWord); iterator.remove(); removeFromWordNet(cur, wordNetAll, line, sbQuantifier.length()); } else { line += cur.realWord.length(); // (cur = iterator.next()).hasNature(Nature.m) 最后一个next可能不含q词性 } } if (sbQuantifier.length() != pre.realWord.length()) { for (Vertex vertex : wordNetAll.get(line + pre.realWord.length())) { vertex.from = null; } pre.realWord = sbQuantifier.toString(); pre.word = Predefine.TAG_NUMBER; pre.attribute = new CoreDictionary.Attribute(Nature.mq); pre.wordID = CoreDictionary.M_WORD_ID; sbQuantifier.setLength(0); } } sbQuantifier.setLength(0); line += pre.realWord.length(); } // System.out.println(wordNetAll); }
[ "protected", "void", "mergeNumberQuantifier", "(", "List", "<", "Vertex", ">", "termList", ",", "WordNet", "wordNetAll", ",", "Config", "config", ")", "{", "if", "(", "termList", ".", "size", "(", ")", "<", "4", ")", "return", ";", "StringBuilder", "sbQuan...
合并数字 @param termList
[ "合并数字" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/Segment.java#L405-L459
train
Merge number quantifier.
[ 30522, 5123, 11675, 13590, 19172, 5677, 16211, 16778, 8873, 2121, 1006, 2862, 1026, 19449, 1028, 2744, 9863, 1010, 2773, 7159, 2773, 7159, 8095, 1010, 9530, 8873, 2290, 9530, 8873, 2290, 1007, 1063, 2065, 1006, 2744, 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...
looly/hutool
hutool-script/src/main/java/cn/hutool/script/ScriptUtil.java
ScriptUtil.eval
public static Object eval(String script, ScriptContext context) throws ScriptRuntimeException { try { return compile(script).eval(context); } catch (ScriptException e) { throw new ScriptRuntimeException(e); } }
java
public static Object eval(String script, ScriptContext context) throws ScriptRuntimeException { try { return compile(script).eval(context); } catch (ScriptException e) { throw new ScriptRuntimeException(e); } }
[ "public", "static", "Object", "eval", "(", "String", "script", ",", "ScriptContext", "context", ")", "throws", "ScriptRuntimeException", "{", "try", "{", "return", "compile", "(", "script", ")", ".", "eval", "(", "context", ")", ";", "}", "catch", "(", "Sc...
编译脚本 @param script 脚本内容 @param context 脚本上下文 @return {@link CompiledScript} @throws ScriptRuntimeException 脚本异常 @since 3.2.0
[ "编译脚本" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-script/src/main/java/cn/hutool/script/ScriptUtil.java#L63-L69
train
Evaluates a script in the given context.
[ 30522, 2270, 10763, 4874, 9345, 2140, 1006, 5164, 5896, 1010, 5896, 8663, 18209, 6123, 1007, 11618, 5896, 15532, 7292, 10288, 24422, 1063, 3046, 1063, 2709, 4012, 22090, 1006, 5896, 1007, 1012, 9345, 2140, 1006, 6123, 1007, 1025, 1065, 4608...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java
TaskSlotTable.markSlotActive
public boolean markSlotActive(AllocationID allocationId) throws SlotNotFoundException { checkInit(); TaskSlot taskSlot = getTaskSlot(allocationId); if (taskSlot != null) { if (taskSlot.markActive()) { // unregister a potential timeout LOG.info("Activate slot {}.", allocationId); timerService.unregisterTimeout(allocationId); return true; } else { return false; } } else { throw new SlotNotFoundException(allocationId); } }
java
public boolean markSlotActive(AllocationID allocationId) throws SlotNotFoundException { checkInit(); TaskSlot taskSlot = getTaskSlot(allocationId); if (taskSlot != null) { if (taskSlot.markActive()) { // unregister a potential timeout LOG.info("Activate slot {}.", allocationId); timerService.unregisterTimeout(allocationId); return true; } else { return false; } } else { throw new SlotNotFoundException(allocationId); } }
[ "public", "boolean", "markSlotActive", "(", "AllocationID", "allocationId", ")", "throws", "SlotNotFoundException", "{", "checkInit", "(", ")", ";", "TaskSlot", "taskSlot", "=", "getTaskSlot", "(", "allocationId", ")", ";", "if", "(", "taskSlot", "!=", "null", "...
Marks the slot under the given allocation id as active. If the slot could not be found, then a {@link SlotNotFoundException} is thrown. @param allocationId to identify the task slot to mark as active @throws SlotNotFoundException if the slot could not be found for the given allocation id @return True if the slot could be marked active; otherwise false
[ "Marks", "the", "slot", "under", "the", "given", "allocation", "id", "as", "active", ".", "If", "the", "slot", "could", "not", "be", "found", "then", "a", "{", "@link", "SlotNotFoundException", "}", "is", "thrown", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L229-L248
train
Mark the slot active.
[ 30522, 2270, 22017, 20898, 6017, 10994, 19620, 1006, 16169, 3593, 16169, 3593, 1007, 11618, 10453, 17048, 14876, 8630, 10288, 24422, 1063, 4638, 5498, 2102, 1006, 1007, 1025, 8518, 10994, 8518, 10994, 1027, 2131, 10230, 5705, 10994, 1006, 161...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/utils/JarHandlerUtils.java
JarHandlerUtils.tokenizeArguments
@VisibleForTesting static List<String> tokenizeArguments(@Nullable final String args) { if (args == null) { return Collections.emptyList(); } final Matcher matcher = ARGUMENTS_TOKENIZE_PATTERN.matcher(args); final List<String> tokens = new ArrayList<>(); while (matcher.find()) { tokens.add(matcher.group() .trim() .replace("\"", "") .replace("\'", "")); } return tokens; }
java
@VisibleForTesting static List<String> tokenizeArguments(@Nullable final String args) { if (args == null) { return Collections.emptyList(); } final Matcher matcher = ARGUMENTS_TOKENIZE_PATTERN.matcher(args); final List<String> tokens = new ArrayList<>(); while (matcher.find()) { tokens.add(matcher.group() .trim() .replace("\"", "") .replace("\'", "")); } return tokens; }
[ "@", "VisibleForTesting", "static", "List", "<", "String", ">", "tokenizeArguments", "(", "@", "Nullable", "final", "String", "args", ")", "{", "if", "(", "args", "==", "null", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "fin...
Takes program arguments as a single string, and splits them into a list of string. <pre> tokenizeArguments("--foo bar") = ["--foo" "bar"] tokenizeArguments("--foo \"bar baz\"") = ["--foo" "bar baz"] tokenizeArguments("--foo 'bar baz'") = ["--foo" "bar baz"] tokenizeArguments(null) = [] </pre> <strong>WARNING: </strong>This method does not respect escaped quotes.
[ "Takes", "program", "arguments", "as", "a", "single", "string", "and", "splits", "them", "into", "a", "list", "of", "string", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/utils/JarHandlerUtils.java#L176-L190
train
Tokenize arguments.
[ 30522, 1030, 5710, 13028, 4355, 2075, 10763, 2862, 1026, 5164, 1028, 19204, 4697, 2906, 22850, 11187, 1006, 1030, 19701, 3085, 2345, 5164, 12098, 5620, 1007, 1063, 2065, 1006, 12098, 5620, 1027, 1027, 19701, 1007, 1063, 2709, 6407, 1012, 40...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.createRequest
public static HttpRequest createRequest(Method method, String url) { return new HttpRequest(url).method(method); }
java
public static HttpRequest createRequest(Method method, String url) { return new HttpRequest(url).method(method); }
[ "public", "static", "HttpRequest", "createRequest", "(", "Method", "method", ",", "String", "url", ")", "{", "return", "new", "HttpRequest", "(", "url", ")", ".", "method", "(", "method", ")", ";", "}" ]
创建Http请求对象 @param method 方法枚举{@link Method} @param url 请求的URL,可以使HTTP或者HTTPS @return {@link HttpRequest} @since 3.0.9
[ "创建Http请求对象" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpUtil.java#L63-L65
train
Creates an HttpRequest with the given method and URL.
[ 30522, 2270, 10763, 8299, 2890, 15500, 3443, 2890, 15500, 1006, 4118, 4118, 1010, 5164, 24471, 2140, 1007, 1063, 2709, 2047, 8299, 2890, 15500, 1006, 24471, 2140, 1007, 1012, 4118, 1006, 4118, 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...
netty/netty
transport-native-epoll/src/main/java/io/netty/channel/epoll/NativeDatagramPacketArray.java
NativeDatagramPacketArray.add
boolean add(DatagramPacket packet) { if (count == packets.length) { // We already filled up to UIO_MAX_IOV messages. This is the max allowed per sendmmsg(...) call, we will // try again later. return false; } ByteBuf content = packet.content(); int len = content.readableBytes(); if (len == 0) { return true; } NativeDatagramPacket p = packets[count]; InetSocketAddress recipient = packet.recipient(); int offset = iovArray.count(); if (!iovArray.add(content)) { // Not enough space to hold the whole content, we will try again later. return false; } p.init(iovArray.memoryAddress(offset), iovArray.count() - offset, recipient); count++; return true; }
java
boolean add(DatagramPacket packet) { if (count == packets.length) { // We already filled up to UIO_MAX_IOV messages. This is the max allowed per sendmmsg(...) call, we will // try again later. return false; } ByteBuf content = packet.content(); int len = content.readableBytes(); if (len == 0) { return true; } NativeDatagramPacket p = packets[count]; InetSocketAddress recipient = packet.recipient(); int offset = iovArray.count(); if (!iovArray.add(content)) { // Not enough space to hold the whole content, we will try again later. return false; } p.init(iovArray.memoryAddress(offset), iovArray.count() - offset, recipient); count++; return true; }
[ "boolean", "add", "(", "DatagramPacket", "packet", ")", "{", "if", "(", "count", "==", "packets", ".", "length", ")", "{", "// We already filled up to UIO_MAX_IOV messages. This is the max allowed per sendmmsg(...) call, we will", "// try again later.", "return", "false", ";"...
Try to add the given {@link DatagramPacket}. Returns {@code true} on success, {@code false} otherwise.
[ "Try", "to", "add", "the", "given", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/NativeDatagramPacketArray.java#L52-L75
train
Add a new packet to the end of the list.
[ 30522, 22017, 20898, 5587, 1006, 2951, 13113, 23947, 3388, 14771, 1007, 1063, 2065, 1006, 4175, 1027, 1027, 23730, 1012, 3091, 1007, 1063, 1013, 1013, 2057, 2525, 3561, 2039, 2000, 21318, 2080, 1035, 4098, 1035, 22834, 2615, 7696, 1012, 202...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
codec-socks/src/main/java/io/netty/handler/codec/socksx/v4/Socks4ServerDecoder.java
Socks4ServerDecoder.readString
private static String readString(String fieldName, ByteBuf in) { int length = in.bytesBefore(MAX_FIELD_LENGTH + 1, (byte) 0); if (length < 0) { throw new DecoderException("field '" + fieldName + "' longer than " + MAX_FIELD_LENGTH + " chars"); } String value = in.readSlice(length).toString(CharsetUtil.US_ASCII); in.skipBytes(1); // Skip the NUL. return value; }
java
private static String readString(String fieldName, ByteBuf in) { int length = in.bytesBefore(MAX_FIELD_LENGTH + 1, (byte) 0); if (length < 0) { throw new DecoderException("field '" + fieldName + "' longer than " + MAX_FIELD_LENGTH + " chars"); } String value = in.readSlice(length).toString(CharsetUtil.US_ASCII); in.skipBytes(1); // Skip the NUL. return value; }
[ "private", "static", "String", "readString", "(", "String", "fieldName", ",", "ByteBuf", "in", ")", "{", "int", "length", "=", "in", ".", "bytesBefore", "(", "MAX_FIELD_LENGTH", "+", "1", ",", "(", "byte", ")", "0", ")", ";", "if", "(", "length", "<", ...
Reads a variable-length NUL-terminated string as defined in SOCKS4.
[ "Reads", "a", "variable", "-", "length", "NUL", "-", "terminated", "string", "as", "defined", "in", "SOCKS4", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-socks/src/main/java/io/netty/handler/codec/socksx/v4/Socks4ServerDecoder.java#L122-L132
train
Read a string from the buffer.
[ 30522, 2797, 10763, 5164, 9631, 18886, 3070, 1006, 5164, 2492, 18442, 1010, 24880, 8569, 2546, 1999, 1007, 1063, 20014, 3091, 1027, 1999, 1012, 27507, 4783, 29278, 2063, 1006, 4098, 1035, 2492, 1035, 3091, 1009, 1015, 1010, 1006, 24880, 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-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java
RequestedGlobalProperties.filterBySemanticProperties
public RequestedGlobalProperties filterBySemanticProperties(SemanticProperties props, int input) { // no semantic properties available. All global properties are filtered. if (props == null) { throw new NullPointerException("SemanticProperties may not be null."); } RequestedGlobalProperties rgProp = new RequestedGlobalProperties(); switch(this.partitioning) { case FULL_REPLICATION: case FORCED_REBALANCED: case CUSTOM_PARTITIONING: case RANDOM_PARTITIONED: case ANY_DISTRIBUTION: // make sure that certain properties are not pushed down return null; case HASH_PARTITIONED: case ANY_PARTITIONING: FieldSet newFields; if(this.partitioningFields instanceof FieldList) { newFields = new FieldList(); } else { newFields = new FieldSet(); } for (Integer targetField : this.partitioningFields) { int sourceField = props.getForwardingSourceField(input, targetField); if (sourceField >= 0) { newFields = newFields.addField(sourceField); } else { // partial partitionings are not preserved to avoid skewed partitioning return null; } } rgProp.partitioning = this.partitioning; rgProp.partitioningFields = newFields; return rgProp; case RANGE_PARTITIONED: // range partitioning Ordering newOrdering = new Ordering(); for (int i = 0; i < this.ordering.getInvolvedIndexes().size(); i++) { int value = this.ordering.getInvolvedIndexes().get(i); int sourceField = props.getForwardingSourceField(input, value); if (sourceField >= 0) { newOrdering.appendOrdering(sourceField, this.ordering.getType(i), this.ordering.getOrder(i)); } else { return null; } } rgProp.partitioning = this.partitioning; rgProp.ordering = newOrdering; rgProp.dataDistribution = this.dataDistribution; return rgProp; default: throw new RuntimeException("Unknown partitioning type encountered."); } }
java
public RequestedGlobalProperties filterBySemanticProperties(SemanticProperties props, int input) { // no semantic properties available. All global properties are filtered. if (props == null) { throw new NullPointerException("SemanticProperties may not be null."); } RequestedGlobalProperties rgProp = new RequestedGlobalProperties(); switch(this.partitioning) { case FULL_REPLICATION: case FORCED_REBALANCED: case CUSTOM_PARTITIONING: case RANDOM_PARTITIONED: case ANY_DISTRIBUTION: // make sure that certain properties are not pushed down return null; case HASH_PARTITIONED: case ANY_PARTITIONING: FieldSet newFields; if(this.partitioningFields instanceof FieldList) { newFields = new FieldList(); } else { newFields = new FieldSet(); } for (Integer targetField : this.partitioningFields) { int sourceField = props.getForwardingSourceField(input, targetField); if (sourceField >= 0) { newFields = newFields.addField(sourceField); } else { // partial partitionings are not preserved to avoid skewed partitioning return null; } } rgProp.partitioning = this.partitioning; rgProp.partitioningFields = newFields; return rgProp; case RANGE_PARTITIONED: // range partitioning Ordering newOrdering = new Ordering(); for (int i = 0; i < this.ordering.getInvolvedIndexes().size(); i++) { int value = this.ordering.getInvolvedIndexes().get(i); int sourceField = props.getForwardingSourceField(input, value); if (sourceField >= 0) { newOrdering.appendOrdering(sourceField, this.ordering.getType(i), this.ordering.getOrder(i)); } else { return null; } } rgProp.partitioning = this.partitioning; rgProp.ordering = newOrdering; rgProp.dataDistribution = this.dataDistribution; return rgProp; default: throw new RuntimeException("Unknown partitioning type encountered."); } }
[ "public", "RequestedGlobalProperties", "filterBySemanticProperties", "(", "SemanticProperties", "props", ",", "int", "input", ")", "{", "// no semantic properties available. All global properties are filtered.", "if", "(", "props", "==", "null", ")", "{", "throw", "new", "N...
Filters these properties by what can be preserved by the given SemanticProperties when propagated down to the given input. @param props The SemanticProperties which define which fields are preserved. @param input The index of the operator's input. @return The filtered RequestedGlobalProperties
[ "Filters", "these", "properties", "by", "what", "can", "be", "preserved", "by", "the", "given", "SemanticProperties", "when", "propagated", "down", "to", "the", "given", "input", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java#L236-L292
train
Filters the requested global properties by semantic properties.
[ 30522, 2270, 7303, 23296, 16429, 2389, 21572, 4842, 7368, 11307, 3762, 3366, 2386, 4588, 21572, 4842, 7368, 1006, 21641, 21572, 4842, 7368, 24387, 1010, 20014, 7953, 1007, 1063, 1013, 1013, 2053, 21641, 5144, 2800, 1012, 2035, 3795, 5144, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java
ReUtil.findAllGroup0
public static List<String> findAllGroup0(String regex, CharSequence content) { return findAll(regex, content, 0); }
java
public static List<String> findAllGroup0(String regex, CharSequence content) { return findAll(regex, content, 0); }
[ "public", "static", "List", "<", "String", ">", "findAllGroup0", "(", "String", "regex", ",", "CharSequence", "content", ")", "{", "return", "findAll", "(", "regex", ",", "content", ",", "0", ")", ";", "}" ]
取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组0的内容 @param regex 正则 @param content 被查找的内容 @return 结果列表 @since 3.1.2
[ "取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组0的内容" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L363-L365
train
Finds all groups of the given regex in the given content.
[ 30522, 2270, 10763, 2862, 1026, 5164, 1028, 2424, 8095, 17058, 2692, 1006, 5164, 19723, 10288, 1010, 25869, 3366, 4226, 5897, 4180, 1007, 1063, 2709, 2424, 8095, 1006, 19723, 10288, 1010, 4180, 1010, 1014, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/cache/DistributedCache.java
DistributedCache.writeFileInfoToConfig
public static void writeFileInfoToConfig(String name, DistributedCacheEntry e, Configuration conf) { int num = conf.getInteger(CACHE_FILE_NUM, 0) + 1; conf.setInteger(CACHE_FILE_NUM, num); conf.setString(CACHE_FILE_NAME + num, name); conf.setString(CACHE_FILE_PATH + num, e.filePath); conf.setBoolean(CACHE_FILE_EXE + num, e.isExecutable || new File(e.filePath).canExecute()); conf.setBoolean(CACHE_FILE_DIR + num, e.isZipped || new File(e.filePath).isDirectory()); if (e.blobKey != null) { conf.setBytes(CACHE_FILE_BLOB_KEY + num, e.blobKey); } }
java
public static void writeFileInfoToConfig(String name, DistributedCacheEntry e, Configuration conf) { int num = conf.getInteger(CACHE_FILE_NUM, 0) + 1; conf.setInteger(CACHE_FILE_NUM, num); conf.setString(CACHE_FILE_NAME + num, name); conf.setString(CACHE_FILE_PATH + num, e.filePath); conf.setBoolean(CACHE_FILE_EXE + num, e.isExecutable || new File(e.filePath).canExecute()); conf.setBoolean(CACHE_FILE_DIR + num, e.isZipped || new File(e.filePath).isDirectory()); if (e.blobKey != null) { conf.setBytes(CACHE_FILE_BLOB_KEY + num, e.blobKey); } }
[ "public", "static", "void", "writeFileInfoToConfig", "(", "String", "name", ",", "DistributedCacheEntry", "e", ",", "Configuration", "conf", ")", "{", "int", "num", "=", "conf", ".", "getInteger", "(", "CACHE_FILE_NUM", ",", "0", ")", "+", "1", ";", "conf", ...
------------------------------------------------------------------------
[ "------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/cache/DistributedCache.java#L132-L142
train
Write the file info to the configuration.
[ 30522, 2270, 10763, 11675, 4339, 8873, 19856, 14876, 3406, 8663, 8873, 2290, 1006, 5164, 2171, 1010, 5500, 3540, 25923, 3372, 2854, 1041, 1010, 9563, 9530, 2546, 1007, 1063, 20014, 16371, 2213, 1027, 9530, 2546, 1012, 2131, 18447, 26320, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/AbstractHeapPriorityQueue.java
AbstractHeapPriorityQueue.clear
public void clear() { final int arrayOffset = getHeadElementIndex(); Arrays.fill(queue, arrayOffset, arrayOffset + size, null); size = 0; }
java
public void clear() { final int arrayOffset = getHeadElementIndex(); Arrays.fill(queue, arrayOffset, arrayOffset + size, null); size = 0; }
[ "public", "void", "clear", "(", ")", "{", "final", "int", "arrayOffset", "=", "getHeadElementIndex", "(", ")", ";", "Arrays", ".", "fill", "(", "queue", ",", "arrayOffset", ",", "arrayOffset", "+", "size", ",", "null", ")", ";", "size", "=", "0", ";", ...
Clears the queue.
[ "Clears", "the", "queue", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/AbstractHeapPriorityQueue.java#L138-L142
train
Clear the queue.
[ 30522, 2270, 11675, 3154, 1006, 1007, 1063, 2345, 20014, 9140, 27475, 3388, 1027, 2131, 4974, 12260, 3672, 22254, 10288, 1006, 1007, 1025, 27448, 1012, 6039, 1006, 24240, 1010, 9140, 27475, 3388, 1010, 9140, 27475, 3388, 1009, 2946, 1010, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/operators/base/GroupReduceOperatorBase.java
GroupReduceOperatorBase.setCombinable
public void setCombinable(boolean combinable) { // sanity check if (combinable && !GroupCombineFunction.class.isAssignableFrom(this.userFunction.getUserCodeClass())) { throw new IllegalArgumentException("Cannot set a UDF as combinable if it does not implement the interface " + GroupCombineFunction.class.getName()); } else { this.combinable = combinable; } }
java
public void setCombinable(boolean combinable) { // sanity check if (combinable && !GroupCombineFunction.class.isAssignableFrom(this.userFunction.getUserCodeClass())) { throw new IllegalArgumentException("Cannot set a UDF as combinable if it does not implement the interface " + GroupCombineFunction.class.getName()); } else { this.combinable = combinable; } }
[ "public", "void", "setCombinable", "(", "boolean", "combinable", ")", "{", "// sanity check", "if", "(", "combinable", "&&", "!", "GroupCombineFunction", ".", "class", ".", "isAssignableFrom", "(", "this", ".", "userFunction", ".", "getUserCodeClass", "(", ")", ...
Marks the group reduce operation as combinable. Combinable operations may pre-reduce the data before the actual group reduce operations. Combinable user-defined functions must implement the interface {@link GroupCombineFunction}. @param combinable Flag to mark the group reduce operation as combinable.
[ "Marks", "the", "group", "reduce", "operation", "as", "combinable", ".", "Combinable", "operations", "may", "pre", "-", "reduce", "the", "data", "before", "the", "actual", "group", "reduce", "operations", ".", "Combinable", "user", "-", "defined", "functions", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/base/GroupReduceOperatorBase.java#L117-L125
train
Sets the combinable flag.
[ 30522, 2270, 11675, 2275, 18274, 3981, 3468, 1006, 22017, 20898, 22863, 3981, 3468, 1007, 1063, 1013, 1013, 20039, 4638, 2065, 1006, 22863, 3981, 3468, 1004, 1004, 999, 2177, 18274, 3170, 11263, 27989, 1012, 2465, 1012, 18061, 18719, 16989, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/ReflectUtil.java
ReflectUtil.isEqualsMethod
public static boolean isEqualsMethod(Method method) { if (method == null || false == method.getName().equals("equals")) { return false; } final Class<?>[] paramTypes = method.getParameterTypes(); return (1 == paramTypes.length && paramTypes[0] == Object.class); }
java
public static boolean isEqualsMethod(Method method) { if (method == null || false == method.getName().equals("equals")) { return false; } final Class<?>[] paramTypes = method.getParameterTypes(); return (1 == paramTypes.length && paramTypes[0] == Object.class); }
[ "public", "static", "boolean", "isEqualsMethod", "(", "Method", "method", ")", "{", "if", "(", "method", "==", "null", "||", "false", "==", "method", ".", "getName", "(", ")", ".", "equals", "(", "\"equals\"", ")", ")", "{", "return", "false", ";", "}"...
是否为equals方法 @param method 方法 @return 是否为equals方法
[ "是否为equals方法" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L614-L620
train
Checks if the given method is equals.
[ 30522, 2270, 10763, 22017, 20898, 2003, 2063, 26426, 6491, 11031, 7716, 1006, 4118, 4118, 1007, 1063, 2065, 1006, 4118, 1027, 1027, 19701, 1064, 1064, 6270, 1027, 1027, 4118, 1012, 2131, 18442, 1006, 1007, 1012, 19635, 1006, 1000, 19635, 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/recognition/ns/PlaceRecognition.java
PlaceRecognition.viterbiCompute
public static List<NS> viterbiCompute(List<EnumItem<NS>> roleTagList) { return Viterbi.computeEnum(roleTagList, PlaceDictionary.transformMatrixDictionary); }
java
public static List<NS> viterbiCompute(List<EnumItem<NS>> roleTagList) { return Viterbi.computeEnum(roleTagList, PlaceDictionary.transformMatrixDictionary); }
[ "public", "static", "List", "<", "NS", ">", "viterbiCompute", "(", "List", "<", "EnumItem", "<", "NS", ">", ">", "roleTagList", ")", "{", "return", "Viterbi", ".", "computeEnum", "(", "roleTagList", ",", "PlaceDictionary", ".", "transformMatrixDictionary", ")"...
维特比算法求解最优标签 @param roleTagList @return
[ "维特比算法求解最优标签" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/recognition/ns/PlaceRecognition.java#L125-L128
train
Compute the Viterbi role tag list.
[ 30522, 2270, 10763, 2862, 1026, 24978, 1028, 6819, 3334, 13592, 25377, 10421, 1006, 2862, 1026, 4372, 12717, 18532, 1026, 24978, 1028, 1028, 2535, 15900, 9863, 1007, 1063, 2709, 6819, 3334, 5638, 1012, 24134, 2368, 2819, 1006, 2535, 15900, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/TMDictionaryMaker.java
TMDictionaryMaker.addPair
public void addPair(String first, String second) { Map<String, Integer> firstMatrix = transferMatrix.get(first); if (firstMatrix == null) { firstMatrix = new TreeMap<String, Integer>(); transferMatrix.put(first, firstMatrix); } Integer frequency = firstMatrix.get(second); if (frequency == null) frequency = 0; firstMatrix.put(second, frequency + 1); }
java
public void addPair(String first, String second) { Map<String, Integer> firstMatrix = transferMatrix.get(first); if (firstMatrix == null) { firstMatrix = new TreeMap<String, Integer>(); transferMatrix.put(first, firstMatrix); } Integer frequency = firstMatrix.get(second); if (frequency == null) frequency = 0; firstMatrix.put(second, frequency + 1); }
[ "public", "void", "addPair", "(", "String", "first", ",", "String", "second", ")", "{", "Map", "<", "String", ",", "Integer", ">", "firstMatrix", "=", "transferMatrix", ".", "get", "(", "first", ")", ";", "if", "(", "firstMatrix", "==", "null", ")", "{...
添加一个转移例子,会在内部完成统计 @param first @param second
[ "添加一个转移例子,会在内部完成统计" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/dictionary/TMDictionaryMaker.java#L43-L54
train
Add a pair of a single class to the sequence.
[ 30522, 2270, 11675, 5587, 4502, 4313, 1006, 5164, 2034, 1010, 5164, 2117, 1007, 1063, 4949, 1026, 5164, 1010, 16109, 1028, 2034, 18900, 17682, 1027, 4651, 18900, 17682, 1012, 2131, 1006, 2034, 1007, 1025, 2065, 1006, 2034, 18900, 17682, 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...
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.urlContains
public static ExpectedCondition<Boolean> urlContains(final String fraction) { return new ExpectedCondition<Boolean>() { private String currentUrl = ""; @Override public Boolean apply(WebDriver driver) { currentUrl = driver.getCurrentUrl(); return currentUrl != null && currentUrl.contains(fraction); } @Override public String toString() { return String.format("url to contain \"%s\". Current url: \"%s\"", fraction, currentUrl); } }; }
java
public static ExpectedCondition<Boolean> urlContains(final String fraction) { return new ExpectedCondition<Boolean>() { private String currentUrl = ""; @Override public Boolean apply(WebDriver driver) { currentUrl = driver.getCurrentUrl(); return currentUrl != null && currentUrl.contains(fraction); } @Override public String toString() { return String.format("url to contain \"%s\". Current url: \"%s\"", fraction, currentUrl); } }; }
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "urlContains", "(", "final", "String", "fraction", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "private", "String", "currentUrl", "=", "\"\"", ";", "@", "Ov...
An expectation for the URL of the current page to contain specific text. @param fraction the fraction of the url that the page should be on @return <code>true</code> when the URL contains the text
[ "An", "expectation", "for", "the", "URL", "of", "the", "current", "page", "to", "contain", "specific", "text", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L126-L141
train
An expectation for checking if the current url contains the given fraction.
[ 30522, 2270, 10763, 3517, 8663, 20562, 1026, 22017, 20898, 1028, 24471, 22499, 12380, 7076, 1006, 2345, 5164, 12884, 1007, 1063, 2709, 2047, 3517, 8663, 20562, 1026, 22017, 20898, 1028, 1006, 1007, 1063, 2797, 5164, 2783, 3126, 2140, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/spark
launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java
CommandBuilderUtils.mergeEnvPathList
static void mergeEnvPathList(Map<String, String> userEnv, String envKey, String pathList) { if (!isEmpty(pathList)) { String current = firstNonEmpty(userEnv.get(envKey), System.getenv(envKey)); userEnv.put(envKey, join(File.pathSeparator, current, pathList)); } }
java
static void mergeEnvPathList(Map<String, String> userEnv, String envKey, String pathList) { if (!isEmpty(pathList)) { String current = firstNonEmpty(userEnv.get(envKey), System.getenv(envKey)); userEnv.put(envKey, join(File.pathSeparator, current, pathList)); } }
[ "static", "void", "mergeEnvPathList", "(", "Map", "<", "String", ",", "String", ">", "userEnv", ",", "String", "envKey", ",", "String", "pathList", ")", "{", "if", "(", "!", "isEmpty", "(", "pathList", ")", ")", "{", "String", "current", "=", "firstNonEm...
Updates the user environment, appending the given pathList to the existing value of the given environment variable (or setting it if it hasn't yet been set).
[ "Updates", "the", "user", "environment", "appending", "the", "given", "pathList", "to", "the", "existing", "value", "of", "the", "given", "environment", "variable", "(", "or", "setting", "it", "if", "it", "hasn", "t", "yet", "been", "set", ")", "." ]
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java#L114-L119
train
Merge env path list into user env.
[ 30522, 10763, 11675, 13590, 2368, 2615, 15069, 9863, 1006, 4949, 1026, 5164, 1010, 5164, 1028, 5310, 2368, 2615, 1010, 5164, 4372, 2615, 14839, 1010, 5164, 4130, 9863, 1007, 1063, 2065, 1006, 999, 2003, 6633, 13876, 2100, 1006, 4130, 9863, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/util/StringValueUtils.java
StringValueUtils.replaceNonWordChars
public static void replaceNonWordChars(StringValue string, char replacement) { final char[] chars = string.getCharArray(); final int len = string.length(); for (int i = 0; i < len; i++) { final char c = chars[i]; if (!(Character.isLetter(c) || Character.isDigit(c) || c == '_')) { chars[i] = replacement; } } }
java
public static void replaceNonWordChars(StringValue string, char replacement) { final char[] chars = string.getCharArray(); final int len = string.length(); for (int i = 0; i < len; i++) { final char c = chars[i]; if (!(Character.isLetter(c) || Character.isDigit(c) || c == '_')) { chars[i] = replacement; } } }
[ "public", "static", "void", "replaceNonWordChars", "(", "StringValue", "string", ",", "char", "replacement", ")", "{", "final", "char", "[", "]", "chars", "=", "string", ".", "getCharArray", "(", ")", ";", "final", "int", "len", "=", "string", ".", "length...
Replaces all non-word characters in a string by a given character. The only characters not replaced are the characters that qualify as word characters or digit characters with respect to {@link Character#isLetter(char)} or {@link Character#isDigit(char)}, as well as the underscore character. <p>This operation is intended to simplify strings for counting distinct words. @param string The string value to have the non-word characters replaced. @param replacement The character to use as the replacement.
[ "Replaces", "all", "non", "-", "word", "characters", "in", "a", "string", "by", "a", "given", "character", ".", "The", "only", "characters", "not", "replaced", "are", "the", "characters", "that", "qualify", "as", "word", "characters", "or", "digit", "charact...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/StringValueUtils.java#L62-L72
train
Replaces non - word characters in a string with a replacement character.
[ 30522, 2270, 10763, 11675, 5672, 8540, 18351, 7507, 2869, 1006, 5164, 10175, 5657, 5164, 1010, 25869, 6110, 1007, 1063, 2345, 25869, 1031, 1033, 25869, 2015, 1027, 5164, 1012, 2131, 7507, 19848, 9447, 1006, 1007, 1025, 2345, 20014, 18798, 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
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java
EmbeddedCLIServiceClient.getTables
@Override public OperationHandle getTables(SessionHandle sessionHandle, String catalogName, String schemaName, String tableName, List<String> tableTypes) throws HiveSQLException { return cliService.getTables(sessionHandle, catalogName, schemaName, tableName, tableTypes); }
java
@Override public OperationHandle getTables(SessionHandle sessionHandle, String catalogName, String schemaName, String tableName, List<String> tableTypes) throws HiveSQLException { return cliService.getTables(sessionHandle, catalogName, schemaName, tableName, tableTypes); }
[ "@", "Override", "public", "OperationHandle", "getTables", "(", "SessionHandle", "sessionHandle", ",", "String", "catalogName", ",", "String", "schemaName", ",", "String", "tableName", ",", "List", "<", "String", ">", "tableTypes", ")", "throws", "HiveSQLException",...
/* (non-Javadoc) @see org.apache.hive.service.cli.CLIServiceClient#getTables(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.util.List)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java#L119-L123
train
Get the tables for the sequence number.
[ 30522, 1030, 2058, 15637, 2270, 3169, 11774, 2571, 2131, 10880, 2015, 1006, 5219, 11774, 2571, 5219, 11774, 2571, 1010, 5164, 12105, 18442, 1010, 5164, 8040, 28433, 18442, 1010, 5164, 2795, 18442, 1010, 2862, 1026, 5164, 1028, 13855, 18863, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.form
public HttpRequest form(String name, byte[] fileBytes, String fileName) { if (null != fileBytes) { form(name, new BytesResource(fileBytes, fileName)); } return this; }
java
public HttpRequest form(String name, byte[] fileBytes, String fileName) { if (null != fileBytes) { form(name, new BytesResource(fileBytes, fileName)); } return this; }
[ "public", "HttpRequest", "form", "(", "String", "name", ",", "byte", "[", "]", "fileBytes", ",", "String", "fileName", ")", "{", "if", "(", "null", "!=", "fileBytes", ")", "{", "form", "(", "name", ",", "new", "BytesResource", "(", "fileBytes", ",", "f...
文件byte[]表单项<br> 一旦有文件加入,表单变为multipart/form-data @param name 名 @param fileBytes 需要上传的文件 @param fileName 文件名 @return this @since 4.1.0
[ "文件byte", "[]", "表单项<br", ">", "一旦有文件加入,表单变为multipart", "/", "form", "-", "data" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java#L545-L550
train
Adds a form file to the request.
[ 30522, 2270, 8299, 2890, 15500, 2433, 1006, 5164, 2171, 1010, 24880, 1031, 1033, 5371, 3762, 4570, 1010, 5164, 5371, 18442, 1007, 1063, 2065, 1006, 19701, 999, 1027, 5371, 3762, 4570, 1007, 1063, 2433, 1006, 2171, 1010, 2047, 27507, 6072, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...