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
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java
ZipUtil.zip
public static File zip(File zipFile, String path, String data, Charset charset) throws UtilException { return zip(zipFile, path, IoUtil.toStream(data, charset), charset); }
java
public static File zip(File zipFile, String path, String data, Charset charset) throws UtilException { return zip(zipFile, path, IoUtil.toStream(data, charset), charset); }
[ "public", "static", "File", "zip", "(", "File", "zipFile", ",", "String", "path", ",", "String", "data", ",", "Charset", "charset", ")", "throws", "UtilException", "{", "return", "zip", "(", "zipFile", ",", "path", ",", "IoUtil", ".", "toStream", "(", "d...
对流中的数据加入到压缩文件<br> @param zipFile 生成的Zip文件,包括文件名。注意:zipPath不能是srcPath路径下的子文件夹 @param path 流数据在压缩文件中的路径或文件名 @param data 要压缩的数据 @param charset 编码 @return 压缩文件 @throws UtilException IO异常 @since 3.2.2
[ "对流中的数据加入到压缩文件<br", ">" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L206-L208
train
Creates a zip file from the given file and path and data.
[ 30522, 2270, 10763, 5371, 14101, 1006, 5371, 14101, 8873, 2571, 1010, 5164, 4130, 1010, 5164, 2951, 1010, 25869, 13462, 25869, 13462, 1007, 11618, 21183, 9463, 2595, 24422, 1063, 2709, 14101, 1006, 14101, 8873, 2571, 1010, 4130, 1010, 22834, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java
SingleThreadEventExecutor.deadlineNanos
@UnstableApi protected long deadlineNanos() { ScheduledFutureTask<?> scheduledTask = peekScheduledTask(); if (scheduledTask == null) { return nanoTime() + SCHEDULE_PURGE_INTERVAL; } return scheduledTask.deadlineNanos(); }
java
@UnstableApi protected long deadlineNanos() { ScheduledFutureTask<?> scheduledTask = peekScheduledTask(); if (scheduledTask == null) { return nanoTime() + SCHEDULE_PURGE_INTERVAL; } return scheduledTask.deadlineNanos(); }
[ "@", "UnstableApi", "protected", "long", "deadlineNanos", "(", ")", "{", "ScheduledFutureTask", "<", "?", ">", "scheduledTask", "=", "peekScheduledTask", "(", ")", ";", "if", "(", "scheduledTask", "==", "null", ")", "{", "return", "nanoTime", "(", ")", "+", ...
Returns the absolute point in time (relative to {@link #nanoTime()}) at which the the next closest scheduled task should run.
[ "Returns", "the", "absolute", "point", "in", "time", "(", "relative", "to", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java#L451-L458
train
Returns the deadline of the current scheduled task.
[ 30522, 1030, 14480, 9331, 2072, 5123, 2146, 15117, 7229, 2891, 1006, 1007, 1063, 5115, 11263, 11244, 10230, 2243, 1026, 1029, 1028, 5115, 10230, 2243, 1027, 19043, 22842, 8566, 3709, 10230, 2243, 1006, 1007, 1025, 2065, 1006, 5115, 10230, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
common/src/main/java/io/netty/util/internal/PlatformDependent0.java
PlatformDependent0.majorVersion
static int majorVersion(final String javaSpecVersion) { final String[] components = javaSpecVersion.split("\\."); final int[] version = new int[components.length]; for (int i = 0; i < components.length; i++) { version[i] = Integer.parseInt(components[i]); } if (version[0] == 1) { assert version[1] >= 6; return version[1]; } else { return version[0]; } }
java
static int majorVersion(final String javaSpecVersion) { final String[] components = javaSpecVersion.split("\\."); final int[] version = new int[components.length]; for (int i = 0; i < components.length; i++) { version[i] = Integer.parseInt(components[i]); } if (version[0] == 1) { assert version[1] >= 6; return version[1]; } else { return version[0]; } }
[ "static", "int", "majorVersion", "(", "final", "String", "javaSpecVersion", ")", "{", "final", "String", "[", "]", "components", "=", "javaSpecVersion", ".", "split", "(", "\"\\\\.\"", ")", ";", "final", "int", "[", "]", "version", "=", "new", "int", "[", ...
Package-private for testing only
[ "Package", "-", "private", "for", "testing", "only" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/PlatformDependent0.java#L862-L875
train
Get the major version of the class.
[ 30522, 10763, 20014, 2350, 27774, 1006, 2345, 5164, 9262, 13102, 8586, 27774, 1007, 1063, 2345, 5164, 1031, 1033, 6177, 1027, 9262, 13102, 8586, 27774, 1012, 3975, 1006, 1000, 1032, 1032, 1012, 1000, 1007, 1025, 2345, 20014, 1031, 1033, 254...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java
Configuration.getTrimmedStringCollection
public Collection<String> getTrimmedStringCollection(String name) { String valueString = get(name); if (null == valueString) { Collection<String> empty = new ArrayList<String>(); return empty; } return StringUtils.getTrimmedStringCollection(valueString); }
java
public Collection<String> getTrimmedStringCollection(String name) { String valueString = get(name); if (null == valueString) { Collection<String> empty = new ArrayList<String>(); return empty; } return StringUtils.getTrimmedStringCollection(valueString); }
[ "public", "Collection", "<", "String", ">", "getTrimmedStringCollection", "(", "String", "name", ")", "{", "String", "valueString", "=", "get", "(", "name", ")", ";", "if", "(", "null", "==", "valueString", ")", "{", "Collection", "<", "String", ">", "empt...
Get the comma delimited values of the <code>name</code> property as a collection of <code>String</code>s, trimmed of the leading and trailing whitespace. If no such property is specified then empty <code>Collection</code> is returned. @param name property name. @return property value as a collection of <code>String</code>s, or empty <code>Collection</code>
[ "Get", "the", "comma", "delimited", "values", "of", "the", "<code", ">", "name<", "/", "code", ">", "property", "as", "a", "collection", "of", "<code", ">", "String<", "/", "code", ">", "s", "trimmed", "of", "the", "leading", "and", "trailing", "whitespa...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L2093-L2100
train
Gets the trimmed string collection.
[ 30522, 2270, 3074, 1026, 5164, 1028, 2131, 18886, 20058, 5104, 18886, 3070, 26895, 18491, 1006, 5164, 2171, 1007, 1063, 5164, 5300, 18886, 3070, 1027, 2131, 1006, 2171, 1007, 1025, 2065, 1006, 19701, 1027, 1027, 5300, 18886, 3070, 1007, 106...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java
ZooKeeperStateHandleStore.getAllAndLock
@SuppressWarnings("unchecked") public List<Tuple2<RetrievableStateHandle<T>, String>> getAllAndLock() throws Exception { final List<Tuple2<RetrievableStateHandle<T>, String>> stateHandles = new ArrayList<>(); boolean success = false; retry: while (!success) { stateHandles.clear(); Stat stat = client.checkExists().forPath("/"); if (stat == null) { break; // Node does not exist, done. } else { // Initial cVersion (number of changes to the children of this node) int initialCVersion = stat.getCversion(); List<String> children = client.getChildren().forPath("/"); for (String path : children) { path = "/" + path; try { final RetrievableStateHandle<T> stateHandle = getAndLock(path); stateHandles.add(new Tuple2<>(stateHandle, path)); } catch (KeeperException.NoNodeException ignored) { // Concurrent deletion, retry continue retry; } catch (IOException ioException) { LOG.warn("Could not get all ZooKeeper children. Node {} contained " + "corrupted data. Ignoring this node.", path, ioException); } } int finalCVersion = client.checkExists().forPath("/").getCversion(); // Check for concurrent modifications success = initialCVersion == finalCVersion; } } return stateHandles; }
java
@SuppressWarnings("unchecked") public List<Tuple2<RetrievableStateHandle<T>, String>> getAllAndLock() throws Exception { final List<Tuple2<RetrievableStateHandle<T>, String>> stateHandles = new ArrayList<>(); boolean success = false; retry: while (!success) { stateHandles.clear(); Stat stat = client.checkExists().forPath("/"); if (stat == null) { break; // Node does not exist, done. } else { // Initial cVersion (number of changes to the children of this node) int initialCVersion = stat.getCversion(); List<String> children = client.getChildren().forPath("/"); for (String path : children) { path = "/" + path; try { final RetrievableStateHandle<T> stateHandle = getAndLock(path); stateHandles.add(new Tuple2<>(stateHandle, path)); } catch (KeeperException.NoNodeException ignored) { // Concurrent deletion, retry continue retry; } catch (IOException ioException) { LOG.warn("Could not get all ZooKeeper children. Node {} contained " + "corrupted data. Ignoring this node.", path, ioException); } } int finalCVersion = client.checkExists().forPath("/").getCversion(); // Check for concurrent modifications success = initialCVersion == finalCVersion; } } return stateHandles; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "List", "<", "Tuple2", "<", "RetrievableStateHandle", "<", "T", ">", ",", "String", ">", ">", "getAllAndLock", "(", ")", "throws", "Exception", "{", "final", "List", "<", "Tuple2", "<", "Retrievab...
Gets all available state handles from ZooKeeper and locks the respective state nodes. <p>If there is a concurrent modification, the operation is retried until it succeeds. @return All state handles from ZooKeeper. @throws Exception If a ZooKeeper or state handle operation fails
[ "Gets", "all", "available", "state", "handles", "from", "ZooKeeper", "and", "locks", "the", "respective", "state", "nodes", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java#L279-L321
train
Get all state handles and lock the node.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 2270, 2862, 1026, 10722, 10814, 2475, 1026, 2128, 18886, 13331, 13510, 12259, 11774, 2571, 1026, 1056, 1028, 1010, 5164, 1028, 1028, 2131, 25425, 4859, 7878, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshot.java
PojoSerializerSnapshot.getCompatibilityOfPreExistingFields
private static <T> IntermediateCompatibilityResult<T> getCompatibilityOfPreExistingFields( PojoSerializer<T> newPojoSerializer, LinkedOptionalMap<Field, TypeSerializerSnapshot<?>> fieldSerializerSnapshots) { // the present entries dictates the preexisting fields, because removed fields would be // represented as absent keys in the optional map. final Set<LinkedOptionalMap.KeyValue<Field, TypeSerializerSnapshot<?>>> presentFieldSnapshots = fieldSerializerSnapshots.getPresentEntries(); final ArrayList<TypeSerializerSnapshot<?>> associatedFieldSerializerSnapshots = new ArrayList<>(presentFieldSnapshots.size()); final ArrayList<TypeSerializer<?>> associatedNewFieldSerializers = new ArrayList<>(presentFieldSnapshots.size()); final Map<Field, TypeSerializer<?>> newFieldSerializersIndex = buildNewFieldSerializersIndex(newPojoSerializer); for (LinkedOptionalMap.KeyValue<Field, TypeSerializerSnapshot<?>> presentFieldEntry : presentFieldSnapshots) { TypeSerializer<?> associatedNewFieldSerializer = newFieldSerializersIndex.get(presentFieldEntry.getKey()); checkState( associatedNewFieldSerializer != null, "a present field should have its associated new field serializer available."); associatedFieldSerializerSnapshots.add(presentFieldEntry.getValue()); associatedNewFieldSerializers.add(associatedNewFieldSerializer); } return CompositeTypeSerializerUtil.constructIntermediateCompatibilityResult( associatedNewFieldSerializers.toArray(new TypeSerializer<?>[associatedNewFieldSerializers.size()]), associatedFieldSerializerSnapshots.toArray(new TypeSerializerSnapshot<?>[associatedFieldSerializerSnapshots.size()])); }
java
private static <T> IntermediateCompatibilityResult<T> getCompatibilityOfPreExistingFields( PojoSerializer<T> newPojoSerializer, LinkedOptionalMap<Field, TypeSerializerSnapshot<?>> fieldSerializerSnapshots) { // the present entries dictates the preexisting fields, because removed fields would be // represented as absent keys in the optional map. final Set<LinkedOptionalMap.KeyValue<Field, TypeSerializerSnapshot<?>>> presentFieldSnapshots = fieldSerializerSnapshots.getPresentEntries(); final ArrayList<TypeSerializerSnapshot<?>> associatedFieldSerializerSnapshots = new ArrayList<>(presentFieldSnapshots.size()); final ArrayList<TypeSerializer<?>> associatedNewFieldSerializers = new ArrayList<>(presentFieldSnapshots.size()); final Map<Field, TypeSerializer<?>> newFieldSerializersIndex = buildNewFieldSerializersIndex(newPojoSerializer); for (LinkedOptionalMap.KeyValue<Field, TypeSerializerSnapshot<?>> presentFieldEntry : presentFieldSnapshots) { TypeSerializer<?> associatedNewFieldSerializer = newFieldSerializersIndex.get(presentFieldEntry.getKey()); checkState( associatedNewFieldSerializer != null, "a present field should have its associated new field serializer available."); associatedFieldSerializerSnapshots.add(presentFieldEntry.getValue()); associatedNewFieldSerializers.add(associatedNewFieldSerializer); } return CompositeTypeSerializerUtil.constructIntermediateCompatibilityResult( associatedNewFieldSerializers.toArray(new TypeSerializer<?>[associatedNewFieldSerializers.size()]), associatedFieldSerializerSnapshots.toArray(new TypeSerializerSnapshot<?>[associatedFieldSerializerSnapshots.size()])); }
[ "private", "static", "<", "T", ">", "IntermediateCompatibilityResult", "<", "T", ">", "getCompatibilityOfPreExistingFields", "(", "PojoSerializer", "<", "T", ">", "newPojoSerializer", ",", "LinkedOptionalMap", "<", "Field", ",", "TypeSerializerSnapshot", "<", "?", ">"...
Finds which Pojo fields exists both in the new {@link PojoSerializer} as well as in the previous one (represented by this snapshot), and returns an {@link IntermediateCompatibilityResult} of the serializers of those preexisting fields.
[ "Finds", "which", "Pojo", "fields", "exists", "both", "in", "the", "new", "{" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshot.java#L266-L292
train
Returns the compatibility of the preexisting fields.
[ 30522, 2797, 10763, 1026, 1056, 1028, 7783, 9006, 24952, 8553, 6072, 11314, 1026, 1056, 1028, 2131, 9006, 24952, 8553, 11253, 28139, 10288, 2923, 2075, 15155, 1006, 13433, 19929, 11610, 28863, 1026, 1056, 1028, 2047, 6873, 19929, 11610, 28863...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java
OpenSslSessionStats.timeouts
public long timeouts() { Lock readerLock = context.ctxLock.readLock(); readerLock.lock(); try { return SSLContext.sessionTimeouts(context.ctx); } finally { readerLock.unlock(); } }
java
public long timeouts() { Lock readerLock = context.ctxLock.readLock(); readerLock.lock(); try { return SSLContext.sessionTimeouts(context.ctx); } finally { readerLock.unlock(); } }
[ "public", "long", "timeouts", "(", ")", "{", "Lock", "readerLock", "=", "context", ".", "ctxLock", ".", "readLock", "(", ")", ";", "readerLock", ".", "lock", "(", ")", ";", "try", "{", "return", "SSLContext", ".", "sessionTimeouts", "(", "context", ".", ...
Returns the number of sessions proposed by clients and either found in the internal or external session cache in server mode, but that were invalid due to timeout. These sessions are not included in the {@link #hits()} count.
[ "Returns", "the", "number", "of", "sessions", "proposed", "by", "clients", "and", "either", "found", "in", "the", "internal", "or", "external", "session", "cache", "in", "server", "mode", "but", "that", "were", "invalid", "due", "to", "timeout", ".", "These"...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslSessionStats.java#L178-L186
train
Gets the number of session timeouts.
[ 30522, 2270, 2146, 2051, 12166, 1006, 1007, 1063, 5843, 8068, 7878, 1027, 6123, 1012, 14931, 2595, 7878, 1012, 3191, 7878, 1006, 1007, 1025, 8068, 7878, 1012, 5843, 1006, 1007, 1025, 3046, 1063, 2709, 7020, 22499, 10111, 18413, 1012, 5219, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/JobID.java
JobID.fromHexString
public static JobID fromHexString(String hexString) { try { return new JobID(StringUtils.hexStringToByte(hexString)); } catch (Exception e) { throw new IllegalArgumentException("Cannot parse JobID from \"" + hexString + "\". The expected format is " + "[0-9a-fA-F]{32}, e.g. fd72014d4c864993a2e5a9287b4a9c5d.", e); } }
java
public static JobID fromHexString(String hexString) { try { return new JobID(StringUtils.hexStringToByte(hexString)); } catch (Exception e) { throw new IllegalArgumentException("Cannot parse JobID from \"" + hexString + "\". The expected format is " + "[0-9a-fA-F]{32}, e.g. fd72014d4c864993a2e5a9287b4a9c5d.", e); } }
[ "public", "static", "JobID", "fromHexString", "(", "String", "hexString", ")", "{", "try", "{", "return", "new", "JobID", "(", "StringUtils", ".", "hexStringToByte", "(", "hexString", ")", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", ...
Parses a JobID from the given string. @param hexString string representation of a JobID @return Parsed JobID @throws IllegalArgumentException if the JobID could not be parsed from the given string
[ "Parses", "a", "JobID", "from", "the", "given", "string", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/JobID.java#L107-L114
train
Parses a JobID from a hexadecimal string.
[ 30522, 2270, 10763, 3105, 3593, 2013, 5369, 2595, 3367, 4892, 1006, 5164, 2002, 2595, 3367, 4892, 1007, 1063, 3046, 1063, 2709, 2047, 3105, 3593, 1006, 5164, 21823, 4877, 1012, 2002, 2595, 3367, 4892, 3406, 3762, 2618, 1006, 2002, 2595, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/model/crf/crfpp/Encoder.java
Encoder.runCRF
private boolean runCRF(List<TaggerImpl> x, EncoderFeatureIndex featureIndex, double[] alpha, int maxItr, double C, double eta, int shrinkingSize, int threadNum, boolean orthant) { double oldObj = 1e+37; int converge = 0; LbfgsOptimizer lbfgs = new LbfgsOptimizer(); List<CRFEncoderThread> threads = new ArrayList<CRFEncoderThread>(); for (int i = 0; i < threadNum; i++) { CRFEncoderThread thread = new CRFEncoderThread(alpha.length); thread.start_i = i; thread.size = x.size(); thread.threadNum = threadNum; thread.x = x; threads.add(thread); } int all = 0; for (int i = 0; i < x.size(); i++) { all += x.get(i).size(); } ExecutorService executor = Executors.newFixedThreadPool(threadNum); for (int itr = 0; itr < maxItr; itr++) { featureIndex.clear(); try { executor.invokeAll(threads); } catch (Exception e) { e.printStackTrace(); return false; } for (int i = 1; i < threadNum; i++) { threads.get(0).obj += threads.get(i).obj; threads.get(0).err += threads.get(i).err; threads.get(0).zeroone += threads.get(i).zeroone; } for (int i = 1; i < threadNum; i++) { for (int k = 0; k < featureIndex.size(); k++) { threads.get(0).expected[k] += threads.get(i).expected[k]; } } int numNonZero = 0; if (orthant) { for (int k = 0; k < featureIndex.size(); k++) { threads.get(0).obj += Math.abs(alpha[k] / C); if (alpha[k] != 0.0) { numNonZero++; } } } else { numNonZero = featureIndex.size(); for (int k = 0; k < featureIndex.size(); k++) { threads.get(0).obj += (alpha[k] * alpha[k] / (2.0 * C)); threads.get(0).expected[k] += alpha[k] / C; } } for (int i = 1; i < threadNum; i++) { // try to free some memory threads.get(i).expected = null; } double diff = (itr == 0 ? 1.0 : Math.abs(oldObj - threads.get(0).obj) / oldObj); StringBuilder b = new StringBuilder(); b.append("iter=").append(itr); b.append(" terr=").append(1.0 * threads.get(0).err / all); b.append(" serr=").append(1.0 * threads.get(0).zeroone / x.size()); b.append(" act=").append(numNonZero); b.append(" obj=").append(threads.get(0).obj); b.append(" diff=").append(diff); System.out.println(b.toString()); oldObj = threads.get(0).obj; if (diff < eta) { converge++; } else { converge = 0; } if (itr > maxItr || converge == 3) { break; } int ret = lbfgs.optimize(featureIndex.size(), alpha, threads.get(0).obj, threads.get(0).expected, orthant, C); if (ret <= 0) { return false; } } executor.shutdown(); try { executor.awaitTermination(-1, TimeUnit.SECONDS); } catch (Exception e) { e.printStackTrace(); System.err.println("fail waiting executor to shutdown"); } return true; }
java
private boolean runCRF(List<TaggerImpl> x, EncoderFeatureIndex featureIndex, double[] alpha, int maxItr, double C, double eta, int shrinkingSize, int threadNum, boolean orthant) { double oldObj = 1e+37; int converge = 0; LbfgsOptimizer lbfgs = new LbfgsOptimizer(); List<CRFEncoderThread> threads = new ArrayList<CRFEncoderThread>(); for (int i = 0; i < threadNum; i++) { CRFEncoderThread thread = new CRFEncoderThread(alpha.length); thread.start_i = i; thread.size = x.size(); thread.threadNum = threadNum; thread.x = x; threads.add(thread); } int all = 0; for (int i = 0; i < x.size(); i++) { all += x.get(i).size(); } ExecutorService executor = Executors.newFixedThreadPool(threadNum); for (int itr = 0; itr < maxItr; itr++) { featureIndex.clear(); try { executor.invokeAll(threads); } catch (Exception e) { e.printStackTrace(); return false; } for (int i = 1; i < threadNum; i++) { threads.get(0).obj += threads.get(i).obj; threads.get(0).err += threads.get(i).err; threads.get(0).zeroone += threads.get(i).zeroone; } for (int i = 1; i < threadNum; i++) { for (int k = 0; k < featureIndex.size(); k++) { threads.get(0).expected[k] += threads.get(i).expected[k]; } } int numNonZero = 0; if (orthant) { for (int k = 0; k < featureIndex.size(); k++) { threads.get(0).obj += Math.abs(alpha[k] / C); if (alpha[k] != 0.0) { numNonZero++; } } } else { numNonZero = featureIndex.size(); for (int k = 0; k < featureIndex.size(); k++) { threads.get(0).obj += (alpha[k] * alpha[k] / (2.0 * C)); threads.get(0).expected[k] += alpha[k] / C; } } for (int i = 1; i < threadNum; i++) { // try to free some memory threads.get(i).expected = null; } double diff = (itr == 0 ? 1.0 : Math.abs(oldObj - threads.get(0).obj) / oldObj); StringBuilder b = new StringBuilder(); b.append("iter=").append(itr); b.append(" terr=").append(1.0 * threads.get(0).err / all); b.append(" serr=").append(1.0 * threads.get(0).zeroone / x.size()); b.append(" act=").append(numNonZero); b.append(" obj=").append(threads.get(0).obj); b.append(" diff=").append(diff); System.out.println(b.toString()); oldObj = threads.get(0).obj; if (diff < eta) { converge++; } else { converge = 0; } if (itr > maxItr || converge == 3) { break; } int ret = lbfgs.optimize(featureIndex.size(), alpha, threads.get(0).obj, threads.get(0).expected, orthant, C); if (ret <= 0) { return false; } } executor.shutdown(); try { executor.awaitTermination(-1, TimeUnit.SECONDS); } catch (Exception e) { e.printStackTrace(); System.err.println("fail waiting executor to shutdown"); } return true; }
[ "private", "boolean", "runCRF", "(", "List", "<", "TaggerImpl", ">", "x", ",", "EncoderFeatureIndex", "featureIndex", ",", "double", "[", "]", "alpha", ",", "int", "maxItr", ",", "double", "C", ",", "double", "eta", ",", "int", "shrinkingSize", ",", "int",...
CRF训练 @param x 句子列表 @param featureIndex 特征编号表 @param alpha 特征函数的代价 @param maxItr 最大迭代次数 @param C cost factor @param eta 收敛阈值 @param shrinkingSize 未使用 @param threadNum 线程数 @param orthant 是否使用L1范数 @return 是否成功
[ "CRF训练" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/crf/crfpp/Encoder.java#L213-L342
train
Run CRF.
[ 30522, 2797, 22017, 20898, 2448, 26775, 2546, 1006, 2862, 1026, 6415, 4590, 5714, 24759, 1028, 1060, 1010, 4372, 16044, 12881, 5243, 11244, 22254, 10288, 3444, 22254, 10288, 1010, 3313, 1031, 1033, 6541, 1010, 20014, 21510, 16344, 1010, 3313,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java
MemorySegment.getChar
@SuppressWarnings("restriction") public final char getChar(int index) { final long pos = address + index; if (index >= 0 && pos <= addressLimit - 2) { return UNSAFE.getChar(heapMemory, pos); } else if (address > addressLimit) { throw new IllegalStateException("This segment has been freed."); } else { // index is in fact invalid throw new IndexOutOfBoundsException(); } }
java
@SuppressWarnings("restriction") public final char getChar(int index) { final long pos = address + index; if (index >= 0 && pos <= addressLimit - 2) { return UNSAFE.getChar(heapMemory, pos); } else if (address > addressLimit) { throw new IllegalStateException("This segment has been freed."); } else { // index is in fact invalid throw new IndexOutOfBoundsException(); } }
[ "@", "SuppressWarnings", "(", "\"restriction\"", ")", "public", "final", "char", "getChar", "(", "int", "index", ")", "{", "final", "long", "pos", "=", "address", "+", "index", ";", "if", "(", "index", ">=", "0", "&&", "pos", "<=", "addressLimit", "-", ...
Reads a char value from the given position, in the system's native byte order. @param index The position from which the memory will be read. @return The char value at the given position. @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger than the segment size minus 2.
[ "Reads", "a", "char", "value", "from", "the", "given", "position", "in", "the", "system", "s", "native", "byte", "order", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L421-L434
train
Gets a char from the segment.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 16840, 1000, 1007, 2270, 2345, 25869, 2131, 7507, 2099, 1006, 20014, 5950, 1007, 1063, 2345, 2146, 13433, 2015, 1027, 4769, 1009, 5950, 1025, 2065, 1006, 5950, 1028, 1027, 1014, 1004, 1004, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java
NumberUtil.roundStr
public static String roundStr(double v, int scale, RoundingMode roundingMode) { return round(v, scale, roundingMode).toString(); }
java
public static String roundStr(double v, int scale, RoundingMode roundingMode) { return round(v, scale, roundingMode).toString(); }
[ "public", "static", "String", "roundStr", "(", "double", "v", ",", "int", "scale", ",", "RoundingMode", "roundingMode", ")", "{", "return", "round", "(", "v", ",", "scale", ",", "roundingMode", ")", ".", "toString", "(", ")", ";", "}" ]
保留固定位数小数<br> 例如保留四位小数:123.456789 =》 123.4567 @param v 值 @param scale 保留小数位数 @param roundingMode 保留小数的模式 {@link RoundingMode} @return 新值 @since 3.2.2
[ "保留固定位数小数<br", ">", "例如保留四位小数:123", ".", "456789", "=", "》", "123", ".", "4567" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L843-L845
train
Returns a string representation of the given value rounded to the given scale.
[ 30522, 2270, 10763, 5164, 6241, 16344, 1006, 3313, 1058, 1010, 20014, 4094, 1010, 26939, 5302, 3207, 26939, 5302, 3207, 1007, 1063, 2709, 2461, 1006, 1058, 30524, 2000, 3367, 4892, 1006, 1007, 1025, 1065, 102, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/ssh/Sftp.java
Sftp.delDir
@Override @SuppressWarnings("unchecked") public boolean delDir(String dirPath) { if (false == cd(dirPath)) { return false; } Vector<LsEntry> list = null; try { list = channel.ls(channel.pwd()); } catch (SftpException e) { throw new JschRuntimeException(e); } String fileName; for (LsEntry entry : list) { fileName = entry.getFilename(); if (false == fileName.equals(".") && false == fileName.equals("..")) { if (entry.getAttrs().isDir()) { delDir(fileName); } else { delFile(fileName); } } } if (false == cd("..")) { return false; } // 删除空目录 try { channel.rmdir(dirPath); return true; } catch (SftpException e) { throw new JschRuntimeException(e); } }
java
@Override @SuppressWarnings("unchecked") public boolean delDir(String dirPath) { if (false == cd(dirPath)) { return false; } Vector<LsEntry> list = null; try { list = channel.ls(channel.pwd()); } catch (SftpException e) { throw new JschRuntimeException(e); } String fileName; for (LsEntry entry : list) { fileName = entry.getFilename(); if (false == fileName.equals(".") && false == fileName.equals("..")) { if (entry.getAttrs().isDir()) { delDir(fileName); } else { delFile(fileName); } } } if (false == cd("..")) { return false; } // 删除空目录 try { channel.rmdir(dirPath); return true; } catch (SftpException e) { throw new JschRuntimeException(e); } }
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "boolean", "delDir", "(", "String", "dirPath", ")", "{", "if", "(", "false", "==", "cd", "(", "dirPath", ")", ")", "{", "return", "false", ";", "}", "Vector", "<", "LsEntry", ...
删除文件夹及其文件夹下的所有文件 @param dirPath 文件夹路径 @return boolean 是否删除成功
[ "删除文件夹及其文件夹下的所有文件" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ssh/Sftp.java#L311-L348
train
Deletes the file or directory with the specified path.
[ 30522, 1030, 2058, 15637, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 2270, 22017, 20898, 3972, 4305, 2099, 1006, 5164, 16101, 15069, 1007, 1063, 2065, 1006, 6270, 1027, 1027, 3729, 1006, 16101, 15069, 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...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/convert/Convert.java
Convert.toSBC
public static String toSBC(String input, Set<Character> notConvertSet) { char c[] = input.toCharArray(); for (int i = 0; i < c.length; i++) { if (null != notConvertSet && notConvertSet.contains(c[i])) { // 跳过不替换的字符 continue; } if (c[i] == ' ') { c[i] = '\u3000'; } else if (c[i] < '\177') { c[i] = (char) (c[i] + 65248); } } return new String(c); }
java
public static String toSBC(String input, Set<Character> notConvertSet) { char c[] = input.toCharArray(); for (int i = 0; i < c.length; i++) { if (null != notConvertSet && notConvertSet.contains(c[i])) { // 跳过不替换的字符 continue; } if (c[i] == ' ') { c[i] = '\u3000'; } else if (c[i] < '\177') { c[i] = (char) (c[i] + 65248); } } return new String(c); }
[ "public", "static", "String", "toSBC", "(", "String", "input", ",", "Set", "<", "Character", ">", "notConvertSet", ")", "{", "char", "c", "[", "]", "=", "input", ".", "toCharArray", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", ...
半角转全角 @param input String @param notConvertSet 不替换的字符集合 @return 全角字符串.
[ "半角转全角" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java#L631-L647
train
Converts a String to SBC.
[ 30522, 2270, 10763, 5164, 2000, 19022, 2278, 1006, 5164, 7953, 1010, 2275, 1026, 2839, 1028, 2025, 8663, 16874, 13462, 1007, 1063, 25869, 1039, 1031, 1033, 1027, 7953, 1012, 2000, 7507, 19848, 9447, 1006, 1007, 1025, 2005, 1006, 20014, 1045...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java
AbstractYarnClusterDescriptor.setupSingleLocalResource
private static Path setupSingleLocalResource( String key, FileSystem fs, ApplicationId appId, Path localSrcPath, Map<String, LocalResource> localResources, Path targetHomeDir, String relativeTargetPath) throws IOException, URISyntaxException { Tuple2<Path, LocalResource> resource = Utils.setupLocalResource( fs, appId.toString(), localSrcPath, targetHomeDir, relativeTargetPath); localResources.put(key, resource.f1); return resource.f0; }
java
private static Path setupSingleLocalResource( String key, FileSystem fs, ApplicationId appId, Path localSrcPath, Map<String, LocalResource> localResources, Path targetHomeDir, String relativeTargetPath) throws IOException, URISyntaxException { Tuple2<Path, LocalResource> resource = Utils.setupLocalResource( fs, appId.toString(), localSrcPath, targetHomeDir, relativeTargetPath); localResources.put(key, resource.f1); return resource.f0; }
[ "private", "static", "Path", "setupSingleLocalResource", "(", "String", "key", ",", "FileSystem", "fs", ",", "ApplicationId", "appId", ",", "Path", "localSrcPath", ",", "Map", "<", "String", ",", "LocalResource", ">", "localResources", ",", "Path", "targetHomeDir"...
Uploads and registers a single resource and adds it to <tt>localResources</tt>. @param key the key to add the resource under @param fs the remote file system to upload to @param appId application ID @param localSrcPath local path to the file @param localResources map of resources @return the remote path to the uploaded resource
[ "Uploads", "and", "registers", "a", "single", "resource", "and", "adds", "it", "to", "<tt", ">", "localResources<", "/", "tt", ">", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java#L1081-L1100
train
Setup a single local resource.
[ 30522, 2797, 10763, 4130, 16437, 7741, 2571, 4135, 9289, 6072, 8162, 3401, 1006, 5164, 3145, 1010, 6764, 27268, 6633, 1042, 2015, 1010, 4646, 3593, 10439, 3593, 1010, 4130, 10575, 11890, 15069, 1010, 4949, 1026, 5164, 1010, 2334, 6072, 8162...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/trigram/CharacterBasedGenerativeModel.java
CharacterBasedGenerativeModel.train
public void train() { double tl1 = 0.0; double tl2 = 0.0; double tl3 = 0.0; for (String key : tf.d.keySet()) { if (key.length() != 6) continue; // tri samples char[][] now = new char[][] { {key.charAt(0), key.charAt(1)}, {key.charAt(2), key.charAt(3)}, {key.charAt(4), key.charAt(5)}, }; double c3 = div(tf.get(now) - 1, tf.get(now[0], now[1]) - 1); double c2 = div(tf.get(now[1], now[2]) - 1, tf.get(now[1]) - 1); double c1 = div(tf.get(now[2]) - 1, tf.getsum() - 1); if (c3 >= c1 && c3 >= c2) tl3 += tf.get(key.toCharArray()); else if (c2 >= c1 && c2 >= c3) tl2 += tf.get(key.toCharArray()); else if (c1 >= c2 && c1 >= c3) tl1 += tf.get(key.toCharArray()); } l1 = div(tl1, tl1 + tl2 + tl3); l2 = div(tl2, tl1 + tl2 + tl3); l3 = div(tl3, tl1 + tl2 + tl3); }
java
public void train() { double tl1 = 0.0; double tl2 = 0.0; double tl3 = 0.0; for (String key : tf.d.keySet()) { if (key.length() != 6) continue; // tri samples char[][] now = new char[][] { {key.charAt(0), key.charAt(1)}, {key.charAt(2), key.charAt(3)}, {key.charAt(4), key.charAt(5)}, }; double c3 = div(tf.get(now) - 1, tf.get(now[0], now[1]) - 1); double c2 = div(tf.get(now[1], now[2]) - 1, tf.get(now[1]) - 1); double c1 = div(tf.get(now[2]) - 1, tf.getsum() - 1); if (c3 >= c1 && c3 >= c2) tl3 += tf.get(key.toCharArray()); else if (c2 >= c1 && c2 >= c3) tl2 += tf.get(key.toCharArray()); else if (c1 >= c2 && c1 >= c3) tl1 += tf.get(key.toCharArray()); } l1 = div(tl1, tl1 + tl2 + tl3); l2 = div(tl2, tl1 + tl2 + tl3); l3 = div(tl3, tl1 + tl2 + tl3); }
[ "public", "void", "train", "(", ")", "{", "double", "tl1", "=", "0.0", ";", "double", "tl2", "=", "0.0", ";", "double", "tl3", "=", "0.0", ";", "for", "(", "String", "key", ":", "tf", ".", "d", ".", "keySet", "(", ")", ")", "{", "if", "(", "k...
观测结束,开始训练
[ "观测结束,开始训练" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/trigram/CharacterBasedGenerativeModel.java#L117-L145
train
Train the sequence of the tca file.
[ 30522, 2270, 11675, 3345, 1006, 1007, 1063, 3313, 1056, 2140, 2487, 1027, 1014, 1012, 1014, 1025, 3313, 1056, 2140, 2475, 1027, 1014, 1012, 1014, 1025, 3313, 1056, 2140, 2509, 1027, 1014, 1012, 1014, 1025, 2005, 1006, 5164, 3145, 1024, 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-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java
AllWindowedStream.minBy
public SingleOutputStreamOperator<T> minBy(String field, boolean first) { return aggregate(new ComparableAggregator<>(field, input.getType(), AggregationFunction.AggregationType.MINBY, first, input.getExecutionConfig())); }
java
public SingleOutputStreamOperator<T> minBy(String field, boolean first) { return aggregate(new ComparableAggregator<>(field, input.getType(), AggregationFunction.AggregationType.MINBY, first, input.getExecutionConfig())); }
[ "public", "SingleOutputStreamOperator", "<", "T", ">", "minBy", "(", "String", "field", ",", "boolean", "first", ")", "{", "return", "aggregate", "(", "new", "ComparableAggregator", "<>", "(", "field", ",", "input", ".", "getType", "(", ")", ",", "Aggregatio...
Applies an aggregation that that gives the minimum element of the pojo data stream by the given field expression for every window. A field expression is either the name of a public field or a getter method with parentheses of the {@link DataStream DataStreams} underlying type. A dot can be used to drill down into objects, as in {@code "field1.getInnerField2()" }. @param field The field expression based on which the aggregation will be applied. @param first If True then in case of field equality the first object will be returned @return The transformed DataStream.
[ "Applies", "an", "aggregation", "that", "that", "gives", "the", "minimum", "element", "of", "the", "pojo", "data", "stream", "by", "the", "given", "field", "expression", "for", "every", "window", ".", "A", "field", "expression", "is", "either", "the", "name"...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java#L1473-L1475
train
Min by aggregation.
[ 30522, 2270, 2309, 5833, 18780, 21422, 25918, 8844, 1026, 1056, 1028, 8117, 3762, 1006, 5164, 2492, 1010, 22017, 20898, 2034, 1007, 1063, 2709, 9572, 1006, 2047, 12435, 8490, 17603, 20697, 2953, 1026, 1028, 1006, 2492, 1010, 7953, 1012, 213...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/trie/bintrie/BinTrie.java
BinTrie.save
public boolean save(DataOutputStream out) { try { for (BaseNode node : child) { if (node == null) { out.writeInt(0); } else { out.writeInt(1); node.walkToSave(out); } } } catch (Exception e) { logger.warning("保存到" + out + "失败" + TextUtility.exceptionToString(e)); return false; } return true; }
java
public boolean save(DataOutputStream out) { try { for (BaseNode node : child) { if (node == null) { out.writeInt(0); } else { out.writeInt(1); node.walkToSave(out); } } } catch (Exception e) { logger.warning("保存到" + out + "失败" + TextUtility.exceptionToString(e)); return false; } return true; }
[ "public", "boolean", "save", "(", "DataOutputStream", "out", ")", "{", "try", "{", "for", "(", "BaseNode", "node", ":", "child", ")", "{", "if", "(", "node", "==", "null", ")", "{", "out", ".", "writeInt", "(", "0", ")", ";", "}", "else", "{", "o...
保存到二进制输出流 @param out @return
[ "保存到二进制输出流" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/trie/bintrie/BinTrie.java#L379-L403
train
Save the result of this node to a file.
[ 30522, 2270, 22017, 20898, 3828, 1006, 2951, 5833, 18780, 21422, 2041, 1007, 1063, 3046, 1063, 2005, 1006, 2918, 3630, 3207, 13045, 1024, 2775, 1007, 1063, 2065, 1006, 13045, 1027, 1027, 19701, 1007, 1063, 2041, 1012, 4339, 18447, 1006, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-java/src/main/java/org/apache/flink/api/java/DataSet.java
DataSet.writeAsFormattedText
public DataSink<String> writeAsFormattedText(String filePath, WriteMode writeMode, TextFormatter<T> formatter) { return map(new FormattingMapper<>(clean(formatter))).writeAsText(filePath, writeMode); }
java
public DataSink<String> writeAsFormattedText(String filePath, WriteMode writeMode, TextFormatter<T> formatter) { return map(new FormattingMapper<>(clean(formatter))).writeAsText(filePath, writeMode); }
[ "public", "DataSink", "<", "String", ">", "writeAsFormattedText", "(", "String", "filePath", ",", "WriteMode", "writeMode", ",", "TextFormatter", "<", "T", ">", "formatter", ")", "{", "return", "map", "(", "new", "FormattingMapper", "<>", "(", "clean", "(", ...
Writes a DataSet as text file(s) to the specified location. <p>For each element of the DataSet the result of {@link TextFormatter#format(Object)} is written. @param filePath The path pointing to the location the text file is written to. @param writeMode Control the behavior for existing files. Options are NO_OVERWRITE and OVERWRITE. @param formatter formatter that is applied on every element of the DataSet. @return The DataSink that writes the DataSet. @see TextOutputFormat @see DataSet#writeAsText(String) Output files and directories
[ "Writes", "a", "DataSet", "as", "text", "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#L1543-L1545
train
Write the data sink to a file in text format.
[ 30522, 2270, 2951, 11493, 2243, 1026, 5164, 1028, 4339, 3022, 14192, 19321, 2098, 18209, 1006, 5164, 5371, 15069, 1010, 4339, 5302, 3207, 4339, 5302, 3207, 1010, 3793, 14192, 20097, 1026, 1056, 1028, 4289, 3334, 1007, 1063, 2709, 4949, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanCopier.java
BeanCopier.valueProviderToBean
private void valueProviderToBean(ValueProvider<String> valueProvider, Object bean) { if (null == valueProvider) { return; } final CopyOptions copyOptions = this.copyOptions; Class<?> actualEditable = bean.getClass(); if (copyOptions.editable != null) { // 检查限制类是否为target的父类或接口 if (false == copyOptions.editable.isInstance(bean)) { throw new IllegalArgumentException(StrUtil.format("Target class [{}] not assignable to Editable class [{}]", bean.getClass().getName(), copyOptions.editable.getName())); } actualEditable = copyOptions.editable; } final HashSet<String> ignoreSet = (null != copyOptions.ignoreProperties) ? CollUtil.newHashSet(copyOptions.ignoreProperties) : null; final Map<String, String> fieldReverseMapping = copyOptions.getReversedMapping(); final Collection<PropDesc> props = BeanUtil.getBeanDesc(actualEditable).getProps(); String fieldName; Object value; Method setterMethod; Class<?> propClass; for (PropDesc prop : props) { // 获取值 fieldName = prop.getFieldName(); if (CollUtil.contains(ignoreSet, fieldName)) { // 目标属性值被忽略或值提供者无此key时跳过 continue; } final String providerKey = mappingKey(fieldReverseMapping, fieldName); if (false == valueProvider.containsKey(providerKey)) { // 无对应值可提供 continue; } setterMethod = prop.getSetter(); if (null == setterMethod) { // Setter方法不存在跳过 continue; } Type firstParamType = TypeUtil.getFirstParamType(setterMethod); if (firstParamType instanceof ParameterizedType) { // 参数为泛型参数类型,解析对应泛型类型为真实类型 ParameterizedType tmp = (ParameterizedType) firstParamType; Type[] actualTypeArguments = tmp.getActualTypeArguments(); if (TypeUtil.hasTypeVeriable(actualTypeArguments)) { // 泛型对象中含有未被转换的泛型变量 actualTypeArguments = TypeUtil.getActualTypes(this.destType, setterMethod.getDeclaringClass(), tmp.getActualTypeArguments()); if (ArrayUtil.isNotEmpty(actualTypeArguments)) { // 替换泛型变量为实际类型 firstParamType = new ParameterizedTypeImpl(actualTypeArguments, tmp.getOwnerType(), tmp.getRawType()); } } } else if (firstParamType instanceof TypeVariable) { // 参数为泛型,查找其真实类型(适用于泛型方法定义于泛型父类) firstParamType = TypeUtil.getActualType(this.destType, setterMethod.getDeclaringClass(), (TypeVariable<?>) firstParamType); } value = valueProvider.value(providerKey, firstParamType); if (null == value && copyOptions.ignoreNullValue) { continue;// 当允许跳过空时,跳过 } if (bean.equals(value)) { continue;// 值不能为bean本身,防止循环引用 } try { // valueProvider在没有对值做转换且当类型不匹配的时候,执行默认转换 propClass = prop.getFieldClass(); if (false == propClass.isInstance(value)) { value = Convert.convert(propClass, value); if (null == value && copyOptions.ignoreNullValue) { continue;// 当允许跳过空时,跳过 } } // 执行set方法注入值 setterMethod.invoke(bean, value); } catch (Exception e) { if (copyOptions.ignoreError) { continue;// 忽略注入失败 } else { throw new UtilException(e, "Inject [{}] error!", prop.getFieldName()); } } } }
java
private void valueProviderToBean(ValueProvider<String> valueProvider, Object bean) { if (null == valueProvider) { return; } final CopyOptions copyOptions = this.copyOptions; Class<?> actualEditable = bean.getClass(); if (copyOptions.editable != null) { // 检查限制类是否为target的父类或接口 if (false == copyOptions.editable.isInstance(bean)) { throw new IllegalArgumentException(StrUtil.format("Target class [{}] not assignable to Editable class [{}]", bean.getClass().getName(), copyOptions.editable.getName())); } actualEditable = copyOptions.editable; } final HashSet<String> ignoreSet = (null != copyOptions.ignoreProperties) ? CollUtil.newHashSet(copyOptions.ignoreProperties) : null; final Map<String, String> fieldReverseMapping = copyOptions.getReversedMapping(); final Collection<PropDesc> props = BeanUtil.getBeanDesc(actualEditable).getProps(); String fieldName; Object value; Method setterMethod; Class<?> propClass; for (PropDesc prop : props) { // 获取值 fieldName = prop.getFieldName(); if (CollUtil.contains(ignoreSet, fieldName)) { // 目标属性值被忽略或值提供者无此key时跳过 continue; } final String providerKey = mappingKey(fieldReverseMapping, fieldName); if (false == valueProvider.containsKey(providerKey)) { // 无对应值可提供 continue; } setterMethod = prop.getSetter(); if (null == setterMethod) { // Setter方法不存在跳过 continue; } Type firstParamType = TypeUtil.getFirstParamType(setterMethod); if (firstParamType instanceof ParameterizedType) { // 参数为泛型参数类型,解析对应泛型类型为真实类型 ParameterizedType tmp = (ParameterizedType) firstParamType; Type[] actualTypeArguments = tmp.getActualTypeArguments(); if (TypeUtil.hasTypeVeriable(actualTypeArguments)) { // 泛型对象中含有未被转换的泛型变量 actualTypeArguments = TypeUtil.getActualTypes(this.destType, setterMethod.getDeclaringClass(), tmp.getActualTypeArguments()); if (ArrayUtil.isNotEmpty(actualTypeArguments)) { // 替换泛型变量为实际类型 firstParamType = new ParameterizedTypeImpl(actualTypeArguments, tmp.getOwnerType(), tmp.getRawType()); } } } else if (firstParamType instanceof TypeVariable) { // 参数为泛型,查找其真实类型(适用于泛型方法定义于泛型父类) firstParamType = TypeUtil.getActualType(this.destType, setterMethod.getDeclaringClass(), (TypeVariable<?>) firstParamType); } value = valueProvider.value(providerKey, firstParamType); if (null == value && copyOptions.ignoreNullValue) { continue;// 当允许跳过空时,跳过 } if (bean.equals(value)) { continue;// 值不能为bean本身,防止循环引用 } try { // valueProvider在没有对值做转换且当类型不匹配的时候,执行默认转换 propClass = prop.getFieldClass(); if (false == propClass.isInstance(value)) { value = Convert.convert(propClass, value); if (null == value && copyOptions.ignoreNullValue) { continue;// 当允许跳过空时,跳过 } } // 执行set方法注入值 setterMethod.invoke(bean, value); } catch (Exception e) { if (copyOptions.ignoreError) { continue;// 忽略注入失败 } else { throw new UtilException(e, "Inject [{}] error!", prop.getFieldName()); } } } }
[ "private", "void", "valueProviderToBean", "(", "ValueProvider", "<", "String", ">", "valueProvider", ",", "Object", "bean", ")", "{", "if", "(", "null", "==", "valueProvider", ")", "{", "return", ";", "}", "final", "CopyOptions", "copyOptions", "=", "this", ...
值提供器转Bean @param valueProvider 值提供器 @param bean Bean
[ "值提供器转Bean" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanCopier.java#L198-L284
train
Override this method to convert a value provider to a bean.
[ 30522, 2797, 11675, 3643, 21572, 17258, 8743, 20891, 2319, 1006, 3643, 21572, 17258, 2121, 1026, 5164, 1028, 3643, 21572, 17258, 2121, 1010, 4874, 14068, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 3643, 21572, 17258, 2121, 1007, 1063, 2709, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/BooleanUtil.java
BooleanUtil.and
public static boolean and(boolean... array) { if (ArrayUtil.isEmpty(array)) { throw new IllegalArgumentException("The Array must not be empty !"); } for (final boolean element : array) { if (false == element) { return false; } } return true; }
java
public static boolean and(boolean... array) { if (ArrayUtil.isEmpty(array)) { throw new IllegalArgumentException("The Array must not be empty !"); } for (final boolean element : array) { if (false == element) { return false; } } return true; }
[ "public", "static", "boolean", "and", "(", "boolean", "...", "array", ")", "{", "if", "(", "ArrayUtil", ".", "isEmpty", "(", "array", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The Array must not be empty !\"", ")", ";", "}", "for", "...
对Boolean数组取与 <pre> BooleanUtil.and(true, true) = true BooleanUtil.and(false, false) = false BooleanUtil.and(true, false) = false BooleanUtil.and(true, true, false) = false BooleanUtil.and(true, true, true) = true </pre> @param array {@code Boolean}数组 @return 取与为真返回{@code true}
[ "对Boolean数组取与" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/BooleanUtil.java#L303-L313
train
AND two boolean objects.
[ 30522, 2270, 10763, 22017, 20898, 1998, 1006, 22017, 20898, 1012, 1012, 1012, 9140, 1007, 1063, 2065, 1006, 9140, 21823, 2140, 1012, 2003, 6633, 13876, 2100, 1006, 9140, 1007, 1007, 1063, 5466, 2047, 6206, 2906, 22850, 15781, 2595, 24422, 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/Proxy.java
Proxy.setSocksPassword
public Proxy setSocksPassword(String password) { verifyProxyTypeCompatibility(ProxyType.MANUAL); this.proxyType = ProxyType.MANUAL; this.socksPassword = password; return this; }
java
public Proxy setSocksPassword(String password) { verifyProxyTypeCompatibility(ProxyType.MANUAL); this.proxyType = ProxyType.MANUAL; this.socksPassword = password; return this; }
[ "public", "Proxy", "setSocksPassword", "(", "String", "password", ")", "{", "verifyProxyTypeCompatibility", "(", "ProxyType", ".", "MANUAL", ")", ";", "this", ".", "proxyType", "=", "ProxyType", ".", "MANUAL", ";", "this", ".", "socksPassword", "=", "password", ...
Specifies a password for the SOCKS proxy. Supported by SOCKS v5 and above. @param password password for the SOCKS proxy @return reference to self
[ "Specifies", "a", "password", "for", "the", "SOCKS", "proxy", ".", "Supported", "by", "SOCKS", "v5", "and", "above", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/Proxy.java#L371-L376
train
Sets the SOCKS password.
[ 30522, 2270, 24540, 4520, 25384, 15194, 18351, 1006, 5164, 20786, 1007, 1063, 20410, 21572, 18037, 13874, 9006, 24952, 8553, 1006, 24540, 13874, 1012, 6410, 1007, 1025, 2023, 1012, 24540, 13874, 1027, 24540, 13874, 1012, 6410, 1025, 2023, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java
JSONArray.optJSONObject
public JSONObject optJSONObject(int index) { Object object = opt(index); return object instanceof JSONObject ? (JSONObject) object : null; }
java
public JSONObject optJSONObject(int index) { Object object = opt(index); return object instanceof JSONObject ? (JSONObject) object : null; }
[ "public", "JSONObject", "optJSONObject", "(", "int", "index", ")", "{", "Object", "object", "=", "opt", "(", "index", ")", ";", "return", "object", "instanceof", "JSONObject", "?", "(", "JSONObject", ")", "object", ":", "null", ";", "}" ]
Returns the value at {@code index} if it exists and is a {@code JSONObject}. Returns null otherwise. @param index the index to get the value from @return the object at {@code index} or {@code null}
[ "Returns", "the", "value", "at", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java#L574-L577
train
Get the optional JSONObject associated with an index.
[ 30522, 2270, 1046, 3385, 16429, 20614, 23569, 22578, 17175, 2497, 20614, 1006, 20014, 5950, 1007, 1063, 4874, 4874, 1027, 23569, 1006, 5950, 1007, 1025, 2709, 4874, 6013, 11253, 1046, 3385, 16429, 20614, 1029, 1006, 1046, 3385, 16429, 20614, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/ConscryptAlpnSslEngine.java
ConscryptAlpnSslEngine.calculateOutNetBufSize
final int calculateOutNetBufSize(int plaintextBytes, int numBuffers) { // Assuming a max of one frame per component in a composite buffer. long maxOverhead = (long) Conscrypt.maxSealOverhead(getWrappedEngine()) * numBuffers; // TODO(nmittler): update this to use MAX_ENCRYPTED_PACKET_LENGTH instead of Integer.MAX_VALUE return (int) min(Integer.MAX_VALUE, plaintextBytes + maxOverhead); }
java
final int calculateOutNetBufSize(int plaintextBytes, int numBuffers) { // Assuming a max of one frame per component in a composite buffer. long maxOverhead = (long) Conscrypt.maxSealOverhead(getWrappedEngine()) * numBuffers; // TODO(nmittler): update this to use MAX_ENCRYPTED_PACKET_LENGTH instead of Integer.MAX_VALUE return (int) min(Integer.MAX_VALUE, plaintextBytes + maxOverhead); }
[ "final", "int", "calculateOutNetBufSize", "(", "int", "plaintextBytes", ",", "int", "numBuffers", ")", "{", "// Assuming a max of one frame per component in a composite buffer.", "long", "maxOverhead", "=", "(", "long", ")", "Conscrypt", ".", "maxSealOverhead", "(", "getW...
Calculates the maximum size of the encrypted output buffer required to wrap the given plaintext bytes. Assumes as a worst case that there is one TLS record per buffer. @param plaintextBytes the number of plaintext bytes to be wrapped. @param numBuffers the number of buffers that the plaintext bytes are spread across. @return the maximum size of the encrypted output buffer required for the wrap operation.
[ "Calculates", "the", "maximum", "size", "of", "the", "encrypted", "output", "buffer", "required", "to", "wrap", "the", "given", "plaintext", "bytes", ".", "Assumes", "as", "a", "worst", "case", "that", "there", "is", "one", "TLS", "record", "per", "buffer", ...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ConscryptAlpnSslEngine.java#L85-L90
train
Calculate the size of the output net buffer.
[ 30522, 2345, 20014, 18422, 5833, 7159, 8569, 10343, 4697, 1006, 20014, 5810, 18209, 3762, 4570, 1010, 20014, 15903, 16093, 24396, 1007, 1063, 1013, 1013, 10262, 1037, 4098, 1997, 2028, 4853, 2566, 6922, 1999, 1037, 12490, 17698, 1012, 2146, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/utils/proxy/OptionalBoolean.java
OptionalBoolean.conflictsWith
public boolean conflictsWith(OptionalBoolean other) { return state == State.CONFLICTING || other.state == State.CONFLICTING || (state == State.TRUE && other.state == State.FALSE) || (state == State.FALSE && other.state == State.TRUE); }
java
public boolean conflictsWith(OptionalBoolean other) { return state == State.CONFLICTING || other.state == State.CONFLICTING || (state == State.TRUE && other.state == State.FALSE) || (state == State.FALSE && other.state == State.TRUE); }
[ "public", "boolean", "conflictsWith", "(", "OptionalBoolean", "other", ")", "{", "return", "state", "==", "State", ".", "CONFLICTING", "||", "other", ".", "state", "==", "State", ".", "CONFLICTING", "||", "(", "state", "==", "State", ".", "TRUE", "&&", "ot...
The conflicting states are true with false and false with true. @param other object to test with @return whether the objects conflict
[ "The", "conflicting", "states", "are", "true", "with", "false", "and", "false", "with", "true", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/utils/proxy/OptionalBoolean.java#L112-L117
train
Checks if this boolean conflicts with the other boolean.
[ 30522, 2270, 22017, 20898, 9755, 24415, 1006, 11887, 5092, 9890, 2319, 2060, 1007, 1063, 2709, 2110, 1027, 1027, 2110, 1012, 19326, 1064, 1064, 2060, 1012, 2110, 1027, 1027, 2110, 1012, 19326, 1064, 1064, 1006, 2110, 1027, 1027, 2110, 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...
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java
RemoteWebDriver.log
protected void log(SessionId sessionId, String commandName, Object toLog, When when) { if (!logger.isLoggable(level)) { return; } String text = String.valueOf(toLog); if (commandName.equals(DriverCommand.EXECUTE_SCRIPT) || commandName.equals(DriverCommand.EXECUTE_ASYNC_SCRIPT)) { if (text.length() > 100 && Boolean.getBoolean("webdriver.remote.shorten_log_messages")) { text = text.substring(0, 100) + "..."; } } switch(when) { case BEFORE: logger.log(level, "Executing: " + commandName + " " + text); break; case AFTER: logger.log(level, "Executed: " + text); break; case EXCEPTION: logger.log(level, "Exception: " + text); break; default: logger.log(level, text); break; } }
java
protected void log(SessionId sessionId, String commandName, Object toLog, When when) { if (!logger.isLoggable(level)) { return; } String text = String.valueOf(toLog); if (commandName.equals(DriverCommand.EXECUTE_SCRIPT) || commandName.equals(DriverCommand.EXECUTE_ASYNC_SCRIPT)) { if (text.length() > 100 && Boolean.getBoolean("webdriver.remote.shorten_log_messages")) { text = text.substring(0, 100) + "..."; } } switch(when) { case BEFORE: logger.log(level, "Executing: " + commandName + " " + text); break; case AFTER: logger.log(level, "Executed: " + text); break; case EXCEPTION: logger.log(level, "Exception: " + text); break; default: logger.log(level, text); break; } }
[ "protected", "void", "log", "(", "SessionId", "sessionId", ",", "String", "commandName", ",", "Object", "toLog", ",", "When", "when", ")", "{", "if", "(", "!", "logger", ".", "isLoggable", "(", "level", ")", ")", "{", "return", ";", "}", "String", "tex...
Override this to be notified at key points in the execution of a command. @param sessionId the session id. @param commandName the command that is being executed. @param toLog any data that might be interesting. @param when verb tense of "Execute" to prefix message
[ "Override", "this", "to", "be", "notified", "at", "key", "points", "in", "the", "execution", "of", "a", "command", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java#L673-L698
train
Log a message to the logger.
[ 30522, 5123, 11675, 8833, 1006, 5219, 3593, 5219, 3593, 1010, 5164, 3094, 18442, 1010, 4874, 2000, 21197, 1010, 2043, 2043, 1007, 1063, 2065, 1006, 999, 8833, 4590, 1012, 2003, 21197, 3654, 3468, 1006, 2504, 1007, 1007, 1063, 2709, 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/seg/common/WordNet.java
WordNet.getVertexesLineFirst
private Vertex[] getVertexesLineFirst() { Vertex[] vertexes = new Vertex[size]; int i = 0; for (List<Vertex> vertexList : this.vertexes) { for (Vertex v : vertexList) { v.index = i; // 设置id vertexes[i++] = v; } } return vertexes; }
java
private Vertex[] getVertexesLineFirst() { Vertex[] vertexes = new Vertex[size]; int i = 0; for (List<Vertex> vertexList : this.vertexes) { for (Vertex v : vertexList) { v.index = i; // 设置id vertexes[i++] = v; } } return vertexes; }
[ "private", "Vertex", "[", "]", "getVertexesLineFirst", "(", ")", "{", "Vertex", "[", "]", "vertexes", "=", "new", "Vertex", "[", "size", "]", ";", "int", "i", "=", "0", ";", "for", "(", "List", "<", "Vertex", ">", "vertexList", ":", "this", ".", "v...
获取顶点数组 @return Vertex[] 按行优先列次之的顺序构造的顶点数组
[ "获取顶点数组" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/common/WordNet.java#L301-L315
train
getVertexesLineFirst Method.
[ 30522, 2797, 19449, 1031, 1033, 2131, 16874, 10288, 2229, 4179, 8873, 12096, 1006, 1007, 1063, 19449, 1031, 1033, 19449, 2229, 1027, 2047, 19449, 1031, 2946, 1033, 1025, 20014, 1045, 1027, 1014, 1025, 2005, 1006, 2862, 1026, 19449, 1028, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
codec-smtp/src/main/java/io/netty/handler/codec/smtp/SmtpRequests.java
SmtpRequests.help
public static SmtpRequest help(String cmd) { return cmd == null ? HELP_NO_ARG : new DefaultSmtpRequest(SmtpCommand.HELP, cmd); }
java
public static SmtpRequest help(String cmd) { return cmd == null ? HELP_NO_ARG : new DefaultSmtpRequest(SmtpCommand.HELP, cmd); }
[ "public", "static", "SmtpRequest", "help", "(", "String", "cmd", ")", "{", "return", "cmd", "==", "null", "?", "HELP_NO_ARG", ":", "new", "DefaultSmtpRequest", "(", "SmtpCommand", ".", "HELP", ",", "cmd", ")", ";", "}" ]
Creates a {@code HELP} request.
[ "Creates", "a", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-smtp/src/main/java/io/netty/handler/codec/smtp/SmtpRequests.java#L76-L78
train
Returns a new request that will return the help message.
[ 30522, 2270, 10763, 15488, 25856, 2890, 15500, 2393, 1006, 5164, 4642, 2094, 1007, 1063, 2709, 4642, 2094, 1027, 1027, 19701, 1029, 2393, 1035, 2053, 1035, 12098, 2290, 1024, 2047, 12398, 6491, 25856, 2890, 15500, 1006, 15488, 25856, 9006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java
ClusterClient.getOptimizedPlan
private static OptimizedPlan getOptimizedPlan(Optimizer compiler, JobWithJars prog, int parallelism) throws CompilerException, ProgramInvocationException { return getOptimizedPlan(compiler, prog.getPlan(), parallelism); }
java
private static OptimizedPlan getOptimizedPlan(Optimizer compiler, JobWithJars prog, int parallelism) throws CompilerException, ProgramInvocationException { return getOptimizedPlan(compiler, prog.getPlan(), parallelism); }
[ "private", "static", "OptimizedPlan", "getOptimizedPlan", "(", "Optimizer", "compiler", ",", "JobWithJars", "prog", ",", "int", "parallelism", ")", "throws", "CompilerException", ",", "ProgramInvocationException", "{", "return", "getOptimizedPlan", "(", "compiler", ",",...
Creates the optimized plan for a given program, using this client's compiler. @param prog The program to be compiled. @return The compiled and optimized plan, as returned by the compiler. @throws CompilerException Thrown, if the compiler encounters an illegal situation.
[ "Creates", "the", "optimized", "plan", "for", "a", "given", "program", "using", "this", "client", "s", "compiler", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java#L421-L424
train
Get an OptimizedPlan from a JobWithJars.
[ 30522, 2797, 10763, 23569, 27605, 5422, 24759, 2319, 2131, 7361, 3775, 4328, 5422, 24759, 2319, 1006, 23569, 27605, 6290, 21624, 1010, 3105, 24415, 16084, 2015, 4013, 2290, 1010, 20014, 5903, 2964, 1007, 11618, 21624, 10288, 24422, 1010, 2565...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
Execution.scheduleForExecution
public CompletableFuture<Void> scheduleForExecution( SlotProvider slotProvider, boolean queued, LocationPreferenceConstraint locationPreferenceConstraint, @Nonnull Set<AllocationID> allPreviousExecutionGraphAllocationIds) { assertRunningInJobMasterMainThread(); final ExecutionGraph executionGraph = vertex.getExecutionGraph(); final Time allocationTimeout = executionGraph.getAllocationTimeout(); try { final CompletableFuture<Execution> allocationFuture = allocateAndAssignSlotForExecution( slotProvider, queued, locationPreferenceConstraint, allPreviousExecutionGraphAllocationIds, allocationTimeout); final CompletableFuture<Void> deploymentFuture; if (allocationFuture.isDone() || queued) { deploymentFuture = allocationFuture.thenRun(ThrowingRunnable.unchecked(this::deploy)); } else { deploymentFuture = FutureUtils.completedExceptionally( new IllegalArgumentException("The slot allocation future has not been completed yet.")); } deploymentFuture.whenComplete( (Void ignored, Throwable failure) -> { if (failure != null) { final Throwable stripCompletionException = ExceptionUtils.stripCompletionException(failure); final Throwable schedulingFailureCause; if (stripCompletionException instanceof TimeoutException) { schedulingFailureCause = new NoResourceAvailableException( "Could not allocate enough slots within timeout of " + allocationTimeout + " to run the job. " + "Please make sure that the cluster has enough resources."); } else { schedulingFailureCause = stripCompletionException; } markFailed(schedulingFailureCause); } }); return deploymentFuture; } catch (IllegalExecutionStateException e) { return FutureUtils.completedExceptionally(e); } }
java
public CompletableFuture<Void> scheduleForExecution( SlotProvider slotProvider, boolean queued, LocationPreferenceConstraint locationPreferenceConstraint, @Nonnull Set<AllocationID> allPreviousExecutionGraphAllocationIds) { assertRunningInJobMasterMainThread(); final ExecutionGraph executionGraph = vertex.getExecutionGraph(); final Time allocationTimeout = executionGraph.getAllocationTimeout(); try { final CompletableFuture<Execution> allocationFuture = allocateAndAssignSlotForExecution( slotProvider, queued, locationPreferenceConstraint, allPreviousExecutionGraphAllocationIds, allocationTimeout); final CompletableFuture<Void> deploymentFuture; if (allocationFuture.isDone() || queued) { deploymentFuture = allocationFuture.thenRun(ThrowingRunnable.unchecked(this::deploy)); } else { deploymentFuture = FutureUtils.completedExceptionally( new IllegalArgumentException("The slot allocation future has not been completed yet.")); } deploymentFuture.whenComplete( (Void ignored, Throwable failure) -> { if (failure != null) { final Throwable stripCompletionException = ExceptionUtils.stripCompletionException(failure); final Throwable schedulingFailureCause; if (stripCompletionException instanceof TimeoutException) { schedulingFailureCause = new NoResourceAvailableException( "Could not allocate enough slots within timeout of " + allocationTimeout + " to run the job. " + "Please make sure that the cluster has enough resources."); } else { schedulingFailureCause = stripCompletionException; } markFailed(schedulingFailureCause); } }); return deploymentFuture; } catch (IllegalExecutionStateException e) { return FutureUtils.completedExceptionally(e); } }
[ "public", "CompletableFuture", "<", "Void", ">", "scheduleForExecution", "(", "SlotProvider", "slotProvider", ",", "boolean", "queued", ",", "LocationPreferenceConstraint", "locationPreferenceConstraint", ",", "@", "Nonnull", "Set", "<", "AllocationID", ">", "allPreviousE...
NOTE: This method only throws exceptions if it is in an illegal state to be scheduled, or if the tasks needs to be scheduled immediately and no resource is available. If the task is accepted by the schedule, any error sets the vertex state to failed and triggers the recovery logic. @param slotProvider The slot provider to use to allocate slot for this execution attempt. @param queued Flag to indicate whether the scheduler may queue this task if it cannot immediately deploy it. @param locationPreferenceConstraint constraint for the location preferences @param allPreviousExecutionGraphAllocationIds set with all previous allocation ids in the job graph. Can be empty if the allocation ids are not required for scheduling. @return Future which is completed once the Execution has been deployed
[ "NOTE", ":", "This", "method", "only", "throws", "exceptions", "if", "it", "is", "in", "an", "illegal", "state", "to", "be", "scheduled", "or", "if", "the", "tasks", "needs", "to", "be", "scheduled", "immediately", "and", "no", "resource", "is", "available...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java#L416-L463
train
Schedules a slot for execution.
[ 30522, 2270, 4012, 10814, 10880, 11263, 11244, 1026, 11675, 1028, 6134, 29278, 10288, 8586, 13700, 1006, 10453, 21572, 17258, 2121, 10453, 21572, 17258, 2121, 1010, 22017, 20898, 24240, 2094, 1010, 3295, 28139, 25523, 8663, 20528, 18447, 3295, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
buffer/src/main/java/io/netty/buffer/ByteBufUtil.java
ByteBufUtil.prettyHexDump
public static String prettyHexDump(ByteBuf buffer) { return prettyHexDump(buffer, buffer.readerIndex(), buffer.readableBytes()); }
java
public static String prettyHexDump(ByteBuf buffer) { return prettyHexDump(buffer, buffer.readerIndex(), buffer.readableBytes()); }
[ "public", "static", "String", "prettyHexDump", "(", "ByteBuf", "buffer", ")", "{", "return", "prettyHexDump", "(", "buffer", ",", "buffer", ".", "readerIndex", "(", ")", ",", "buffer", ".", "readableBytes", "(", ")", ")", ";", "}" ]
Returns a multi-line hexadecimal dump of the specified {@link ByteBuf} that is easy to read by humans.
[ "Returns", "a", "multi", "-", "line", "hexadecimal", "dump", "of", "the", "specified", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L910-L912
train
Pretty hex dump of a byte buffer.
[ 30522, 2270, 10763, 5164, 3492, 5369, 2595, 8566, 8737, 1006, 24880, 8569, 2546, 17698, 1007, 1063, 2709, 30524, 1007, 1025, 1065, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/ConsistentHash.java
ConsistentHash.get
public T get(Object key) { if (circle.isEmpty()) { return null; } int hash = hashFunc.hash(key); if (!circle.containsKey(hash)) { SortedMap<Integer, T> tailMap = circle.tailMap(hash); //返回此映射的部分视图,其键大于等于 hash hash = tailMap.isEmpty() ? circle.firstKey() : tailMap.firstKey(); } //正好命中 return circle.get(hash); }
java
public T get(Object key) { if (circle.isEmpty()) { return null; } int hash = hashFunc.hash(key); if (!circle.containsKey(hash)) { SortedMap<Integer, T> tailMap = circle.tailMap(hash); //返回此映射的部分视图,其键大于等于 hash hash = tailMap.isEmpty() ? circle.firstKey() : tailMap.firstKey(); } //正好命中 return circle.get(hash); }
[ "public", "T", "get", "(", "Object", "key", ")", "{", "if", "(", "circle", ".", "isEmpty", "(", ")", ")", "{", "return", "null", ";", "}", "int", "hash", "=", "hashFunc", ".", "hash", "(", "key", ")", ";", "if", "(", "!", "circle", ".", "contai...
获得一个最近的顺时针节点 @param key 为给定键取Hash,取得顺时针方向上最近的一个虚拟节点对应的实际节点 @return 节点对象
[ "获得一个最近的顺时针节点" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/ConsistentHash.java#L89-L100
train
Get the value of the specified key.
[ 30522, 2270, 1056, 30524, 19701, 1025, 1065, 20014, 23325, 1027, 23325, 11263, 12273, 1012, 23325, 1006, 3145, 1007, 1025, 2065, 1006, 999, 4418, 1012, 3397, 14839, 1006, 23325, 1007, 1007, 1063, 19616, 2863, 2361, 1026, 16109, 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/flink
flink-formats/flink-avro-confluent-registry/src/main/java/org/apache/flink/formats/avro/registry/confluent/ConfluentRegistryAvroDeserializationSchema.java
ConfluentRegistryAvroDeserializationSchema.forSpecific
public static <T extends SpecificRecord> ConfluentRegistryAvroDeserializationSchema<T> forSpecific(Class<T> tClass, String url, int identityMapCapacity) { return new ConfluentRegistryAvroDeserializationSchema<>( tClass, null, new CachedSchemaCoderProvider(url, identityMapCapacity) ); }
java
public static <T extends SpecificRecord> ConfluentRegistryAvroDeserializationSchema<T> forSpecific(Class<T> tClass, String url, int identityMapCapacity) { return new ConfluentRegistryAvroDeserializationSchema<>( tClass, null, new CachedSchemaCoderProvider(url, identityMapCapacity) ); }
[ "public", "static", "<", "T", "extends", "SpecificRecord", ">", "ConfluentRegistryAvroDeserializationSchema", "<", "T", ">", "forSpecific", "(", "Class", "<", "T", ">", "tClass", ",", "String", "url", ",", "int", "identityMapCapacity", ")", "{", "return", "new",...
Creates {@link AvroDeserializationSchema} that produces classes that were generated from avro schema and looks up writer schema in Confluent Schema Registry. @param tClass class of record to be produced @param url url of schema registry to connect @param identityMapCapacity maximum number of cached schema versions (default: 1000) @return deserialized record
[ "Creates", "{", "@link", "AvroDeserializationSchema", "}", "that", "produces", "classes", "that", "were", "generated", "from", "avro", "schema", "and", "looks", "up", "writer", "schema", "in", "Confluent", "Schema", "Registry", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-avro-confluent-registry/src/main/java/org/apache/flink/formats/avro/registry/confluent/ConfluentRegistryAvroDeserializationSchema.java#L109-L116
train
Creates a new avro - serialization schema for a specific record.
[ 30522, 2270, 10763, 1026, 1056, 8908, 3563, 2890, 27108, 2094, 1028, 9530, 10258, 24997, 7913, 24063, 20444, 19716, 19847, 11610, 22731, 22842, 2863, 1026, 1056, 1028, 2005, 13102, 8586, 18513, 1006, 2465, 1026, 1056, 1028, 22975, 27102, 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-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java
KeyedStream.window
@PublicEvolving public <W extends Window> WindowedStream<T, KEY, W> window(WindowAssigner<? super T, W> assigner) { return new WindowedStream<>(this, assigner); }
java
@PublicEvolving public <W extends Window> WindowedStream<T, KEY, W> window(WindowAssigner<? super T, W> assigner) { return new WindowedStream<>(this, assigner); }
[ "@", "PublicEvolving", "public", "<", "W", "extends", "Window", ">", "WindowedStream", "<", "T", ",", "KEY", ",", "W", ">", "window", "(", "WindowAssigner", "<", "?", "super", "T", ",", "W", ">", "assigner", ")", "{", "return", "new", "WindowedStream", ...
Windows this data stream to a {@code WindowedStream}, which evaluates windows over a key grouped stream. Elements are put into windows by a {@link WindowAssigner}. The grouping of elements is done both by key and by window. <p>A {@link org.apache.flink.streaming.api.windowing.triggers.Trigger} can be defined to specify when windows are evaluated. However, {@code WindowAssigners} have a default {@code Trigger} that is used if a {@code Trigger} is not specified. @param assigner The {@code WindowAssigner} that assigns elements to windows. @return The trigger windows data stream.
[ "Windows", "this", "data", "stream", "to", "a", "{", "@code", "WindowedStream", "}", "which", "evaluates", "windows", "over", "a", "key", "grouped", "stream", ".", "Elements", "are", "put", "into", "windows", "by", "a", "{", "@link", "WindowAssigner", "}", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java#L670-L673
train
Create a new stream that contains all the items in this stream and assigns the given window to each item.
[ 30522, 1030, 2270, 6777, 4747, 6455, 2270, 1026, 1059, 8908, 3332, 1028, 3332, 2098, 21422, 1026, 1056, 1010, 3145, 1010, 1059, 1028, 3332, 1006, 3332, 12054, 23773, 2121, 1026, 1029, 3565, 1056, 1010, 1059, 1028, 23911, 2121, 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...
netty/netty
transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannelConfig.java
EpollSocketChannelConfig.setTcpMd5Sig
public EpollSocketChannelConfig setTcpMd5Sig(Map<InetAddress, byte[]> keys) { try { ((EpollSocketChannel) channel).setTcpMd5Sig(keys); return this; } catch (IOException e) { throw new ChannelException(e); } }
java
public EpollSocketChannelConfig setTcpMd5Sig(Map<InetAddress, byte[]> keys) { try { ((EpollSocketChannel) channel).setTcpMd5Sig(keys); return this; } catch (IOException e) { throw new ChannelException(e); } }
[ "public", "EpollSocketChannelConfig", "setTcpMd5Sig", "(", "Map", "<", "InetAddress", ",", "byte", "[", "]", ">", "keys", ")", "{", "try", "{", "(", "(", "EpollSocketChannel", ")", "channel", ")", ".", "setTcpMd5Sig", "(", "keys", ")", ";", "return", "this...
Set the {@code TCP_MD5SIG} option on the socket. See {@code linux/tcp.h} for more details. Keys can only be set on, not read to prevent a potential leak, as they are confidential. Allowing them being read would mean anyone with access to the channel could get them.
[ "Set", "the", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannelConfig.java#L518-L525
train
Sets the tcpMd5Sig keys.
[ 30522, 2270, 4958, 14511, 6499, 19869, 10649, 20147, 22499, 2078, 8873, 2290, 2275, 13535, 9737, 2094, 2629, 5332, 2290, 1006, 4949, 1026, 1999, 12928, 14141, 8303, 1010, 24880, 1031, 1033, 1028, 6309, 1007, 1063, 3046, 1063, 1006, 1006, 49...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/LengthFieldBasedFrameDecoder.java
LengthFieldBasedFrameDecoder.extractFrame
protected ByteBuf extractFrame(ChannelHandlerContext ctx, ByteBuf buffer, int index, int length) { return buffer.retainedSlice(index, length); }
java
protected ByteBuf extractFrame(ChannelHandlerContext ctx, ByteBuf buffer, int index, int length) { return buffer.retainedSlice(index, length); }
[ "protected", "ByteBuf", "extractFrame", "(", "ChannelHandlerContext", "ctx", ",", "ByteBuf", "buffer", ",", "int", "index", ",", "int", "length", ")", "{", "return", "buffer", ".", "retainedSlice", "(", "index", ",", "length", ")", ";", "}" ]
Extract the sub-region of the specified buffer. <p> If you are sure that the frame and its content are not accessed after the current {@link #decode(ChannelHandlerContext, ByteBuf)} call returns, you can even avoid memory copy by returning the sliced sub-region (i.e. <tt>return buffer.slice(index, length)</tt>). It's often useful when you convert the extracted frame into an object. Refer to the source code of {@link ObjectDecoder} to see how this method is overridden to avoid memory copy.
[ "Extract", "the", "sub", "-", "region", "of", "the", "specified", "buffer", ".", "<p", ">", "If", "you", "are", "sure", "that", "the", "frame", "and", "its", "content", "are", "not", "accessed", "after", "the", "current", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java#L507-L509
train
Extract a frame from the buffer.
[ 30522, 5123, 24880, 8569, 2546, 14817, 15643, 1006, 3149, 11774, 3917, 8663, 18209, 14931, 2595, 1010, 24880, 8569, 2546, 17698, 1010, 20014, 5950, 1010, 20014, 3091, 1007, 1063, 2709, 17698, 1012, 6025, 14540, 6610, 1006, 5950, 1010, 3091, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/summarize/aggregation/NumericSummaryAggregator.java
NumericSummaryAggregator.combine
@Override public void combine(Aggregator<T, NumericColumnSummary<T>> otherSameType) { NumericSummaryAggregator<T> other = (NumericSummaryAggregator<T>) otherSameType; nullCount += other.nullCount; nanCount += other.nanCount; infinityCount += other.infinityCount; if (nonMissingCount == 0) { nonMissingCount = other.nonMissingCount; min = other.min; max = other.max; sum = other.sum; mean = other.mean; m2 = other.m2; } else if (other.nonMissingCount != 0) { long combinedCount = nonMissingCount + other.nonMissingCount; min.combine(other.min); max.combine(other.max); sum.combine(other.sum); double deltaMean = other.mean.value() - mean.value(); mean = mean.add(deltaMean * other.nonMissingCount / combinedCount); m2 = m2.add(other.m2).add(deltaMean * deltaMean * nonMissingCount * other.nonMissingCount / combinedCount); nonMissingCount = combinedCount; } }
java
@Override public void combine(Aggregator<T, NumericColumnSummary<T>> otherSameType) { NumericSummaryAggregator<T> other = (NumericSummaryAggregator<T>) otherSameType; nullCount += other.nullCount; nanCount += other.nanCount; infinityCount += other.infinityCount; if (nonMissingCount == 0) { nonMissingCount = other.nonMissingCount; min = other.min; max = other.max; sum = other.sum; mean = other.mean; m2 = other.m2; } else if (other.nonMissingCount != 0) { long combinedCount = nonMissingCount + other.nonMissingCount; min.combine(other.min); max.combine(other.max); sum.combine(other.sum); double deltaMean = other.mean.value() - mean.value(); mean = mean.add(deltaMean * other.nonMissingCount / combinedCount); m2 = m2.add(other.m2).add(deltaMean * deltaMean * nonMissingCount * other.nonMissingCount / combinedCount); nonMissingCount = combinedCount; } }
[ "@", "Override", "public", "void", "combine", "(", "Aggregator", "<", "T", ",", "NumericColumnSummary", "<", "T", ">", ">", "otherSameType", ")", "{", "NumericSummaryAggregator", "<", "T", ">", "other", "=", "(", "NumericSummaryAggregator", "<", "T", ">", ")...
combine two aggregations.
[ "combine", "two", "aggregations", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/summarize/aggregation/NumericSummaryAggregator.java#L95-L127
train
Combine the two aggregators.
[ 30522, 1030, 2058, 15637, 2270, 11675, 11506, 1006, 24089, 1026, 1056, 1010, 16371, 25531, 25778, 2819, 3619, 2819, 7849, 2100, 1026, 1056, 1028, 1028, 2500, 14074, 13874, 1007, 1063, 16371, 25531, 17421, 7849, 3148, 13871, 2890, 20697, 2953,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/CharUtil.java
CharUtil.isEmoji
public static boolean isEmoji(char c) { return false == ((c == 0x0) || // (c == 0x9) || // (c == 0xA) || // (c == 0xD) || // ((c >= 0x20) && (c <= 0xD7FF)) || // ((c >= 0xE000) && (c <= 0xFFFD)) || // ((c >= 0x10000) && (c <= 0x10FFFF))); }
java
public static boolean isEmoji(char c) { return false == ((c == 0x0) || // (c == 0x9) || // (c == 0xA) || // (c == 0xD) || // ((c >= 0x20) && (c <= 0xD7FF)) || // ((c >= 0xE000) && (c <= 0xFFFD)) || // ((c >= 0x10000) && (c <= 0x10FFFF))); }
[ "public", "static", "boolean", "isEmoji", "(", "char", "c", ")", "{", "return", "false", "==", "(", "(", "c", "==", "0x0", ")", "||", "//\r", "(", "c", "==", "0x9", ")", "||", "//\r", "(", "c", "==", "0xA", ")", "||", "//\r", "(", "c", "==", ...
判断是否为emoji表情符<br> @param c 字符 @return 是否为emoji @since 4.0.8
[ "判断是否为emoji表情符<br", ">" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/CharUtil.java#L285-L293
train
Returns true if the specified character is an emoji character.
[ 30522, 2270, 10763, 22017, 20898, 2003, 6633, 29147, 2072, 1006, 25869, 1039, 1007, 1063, 2709, 6270, 1027, 1027, 1006, 1006, 1039, 1027, 1027, 1014, 2595, 2692, 1007, 1064, 1064, 1013, 1013, 1006, 1039, 1027, 1027, 1014, 2595, 2683, 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-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessageDecoder.java
HAProxyMessageDecoder.findVersion
private static int findVersion(final ByteBuf buffer) { final int n = buffer.readableBytes(); // per spec, the version number is found in the 13th byte if (n < 13) { return -1; } int idx = buffer.readerIndex(); return match(BINARY_PREFIX, buffer, idx) ? buffer.getByte(idx + BINARY_PREFIX_LENGTH) : 1; }
java
private static int findVersion(final ByteBuf buffer) { final int n = buffer.readableBytes(); // per spec, the version number is found in the 13th byte if (n < 13) { return -1; } int idx = buffer.readerIndex(); return match(BINARY_PREFIX, buffer, idx) ? buffer.getByte(idx + BINARY_PREFIX_LENGTH) : 1; }
[ "private", "static", "int", "findVersion", "(", "final", "ByteBuf", "buffer", ")", "{", "final", "int", "n", "=", "buffer", ".", "readableBytes", "(", ")", ";", "// per spec, the version number is found in the 13th byte", "if", "(", "n", "<", "13", ")", "{", "...
Returns the proxy protocol specification version in the buffer if the version is found. Returns -1 if no version was found in the buffer.
[ "Returns", "the", "proxy", "protocol", "specification", "version", "in", "the", "buffer", "if", "the", "version", "is", "found", ".", "Returns", "-", "1", "if", "no", "version", "was", "found", "in", "the", "buffer", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessageDecoder.java#L163-L172
train
Find the version number in the buffer.
[ 30522, 2797, 10763, 20014, 2424, 27774, 1006, 2345, 24880, 8569, 2546, 17698, 1007, 1063, 2345, 20014, 1050, 1027, 17698, 1012, 3191, 3085, 3762, 4570, 1006, 1007, 1025, 1013, 1013, 2566, 28699, 1010, 1996, 2544, 2193, 2003, 2179, 1999, 199...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
java/server/src/org/openqa/grid/web/servlet/console/MiniCapability.java
MiniCapability.getConsoleIconPath
private String getConsoleIconPath(DesiredCapabilities cap) { String name = consoleIconName(cap); String path = "org/openqa/grid/images/"; InputStream in = Thread.currentThread().getContextClassLoader() .getResourceAsStream(path + name + ".png"); if (in == null) { return null; } return "/grid/resources/" + path + name + ".png"; }
java
private String getConsoleIconPath(DesiredCapabilities cap) { String name = consoleIconName(cap); String path = "org/openqa/grid/images/"; InputStream in = Thread.currentThread().getContextClassLoader() .getResourceAsStream(path + name + ".png"); if (in == null) { return null; } return "/grid/resources/" + path + name + ".png"; }
[ "private", "String", "getConsoleIconPath", "(", "DesiredCapabilities", "cap", ")", "{", "String", "name", "=", "consoleIconName", "(", "cap", ")", ";", "String", "path", "=", "\"org/openqa/grid/images/\"", ";", "InputStream", "in", "=", "Thread", ".", "currentThre...
get the icon representing the browser for the grid. If the icon cannot be located, returns null. @param cap - Capability @return String with path to icon image file. Can be <i>null</i> if no icon file if available.
[ "get", "the", "icon", "representing", "the", "browser", "for", "the", "grid", ".", "If", "the", "icon", "cannot", "be", "located", "returns", "null", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/console/MiniCapability.java#L60-L70
train
Get the image path for the console icon.
[ 30522, 2797, 5164, 2131, 8663, 19454, 7416, 8663, 15069, 1006, 9059, 17695, 28518, 15909, 3111, 6178, 1007, 1063, 5164, 2171, 1027, 10122, 28524, 18442, 1006, 6178, 1007, 1025, 5164, 4130, 1027, 1000, 8917, 1013, 2330, 19062, 1013, 8370, 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/bean/BeanDesc.java
BeanDesc.isMatchSetter
private boolean isMatchSetter(String methodName, String fieldName, boolean isBooeanField) { // 全部转为小写,忽略大小写比较 methodName = methodName.toLowerCase(); fieldName = fieldName.toLowerCase(); // 非标准Setter方法跳过 if (false == methodName.startsWith("set")) { return false; } // 针对Boolean类型特殊检查 if (isBooeanField && fieldName.startsWith("is")) { // 字段是is开头 if (methodName.equals("set" + StrUtil.removePrefix(fieldName, "is"))// isName -》 setName || methodName.equals("set" + fieldName)// isName -》 setIsName ) { return true; } } // 包括boolean的任何类型只有一种匹配情况:name -》 setName return methodName.equals("set" + fieldName); }
java
private boolean isMatchSetter(String methodName, String fieldName, boolean isBooeanField) { // 全部转为小写,忽略大小写比较 methodName = methodName.toLowerCase(); fieldName = fieldName.toLowerCase(); // 非标准Setter方法跳过 if (false == methodName.startsWith("set")) { return false; } // 针对Boolean类型特殊检查 if (isBooeanField && fieldName.startsWith("is")) { // 字段是is开头 if (methodName.equals("set" + StrUtil.removePrefix(fieldName, "is"))// isName -》 setName || methodName.equals("set" + fieldName)// isName -》 setIsName ) { return true; } } // 包括boolean的任何类型只有一种匹配情况:name -》 setName return methodName.equals("set" + fieldName); }
[ "private", "boolean", "isMatchSetter", "(", "String", "methodName", ",", "String", "fieldName", ",", "boolean", "isBooeanField", ")", "{", "// 全部转为小写,忽略大小写比较\r", "methodName", "=", "methodName", ".", "toLowerCase", "(", ")", ";", "fieldName", "=", "fieldName", "."...
方法是否为Setter方法<br> 匹配规则如下(忽略大小写): <pre> 字段名 -》 方法名 isName -》 setName isName -》 setIsName name -》 setName </pre> @param methodName 方法名 @param fieldName 字段名 @param isBooeanField 是否为Boolean类型字段 @return 是否匹配
[ "方法是否为Setter方法<br", ">", "匹配规则如下(忽略大小写):" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanDesc.java#L267-L289
train
Checks if the specified method name and field name match the setter method name.
[ 30522, 2797, 22017, 20898, 2003, 18900, 18069, 7585, 2099, 1006, 5164, 4118, 18442, 1010, 5164, 2492, 18442, 1010, 22017, 20898, 2003, 5092, 8913, 2319, 3790, 1007, 1063, 1013, 1013, 100, 1960, 100, 100, 1829, 100, 1989, 100, 100, 1810, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/rank/TopNBuffer.java
TopNBuffer.getElement
BaseRow getElement(int rank) { int curRank = 0; Iterator<Map.Entry<BaseRow, Collection<BaseRow>>> iter = treeMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<BaseRow, Collection<BaseRow>> entry = iter.next(); Collection<BaseRow> list = entry.getValue(); Iterator<BaseRow> listIter = list.iterator(); while (listIter.hasNext()) { BaseRow elem = listIter.next(); curRank += 1; if (curRank == rank) { return elem; } } } return null; }
java
BaseRow getElement(int rank) { int curRank = 0; Iterator<Map.Entry<BaseRow, Collection<BaseRow>>> iter = treeMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<BaseRow, Collection<BaseRow>> entry = iter.next(); Collection<BaseRow> list = entry.getValue(); Iterator<BaseRow> listIter = list.iterator(); while (listIter.hasNext()) { BaseRow elem = listIter.next(); curRank += 1; if (curRank == rank) { return elem; } } } return null; }
[ "BaseRow", "getElement", "(", "int", "rank", ")", "{", "int", "curRank", "=", "0", ";", "Iterator", "<", "Map", ".", "Entry", "<", "BaseRow", ",", "Collection", "<", "BaseRow", ">", ">", ">", "iter", "=", "treeMap", ".", "entrySet", "(", ")", ".", ...
Gets record which rank is given value. @param rank rank value to search @return the record which rank is given value
[ "Gets", "record", "which", "rank", "is", "given", "value", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/rank/TopNBuffer.java#L146-L163
train
Get the element of the given rank.
[ 30522, 2918, 10524, 2131, 12260, 3672, 1006, 20014, 4635, 1007, 1063, 20014, 19649, 2243, 1027, 1014, 1025, 2009, 6906, 4263, 1026, 4949, 1012, 4443, 1026, 2918, 10524, 1010, 3074, 1026, 2918, 10524, 1028, 1028, 1028, 2009, 2121, 1027, 3392...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/AstUtils.java
AstUtils.getClosure
public static ClosureExpression getClosure(BlockStatement block, String name, boolean remove) { for (ExpressionStatement statement : getExpressionStatements(block)) { Expression expression = statement.getExpression(); if (expression instanceof MethodCallExpression) { ClosureExpression closure = getClosure(name, (MethodCallExpression) expression); if (closure != null) { if (remove) { block.getStatements().remove(statement); } return closure; } } } return null; }
java
public static ClosureExpression getClosure(BlockStatement block, String name, boolean remove) { for (ExpressionStatement statement : getExpressionStatements(block)) { Expression expression = statement.getExpression(); if (expression instanceof MethodCallExpression) { ClosureExpression closure = getClosure(name, (MethodCallExpression) expression); if (closure != null) { if (remove) { block.getStatements().remove(statement); } return closure; } } } return null; }
[ "public", "static", "ClosureExpression", "getClosure", "(", "BlockStatement", "block", ",", "String", "name", ",", "boolean", "remove", ")", "{", "for", "(", "ExpressionStatement", "statement", ":", "getExpressionStatements", "(", "block", ")", ")", "{", "Expressi...
Extract a top-level {@code name} closure from inside this block if there is one, optionally removing it from the block at the same time. @param block a block statement (class definition) @param name the name to look for @param remove whether or not the extracted closure should be removed @return a beans Closure if one can be found, null otherwise
[ "Extract", "a", "top", "-", "level", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/AstUtils.java#L150-L166
train
Get a closure expression from a block statement.
[ 30522, 2270, 10763, 8503, 10288, 20110, 3258, 2131, 20464, 2891, 5397, 1006, 5991, 12259, 3672, 3796, 1010, 5164, 2171, 1010, 22017, 20898, 6366, 1007, 1063, 2005, 1006, 11423, 12259, 3672, 4861, 1024, 2131, 10288, 20110, 8496, 12259, 8163, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/lang/Assert.java
Assert.notNull
public static <T> T notNull(T object, String errorMsgTemplate, Object... params) throws IllegalArgumentException { if (object == null) { throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params)); } return object; }
java
public static <T> T notNull(T object, String errorMsgTemplate, Object... params) throws IllegalArgumentException { if (object == null) { throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params)); } return object; }
[ "public", "static", "<", "T", ">", "T", "notNull", "(", "T", "object", ",", "String", "errorMsgTemplate", ",", "Object", "...", "params", ")", "throws", "IllegalArgumentException", "{", "if", "(", "object", "==", "null", ")", "{", "throw", "new", "IllegalA...
断言对象是否不为{@code null} ,如果为{@code null} 抛出{@link NullPointerException} 异常 Assert that an object is not {@code null} . <pre class="code"> Assert.notNull(clazz, "The class must not be null"); </pre> @param <T> 被检查对象泛型类型 @param object 被检查对象 @param errorMsgTemplate 错误消息模板,变量使用{}表示 @param params 参数 @return 被检查后的对象 @throws IllegalArgumentException if the object is {@code null}
[ "断言对象是否不为", "{", "@code", "null", "}", ",如果为", "{", "@code", "null", "}", "抛出", "{", "@link", "NullPointerException", "}", "异常", "Assert", "that", "an", "object", "is", "not", "{", "@code", "null", "}", "." ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L130-L135
train
Returns the object that is not null.
[ 30522, 2270, 10763, 1026, 1056, 1028, 1056, 2025, 11231, 3363, 1006, 1056, 4874, 1010, 5164, 7561, 5244, 13512, 6633, 15725, 1010, 4874, 1012, 1012, 1012, 11498, 5244, 1007, 11618, 6206, 2906, 22850, 15781, 2595, 24422, 1063, 2065, 1006, 48...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
transport/src/main/java/io/netty/channel/group/DefaultChannelGroup.java
DefaultChannelGroup.safeDuplicate
private static Object safeDuplicate(Object message) { if (message instanceof ByteBuf) { return ((ByteBuf) message).retainedDuplicate(); } else if (message instanceof ByteBufHolder) { return ((ByteBufHolder) message).retainedDuplicate(); } else { return ReferenceCountUtil.retain(message); } }
java
private static Object safeDuplicate(Object message) { if (message instanceof ByteBuf) { return ((ByteBuf) message).retainedDuplicate(); } else if (message instanceof ByteBufHolder) { return ((ByteBufHolder) message).retainedDuplicate(); } else { return ReferenceCountUtil.retain(message); } }
[ "private", "static", "Object", "safeDuplicate", "(", "Object", "message", ")", "{", "if", "(", "message", "instanceof", "ByteBuf", ")", "{", "return", "(", "(", "ByteBuf", ")", "message", ")", ".", "retainedDuplicate", "(", ")", ";", "}", "else", "if", "...
See https://github.com/netty/netty/issues/1461
[ "See", "https", ":", "//", "github", ".", "com", "/", "netty", "/", "netty", "/", "issues", "/", "1461" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/group/DefaultChannelGroup.java#L242-L250
train
Safely duplicate a message.
[ 30522, 2797, 10763, 4874, 3647, 8566, 24759, 24695, 1006, 4874, 4471, 1007, 1063, 2065, 1006, 4471, 6013, 11253, 24880, 8569, 2546, 1007, 1063, 2709, 1006, 1006, 24880, 8569, 2546, 1007, 4471, 1007, 1012, 6025, 8566, 24759, 24695, 1006, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/NFA.java
NFA.close
public void close() throws Exception { for (State<T> state : getStates()) { for (StateTransition<T> transition : state.getStateTransitions()) { IterativeCondition condition = transition.getCondition(); FunctionUtils.closeFunction(condition); } } }
java
public void close() throws Exception { for (State<T> state : getStates()) { for (StateTransition<T> transition : state.getStateTransitions()) { IterativeCondition condition = transition.getCondition(); FunctionUtils.closeFunction(condition); } } }
[ "public", "void", "close", "(", ")", "throws", "Exception", "{", "for", "(", "State", "<", "T", ">", "state", ":", "getStates", "(", ")", ")", "{", "for", "(", "StateTransition", "<", "T", ">", "transition", ":", "state", ".", "getStateTransitions", "(...
Tear-down method for the NFA.
[ "Tear", "-", "down", "method", "for", "the", "NFA", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/NFA.java#L192-L199
train
Close the iterator.
[ 30522, 2270, 11675, 2485, 1006, 1007, 11618, 30524, 2015, 1006, 1007, 1007, 1063, 2009, 25284, 8663, 20562, 4650, 1027, 6653, 1012, 2131, 8663, 20562, 1006, 1007, 1025, 3853, 21823, 4877, 1012, 2485, 11263, 27989, 1006, 4650, 1007, 1025, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java
CompressorHttp2ConnectionEncoder.newCompressor
private EmbeddedChannel newCompressor(ChannelHandlerContext ctx, Http2Headers headers, boolean endOfStream) throws Http2Exception { if (endOfStream) { return null; } CharSequence encoding = headers.get(CONTENT_ENCODING); if (encoding == null) { encoding = IDENTITY; } final EmbeddedChannel compressor = newContentCompressor(ctx, encoding); if (compressor != null) { CharSequence targetContentEncoding = getTargetContentEncoding(encoding); if (IDENTITY.contentEqualsIgnoreCase(targetContentEncoding)) { headers.remove(CONTENT_ENCODING); } else { headers.set(CONTENT_ENCODING, targetContentEncoding); } // The content length will be for the decompressed data. Since we will compress the data // this content-length will not be correct. Instead of queuing messages or delaying sending // header frames...just remove the content-length header headers.remove(CONTENT_LENGTH); } return compressor; }
java
private EmbeddedChannel newCompressor(ChannelHandlerContext ctx, Http2Headers headers, boolean endOfStream) throws Http2Exception { if (endOfStream) { return null; } CharSequence encoding = headers.get(CONTENT_ENCODING); if (encoding == null) { encoding = IDENTITY; } final EmbeddedChannel compressor = newContentCompressor(ctx, encoding); if (compressor != null) { CharSequence targetContentEncoding = getTargetContentEncoding(encoding); if (IDENTITY.contentEqualsIgnoreCase(targetContentEncoding)) { headers.remove(CONTENT_ENCODING); } else { headers.set(CONTENT_ENCODING, targetContentEncoding); } // The content length will be for the decompressed data. Since we will compress the data // this content-length will not be correct. Instead of queuing messages or delaying sending // header frames...just remove the content-length header headers.remove(CONTENT_LENGTH); } return compressor; }
[ "private", "EmbeddedChannel", "newCompressor", "(", "ChannelHandlerContext", "ctx", ",", "Http2Headers", "headers", ",", "boolean", "endOfStream", ")", "throws", "Http2Exception", "{", "if", "(", "endOfStream", ")", "{", "return", "null", ";", "}", "CharSequence", ...
Checks if a new compressor object is needed for the stream identified by {@code streamId}. This method will modify the {@code content-encoding} header contained in {@code headers}. @param ctx the context. @param headers Object representing headers which are to be written @param endOfStream Indicates if the stream has ended @return The channel used to compress data. @throws Http2Exception if any problems occur during initialization.
[ "Checks", "if", "a", "new", "compressor", "object", "is", "needed", "for", "the", "stream", "identified", "by", "{", "@code", "streamId", "}", ".", "This", "method", "will", "modify", "the", "{", "@code", "content", "-", "encoding", "}", "header", "contain...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java#L238-L264
train
Create a new compressor for the given headers.
[ 30522, 2797, 11157, 26058, 2047, 9006, 20110, 2953, 1006, 3149, 11774, 3917, 8663, 18209, 14931, 2595, 1010, 8299, 2475, 4974, 2545, 20346, 2015, 1010, 22017, 20898, 2203, 11253, 21422, 1007, 11618, 8299, 2475, 10288, 24422, 1063, 2065, 1006,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
RestClusterClient.pollResourceAsync
private <R, A extends AsynchronouslyCreatedResource<R>> CompletableFuture<R> pollResourceAsync( final Supplier<CompletableFuture<A>> resourceFutureSupplier) { return pollResourceAsync(resourceFutureSupplier, new CompletableFuture<>(), 0); }
java
private <R, A extends AsynchronouslyCreatedResource<R>> CompletableFuture<R> pollResourceAsync( final Supplier<CompletableFuture<A>> resourceFutureSupplier) { return pollResourceAsync(resourceFutureSupplier, new CompletableFuture<>(), 0); }
[ "private", "<", "R", ",", "A", "extends", "AsynchronouslyCreatedResource", "<", "R", ">", ">", "CompletableFuture", "<", "R", ">", "pollResourceAsync", "(", "final", "Supplier", "<", "CompletableFuture", "<", "A", ">", ">", "resourceFutureSupplier", ")", "{", ...
Creates a {@code CompletableFuture} that polls a {@code AsynchronouslyCreatedResource} until its {@link AsynchronouslyCreatedResource#queueStatus() QueueStatus} becomes {@link QueueStatus.Id#COMPLETED COMPLETED}. The future completes with the result of {@link AsynchronouslyCreatedResource#resource()}. @param resourceFutureSupplier The operation which polls for the {@code AsynchronouslyCreatedResource}. @param <R> The type of the resource. @param <A> The type of the {@code AsynchronouslyCreatedResource}. @return A {@code CompletableFuture} delivering the resource.
[ "Creates", "a", "{", "@code", "CompletableFuture", "}", "that", "polls", "a", "{", "@code", "AsynchronouslyCreatedResource", "}", "until", "its", "{", "@link", "AsynchronouslyCreatedResource#queueStatus", "()", "QueueStatus", "}", "becomes", "{", "@link", "QueueStatus...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java#L584-L587
train
Polls for a resource asynchronously.
[ 30522, 2797, 1026, 1054, 1010, 1037, 8908, 2004, 6038, 2818, 4948, 13453, 16748, 4383, 6072, 8162, 3401, 1026, 1054, 1028, 1028, 4012, 10814, 10880, 11263, 11244, 1026, 1054, 1028, 8554, 6072, 8162, 21456, 6508, 12273, 1006, 2345, 17024, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyInt
public static ByteBuf copyInt(int value) { ByteBuf buf = buffer(4); buf.writeInt(value); return buf; }
java
public static ByteBuf copyInt(int value) { ByteBuf buf = buffer(4); buf.writeInt(value); return buf; }
[ "public", "static", "ByteBuf", "copyInt", "(", "int", "value", ")", "{", "ByteBuf", "buf", "=", "buffer", "(", "4", ")", ";", "buf", ".", "writeInt", "(", "value", ")", ";", "return", "buf", ";", "}" ]
Creates a new 4-byte big-endian buffer that holds the specified 32-bit integer.
[ "Creates", "a", "new", "4", "-", "byte", "big", "-", "endian", "buffer", "that", "holds", "the", "specified", "32", "-", "bit", "integer", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L676-L680
train
Create a new big - endian buffer that holds a single integer.
[ 30522, 2270, 10763, 24880, 8569, 2546, 6100, 18447, 1006, 20014, 3643, 1007, 1063, 24880, 8569, 2546, 20934, 2546, 1027, 17698, 1006, 1018, 1007, 1025, 20934, 2546, 1012, 4339, 18447, 1006, 3643, 1007, 1025, 2709, 20934, 2546, 1025, 1065, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java
IoUtil.write
public static void write(OutputStream out, String charsetName, boolean isCloseOut, Object... contents) throws IORuntimeException { write(out, CharsetUtil.charset(charsetName), isCloseOut, contents); }
java
public static void write(OutputStream out, String charsetName, boolean isCloseOut, Object... contents) throws IORuntimeException { write(out, CharsetUtil.charset(charsetName), isCloseOut, contents); }
[ "public", "static", "void", "write", "(", "OutputStream", "out", ",", "String", "charsetName", ",", "boolean", "isCloseOut", ",", "Object", "...", "contents", ")", "throws", "IORuntimeException", "{", "write", "(", "out", ",", "CharsetUtil", ".", "charset", "(...
将多部分内容写到流中,自动转换为字符串 @param out 输出流 @param charsetName 写出的内容的字符集 @param isCloseOut 写入完毕是否关闭输出流 @param contents 写入的内容,调用toString()方法,不包括不会自动换行 @throws IORuntimeException IO异常
[ "将多部分内容写到流中,自动转换为字符串" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L891-L893
train
Write the contents of the object array to the output stream using the specified encoding.
[ 30522, 2270, 10763, 11675, 4339, 1006, 27852, 25379, 2041, 1010, 5164, 25869, 13462, 18442, 1010, 22017, 20898, 2003, 20464, 9232, 5833, 1010, 30524, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-yarn/src/main/java/org/apache/flink/yarn/highavailability/YarnHighAvailabilityServices.java
YarnHighAvailabilityServices.forYarnTaskManager
public static YarnHighAvailabilityServices forYarnTaskManager( Configuration flinkConfig, org.apache.hadoop.conf.Configuration hadoopConfig) throws IOException { checkNotNull(flinkConfig, "flinkConfig"); checkNotNull(hadoopConfig, "hadoopConfig"); final HighAvailabilityMode mode = HighAvailabilityMode.fromConfig(flinkConfig); switch (mode) { case NONE: return new YarnPreConfiguredMasterNonHaServices( flinkConfig, hadoopConfig, HighAvailabilityServicesUtils.AddressResolution.TRY_ADDRESS_RESOLUTION); case ZOOKEEPER: throw new UnsupportedOperationException("to be implemented"); default: throw new IllegalConfigurationException("Unrecognized high availability mode: " + mode); } }
java
public static YarnHighAvailabilityServices forYarnTaskManager( Configuration flinkConfig, org.apache.hadoop.conf.Configuration hadoopConfig) throws IOException { checkNotNull(flinkConfig, "flinkConfig"); checkNotNull(hadoopConfig, "hadoopConfig"); final HighAvailabilityMode mode = HighAvailabilityMode.fromConfig(flinkConfig); switch (mode) { case NONE: return new YarnPreConfiguredMasterNonHaServices( flinkConfig, hadoopConfig, HighAvailabilityServicesUtils.AddressResolution.TRY_ADDRESS_RESOLUTION); case ZOOKEEPER: throw new UnsupportedOperationException("to be implemented"); default: throw new IllegalConfigurationException("Unrecognized high availability mode: " + mode); } }
[ "public", "static", "YarnHighAvailabilityServices", "forYarnTaskManager", "(", "Configuration", "flinkConfig", ",", "org", ".", "apache", ".", "hadoop", ".", "conf", ".", "Configuration", "hadoopConfig", ")", "throws", "IOException", "{", "checkNotNull", "(", "flinkCo...
Creates the high-availability services for the TaskManagers participating in a Flink YARN application. @param flinkConfig The Flink configuration. @param hadoopConfig The Hadoop configuration for the YARN cluster. @return The created high-availability services. @throws IOException Thrown, if the high-availability services could not be initialized.
[ "Creates", "the", "high", "-", "availability", "services", "for", "the", "TaskManagers", "participating", "in", "a", "Flink", "YARN", "application", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/highavailability/YarnHighAvailabilityServices.java#L349-L370
train
Creates a YarnHighAvailabilityServices instance for the given configuration.
[ 30522, 2270, 10763, 27158, 4048, 5603, 12462, 11733, 8553, 8043, 7903, 2229, 2005, 13380, 12380, 6711, 24805, 4590, 1006, 9563, 13109, 19839, 8663, 8873, 2290, 1010, 8917, 1012, 15895, 1012, 2018, 18589, 1012, 9530, 2546, 1012, 9563, 2018, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/runtime/tasks/StreamTask.java
StreamTask.tryDisposeAllOperators
private void tryDisposeAllOperators() throws Exception { for (StreamOperator<?> operator : operatorChain.getAllOperators()) { if (operator != null) { operator.dispose(); } } }
java
private void tryDisposeAllOperators() throws Exception { for (StreamOperator<?> operator : operatorChain.getAllOperators()) { if (operator != null) { operator.dispose(); } } }
[ "private", "void", "tryDisposeAllOperators", "(", ")", "throws", "Exception", "{", "for", "(", "StreamOperator", "<", "?", ">", "operator", ":", "operatorChain", ".", "getAllOperators", "(", ")", ")", "{", "if", "(", "operator", "!=", "null", ")", "{", "op...
Execute {@link StreamOperator#dispose()} of each operator in the chain of this {@link StreamTask}. Disposing happens from <b>tail to head</b> operator in the chain.
[ "Execute", "{" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java#L487-L493
train
Disposes all operators.
[ 30522, 2797, 11675, 3046, 10521, 20688, 8095, 25918, 18926, 1006, 1007, 11618, 6453, 1063, 2005, 1006, 5460, 25918, 8844, 1026, 1029, 1028, 6872, 1024, 6872, 24925, 2078, 1012, 2131, 8095, 25918, 18926, 1006, 1007, 1007, 1063, 2065, 1006, 6...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
networknt/light-4j
metrics/src/main/java/io/dropwizard/metrics/InstrumentedExecutors.java
InstrumentedExecutors.defaultThreadFactory
public static InstrumentedThreadFactory defaultThreadFactory(MetricRegistry registry, String name) { return new InstrumentedThreadFactory(Executors.defaultThreadFactory(), registry, name); }
java
public static InstrumentedThreadFactory defaultThreadFactory(MetricRegistry registry, String name) { return new InstrumentedThreadFactory(Executors.defaultThreadFactory(), registry, name); }
[ "public", "static", "InstrumentedThreadFactory", "defaultThreadFactory", "(", "MetricRegistry", "registry", ",", "String", "name", ")", "{", "return", "new", "InstrumentedThreadFactory", "(", "Executors", ".", "defaultThreadFactory", "(", ")", ",", "registry", ",", "n...
Returns an instrumented default thread factory used to create new threads. This factory creates all new threads used by an Executor in the same {@link ThreadGroup}. If there is a {@link java.lang.SecurityManager}, it uses the group of {@link System#getSecurityManager}, else the group of the thread invoking this {@code defaultThreadFactory} method. Each new thread is created as a non-daemon thread with priority set to the smaller of {@code Thread.NORM_PRIORITY} and the maximum priority permitted in the thread group. New threads have names accessible via {@link Thread#getName} of <em>pool-N-thread-M</em>, where <em>N</em> is the sequence number of this factory, and <em>M</em> is the sequence number of the thread created by this factory. @param registry the {@link MetricRegistry} that will contain the metrics. @param name the (metrics) name for this executor service, see {@link MetricRegistry#name(String, String...)}. @return a thread factory @see Executors#defaultThreadFactory()
[ "Returns", "an", "instrumented", "default", "thread", "factory", "used", "to", "create", "new", "threads", ".", "This", "factory", "creates", "all", "new", "threads", "used", "by", "an", "Executor", "in", "the", "same", "{", "@link", "ThreadGroup", "}", ".",...
2a60257c60663684c8f6dc8b5ea3cf184e534db6
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/metrics/src/main/java/io/dropwizard/metrics/InstrumentedExecutors.java#L483-L485
train
Create a thread factory that uses the default thread factory.
[ 30522, 2270, 10763, 6602, 2098, 2705, 16416, 20952, 18908, 10253, 12398, 2705, 16416, 20952, 18908, 10253, 1006, 12046, 2890, 24063, 2854, 15584, 1010, 5164, 2171, 1007, 1063, 2709, 2047, 6602, 2098, 2705, 16416, 20952, 18908, 10253, 1006, 46...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
networknt/light-4j
http-url/src/main/java/com/networknt/url/URLNormalizer.java
URLNormalizer.removeTrailingHash
public URLNormalizer removeTrailingHash() { if (url.endsWith("#") && StringUtils.countMatches(url, "#") == 1) { url = StringUtils.removeEnd(url, "#"); } return this; }
java
public URLNormalizer removeTrailingHash() { if (url.endsWith("#") && StringUtils.countMatches(url, "#") == 1) { url = StringUtils.removeEnd(url, "#"); } return this; }
[ "public", "URLNormalizer", "removeTrailingHash", "(", ")", "{", "if", "(", "url", ".", "endsWith", "(", "\"#\"", ")", "&&", "StringUtils", ".", "countMatches", "(", "url", ",", "\"#\"", ")", "==", "1", ")", "{", "url", "=", "StringUtils", ".", "removeEnd...
<p>Removes trailing hash character ("#").</p> <code>http://www.example.com/path# &rarr; http://www.example.com/path</code> <p> This only removes the hash character if it is the last character. To remove an entire URL fragment, use {@link #removeFragment()}. </p> @return this instance @since 1.13.0
[ "<p", ">", "Removes", "trailing", "hash", "character", "(", "#", ")", ".", "<", "/", "p", ">", "<code", ">", "http", ":", "//", "www", ".", "example", ".", "com", "/", "path#", "&rarr", ";", "http", ":", "//", "www", ".", "example", ".", "com", ...
2a60257c60663684c8f6dc8b5ea3cf184e534db6
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/http-url/src/main/java/com/networknt/url/URLNormalizer.java#L774-L779
train
Removes trailing hash from url.
[ 30522, 2270, 24471, 19666, 2953, 9067, 17629, 6366, 6494, 16281, 14949, 2232, 1006, 1007, 1063, 2065, 1006, 24471, 2140, 1012, 4515, 24415, 1006, 1000, 1001, 1000, 1007, 1004, 1004, 5164, 21823, 4877, 1012, 4175, 18900, 8376, 1006, 24471, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java
FileUtil.writeUtf8String
public static File writeUtf8String(String content, File file) throws IORuntimeException { return writeString(content, file, CharsetUtil.CHARSET_UTF_8); }
java
public static File writeUtf8String(String content, File file) throws IORuntimeException { return writeString(content, file, CharsetUtil.CHARSET_UTF_8); }
[ "public", "static", "File", "writeUtf8String", "(", "String", "content", ",", "File", "file", ")", "throws", "IORuntimeException", "{", "return", "writeString", "(", "content", ",", "file", ",", "CharsetUtil", ".", "CHARSET_UTF_8", ")", ";", "}" ]
将String写入文件,覆盖模式,字符集为UTF-8 @param content 写入的内容 @param file 文件 @return 写入的文件 @throws IORuntimeException IO异常
[ "将String写入文件,覆盖模式,字符集为UTF", "-", "8" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2707-L2709
train
Write a UTF - 8 string to a File.
[ 30522, 2270, 10763, 5371, 4339, 4904, 2546, 2620, 3367, 4892, 1006, 5164, 4180, 1010, 5371, 5371, 1007, 11618, 22834, 15532, 7292, 10288, 24422, 1063, 2709, 7009, 18886, 3070, 1006, 4180, 1010, 5371, 1010, 25869, 13462, 21823, 2140, 1012, 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/io/IoUtil.java
IoUtil.getReader
public static BufferedReader getReader(InputStream in, String charsetName) { return getReader(in, Charset.forName(charsetName)); }
java
public static BufferedReader getReader(InputStream in, String charsetName) { return getReader(in, Charset.forName(charsetName)); }
[ "public", "static", "BufferedReader", "getReader", "(", "InputStream", "in", ",", "String", "charsetName", ")", "{", "return", "getReader", "(", "in", ",", "Charset", ".", "forName", "(", "charsetName", ")", ")", ";", "}" ]
获得一个文件读取器 @param in 输入流 @param charsetName 字符集名称 @return BufferedReader对象
[ "获得一个文件读取器" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L301-L303
train
Returns a buffered reader for the specified input stream using the specified character set.
[ 30522, 2270, 10763, 17698, 2098, 16416, 4063, 2131, 16416, 4063, 1006, 20407, 25379, 1999, 1010, 5164, 25869, 13462, 18442, 1007, 1063, 2709, 2131, 16416, 4063, 1006, 1999, 1010, 25869, 13462, 1012, 2005, 18442, 1006, 25869, 13462, 18442, 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...
netty/netty
handler/src/main/java/io/netty/handler/ssl/SslUtils.java
SslUtils.getEncryptedPacketLength
static int getEncryptedPacketLength(ByteBuf buffer, int offset) { int packetLength = 0; // SSLv3 or TLS - Check ContentType boolean tls; switch (buffer.getUnsignedByte(offset)) { case SSL_CONTENT_TYPE_CHANGE_CIPHER_SPEC: case SSL_CONTENT_TYPE_ALERT: case SSL_CONTENT_TYPE_HANDSHAKE: case SSL_CONTENT_TYPE_APPLICATION_DATA: case SSL_CONTENT_TYPE_EXTENSION_HEARTBEAT: tls = true; break; default: // SSLv2 or bad data tls = false; } if (tls) { // SSLv3 or TLS - Check ProtocolVersion int majorVersion = buffer.getUnsignedByte(offset + 1); if (majorVersion == 3) { // SSLv3 or TLS packetLength = unsignedShortBE(buffer, offset + 3) + SSL_RECORD_HEADER_LENGTH; if (packetLength <= SSL_RECORD_HEADER_LENGTH) { // Neither SSLv3 or TLSv1 (i.e. SSLv2 or bad data) tls = false; } } else { // Neither SSLv3 or TLSv1 (i.e. SSLv2 or bad data) tls = false; } } if (!tls) { // SSLv2 or bad data - Check the version int headerLength = (buffer.getUnsignedByte(offset) & 0x80) != 0 ? 2 : 3; int majorVersion = buffer.getUnsignedByte(offset + headerLength + 1); if (majorVersion == 2 || majorVersion == 3) { // SSLv2 packetLength = headerLength == 2 ? (shortBE(buffer, offset) & 0x7FFF) + 2 : (shortBE(buffer, offset) & 0x3FFF) + 3; if (packetLength <= headerLength) { return NOT_ENOUGH_DATA; } } else { return NOT_ENCRYPTED; } } return packetLength; }
java
static int getEncryptedPacketLength(ByteBuf buffer, int offset) { int packetLength = 0; // SSLv3 or TLS - Check ContentType boolean tls; switch (buffer.getUnsignedByte(offset)) { case SSL_CONTENT_TYPE_CHANGE_CIPHER_SPEC: case SSL_CONTENT_TYPE_ALERT: case SSL_CONTENT_TYPE_HANDSHAKE: case SSL_CONTENT_TYPE_APPLICATION_DATA: case SSL_CONTENT_TYPE_EXTENSION_HEARTBEAT: tls = true; break; default: // SSLv2 or bad data tls = false; } if (tls) { // SSLv3 or TLS - Check ProtocolVersion int majorVersion = buffer.getUnsignedByte(offset + 1); if (majorVersion == 3) { // SSLv3 or TLS packetLength = unsignedShortBE(buffer, offset + 3) + SSL_RECORD_HEADER_LENGTH; if (packetLength <= SSL_RECORD_HEADER_LENGTH) { // Neither SSLv3 or TLSv1 (i.e. SSLv2 or bad data) tls = false; } } else { // Neither SSLv3 or TLSv1 (i.e. SSLv2 or bad data) tls = false; } } if (!tls) { // SSLv2 or bad data - Check the version int headerLength = (buffer.getUnsignedByte(offset) & 0x80) != 0 ? 2 : 3; int majorVersion = buffer.getUnsignedByte(offset + headerLength + 1); if (majorVersion == 2 || majorVersion == 3) { // SSLv2 packetLength = headerLength == 2 ? (shortBE(buffer, offset) & 0x7FFF) + 2 : (shortBE(buffer, offset) & 0x3FFF) + 3; if (packetLength <= headerLength) { return NOT_ENOUGH_DATA; } } else { return NOT_ENCRYPTED; } } return packetLength; }
[ "static", "int", "getEncryptedPacketLength", "(", "ByteBuf", "buffer", ",", "int", "offset", ")", "{", "int", "packetLength", "=", "0", ";", "// SSLv3 or TLS - Check ContentType", "boolean", "tls", ";", "switch", "(", "buffer", ".", "getUnsignedByte", "(", "offset...
Return how much bytes can be read out of the encrypted data. Be aware that this method will not increase the readerIndex of the given {@link ByteBuf}. @param buffer The {@link ByteBuf} to read from. Be aware that it must have at least {@link #SSL_RECORD_HEADER_LENGTH} bytes to read, otherwise it will throw an {@link IllegalArgumentException}. @return length The length of the encrypted packet that is included in the buffer or {@link #SslUtils#NOT_ENOUGH_DATA} if not enough data is present in the {@link ByteBuf}. This will return {@link SslUtils#NOT_ENCRYPTED} if the given {@link ByteBuf} is not encrypted at all. @throws IllegalArgumentException Is thrown if the given {@link ByteBuf} has not at least {@link #SSL_RECORD_HEADER_LENGTH} bytes to read.
[ "Return", "how", "much", "bytes", "can", "be", "read", "out", "of", "the", "encrypted", "data", ".", "Be", "aware", "that", "this", "method", "will", "not", "increase", "the", "readerIndex", "of", "the", "given", "{", "@link", "ByteBuf", "}", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslUtils.java#L186-L236
train
Returns the length of the encrypted data in the buffer at the given offset.
[ 30522, 10763, 20014, 2131, 2368, 26775, 22571, 3064, 23947, 3388, 7770, 13512, 2232, 1006, 24880, 8569, 2546, 17698, 1010, 20014, 16396, 1007, 1063, 20014, 14771, 7770, 13512, 2232, 1027, 1014, 1025, 1013, 1013, 7020, 2140, 2615, 2509, 2030, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/ChannelWriterOutputView.java
ChannelWriterOutputView.nextSegment
protected final MemorySegment nextSegment(MemorySegment current, int posInSegment) throws IOException { if (current != null) { writeSegment(current, posInSegment, false); } final MemorySegment next = this.writer.getNextReturnedBlock(); this.blockCount++; return next; }
java
protected final MemorySegment nextSegment(MemorySegment current, int posInSegment) throws IOException { if (current != null) { writeSegment(current, posInSegment, false); } final MemorySegment next = this.writer.getNextReturnedBlock(); this.blockCount++; return next; }
[ "protected", "final", "MemorySegment", "nextSegment", "(", "MemorySegment", "current", ",", "int", "posInSegment", ")", "throws", "IOException", "{", "if", "(", "current", "!=", "null", ")", "{", "writeSegment", "(", "current", ",", "posInSegment", ",", "false",...
--------------------------------------------------------------------------------------------
[ "--------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/ChannelWriterOutputView.java#L200-L209
train
Get the next segment.
[ 30522, 5123, 2345, 3638, 3366, 21693, 4765, 2279, 3366, 21693, 4765, 1006, 3638, 3366, 21693, 4765, 2783, 1010, 20014, 13433, 11493, 3366, 21693, 4765, 1007, 11618, 22834, 10288, 24422, 1063, 2065, 1006, 2783, 999, 1027, 19701, 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/operators/SingleInputOperator.java
SingleInputOperator.addInput
@Deprecated public void addInput(Operator<IN>... input) { this.input = Operator.createUnionCascade(this.input, input); }
java
@Deprecated public void addInput(Operator<IN>... input) { this.input = Operator.createUnionCascade(this.input, input); }
[ "@", "Deprecated", "public", "void", "addInput", "(", "Operator", "<", "IN", ">", "...", "input", ")", "{", "this", ".", "input", "=", "Operator", ".", "createUnionCascade", "(", "this", ".", "input", ",", "input", ")", ";", "}" ]
Adds to the input the union of the given operators. @param input The operator(s) that form the input. @deprecated This method will be removed in future versions. Use the {@link Union} operator instead.
[ "Adds", "to", "the", "input", "the", "union", "of", "the", "given", "operators", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/SingleInputOperator.java#L141-L144
train
Add an input operator to the union of the existing operators.
[ 30522, 1030, 2139, 28139, 12921, 2270, 11675, 5587, 2378, 18780, 1006, 6872, 1026, 1999, 1028, 1012, 1012, 1012, 7953, 1007, 1063, 2023, 1012, 7953, 1027, 6872, 1012, 3443, 19496, 2239, 15671, 21869, 1006, 2023, 1012, 7953, 1010, 7953, 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/dictionary/CoreSynonymDictionary.java
CoreSynonymDictionary.distance
public static long distance(String A, String B) { CommonSynonymDictionary.SynonymItem itemA = get(A); CommonSynonymDictionary.SynonymItem itemB = get(B); if (itemA == null || itemB == null) return Long.MAX_VALUE; return distance(itemA, itemB); }
java
public static long distance(String A, String B) { CommonSynonymDictionary.SynonymItem itemA = get(A); CommonSynonymDictionary.SynonymItem itemB = get(B); if (itemA == null || itemB == null) return Long.MAX_VALUE; return distance(itemA, itemB); }
[ "public", "static", "long", "distance", "(", "String", "A", ",", "String", "B", ")", "{", "CommonSynonymDictionary", ".", "SynonymItem", "itemA", "=", "get", "(", "A", ")", ";", "CommonSynonymDictionary", ".", "SynonymItem", "itemB", "=", "get", "(", "B", ...
判断两个单词之间的语义距离 @param A @param B @return
[ "判断两个单词之间的语义距离" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/CoreSynonymDictionary.java#L89-L96
train
Get the distance between two tokens.
[ 30522, 2270, 10763, 2146, 3292, 1006, 5164, 1037, 1010, 5164, 1038, 1007, 1063, 7674, 6038, 16585, 26876, 28097, 5649, 1012, 10675, 4221, 2213, 8875, 2050, 1027, 2131, 1006, 1037, 1007, 1025, 7674, 6038, 16585, 26876, 28097, 5649, 1012, 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-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java
Graph.removeEdges
public Graph<K, VV, EV> removeEdges(List<Edge<K, EV>> edgesToBeRemoved) { DataSet<Edge<K, EV>> newEdges = getEdges().coGroup(this.context.fromCollection(edgesToBeRemoved)) .where(0, 1).equalTo(0, 1).with(new EdgeRemovalCoGroup<>()).name("Remove edges"); return new Graph<>(this.vertices, newEdges, context); }
java
public Graph<K, VV, EV> removeEdges(List<Edge<K, EV>> edgesToBeRemoved) { DataSet<Edge<K, EV>> newEdges = getEdges().coGroup(this.context.fromCollection(edgesToBeRemoved)) .where(0, 1).equalTo(0, 1).with(new EdgeRemovalCoGroup<>()).name("Remove edges"); return new Graph<>(this.vertices, newEdges, context); }
[ "public", "Graph", "<", "K", ",", "VV", ",", "EV", ">", "removeEdges", "(", "List", "<", "Edge", "<", "K", ",", "EV", ">", ">", "edgesToBeRemoved", ")", "{", "DataSet", "<", "Edge", "<", "K", ",", "EV", ">", ">", "newEdges", "=", "getEdges", "(",...
Removes all the edges that match the edges in the given data set from the graph. @param edgesToBeRemoved the list of edges to be removed @return a new graph where the edges have been removed and in which the vertices remained intact
[ "Removes", "all", "the", "edges", "that", "match", "the", "edges", "in", "the", "given", "data", "set", "from", "the", "graph", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L1571-L1577
train
Removes the edges from the graph.
[ 30522, 2270, 10629, 1026, 1047, 1010, 1058, 2615, 1010, 23408, 1028, 6366, 24225, 2015, 1006, 2862, 1026, 3341, 1026, 1047, 1010, 23408, 1028, 1028, 7926, 3406, 5677, 6633, 21818, 2094, 1007, 1063, 2951, 13462, 1026, 3341, 1026, 1047, 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...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java
NumberUtil.div
public static BigDecimal div(String v1, String v2, int scale) { return div(v1, v2, scale, RoundingMode.HALF_UP); }
java
public static BigDecimal div(String v1, String v2, int scale) { return div(v1, v2, scale, RoundingMode.HALF_UP); }
[ "public", "static", "BigDecimal", "div", "(", "String", "v1", ",", "String", "v2", ",", "int", "scale", ")", "{", "return", "div", "(", "v1", ",", "v2", ",", "scale", ",", "RoundingMode", ".", "HALF_UP", ")", ";", "}" ]
提供(相对)精确的除法运算,当发生除不尽的情况时,由scale指定精确度,后面的四舍五入 @param v1 被除数 @param v2 除数 @param scale 精确度,如果为负值,取绝对值 @return 两个参数的商
[ "提供", "(", "相对", ")", "精确的除法运算", "当发生除不尽的情况时", "由scale指定精确度", "后面的四舍五入" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L635-L637
train
Divide two numbers.
[ 30522, 2270, 10763, 2502, 3207, 6895, 9067, 4487, 2615, 1006, 5164, 1058, 2487, 1010, 5164, 1058, 2475, 1010, 20014, 4094, 1007, 1063, 2709, 4487, 2615, 1006, 1058, 2487, 1010, 1058, 2475, 1010, 4094, 1010, 26939, 5302, 3207, 1012, 2431, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/hmm/HMMSegmenter.java
HMMSegmenter.toSegment
public Segment toSegment() { return new Segment() { @Override protected List<Term> segSentence(char[] sentence) { List<String> wordList = segment(new String(sentence)); List<Term> termList = new LinkedList<Term>(); for (String word : wordList) { termList.add(new Term(word, null)); } return termList; } }.enableCustomDictionary(false); }
java
public Segment toSegment() { return new Segment() { @Override protected List<Term> segSentence(char[] sentence) { List<String> wordList = segment(new String(sentence)); List<Term> termList = new LinkedList<Term>(); for (String word : wordList) { termList.add(new Term(word, null)); } return termList; } }.enableCustomDictionary(false); }
[ "public", "Segment", "toSegment", "(", ")", "{", "return", "new", "Segment", "(", ")", "{", "@", "Override", "protected", "List", "<", "Term", ">", "segSentence", "(", "char", "[", "]", "sentence", ")", "{", "List", "<", "String", ">", "wordList", "=",...
获取兼容旧的Segment接口 @return
[ "获取兼容旧的Segment接口" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/hmm/HMMSegmenter.java#L114-L130
train
Returns a Segment object that represents the sequence of words in the sentence.
[ 30522, 2270, 6903, 2000, 3366, 21693, 4765, 1006, 1007, 1063, 2709, 2047, 6903, 1006, 1007, 1063, 1030, 2058, 15637, 5123, 2862, 1026, 2744, 1028, 7367, 5620, 15781, 5897, 1006, 30524, 9863, 1012, 5587, 1006, 2047, 2744, 1006, 2773, 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-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/grouping/WindowsGrouping.java
WindowsGrouping.reset
public void reset() { nextWindow = null; watermark = Long.MIN_VALUE; triggerWindowStartIndex = 0; emptyWindowTriggered = true; resetBuffer(); }
java
public void reset() { nextWindow = null; watermark = Long.MIN_VALUE; triggerWindowStartIndex = 0; emptyWindowTriggered = true; resetBuffer(); }
[ "public", "void", "reset", "(", ")", "{", "nextWindow", "=", "null", ";", "watermark", "=", "Long", ".", "MIN_VALUE", ";", "triggerWindowStartIndex", "=", "0", ";", "emptyWindowTriggered", "=", "true", ";", "resetBuffer", "(", ")", ";", "}" ]
Reset for next group.
[ "Reset", "for", "next", "group", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/grouping/WindowsGrouping.java#L95-L101
train
Resets the internal state of the internal data structures.
[ 30522, 2270, 11675, 25141, 1006, 1007, 1063, 2279, 11101, 5004, 1027, 19701, 1025, 2300, 10665, 1027, 2146, 1012, 8117, 1035, 3643, 1025, 9495, 11101, 15568, 7559, 7629, 3207, 2595, 1027, 1014, 1025, 4064, 11101, 5004, 18886, 13327, 2098, 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/operators/sort/FixedLengthRecordSorter.java
FixedLengthRecordSorter.getIterator
@Override public final MutableObjectIterator<T> getIterator() { final SingleSegmentInputView startIn = new SingleSegmentInputView(this.recordsPerSegment * this.recordSize); startIn.set(this.sortBuffer.get(0), 0); return new MutableObjectIterator<T>() { private final SingleSegmentInputView in = startIn; private final TypeComparator<T> comp = comparator; private final int numTotal = size(); private final int numPerSegment = recordsPerSegment; private int currentTotal = 0; private int currentInSegment = 0; private int currentSegmentIndex = 0; @Override public T next(T reuse) { if (this.currentTotal < this.numTotal) { if (this.currentInSegment >= this.numPerSegment) { this.currentInSegment = 0; this.currentSegmentIndex++; this.in.set(sortBuffer.get(this.currentSegmentIndex), 0); } this.currentTotal++; this.currentInSegment++; try { return this.comp.readWithKeyDenormalization(reuse, this.in); } catch (IOException ioe) { throw new RuntimeException(ioe); } } else { return null; } } @Override public T next() { if (this.currentTotal < this.numTotal) { if (this.currentInSegment >= this.numPerSegment) { this.currentInSegment = 0; this.currentSegmentIndex++; this.in.set(sortBuffer.get(this.currentSegmentIndex), 0); } this.currentTotal++; this.currentInSegment++; try { return this.comp.readWithKeyDenormalization(serializer.createInstance(), this.in); } catch (IOException ioe) { throw new RuntimeException(ioe); } } else { return null; } } }; }
java
@Override public final MutableObjectIterator<T> getIterator() { final SingleSegmentInputView startIn = new SingleSegmentInputView(this.recordsPerSegment * this.recordSize); startIn.set(this.sortBuffer.get(0), 0); return new MutableObjectIterator<T>() { private final SingleSegmentInputView in = startIn; private final TypeComparator<T> comp = comparator; private final int numTotal = size(); private final int numPerSegment = recordsPerSegment; private int currentTotal = 0; private int currentInSegment = 0; private int currentSegmentIndex = 0; @Override public T next(T reuse) { if (this.currentTotal < this.numTotal) { if (this.currentInSegment >= this.numPerSegment) { this.currentInSegment = 0; this.currentSegmentIndex++; this.in.set(sortBuffer.get(this.currentSegmentIndex), 0); } this.currentTotal++; this.currentInSegment++; try { return this.comp.readWithKeyDenormalization(reuse, this.in); } catch (IOException ioe) { throw new RuntimeException(ioe); } } else { return null; } } @Override public T next() { if (this.currentTotal < this.numTotal) { if (this.currentInSegment >= this.numPerSegment) { this.currentInSegment = 0; this.currentSegmentIndex++; this.in.set(sortBuffer.get(this.currentSegmentIndex), 0); } this.currentTotal++; this.currentInSegment++; try { return this.comp.readWithKeyDenormalization(serializer.createInstance(), this.in); } catch (IOException ioe) { throw new RuntimeException(ioe); } } else { return null; } } }; }
[ "@", "Override", "public", "final", "MutableObjectIterator", "<", "T", ">", "getIterator", "(", ")", "{", "final", "SingleSegmentInputView", "startIn", "=", "new", "SingleSegmentInputView", "(", "this", ".", "recordsPerSegment", "*", "this", ".", "recordSize", ")"...
Gets an iterator over all records in this buffer in their logical order. @return An iterator returning the records in their logical order.
[ "Gets", "an", "iterator", "over", "all", "records", "in", "this", "buffer", "in", "their", "logical", "order", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/FixedLengthRecordSorter.java#L317-L384
train
Get an iterator for the object.
[ 30522, 1030, 2058, 15637, 2270, 2345, 14163, 10880, 16429, 20614, 21646, 8844, 1026, 1056, 1028, 2131, 21646, 8844, 1006, 1007, 1063, 2345, 3895, 13910, 3672, 2378, 18780, 8584, 2707, 2378, 1027, 2047, 3895, 13910, 3672, 2378, 18780, 8584, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/MailUtil.java
MailUtil.send
public static void send(MailAccount mailAccount, Collection<String> tos, Collection<String> ccs, Collection<String> bccs, String subject, String content, boolean isHtml, File... files) { final Mail mail = Mail.create(mailAccount); //可选抄送人 if(CollUtil.isNotEmpty(ccs)) { mail.setCcs(ccs.toArray(new String[ccs.size()])); } //可选密送人 if(CollUtil.isNotEmpty(bccs)) { mail.setBccs(bccs.toArray(new String[bccs.size()])); } mail.setTos(tos.toArray(new String[tos.size()])); mail.setTitle(subject); mail.setContent(content); mail.setHtml(isHtml); mail.setFiles(files); mail.send(); }
java
public static void send(MailAccount mailAccount, Collection<String> tos, Collection<String> ccs, Collection<String> bccs, String subject, String content, boolean isHtml, File... files) { final Mail mail = Mail.create(mailAccount); //可选抄送人 if(CollUtil.isNotEmpty(ccs)) { mail.setCcs(ccs.toArray(new String[ccs.size()])); } //可选密送人 if(CollUtil.isNotEmpty(bccs)) { mail.setBccs(bccs.toArray(new String[bccs.size()])); } mail.setTos(tos.toArray(new String[tos.size()])); mail.setTitle(subject); mail.setContent(content); mail.setHtml(isHtml); mail.setFiles(files); mail.send(); }
[ "public", "static", "void", "send", "(", "MailAccount", "mailAccount", ",", "Collection", "<", "String", ">", "tos", ",", "Collection", "<", "String", ">", "ccs", ",", "Collection", "<", "String", ">", "bccs", ",", "String", "subject", ",", "String", "cont...
发送邮件给多人 @param mailAccount 邮件认证对象 @param tos 收件人列表 @param ccs 抄送人列表,可以为null或空 @param bccs 密送人列表,可以为null或空 @param subject 标题 @param content 正文 @param isHtml 是否为HTML格式 @param files 附件列表 @since 4.0.3
[ "发送邮件给多人" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/mail/MailUtil.java#L180-L199
train
Creates and sends a single CE message to the specified EmailAccount.
[ 30522, 2270, 10763, 11675, 4604, 1006, 5653, 6305, 3597, 16671, 5653, 6305, 3597, 16671, 1010, 3074, 1026, 5164, 1028, 2000, 2015, 1010, 3074, 1026, 5164, 1028, 10507, 2015, 1010, 3074, 1026, 5164, 1028, 4647, 6169, 1010, 5164, 3395, 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/spark
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.java
VariableLengthRowBasedKeyValueBatch.getValueFromKey
@Override public UnsafeRow getValueFromKey(int rowId) { if (keyRowId != rowId) { getKeyRow(rowId); } assert(rowId >= 0); long offset = keyRow.getBaseOffset(); int klen = keyRow.getSizeInBytes(); int vlen = Platform.getInt(base, offset - 8) - klen - 4; valueRow.pointTo(base, offset + klen, vlen); return valueRow; }
java
@Override public UnsafeRow getValueFromKey(int rowId) { if (keyRowId != rowId) { getKeyRow(rowId); } assert(rowId >= 0); long offset = keyRow.getBaseOffset(); int klen = keyRow.getSizeInBytes(); int vlen = Platform.getInt(base, offset - 8) - klen - 4; valueRow.pointTo(base, offset + klen, vlen); return valueRow; }
[ "@", "Override", "public", "UnsafeRow", "getValueFromKey", "(", "int", "rowId", ")", "{", "if", "(", "keyRowId", "!=", "rowId", ")", "{", "getKeyRow", "(", "rowId", ")", ";", "}", "assert", "(", "rowId", ">=", "0", ")", ";", "long", "offset", "=", "k...
Returns the value row by two steps: 1) looking up the key row with the same id (skipped if the key row is cached) 2) retrieve the value row by reusing the metadata from step 1) In most times, 1) is skipped because `getKeyRow(id)` is often called before `getValueRow(id)`.
[ "Returns", "the", "value", "row", "by", "two", "steps", ":", "1", ")", "looking", "up", "the", "key", "row", "with", "the", "same", "id", "(", "skipped", "if", "the", "key", "row", "is", "cached", ")", "2", ")", "retrieve", "the", "value", "row", "...
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.java#L96-L107
train
Get the value of the key.
[ 30522, 1030, 2058, 15637, 2270, 25135, 10524, 2131, 10175, 5657, 19699, 5358, 14839, 1006, 20014, 5216, 3593, 1007, 1063, 2065, 1006, 3145, 10524, 3593, 999, 1027, 5216, 3593, 1007, 1063, 2131, 14839, 10524, 1006, 5216, 3593, 1007, 1025, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java
Http2CodecUtil.streamableBytes
public static int streamableBytes(StreamByteDistributor.StreamState state) { return max(0, (int) min(state.pendingBytes(), state.windowSize())); }
java
public static int streamableBytes(StreamByteDistributor.StreamState state) { return max(0, (int) min(state.pendingBytes(), state.windowSize())); }
[ "public", "static", "int", "streamableBytes", "(", "StreamByteDistributor", ".", "StreamState", "state", ")", "{", "return", "max", "(", "0", ",", "(", "int", ")", "min", "(", "state", ".", "pendingBytes", "(", ")", ",", "state", ".", "windowSize", "(", ...
Calculate the amount of bytes that can be sent by {@code state}. The lower bound is {@code 0}.
[ "Calculate", "the", "amount", "of", "bytes", "that", "can", "be", "sent", "by", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java#L214-L216
train
Returns the number of bytes that can be used to write the given stream.
[ 30522, 2270, 10763, 20014, 5460, 3085, 3762, 4570, 1006, 5460, 3762, 3064, 2923, 3089, 8569, 4263, 1012, 9199, 12259, 2110, 1007, 1063, 2709, 4098, 1006, 1014, 1010, 1006, 20014, 1007, 8117, 1006, 2110, 1012, 14223, 3762, 4570, 1006, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java
Graph.runVertexCentricIteration
public <M> Graph<K, VV, EV> runVertexCentricIteration( ComputeFunction<K, VV, EV, M> computeFunction, MessageCombiner<K, M> combiner, int maximumNumberOfIterations, VertexCentricConfiguration parameters) { VertexCentricIteration<K, VV, EV, M> iteration = VertexCentricIteration.withEdges( edges, computeFunction, combiner, maximumNumberOfIterations); iteration.configure(parameters); DataSet<Vertex<K, VV>> newVertices = this.getVertices().runOperation(iteration); return new Graph<>(newVertices, this.edges, this.context); }
java
public <M> Graph<K, VV, EV> runVertexCentricIteration( ComputeFunction<K, VV, EV, M> computeFunction, MessageCombiner<K, M> combiner, int maximumNumberOfIterations, VertexCentricConfiguration parameters) { VertexCentricIteration<K, VV, EV, M> iteration = VertexCentricIteration.withEdges( edges, computeFunction, combiner, maximumNumberOfIterations); iteration.configure(parameters); DataSet<Vertex<K, VV>> newVertices = this.getVertices().runOperation(iteration); return new Graph<>(newVertices, this.edges, this.context); }
[ "public", "<", "M", ">", "Graph", "<", "K", ",", "VV", ",", "EV", ">", "runVertexCentricIteration", "(", "ComputeFunction", "<", "K", ",", "VV", ",", "EV", ",", "M", ">", "computeFunction", ",", "MessageCombiner", "<", "K", ",", "M", ">", "combiner", ...
Runs a {@link VertexCentricIteration} on the graph with configuration options. @param computeFunction the vertex compute function @param combiner an optional message combiner @param maximumNumberOfIterations maximum number of iterations to perform @param parameters the {@link VertexCentricConfiguration} parameters @return the updated Graph after the vertex-centric iteration has converged or after maximumNumberOfIterations.
[ "Runs", "a", "{", "@link", "VertexCentricIteration", "}", "on", "the", "graph", "with", "configuration", "options", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L1843-L1853
train
Run a Centric iteration on the graph.
[ 30522, 2270, 1026, 1049, 1028, 10629, 1026, 1047, 1010, 1058, 2615, 1010, 23408, 1028, 2448, 16874, 10288, 22461, 21646, 3370, 1006, 24134, 11263, 27989, 1026, 1047, 1010, 1058, 2615, 1010, 23408, 1010, 1049, 1028, 24134, 11263, 27989, 1010, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-shardingsphere
sharding-jdbc/sharding-jdbc-orchestration/src/main/java/org/apache/shardingsphere/shardingjdbc/orchestration/api/yaml/YamlOrchestrationShardingDataSourceFactory.java
YamlOrchestrationShardingDataSourceFactory.createDataSource
public static DataSource createDataSource(final File yamlFile) throws SQLException, IOException { YamlOrchestrationShardingRuleConfiguration config = unmarshal(yamlFile); return createDataSource(config.getDataSources(), config.getShardingRule(), config.getProps(), config.getOrchestration()); }
java
public static DataSource createDataSource(final File yamlFile) throws SQLException, IOException { YamlOrchestrationShardingRuleConfiguration config = unmarshal(yamlFile); return createDataSource(config.getDataSources(), config.getShardingRule(), config.getProps(), config.getOrchestration()); }
[ "public", "static", "DataSource", "createDataSource", "(", "final", "File", "yamlFile", ")", "throws", "SQLException", ",", "IOException", "{", "YamlOrchestrationShardingRuleConfiguration", "config", "=", "unmarshal", "(", "yamlFile", ")", ";", "return", "createDataSour...
Create sharding data source. @param yamlFile YAML file for rule configuration of databases and tables sharding with data sources @return sharding data source @throws SQLException SQL exception @throws IOException IO exception
[ "Create", "sharding", "data", "source", "." ]
f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-orchestration/src/main/java/org/apache/shardingsphere/shardingjdbc/orchestration/api/yaml/YamlOrchestrationShardingDataSourceFactory.java#L60-L63
train
Create a DataSource from a yaml file.
[ 30522, 2270, 10763, 2951, 6499, 3126, 3401, 2580, 6790, 6499, 3126, 3401, 1006, 2345, 5371, 8038, 19968, 8873, 2571, 1007, 11618, 29296, 10288, 24422, 1010, 22834, 10288, 24422, 1063, 8038, 19968, 2953, 8376, 6494, 9285, 11783, 2075, 6820, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/date/format/FastDateFormat.java
FastDateFormat.getDateInstance
public static FastDateFormat getDateInstance(final int style, final TimeZone timeZone) { return cache.getDateInstance(style, timeZone, null); }
java
public static FastDateFormat getDateInstance(final int style, final TimeZone timeZone) { return cache.getDateInstance(style, timeZone, null); }
[ "public", "static", "FastDateFormat", "getDateInstance", "(", "final", "int", "style", ",", "final", "TimeZone", "timeZone", ")", "{", "return", "cache", ".", "getDateInstance", "(", "style", ",", "timeZone", ",", "null", ")", ";", "}" ]
获得 {@link FastDateFormat} 实例<br> 支持缓存 @param style date style: FULL, LONG, MEDIUM, or SHORT @param timeZone 时区{@link TimeZone} @return 本地化 {@link FastDateFormat}
[ "获得", "{", "@link", "FastDateFormat", "}", "实例<br", ">", "支持缓存" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDateFormat.java#L145-L147
train
Gets the date instance.
[ 30522, 2270, 10763, 3435, 13701, 14192, 4017, 2131, 13701, 7076, 26897, 1006, 2345, 20014, 2806, 1010, 2345, 2051, 15975, 2051, 15975, 1007, 1063, 2709, 17053, 1012, 2131, 13701, 7076, 26897, 1006, 2806, 1010, 2051, 15975, 1010, 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...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/BooleanUtil.java
BooleanUtil.or
public static boolean or(boolean... array) { if (ArrayUtil.isEmpty(array)) { throw new IllegalArgumentException("The Array must not be empty !"); } for (final boolean element : array) { if (element) { return true; } } return false; }
java
public static boolean or(boolean... array) { if (ArrayUtil.isEmpty(array)) { throw new IllegalArgumentException("The Array must not be empty !"); } for (final boolean element : array) { if (element) { return true; } } return false; }
[ "public", "static", "boolean", "or", "(", "boolean", "...", "array", ")", "{", "if", "(", "ArrayUtil", ".", "isEmpty", "(", "array", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The Array must not be empty !\"", ")", ";", "}", "for", "(...
对Boolean数组取或 <pre> BooleanUtil.or(true, true) = true BooleanUtil.or(false, false) = false BooleanUtil.or(true, false) = true BooleanUtil.or(true, true, false) = true BooleanUtil.or(true, true, true) = true BooleanUtil.or(false, false, false) = false </pre> @param array {@code Boolean}数组 @return 取或为真返回{@code true}
[ "对Boolean数组取或" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/BooleanUtil.java#L353-L363
train
Returns true if all elements in the array are true.
[ 30522, 2270, 10763, 22017, 20898, 2030, 1006, 22017, 20898, 1012, 1012, 1012, 9140, 1007, 1063, 2065, 1006, 9140, 21823, 2140, 1012, 2003, 6633, 13876, 2100, 1006, 9140, 1007, 1007, 1063, 5466, 2047, 6206, 2906, 22850, 15781, 2595, 24422, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java
XmlUtil.getNodeListByXPath
public static NodeList getNodeListByXPath(String expression, Object source) { return (NodeList) getByXPath(expression, source, XPathConstants.NODESET); }
java
public static NodeList getNodeListByXPath(String expression, Object source) { return (NodeList) getByXPath(expression, source, XPathConstants.NODESET); }
[ "public", "static", "NodeList", "getNodeListByXPath", "(", "String", "expression", ",", "Object", "source", ")", "{", "return", "(", "NodeList", ")", "getByXPath", "(", "expression", ",", "source", ",", "XPathConstants", ".", "NODESET", ")", ";", "}" ]
通过XPath方式读取XML的NodeList<br> Xpath相关文章:https://www.ibm.com/developerworks/cn/xml/x-javaxpathapi.html @param expression XPath表达式 @param source 资源,可以是Docunent、Node节点等 @return NodeList @since 4.0.9
[ "通过XPath方式读取XML的NodeList<br", ">", "Xpath相关文章:https", ":", "//", "www", ".", "ibm", ".", "com", "/", "developerworks", "/", "cn", "/", "xml", "/", "x", "-", "javaxpathapi", ".", "html" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L585-L587
train
Get NodeList by XPath
[ 30522, 2270, 10763, 13045, 9863, 2131, 3630, 9247, 2923, 3762, 2595, 15069, 1006, 5164, 3670, 1010, 4874, 3120, 1007, 1063, 2709, 1006, 13045, 9863, 1007, 2131, 3762, 2595, 15069, 1006, 3670, 1010, 3120, 1010, 26726, 8988, 8663, 12693, 3215...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
buffer/src/main/java/io/netty/buffer/ByteBufUtil.java
ByteBufUtil.getBytes
public static byte[] getBytes(ByteBuf buf, int start, int length) { return getBytes(buf, start, length, true); }
java
public static byte[] getBytes(ByteBuf buf, int start, int length) { return getBytes(buf, start, length, true); }
[ "public", "static", "byte", "[", "]", "getBytes", "(", "ByteBuf", "buf", ",", "int", "start", ",", "int", "length", ")", "{", "return", "getBytes", "(", "buf", ",", "start", ",", "length", ",", "true", ")", ";", "}" ]
Create a copy of the underlying storage from {@code buf} into a byte array. The copy will start at {@code start} and copy {@code length} bytes.
[ "Create", "a", "copy", "of", "the", "underlying", "storage", "from", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L829-L831
train
Get a byte array of bytes from the given buffer.
[ 30522, 2270, 10763, 24880, 1031, 1033, 2131, 3762, 4570, 1006, 24880, 8569, 2546, 20934, 2546, 1010, 20014, 2707, 1010, 20014, 3091, 1007, 1063, 2709, 2131, 3762, 4570, 1006, 20934, 2546, 1010, 2707, 1010, 3091, 1010, 2995, 1007, 1025, 1065...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java
SplitDataProperties.getAllFlatKeys
private int[] getAllFlatKeys(String[] fieldExpressions) { int[] allKeys = null; for (String keyExp : fieldExpressions) { Keys.ExpressionKeys<T> ek = new Keys.ExpressionKeys<>(keyExp, this.type); int[] flatKeys = ek.computeLogicalKeyPositions(); if (allKeys == null) { allKeys = flatKeys; } else { // check for duplicates for (int key1 : flatKeys) { for (int key2 : allKeys) { if (key1 == key2) { throw new InvalidProgramException("Duplicate fields in field expression " + keyExp); } } } // append flat keys int oldLength = allKeys.length; int newLength = oldLength + flatKeys.length; allKeys = Arrays.copyOf(allKeys, newLength); System.arraycopy(flatKeys, 0, allKeys, oldLength, flatKeys.length); } } return allKeys; }
java
private int[] getAllFlatKeys(String[] fieldExpressions) { int[] allKeys = null; for (String keyExp : fieldExpressions) { Keys.ExpressionKeys<T> ek = new Keys.ExpressionKeys<>(keyExp, this.type); int[] flatKeys = ek.computeLogicalKeyPositions(); if (allKeys == null) { allKeys = flatKeys; } else { // check for duplicates for (int key1 : flatKeys) { for (int key2 : allKeys) { if (key1 == key2) { throw new InvalidProgramException("Duplicate fields in field expression " + keyExp); } } } // append flat keys int oldLength = allKeys.length; int newLength = oldLength + flatKeys.length; allKeys = Arrays.copyOf(allKeys, newLength); System.arraycopy(flatKeys, 0, allKeys, oldLength, flatKeys.length); } } return allKeys; }
[ "private", "int", "[", "]", "getAllFlatKeys", "(", "String", "[", "]", "fieldExpressions", ")", "{", "int", "[", "]", "allKeys", "=", "null", ";", "for", "(", "String", "keyExp", ":", "fieldExpressions", ")", "{", "Keys", ".", "ExpressionKeys", "<", "T",...
///////////////////// FLAT FIELD EXTRACTION METHODS
[ "/////////////////////", "FLAT", "FIELD", "EXTRACTION", "METHODS" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java#L370-L398
train
Get all the flat keys of the given field expressions.
[ 30522, 2797, 20014, 1031, 1033, 2131, 8095, 10258, 4017, 14839, 2015, 1006, 5164, 1031, 1033, 2492, 10288, 20110, 8496, 1007, 1063, 20014, 1031, 1033, 2035, 14839, 2015, 1027, 19701, 1025, 2005, 1006, 5164, 3145, 10288, 2361, 1024, 2492, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java
ArrayUtil.unWrap
public static int[] unWrap(Integer... values) { if (null == values) { return null; } final int length = values.length; if (0 == length) { return new int[0]; } final int[] array = new int[length]; for (int i = 0; i < length; i++) { array[i] = values[i].intValue(); } return array; }
java
public static int[] unWrap(Integer... values) { if (null == values) { return null; } final int length = values.length; if (0 == length) { return new int[0]; } final int[] array = new int[length]; for (int i = 0; i < length; i++) { array[i] = values[i].intValue(); } return array; }
[ "public", "static", "int", "[", "]", "unWrap", "(", "Integer", "...", "values", ")", "{", "if", "(", "null", "==", "values", ")", "{", "return", "null", ";", "}", "final", "int", "length", "=", "values", ".", "length", ";", "if", "(", "0", "==", ...
包装类数组转为原始类型数组 @param values 包装类型数组 @return 原始类型数组
[ "包装类数组转为原始类型数组" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L1421-L1435
train
Creates an array of integers wrapping the specified Integer values.
[ 30522, 2270, 10763, 20014, 1031, 1033, 4895, 13088, 9331, 1006, 16109, 1012, 1012, 1012, 5300, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 5300, 1007, 1063, 2709, 19701, 1025, 1065, 2345, 20014, 3091, 1027, 5300, 1012, 3091, 1025, 2065, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.toMap
public static <K, V> HashMap<K, V> toMap(Iterable<Entry<K, V>> entryIter) { return IterUtil.toMap(entryIter); }
java
public static <K, V> HashMap<K, V> toMap(Iterable<Entry<K, V>> entryIter) { return IterUtil.toMap(entryIter); }
[ "public", "static", "<", "K", ",", "V", ">", "HashMap", "<", "K", ",", "V", ">", "toMap", "(", "Iterable", "<", "Entry", "<", "K", ",", "V", ">", ">", "entryIter", ")", "{", "return", "IterUtil", ".", "toMap", "(", "entryIter", ")", ";", "}" ]
将Entry集合转换为HashMap @param <K> 键类型 @param <V> 值类型 @param entryIter entry集合 @return Map @see IterUtil#toMap(Iterable)
[ "将Entry集合转换为HashMap" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1512-L1514
train
Converts an iterable of entries to a HashMap.
[ 30522, 2270, 10763, 1026, 1047, 1010, 1058, 1028, 23325, 2863, 2361, 1026, 1047, 1010, 1058, 1028, 3419, 9331, 1006, 2009, 6906, 3468, 1026, 4443, 1026, 1047, 1010, 1058, 1028, 1028, 4443, 21646, 1007, 1063, 2709, 2009, 2121, 21823, 2140, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-python/src/main/java/org/apache/flink/python/api/util/SetCache.java
SetCache.add
public <S extends SortedGrouping<?>> void add(int id, S set) { cacheSetType(id, SetType.SORTED_GROUPING); sortedGroupings.put(id, set); }
java
public <S extends SortedGrouping<?>> void add(int id, S set) { cacheSetType(id, SetType.SORTED_GROUPING); sortedGroupings.put(id, set); }
[ "public", "<", "S", "extends", "SortedGrouping", "<", "?", ">", ">", "void", "add", "(", "int", "id", ",", "S", "set", ")", "{", "cacheSetType", "(", "id", ",", "SetType", ".", "SORTED_GROUPING", ")", ";", "sortedGroupings", ".", "put", "(", "id", ",...
Adds the given {@link SortedGrouping} to this cache for the given ID. @param id Set ID @param set SortedGrouping to add @param <S> SortedGrouping class
[ "Adds", "the", "given", "{", "@link", "SortedGrouping", "}", "to", "this", "cache", "for", "the", "given", "ID", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/util/SetCache.java#L95-L98
train
Add a sorted grouping to the cache.
[ 30522, 2270, 1026, 1055, 8908, 19616, 17058, 2075, 1026, 1029, 1028, 1028, 11675, 5587, 1006, 20014, 8909, 1010, 1055, 2275, 1007, 1063, 17053, 21678, 18863, 1006, 8909, 1010, 2275, 13874, 1012, 19616, 1035, 19765, 1007, 1025, 19616, 17058, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dictionary/CoreSynonymDictionaryEx.java
CoreSynonymDictionaryEx.distance
public static long distance(CommonSynonymDictionary.SynonymItem itemA, CommonSynonymDictionary.SynonymItem itemB) { return itemA.distance(itemB); }
java
public static long distance(CommonSynonymDictionary.SynonymItem itemA, CommonSynonymDictionary.SynonymItem itemB) { return itemA.distance(itemB); }
[ "public", "static", "long", "distance", "(", "CommonSynonymDictionary", ".", "SynonymItem", "itemA", ",", "CommonSynonymDictionary", ".", "SynonymItem", "itemB", ")", "{", "return", "itemA", ".", "distance", "(", "itemB", ")", ";", "}" ]
语义距离 @param itemA @param itemB @return
[ "语义距离" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/CoreSynonymDictionaryEx.java#L59-L62
train
Get distance between two words.
[ 30522, 2270, 10763, 2146, 3292, 1006, 7674, 6038, 16585, 26876, 28097, 5649, 1012, 10675, 4221, 2213, 8875, 2050, 1010, 7674, 6038, 16585, 26876, 28097, 5649, 1012, 10675, 4221, 2213, 8875, 2497, 1007, 1063, 2709, 8875, 2050, 1012, 3292, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseStatus.java
HttpResponseStatus.parseLine
public static HttpResponseStatus parseLine(CharSequence line) { return (line instanceof AsciiString) ? parseLine((AsciiString) line) : parseLine(line.toString()); }
java
public static HttpResponseStatus parseLine(CharSequence line) { return (line instanceof AsciiString) ? parseLine((AsciiString) line) : parseLine(line.toString()); }
[ "public", "static", "HttpResponseStatus", "parseLine", "(", "CharSequence", "line", ")", "{", "return", "(", "line", "instanceof", "AsciiString", ")", "?", "parseLine", "(", "(", "AsciiString", ")", "line", ")", ":", "parseLine", "(", "line", ".", "toString", ...
Parses the specified HTTP status line into a {@link HttpResponseStatus}. The expected formats of the line are: <ul> <li>{@code statusCode} (e.g. 200)</li> <li>{@code statusCode} {@code reasonPhrase} (e.g. 404 Not Found)</li> </ul> @throws IllegalArgumentException if the specified status line is malformed
[ "Parses", "the", "specified", "HTTP", "status", "line", "into", "a", "{", "@link", "HttpResponseStatus", "}", ".", "The", "expected", "formats", "of", "the", "line", "are", ":", "<ul", ">", "<li", ">", "{", "@code", "statusCode", "}", "(", "e", ".", "g...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseStatus.java#L479-L481
train
Parse a single line of text.
[ 30522, 2270, 10763, 8299, 6072, 26029, 8583, 29336, 2271, 11968, 11246, 3170, 1006, 25869, 3366, 4226, 5897, 2240, 1007, 1063, 2709, 1006, 2240, 6013, 11253, 2004, 6895, 2923, 4892, 1007, 1029, 11968, 11246, 3170, 1006, 1006, 2004, 6895, 29...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/jobmanager/scheduler/Scheduler.java
Scheduler.getFreeSlotForTask
protected SimpleSlot getFreeSlotForTask(ExecutionVertex vertex, Iterable<TaskManagerLocation> requestedLocations, boolean localOnly) { // we need potentially to loop multiple times, because there may be false positives // in the set-with-available-instances while (true) { Pair<Instance, Locality> instanceLocalityPair = findInstance(requestedLocations, localOnly); if (instanceLocalityPair == null){ return null; } Instance instanceToUse = instanceLocalityPair.getLeft(); Locality locality = instanceLocalityPair.getRight(); try { SimpleSlot slot = instanceToUse.allocateSimpleSlot(); // if the instance has further available slots, re-add it to the set of available resources. if (instanceToUse.hasResourcesAvailable()) { this.instancesWithAvailableResources.put(instanceToUse.getTaskManagerID(), instanceToUse); } if (slot != null) { slot.setLocality(locality); return slot; } } catch (InstanceDiedException e) { // the instance died it has not yet been propagated to this scheduler // remove the instance from the set of available instances removeInstance(instanceToUse); } // if we failed to get a slot, fall through the loop } }
java
protected SimpleSlot getFreeSlotForTask(ExecutionVertex vertex, Iterable<TaskManagerLocation> requestedLocations, boolean localOnly) { // we need potentially to loop multiple times, because there may be false positives // in the set-with-available-instances while (true) { Pair<Instance, Locality> instanceLocalityPair = findInstance(requestedLocations, localOnly); if (instanceLocalityPair == null){ return null; } Instance instanceToUse = instanceLocalityPair.getLeft(); Locality locality = instanceLocalityPair.getRight(); try { SimpleSlot slot = instanceToUse.allocateSimpleSlot(); // if the instance has further available slots, re-add it to the set of available resources. if (instanceToUse.hasResourcesAvailable()) { this.instancesWithAvailableResources.put(instanceToUse.getTaskManagerID(), instanceToUse); } if (slot != null) { slot.setLocality(locality); return slot; } } catch (InstanceDiedException e) { // the instance died it has not yet been propagated to this scheduler // remove the instance from the set of available instances removeInstance(instanceToUse); } // if we failed to get a slot, fall through the loop } }
[ "protected", "SimpleSlot", "getFreeSlotForTask", "(", "ExecutionVertex", "vertex", ",", "Iterable", "<", "TaskManagerLocation", ">", "requestedLocations", ",", "boolean", "localOnly", ")", "{", "// we need potentially to loop multiple times, because there may be false positives", ...
Gets a suitable instance to schedule the vertex execution to. <p> NOTE: This method does is not thread-safe, it needs to be synchronized by the caller. @param vertex The task to run. @return The instance to run the vertex on, it {@code null}, if no instance is available.
[ "Gets", "a", "suitable", "instance", "to", "schedule", "the", "vertex", "execution", "to", ".", "<p", ">", "NOTE", ":", "This", "method", "does", "is", "not", "thread", "-", "safe", "it", "needs", "to", "be", "synchronized", "by", "the", "caller", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobmanager/scheduler/Scheduler.java#L366-L402
train
This method returns the free slot for a task.
[ 30522, 5123, 3722, 14540, 4140, 2131, 23301, 14540, 4140, 13028, 19895, 1006, 7781, 16874, 10288, 19449, 1010, 2009, 6906, 3468, 1026, 4708, 24805, 4590, 4135, 10719, 1028, 7303, 4135, 10719, 2015, 1010, 22017, 20898, 2334, 2239, 2135, 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/swing/RobotUtil.java
RobotUtil.keyClick
public static void keyClick(int... keyCodes) { for (int keyCode : keyCodes) { robot.keyPress(keyCode); robot.keyRelease(keyCode); } delay(); }
java
public static void keyClick(int... keyCodes) { for (int keyCode : keyCodes) { robot.keyPress(keyCode); robot.keyRelease(keyCode); } delay(); }
[ "public", "static", "void", "keyClick", "(", "int", "...", "keyCodes", ")", "{", "for", "(", "int", "keyCode", ":", "keyCodes", ")", "{", "robot", ".", "keyPress", "(", "keyCode", ")", ";", "robot", ".", "keyRelease", "(", "keyCode", ")", ";", "}", "...
模拟键盘点击<br> 包括键盘的按下和释放 @param keyCodes 按键码列表,见{@link java.awt.event.KeyEvent} @since 4.5.7
[ "模拟键盘点击<br", ">", "包括键盘的按下和释放" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/swing/RobotUtil.java#L98-L104
train
Handles the key clicks on all the user s input.
[ 30522, 2270, 10763, 11675, 3145, 20464, 6799, 1006, 20014, 1012, 1012, 1012, 3145, 23237, 1007, 1063, 2005, 1006, 20014, 3145, 16044, 1024, 3145, 23237, 1007, 1063, 8957, 1012, 3145, 20110, 1006, 3145, 16044, 1007, 1025, 8957, 1012, 3145, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/triggers/ProcessingTimeTriggers.java
ProcessingTimeTriggers.every
public static <W extends Window> AfterFirstElementPeriodic<W> every(Duration time) { return new AfterFirstElementPeriodic<>(time.toMillis()); }
java
public static <W extends Window> AfterFirstElementPeriodic<W> every(Duration time) { return new AfterFirstElementPeriodic<>(time.toMillis()); }
[ "public", "static", "<", "W", "extends", "Window", ">", "AfterFirstElementPeriodic", "<", "W", ">", "every", "(", "Duration", "time", ")", "{", "return", "new", "AfterFirstElementPeriodic", "<>", "(", "time", ".", "toMillis", "(", ")", ")", ";", "}" ]
Creates a trigger that fires by a certain interval after reception of the first element. @param time the certain interval
[ "Creates", "a", "trigger", "that", "fires", "by", "a", "certain", "interval", "after", "reception", "of", "the", "first", "element", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/triggers/ProcessingTimeTriggers.java#L66-L68
train
Creates a new instance of AfterFirstElementPeriodic that will wait for the first element of the window.
[ 30522, 2270, 10763, 1026, 1059, 8908, 3332, 1028, 2044, 8873, 12096, 12260, 3672, 4842, 3695, 14808, 1026, 1059, 1028, 2296, 1006, 9367, 2051, 1007, 1063, 2709, 2047, 2044, 8873, 12096, 12260, 3672, 4842, 3695, 14808, 1026, 1028, 1006, 2051...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/state/serialization/KvStateSerializer.java
KvStateSerializer.deserializeList
public static <T> List<T> deserializeList(byte[] serializedValue, TypeSerializer<T> serializer) throws IOException { if (serializedValue != null) { final DataInputDeserializer in = new DataInputDeserializer( serializedValue, 0, serializedValue.length); try { final List<T> result = new ArrayList<>(); while (in.available() > 0) { result.add(serializer.deserialize(in)); // The expected binary format has a single byte separator. We // want a consistent binary format in order to not need any // special casing during deserialization. A "cleaner" format // would skip this extra byte, but would require a memory copy // for RocksDB, which stores the data serialized in this way // for lists. if (in.available() > 0) { in.readByte(); } } return result; } catch (IOException e) { throw new IOException( "Unable to deserialize value. " + "This indicates a mismatch in the value serializers " + "used by the KvState instance and this access.", e); } } else { return null; } }
java
public static <T> List<T> deserializeList(byte[] serializedValue, TypeSerializer<T> serializer) throws IOException { if (serializedValue != null) { final DataInputDeserializer in = new DataInputDeserializer( serializedValue, 0, serializedValue.length); try { final List<T> result = new ArrayList<>(); while (in.available() > 0) { result.add(serializer.deserialize(in)); // The expected binary format has a single byte separator. We // want a consistent binary format in order to not need any // special casing during deserialization. A "cleaner" format // would skip this extra byte, but would require a memory copy // for RocksDB, which stores the data serialized in this way // for lists. if (in.available() > 0) { in.readByte(); } } return result; } catch (IOException e) { throw new IOException( "Unable to deserialize value. " + "This indicates a mismatch in the value serializers " + "used by the KvState instance and this access.", e); } } else { return null; } }
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "deserializeList", "(", "byte", "[", "]", "serializedValue", ",", "TypeSerializer", "<", "T", ">", "serializer", ")", "throws", "IOException", "{", "if", "(", "serializedValue", "!=", "null", ")", ...
Deserializes all values with the given serializer. @param serializedValue Serialized value of type List&lt;T&gt; @param serializer Serializer for T @param <T> Type of the value @return Deserialized list or <code>null</code> if the serialized value is <code>null</code> @throws IOException On failure during deserialization
[ "Deserializes", "all", "values", "with", "the", "given", "serializer", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/state/serialization/KvStateSerializer.java#L172-L203
train
Deserializes a list of bytes.
[ 30522, 2270, 10763, 1026, 1056, 1028, 2862, 1026, 1056, 1028, 4078, 11610, 3669, 12638, 2923, 1006, 24880, 1031, 1033, 27289, 10175, 5657, 1010, 4127, 11610, 28863, 1026, 1056, 1028, 7642, 17629, 1007, 11618, 22834, 10288, 24422, 1063, 2065, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionJobVertex.java
ExecutionJobVertex.scheduleAll
public CompletableFuture<Void> scheduleAll( SlotProvider slotProvider, boolean queued, LocationPreferenceConstraint locationPreferenceConstraint, @Nonnull Set<AllocationID> allPreviousExecutionGraphAllocationIds) { final ExecutionVertex[] vertices = this.taskVertices; final ArrayList<CompletableFuture<Void>> scheduleFutures = new ArrayList<>(vertices.length); // kick off the tasks for (ExecutionVertex ev : vertices) { scheduleFutures.add(ev.scheduleForExecution( slotProvider, queued, locationPreferenceConstraint, allPreviousExecutionGraphAllocationIds)); } return FutureUtils.waitForAll(scheduleFutures); }
java
public CompletableFuture<Void> scheduleAll( SlotProvider slotProvider, boolean queued, LocationPreferenceConstraint locationPreferenceConstraint, @Nonnull Set<AllocationID> allPreviousExecutionGraphAllocationIds) { final ExecutionVertex[] vertices = this.taskVertices; final ArrayList<CompletableFuture<Void>> scheduleFutures = new ArrayList<>(vertices.length); // kick off the tasks for (ExecutionVertex ev : vertices) { scheduleFutures.add(ev.scheduleForExecution( slotProvider, queued, locationPreferenceConstraint, allPreviousExecutionGraphAllocationIds)); } return FutureUtils.waitForAll(scheduleFutures); }
[ "public", "CompletableFuture", "<", "Void", ">", "scheduleAll", "(", "SlotProvider", "slotProvider", ",", "boolean", "queued", ",", "LocationPreferenceConstraint", "locationPreferenceConstraint", ",", "@", "Nonnull", "Set", "<", "AllocationID", ">", "allPreviousExecutionG...
Schedules all execution vertices of this ExecutionJobVertex. @param slotProvider to allocate the slots from @param queued if the allocations can be queued @param locationPreferenceConstraint constraint for the location preferences @param allPreviousExecutionGraphAllocationIds set with all previous allocation ids in the job graph. Can be empty if the allocation ids are not required for scheduling. @return Future which is completed once all {@link Execution} could be deployed
[ "Schedules", "all", "execution", "vertices", "of", "this", "ExecutionJobVertex", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionJobVertex.java#L479-L499
train
Schedule all the tasks in this graph.
[ 30522, 2270, 4012, 10814, 10880, 11263, 11244, 1026, 11675, 1028, 6134, 8095, 1006, 10453, 21572, 17258, 2121, 10453, 21572, 17258, 2121, 1010, 22017, 20898, 24240, 2094, 1010, 3295, 28139, 25523, 8663, 20528, 18447, 3295, 28139, 25523, 8663, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Http2FrameCodec.java
Http2FrameCodec.write
@Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) { if (msg instanceof Http2DataFrame) { Http2DataFrame dataFrame = (Http2DataFrame) msg; encoder().writeData(ctx, dataFrame.stream().id(), dataFrame.content(), dataFrame.padding(), dataFrame.isEndStream(), promise); } else if (msg instanceof Http2HeadersFrame) { writeHeadersFrame(ctx, (Http2HeadersFrame) msg, promise); } else if (msg instanceof Http2WindowUpdateFrame) { Http2WindowUpdateFrame frame = (Http2WindowUpdateFrame) msg; Http2FrameStream frameStream = frame.stream(); // It is legit to send a WINDOW_UPDATE frame for the connection stream. The parent channel doesn't attempt // to set the Http2FrameStream so we assume if it is null the WINDOW_UPDATE is for the connection stream. try { if (frameStream == null) { increaseInitialConnectionWindow(frame.windowSizeIncrement()); } else { consumeBytes(frameStream.id(), frame.windowSizeIncrement()); } promise.setSuccess(); } catch (Throwable t) { promise.setFailure(t); } } else if (msg instanceof Http2ResetFrame) { Http2ResetFrame rstFrame = (Http2ResetFrame) msg; encoder().writeRstStream(ctx, rstFrame.stream().id(), rstFrame.errorCode(), promise); } else if (msg instanceof Http2PingFrame) { Http2PingFrame frame = (Http2PingFrame) msg; encoder().writePing(ctx, frame.ack(), frame.content(), promise); } else if (msg instanceof Http2SettingsFrame) { encoder().writeSettings(ctx, ((Http2SettingsFrame) msg).settings(), promise); } else if (msg instanceof Http2SettingsAckFrame) { // In the event of manual SETTINGS ACK is is assumed the encoder will apply the earliest received but not // yet ACKed settings. encoder().writeSettingsAck(ctx, promise); } else if (msg instanceof Http2GoAwayFrame) { writeGoAwayFrame(ctx, (Http2GoAwayFrame) msg, promise); } else if (msg instanceof Http2UnknownFrame) { Http2UnknownFrame unknownFrame = (Http2UnknownFrame) msg; encoder().writeFrame(ctx, unknownFrame.frameType(), unknownFrame.stream().id(), unknownFrame.flags(), unknownFrame.content(), promise); } else if (!(msg instanceof Http2Frame)) { ctx.write(msg, promise); } else { ReferenceCountUtil.release(msg); throw new UnsupportedMessageTypeException(msg); } }
java
@Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) { if (msg instanceof Http2DataFrame) { Http2DataFrame dataFrame = (Http2DataFrame) msg; encoder().writeData(ctx, dataFrame.stream().id(), dataFrame.content(), dataFrame.padding(), dataFrame.isEndStream(), promise); } else if (msg instanceof Http2HeadersFrame) { writeHeadersFrame(ctx, (Http2HeadersFrame) msg, promise); } else if (msg instanceof Http2WindowUpdateFrame) { Http2WindowUpdateFrame frame = (Http2WindowUpdateFrame) msg; Http2FrameStream frameStream = frame.stream(); // It is legit to send a WINDOW_UPDATE frame for the connection stream. The parent channel doesn't attempt // to set the Http2FrameStream so we assume if it is null the WINDOW_UPDATE is for the connection stream. try { if (frameStream == null) { increaseInitialConnectionWindow(frame.windowSizeIncrement()); } else { consumeBytes(frameStream.id(), frame.windowSizeIncrement()); } promise.setSuccess(); } catch (Throwable t) { promise.setFailure(t); } } else if (msg instanceof Http2ResetFrame) { Http2ResetFrame rstFrame = (Http2ResetFrame) msg; encoder().writeRstStream(ctx, rstFrame.stream().id(), rstFrame.errorCode(), promise); } else if (msg instanceof Http2PingFrame) { Http2PingFrame frame = (Http2PingFrame) msg; encoder().writePing(ctx, frame.ack(), frame.content(), promise); } else if (msg instanceof Http2SettingsFrame) { encoder().writeSettings(ctx, ((Http2SettingsFrame) msg).settings(), promise); } else if (msg instanceof Http2SettingsAckFrame) { // In the event of manual SETTINGS ACK is is assumed the encoder will apply the earliest received but not // yet ACKed settings. encoder().writeSettingsAck(ctx, promise); } else if (msg instanceof Http2GoAwayFrame) { writeGoAwayFrame(ctx, (Http2GoAwayFrame) msg, promise); } else if (msg instanceof Http2UnknownFrame) { Http2UnknownFrame unknownFrame = (Http2UnknownFrame) msg; encoder().writeFrame(ctx, unknownFrame.frameType(), unknownFrame.stream().id(), unknownFrame.flags(), unknownFrame.content(), promise); } else if (!(msg instanceof Http2Frame)) { ctx.write(msg, promise); } else { ReferenceCountUtil.release(msg); throw new UnsupportedMessageTypeException(msg); } }
[ "@", "Override", "public", "void", "write", "(", "ChannelHandlerContext", "ctx", ",", "Object", "msg", ",", "ChannelPromise", "promise", ")", "{", "if", "(", "msg", "instanceof", "Http2DataFrame", ")", "{", "Http2DataFrame", "dataFrame", "=", "(", "Http2DataFram...
Processes all {@link Http2Frame}s. {@link Http2StreamFrame}s may only originate in child streams.
[ "Processes", "all", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java#L272-L319
train
Override method to write a message to the HTTP2 protocol.
[ 30522, 1030, 2058, 15637, 2270, 11675, 4339, 1006, 3149, 11774, 3917, 8663, 18209, 14931, 2595, 1010, 4874, 5796, 2290, 1010, 3149, 21572, 28732, 4872, 1007, 1063, 2065, 1006, 5796, 2290, 6013, 11253, 8299, 2475, 2850, 2696, 15643, 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...
netty/netty
common/src/main/java/io/netty/util/AsciiString.java
AsciiString.subSequence
public AsciiString subSequence(int start, int end, boolean copy) { if (isOutOfBounds(start, end - start, length())) { throw new IndexOutOfBoundsException("expected: 0 <= start(" + start + ") <= end (" + end + ") <= length(" + length() + ')'); } if (start == 0 && end == length()) { return this; } if (end == start) { return EMPTY_STRING; } return new AsciiString(value, start + offset, end - start, copy); }
java
public AsciiString subSequence(int start, int end, boolean copy) { if (isOutOfBounds(start, end - start, length())) { throw new IndexOutOfBoundsException("expected: 0 <= start(" + start + ") <= end (" + end + ") <= length(" + length() + ')'); } if (start == 0 && end == length()) { return this; } if (end == start) { return EMPTY_STRING; } return new AsciiString(value, start + offset, end - start, copy); }
[ "public", "AsciiString", "subSequence", "(", "int", "start", ",", "int", "end", ",", "boolean", "copy", ")", "{", "if", "(", "isOutOfBounds", "(", "start", ",", "end", "-", "start", ",", "length", "(", ")", ")", ")", "{", "throw", "new", "IndexOutOfBou...
Either copy or share a subset of underlying sub-sequence of bytes. @param start the offset of the first character (inclusive). @param end The index to stop at (exclusive). @param copy If {@code true} then a copy of the underlying storage will be made. If {@code false} then the underlying storage will be shared. @return a new string containing the characters from start to the end of the string. @throws IndexOutOfBoundsException if {@code start < 0} or {@code start > length()}.
[ "Either", "copy", "or", "share", "a", "subset", "of", "underlying", "sub", "-", "sequence", "of", "bytes", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L634-L649
train
Returns a subsequence of this string.
[ 30522, 2270, 2004, 6895, 2923, 4892, 4942, 3366, 4226, 5897, 1006, 20014, 2707, 1010, 20014, 2203, 1010, 22017, 20898, 6100, 1007, 1063, 2065, 1006, 11163, 16161, 26337, 28819, 2015, 1006, 2707, 1010, 2203, 1011, 2707, 1010, 3091, 1006, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java
HttpUtil.getContentLength
public static int getContentLength(HttpMessage message, int defaultValue) { return (int) Math.min(Integer.MAX_VALUE, getContentLength(message, (long) defaultValue)); }
java
public static int getContentLength(HttpMessage message, int defaultValue) { return (int) Math.min(Integer.MAX_VALUE, getContentLength(message, (long) defaultValue)); }
[ "public", "static", "int", "getContentLength", "(", "HttpMessage", "message", ",", "int", "defaultValue", ")", "{", "return", "(", "int", ")", "Math", ".", "min", "(", "Integer", ".", "MAX_VALUE", ",", "getContentLength", "(", "message", ",", "(", "long", ...
Get an {@code int} representation of {@link #getContentLength(HttpMessage, long)}. @return the content length or {@code defaultValue} if this message does not have the {@code "Content-Length"} header or its value is not a number. Not to exceed the boundaries of integer.
[ "Get", "an", "{", "@code", "int", "}", "representation", "of", "{", "@link", "#getContentLength", "(", "HttpMessage", "long", ")", "}", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java#L195-L197
train
Gets the content length of the message.
[ 30522, 2270, 10763, 20014, 2131, 8663, 6528, 9286, 3070, 2705, 1006, 8299, 7834, 3736, 3351, 4471, 1010, 20014, 12398, 10175, 5657, 1007, 1063, 2709, 1006, 20014, 1007, 8785, 1012, 8117, 1006, 16109, 1012, 4098, 1035, 3643, 1010, 2131, 8663...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-json/src/main/java/cn/hutool/json/JSONUtil.java
JSONUtil.toBean
public static <T> T toBean(String jsonString, Class<T> beanClass) { return toBean(parseObj(jsonString), beanClass); }
java
public static <T> T toBean(String jsonString, Class<T> beanClass) { return toBean(parseObj(jsonString), beanClass); }
[ "public", "static", "<", "T", ">", "T", "toBean", "(", "String", "jsonString", ",", "Class", "<", "T", ">", "beanClass", ")", "{", "return", "toBean", "(", "parseObj", "(", "jsonString", ")", ",", "beanClass", ")", ";", "}" ]
JSON字符串转为实体类对象,转换异常将被抛出 @param <T> Bean类型 @param jsonString JSON字符串 @param beanClass 实体类对象 @return 实体类对象 @since 3.1.2
[ "JSON字符串转为实体类对象,转换异常将被抛出" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L330-L332
train
Converts a JSON string to a Java Bean.
[ 30522, 2270, 10763, 1026, 1056, 1028, 1056, 2000, 4783, 2319, 1006, 5164, 1046, 23345, 18886, 3070, 1010, 2465, 1026, 1056, 1028, 14068, 26266, 1007, 1063, 2709, 2000, 4783, 2319, 1006, 11968, 3366, 16429, 3501, 1006, 1046, 23345, 18886, 30...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/resettable/AbstractBlockResettableIterator.java
AbstractBlockResettableIterator.writeNextRecord
protected boolean writeNextRecord(T record) throws IOException { try { this.serializer.serialize(record, this.collectingView); this.numRecordsInBuffer++; return true; } catch (EOFException eofex) { return false; } }
java
protected boolean writeNextRecord(T record) throws IOException { try { this.serializer.serialize(record, this.collectingView); this.numRecordsInBuffer++; return true; } catch (EOFException eofex) { return false; } }
[ "protected", "boolean", "writeNextRecord", "(", "T", "record", ")", "throws", "IOException", "{", "try", "{", "this", ".", "serializer", ".", "serialize", "(", "record", ",", "this", ".", "collectingView", ")", ";", "this", ".", "numRecordsInBuffer", "++", "...
--------------------------------------------------------------------------------------------
[ "--------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/resettable/AbstractBlockResettableIterator.java#L158-L166
train
Write the next record to the underlying stream.
[ 30522, 5123, 22017, 20898, 4339, 2638, 18413, 2890, 27108, 2094, 1006, 1056, 2501, 1007, 11618, 22834, 10288, 24422, 1063, 3046, 1063, 2023, 1012, 7642, 17629, 1012, 7642, 4697, 1006, 2501, 1010, 2023, 1012, 9334, 8584, 1007, 1025, 2023, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java
ExecutionGraph.computeAllPriorAllocationIdsIfRequiredByScheduling
private Set<AllocationID> computeAllPriorAllocationIdsIfRequiredByScheduling() { // This is a temporary optimization to avoid computing all previous allocations if not required // This can go away when we progress with the implementation of the Scheduler. if (slotProvider instanceof Scheduler && ((Scheduler) slotProvider).requiresPreviousExecutionGraphAllocations()) { return computeAllPriorAllocationIds(); } else { return Collections.emptySet(); } }
java
private Set<AllocationID> computeAllPriorAllocationIdsIfRequiredByScheduling() { // This is a temporary optimization to avoid computing all previous allocations if not required // This can go away when we progress with the implementation of the Scheduler. if (slotProvider instanceof Scheduler && ((Scheduler) slotProvider).requiresPreviousExecutionGraphAllocations()) { return computeAllPriorAllocationIds(); } else { return Collections.emptySet(); } }
[ "private", "Set", "<", "AllocationID", ">", "computeAllPriorAllocationIdsIfRequiredByScheduling", "(", ")", "{", "// This is a temporary optimization to avoid computing all previous allocations if not required", "// This can go away when we progress with the implementation of the Scheduler.", ...
Returns the result of {@link #computeAllPriorAllocationIds()}, but only if the scheduling really requires it. Otherwise this method simply returns an empty set.
[ "Returns", "the", "result", "of", "{" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L1701-L1709
train
Compute all allocation IDs that are required by scheduling.
[ 30522, 2797, 2275, 1026, 16169, 3593, 1028, 24134, 8095, 18098, 25346, 8095, 23909, 9821, 10128, 2890, 15549, 5596, 3762, 22842, 8566, 2989, 1006, 1007, 1063, 1013, 1013, 2023, 2003, 1037, 5741, 20600, 2000, 4468, 9798, 2035, 3025, 16169, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/utility/TextUtility.java
TextUtility.isInAggregate
public static boolean isInAggregate(String aggr, String str) { if (aggr != null && str != null) { str += "1"; for (int i = 0; i < str.length(); i++) { String s = str.substring(i, i + 1); if (aggr.indexOf(s) == -1) return false; } return true; } return false; }
java
public static boolean isInAggregate(String aggr, String str) { if (aggr != null && str != null) { str += "1"; for (int i = 0; i < str.length(); i++) { String s = str.substring(i, i + 1); if (aggr.indexOf(s) == -1) return false; } return true; } return false; }
[ "public", "static", "boolean", "isInAggregate", "(", "String", "aggr", ",", "String", "str", ")", "{", "if", "(", "aggr", "!=", "null", "&&", "str", "!=", "null", ")", "{", "str", "+=", "\"1\"", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<...
判断一个字符串的所有字符是否在另一个字符串集合中 @param aggr 字符串集合 @param str 需要判断的字符串 @return
[ "判断一个字符串的所有字符是否在另一个字符串集合中" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/utility/TextUtility.java#L414-L429
train
isInAggregate This method checks if the string is in the aggregate.
[ 30522, 2270, 10763, 22017, 20898, 2003, 3981, 13871, 2890, 5867, 1006, 5164, 12943, 16523, 1010, 5164, 2358, 2099, 1007, 1063, 2065, 1006, 12943, 16523, 999, 1027, 19701, 1004, 1004, 2358, 2099, 999, 1027, 19701, 1007, 1063, 2358, 2099, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanCopier.java
BeanCopier.create
public static <T> BeanCopier<T> create(Object source, T dest, CopyOptions copyOptions) { return create(source, dest, dest.getClass(), copyOptions); }
java
public static <T> BeanCopier<T> create(Object source, T dest, CopyOptions copyOptions) { return create(source, dest, dest.getClass(), copyOptions); }
[ "public", "static", "<", "T", ">", "BeanCopier", "<", "T", ">", "create", "(", "Object", "source", ",", "T", "dest", ",", "CopyOptions", "copyOptions", ")", "{", "return", "create", "(", "source", ",", "dest", ",", "dest", ".", "getClass", "(", ")", ...
创建BeanCopier @param <T> 目标Bean类型 @param source 来源对象,可以是Bean或者Map @param dest 目标Bean对象 @param copyOptions 拷贝属性选项 @return BeanCopier
[ "创建BeanCopier" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanCopier.java#L54-L56
train
Creates a BeanCopier for the given source object and dest object.
[ 30522, 2270, 10763, 1026, 1056, 1028, 14068, 3597, 14756, 2099, 1026, 1056, 1028, 3443, 1006, 4874, 3120, 1010, 1056, 4078, 2102, 1010, 6100, 7361, 9285, 6100, 7361, 9285, 1007, 1063, 2709, 3443, 1006, 3120, 1010, 4078, 2102, 1010, 4078, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/jobgraph/JobEdge.java
JobEdge.connecDataSet
public void connecDataSet(IntermediateDataSet dataSet) { if (dataSet == null) { throw new NullPointerException(); } if (this.source != null) { throw new IllegalStateException("The edge is already connected."); } if (!dataSet.getId().equals(sourceId)) { throw new IllegalArgumentException("The data set to connect does not match the sourceId."); } this.source = dataSet; }
java
public void connecDataSet(IntermediateDataSet dataSet) { if (dataSet == null) { throw new NullPointerException(); } if (this.source != null) { throw new IllegalStateException("The edge is already connected."); } if (!dataSet.getId().equals(sourceId)) { throw new IllegalArgumentException("The data set to connect does not match the sourceId."); } this.source = dataSet; }
[ "public", "void", "connecDataSet", "(", "IntermediateDataSet", "dataSet", ")", "{", "if", "(", "dataSet", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", ")", ";", "}", "if", "(", "this", ".", "source", "!=", "null", ")", "{", "throw...
--------------------------------------------------------------------------------------------
[ "--------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobEdge.java#L132-L144
train
Connects the given intermediate data set to this edge.
[ 30522, 2270, 11675, 9530, 2638, 19797, 6790, 13462, 1006, 7783, 2850, 18260, 2102, 2951, 13462, 1007, 1063, 2065, 1006, 2951, 13462, 1027, 1027, 19701, 1007, 1063, 5466, 2047, 19701, 8400, 7869, 2595, 24422, 1006, 1007, 1025, 1065, 2065, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java
FlinkYarnSessionCli.repStep
private static boolean repStep( BufferedReader in, boolean readConsoleInput) throws IOException, InterruptedException { // wait until CLIENT_POLLING_INTERVAL is over or the user entered something. long startTime = System.currentTimeMillis(); while ((System.currentTimeMillis() - startTime) < CLIENT_POLLING_INTERVAL_MS && (!readConsoleInput || !in.ready())) { Thread.sleep(200L); } //------------- handle interactive command by user. ---------------------- if (readConsoleInput && in.ready()) { String command = in.readLine(); switch (command) { case "quit": case "stop": return false; case "help": System.err.println(YARN_SESSION_HELP); break; default: System.err.println("Unknown command '" + command + "'. Showing help:"); System.err.println(YARN_SESSION_HELP); break; } } return true; }
java
private static boolean repStep( BufferedReader in, boolean readConsoleInput) throws IOException, InterruptedException { // wait until CLIENT_POLLING_INTERVAL is over or the user entered something. long startTime = System.currentTimeMillis(); while ((System.currentTimeMillis() - startTime) < CLIENT_POLLING_INTERVAL_MS && (!readConsoleInput || !in.ready())) { Thread.sleep(200L); } //------------- handle interactive command by user. ---------------------- if (readConsoleInput && in.ready()) { String command = in.readLine(); switch (command) { case "quit": case "stop": return false; case "help": System.err.println(YARN_SESSION_HELP); break; default: System.err.println("Unknown command '" + command + "'. Showing help:"); System.err.println(YARN_SESSION_HELP); break; } } return true; }
[ "private", "static", "boolean", "repStep", "(", "BufferedReader", "in", ",", "boolean", "readConsoleInput", ")", "throws", "IOException", ",", "InterruptedException", "{", "// wait until CLIENT_POLLING_INTERVAL is over or the user entered something.", "long", "startTime", "=", ...
Read-Evaluate-Print step for the REPL. @param in to read from @param readConsoleInput true if console input has to be read @return true if the REPL shall be continued, otherwise false @throws IOException @throws InterruptedException
[ "Read", "-", "Evaluate", "-", "Print", "step", "for", "the", "REPL", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java#L910-L940
train
This method is called by the client thread to handle interactive session commands.
[ 30522, 2797, 10763, 22017, 20898, 16360, 13473, 2361, 1006, 17698, 2098, 16416, 4063, 1999, 1010, 22017, 20898, 3191, 8663, 19454, 12377, 18780, 1007, 11618, 22834, 10288, 24422, 1010, 7153, 10288, 24422, 1063, 1013, 1013, 3524, 2127, 7396, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/classification/statistics/ContinuousDistributions.java
ContinuousDistributions.GaussCdf
public static double GaussCdf(double z) { // input = z-value (-inf to +inf) // output = p under Normal curve from -inf to z // e.g., if z = 0.0, function returns 0.5000 // ACM Algorithm #209 double y; // 209 scratch variable double p; // result. called ‘z’ in 209 double w; // 209 scratch variable if (z == 0.0) { p = 0.0; } else { y = Math.abs(z) / 2.0; if (y >= 3.0) { p = 1.0; } else if (y < 1.0) { w = y * y; p = ((((((((0.000124818987 * w - 0.001075204047) * w + 0.005198775019) * w - 0.019198292004) * w + 0.059054035642) * w - 0.151968751364) * w + 0.319152932694) * w - 0.531923007300) * w + 0.797884560593) * y * 2.0; } else { y = y - 2.0; p = (((((((((((((-0.000045255659 * y + 0.000152529290) * y - 0.000019538132) * y - 0.000676904986) * y + 0.001390604284) * y - 0.000794620820) * y - 0.002034254874) * y + 0.006549791214) * y - 0.010557625006) * y + 0.011630447319) * y - 0.009279453341) * y + 0.005353579108) * y - 0.002141268741) * y + 0.000535310849) * y + 0.999936657524; } } if (z > 0.0) { return (p + 1.0) / 2.0; } return (1.0 - p) / 2.0; }
java
public static double GaussCdf(double z) { // input = z-value (-inf to +inf) // output = p under Normal curve from -inf to z // e.g., if z = 0.0, function returns 0.5000 // ACM Algorithm #209 double y; // 209 scratch variable double p; // result. called ‘z’ in 209 double w; // 209 scratch variable if (z == 0.0) { p = 0.0; } else { y = Math.abs(z) / 2.0; if (y >= 3.0) { p = 1.0; } else if (y < 1.0) { w = y * y; p = ((((((((0.000124818987 * w - 0.001075204047) * w + 0.005198775019) * w - 0.019198292004) * w + 0.059054035642) * w - 0.151968751364) * w + 0.319152932694) * w - 0.531923007300) * w + 0.797884560593) * y * 2.0; } else { y = y - 2.0; p = (((((((((((((-0.000045255659 * y + 0.000152529290) * y - 0.000019538132) * y - 0.000676904986) * y + 0.001390604284) * y - 0.000794620820) * y - 0.002034254874) * y + 0.006549791214) * y - 0.010557625006) * y + 0.011630447319) * y - 0.009279453341) * y + 0.005353579108) * y - 0.002141268741) * y + 0.000535310849) * y + 0.999936657524; } } if (z > 0.0) { return (p + 1.0) / 2.0; } return (1.0 - p) / 2.0; }
[ "public", "static", "double", "GaussCdf", "(", "double", "z", ")", "{", "// input = z-value (-inf to +inf)", "// output = p under Normal curve from -inf to z", "// e.g., if z = 0.0, function returns 0.5000", "// ACM Algorithm #209", "double", "y", ";", "// 209 scratch variable", "d...
给定高斯函数的z值,返回p值(累积分布函数值)<br> http://jamesmccaffrey.wordpress.com/2010/11/05/programmatically-computing-the-area-under-the-normal-curve/ @param z 从负无穷到正无穷的值 @return 高斯函数累积分布函数值
[ "给定高斯函数的z值,返回p值(累积分布函数值)<br", ">", "http", ":", "//", "jamesmccaffrey", ".", "wordpress", ".", "com", "/", "2010", "/", "11", "/", "05", "/", "programmatically", "-", "computing", "-", "the", "-", "area", "-", "under", "-", "the", "-", "normal", "-", "cu...
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/classification/statistics/ContinuousDistributions.java#L52-L102
train
Gauss Cdf for a single - precision integer z.
[ 30522, 2270, 10763, 3313, 11721, 17854, 19797, 2546, 1006, 3313, 1062, 1007, 1063, 1013, 1013, 7953, 1027, 1062, 1011, 3643, 1006, 1011, 1999, 2546, 2000, 1009, 1999, 2546, 1007, 1013, 1013, 6434, 1027, 1052, 2104, 3671, 7774, 2013, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/CharValue.java
CharValue.compareTo
@Override public int compareTo(CharValue o) { final int other = o.value; return this.value < other ? -1 : this.value > other ? 1 : 0; }
java
@Override public int compareTo(CharValue o) { final int other = o.value; return this.value < other ? -1 : this.value > other ? 1 : 0; }
[ "@", "Override", "public", "int", "compareTo", "(", "CharValue", "o", ")", "{", "final", "int", "other", "=", "o", ".", "value", ";", "return", "this", ".", "value", "<", "other", "?", "-", "1", ":", "this", ".", "value", ">", "other", "?", "1", ...
--------------------------------------------------------------------------------------------
[ "--------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/CharValue.java#L98-L102
train
Compares two CharValues.
[ 30522, 1030, 2058, 15637, 2270, 20014, 12826, 3406, 1006, 25869, 10175, 5657, 1051, 1007, 1063, 2345, 20014, 2060, 1027, 1051, 1012, 3643, 1025, 2709, 2023, 1012, 3643, 1026, 2060, 1029, 1011, 1015, 1024, 2023, 1012, 3643, 1028, 2060, 1029,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
transport/src/main/java/io/netty/channel/group/ChannelMatchers.java
ChannelMatchers.compose
public static ChannelMatcher compose(ChannelMatcher... matchers) { if (matchers.length < 1) { throw new IllegalArgumentException("matchers must at least contain one element"); } if (matchers.length == 1) { return matchers[0]; } return new CompositeMatcher(matchers); }
java
public static ChannelMatcher compose(ChannelMatcher... matchers) { if (matchers.length < 1) { throw new IllegalArgumentException("matchers must at least contain one element"); } if (matchers.length == 1) { return matchers[0]; } return new CompositeMatcher(matchers); }
[ "public", "static", "ChannelMatcher", "compose", "(", "ChannelMatcher", "...", "matchers", ")", "{", "if", "(", "matchers", ".", "length", "<", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"matchers must at least contain one element\"", ")", ";"...
Return a composite of the given {@link ChannelMatcher}s. This means all {@link ChannelMatcher} must return {@code true} to match.
[ "Return", "a", "composite", "of", "the", "given", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/group/ChannelMatchers.java#L103-L111
train
Compose the given set of matchers into one.
[ 30522, 2270, 10763, 3149, 18900, 7474, 17202, 1006, 3149, 18900, 7474, 1012, 1012, 1012, 2674, 2545, 1007, 1063, 2065, 1006, 2674, 2545, 1012, 3091, 1026, 1015, 1007, 1063, 5466, 2047, 6206, 2906, 22850, 15781, 2595, 24422, 1006, 1000, 2674...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/KeyedStream.java
KeyedStream.validateKeyType
private TypeInformation<KEY> validateKeyType(TypeInformation<KEY> keyType) { Stack<TypeInformation<?>> stack = new Stack<>(); stack.push(keyType); List<TypeInformation<?>> unsupportedTypes = new ArrayList<>(); while (!stack.isEmpty()) { TypeInformation<?> typeInfo = stack.pop(); if (!validateKeyTypeIsHashable(typeInfo)) { unsupportedTypes.add(typeInfo); } if (typeInfo instanceof TupleTypeInfoBase) { for (int i = 0; i < typeInfo.getArity(); i++) { stack.push(((TupleTypeInfoBase) typeInfo).getTypeAt(i)); } } } if (!unsupportedTypes.isEmpty()) { throw new InvalidProgramException("Type " + keyType + " cannot be used as key. Contained " + "UNSUPPORTED key types: " + StringUtils.join(unsupportedTypes, ", ") + ". Look " + "at the keyBy() documentation for the conditions a type has to satisfy in order to be " + "eligible for a key."); } return keyType; }
java
private TypeInformation<KEY> validateKeyType(TypeInformation<KEY> keyType) { Stack<TypeInformation<?>> stack = new Stack<>(); stack.push(keyType); List<TypeInformation<?>> unsupportedTypes = new ArrayList<>(); while (!stack.isEmpty()) { TypeInformation<?> typeInfo = stack.pop(); if (!validateKeyTypeIsHashable(typeInfo)) { unsupportedTypes.add(typeInfo); } if (typeInfo instanceof TupleTypeInfoBase) { for (int i = 0; i < typeInfo.getArity(); i++) { stack.push(((TupleTypeInfoBase) typeInfo).getTypeAt(i)); } } } if (!unsupportedTypes.isEmpty()) { throw new InvalidProgramException("Type " + keyType + " cannot be used as key. Contained " + "UNSUPPORTED key types: " + StringUtils.join(unsupportedTypes, ", ") + ". Look " + "at the keyBy() documentation for the conditions a type has to satisfy in order to be " + "eligible for a key."); } return keyType; }
[ "private", "TypeInformation", "<", "KEY", ">", "validateKeyType", "(", "TypeInformation", "<", "KEY", ">", "keyType", ")", "{", "Stack", "<", "TypeInformation", "<", "?", ">", ">", "stack", "=", "new", "Stack", "<>", "(", ")", ";", "stack", ".", "push", ...
Validates that a given type of element (as encoded by the provided {@link TypeInformation}) can be used as a key in the {@code DataStream.keyBy()} operation. This is done by searching depth-first the key type and checking if each of the composite types satisfies the required conditions (see {@link #validateKeyTypeIsHashable(TypeInformation)}). @param keyType The {@link TypeInformation} of the key.
[ "Validates", "that", "a", "given", "type", "of", "element", "(", "as", "encoded", "by", "the", "provided", "{", "@link", "TypeInformation", "}", ")", "can", "be", "used", "as", "a", "key", "in", "the", "{", "@code", "DataStream", ".", "keyBy", "()", "}...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java#L172-L200
train
Validate the key type.
[ 30522, 2797, 2828, 2378, 14192, 3370, 1026, 3145, 1028, 9398, 3686, 14839, 13874, 1006, 2828, 2378, 14192, 3370, 1026, 3145, 1028, 3145, 13874, 1007, 1063, 9991, 1026, 2828, 2378, 14192, 3370, 1026, 1029, 1028, 1028, 9991, 1027, 2047, 9991,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/core/src/main/java/org/apache/spark/sql/execution/vectorized/WritableColumnVector.java
WritableColumnVector.reserveDictionaryIds
public WritableColumnVector reserveDictionaryIds(int capacity) { if (dictionaryIds == null) { dictionaryIds = reserveNewColumn(capacity, DataTypes.IntegerType); } else { dictionaryIds.reset(); dictionaryIds.reserve(capacity); } return dictionaryIds; }
java
public WritableColumnVector reserveDictionaryIds(int capacity) { if (dictionaryIds == null) { dictionaryIds = reserveNewColumn(capacity, DataTypes.IntegerType); } else { dictionaryIds.reset(); dictionaryIds.reserve(capacity); } return dictionaryIds; }
[ "public", "WritableColumnVector", "reserveDictionaryIds", "(", "int", "capacity", ")", "{", "if", "(", "dictionaryIds", "==", "null", ")", "{", "dictionaryIds", "=", "reserveNewColumn", "(", "capacity", ",", "DataTypes", ".", "IntegerType", ")", ";", "}", "else"...
Reserve a integer column for ids of dictionary.
[ "Reserve", "a", "integer", "column", "for", "ids", "of", "dictionary", "." ]
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/WritableColumnVector.java#L165-L173
train
Reserve a number of integer dictionary ids in the column vector.
[ 30522, 2270, 25697, 3085, 25778, 2819, 2078, 3726, 16761, 9235, 28097, 5649, 9821, 1006, 20014, 3977, 1007, 1063, 2065, 1006, 9206, 9821, 1027, 1027, 19701, 1007, 1063, 9206, 9821, 1027, 3914, 2638, 16526, 4747, 2819, 2078, 1006, 3977, 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-libraries/flink-gelly/src/main/java/org/apache/flink/graph/utils/GraphUtils.java
GraphUtils.count
public static <T> DataSet<LongValue> count(DataSet<T> input) { return input .map(new MapTo<>(new LongValue(1))) .returns(LONG_VALUE_TYPE_INFO) .name("Emit 1") .reduce(new AddLongValue()) .name("Sum"); }
java
public static <T> DataSet<LongValue> count(DataSet<T> input) { return input .map(new MapTo<>(new LongValue(1))) .returns(LONG_VALUE_TYPE_INFO) .name("Emit 1") .reduce(new AddLongValue()) .name("Sum"); }
[ "public", "static", "<", "T", ">", "DataSet", "<", "LongValue", ">", "count", "(", "DataSet", "<", "T", ">", "input", ")", "{", "return", "input", ".", "map", "(", "new", "MapTo", "<>", "(", "new", "LongValue", "(", "1", ")", ")", ")", ".", "retu...
Count the number of elements in a DataSet. @param input DataSet of elements to be counted @param <T> element type @return count
[ "Count", "the", "number", "of", "elements", "in", "a", "DataSet", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/utils/GraphUtils.java#L47-L54
train
Count data set.
[ 30522, 2270, 10763, 1026, 1056, 1028, 2951, 13462, 1026, 2146, 10175, 5657, 1028, 4175, 1006, 2951, 13462, 1026, 1056, 1028, 7953, 1007, 1063, 2709, 7953, 1012, 4949, 1006, 2047, 4949, 3406, 1026, 1028, 1006, 30524, 1007, 1007, 1007, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...