function_name
stringlengths
1
57
function_code
stringlengths
20
4.99k
documentation
stringlengths
50
2k
language
stringclasses
5 values
file_path
stringlengths
8
166
line_number
int32
4
16.7k
parameters
listlengths
0
20
return_type
stringlengths
0
131
has_type_hints
bool
2 classes
complexity
int32
1
51
quality_score
float32
6
9.68
repo_name
stringclasses
34 values
repo_stars
int32
2.9k
242k
docstring_style
stringclasses
7 values
is_async
bool
2 classes
isFallthroughSwitchBranch
static bool isFallthroughSwitchBranch(const SwitchBranch &Branch) { struct SwitchCaseVisitor : RecursiveASTVisitor<SwitchCaseVisitor> { using RecursiveASTVisitor<SwitchCaseVisitor>::DataRecursionQueue; bool TraverseLambdaExpr(LambdaExpr *, DataRecursionQueue * = nullptr) { return true; // Ignore lambda...
and ignores the `case X:` or `default:` at the start of the branch.
cpp
clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp
42
[]
true
3
6.88
llvm/llvm-project
36,021
doxygen
false
run_program
def run_program(self, program_path): """ Run a generated Python program and handle output/errors. Args: program_path: Path to the Python program to run Returns: bool: True if program ran successfully, False otherwise """ abs_path = os.path.abspat...
Run a generated Python program and handle output/errors. Args: program_path: Path to the Python program to run Returns: bool: True if program ran successfully, False otherwise
python
tools/experimental/torchfuzz/runner.py
18
[ "self", "program_path" ]
false
5
7.04
pytorch/pytorch
96,034
google
false
map
R map(R instance, @Nullable T value);
Map a existing instance for the given nullable value. @param instance the existing instance @param value the value to map (may be {@code null}) @return the resulting mapped instance
java
core/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java
552
[ "instance", "value" ]
R
true
1
6.8
spring-projects/spring-boot
79,428
javadoc
false
validate_udf
def validate_udf(func: Callable) -> None: """ Validate user defined function for ops when using Numba with groupby ops. The first signature arguments should include: def f(values, index, ...): ... Parameters ---------- func : function, default False user defined function ...
Validate user defined function for ops when using Numba with groupby ops. The first signature arguments should include: def f(values, index, ...): ... Parameters ---------- func : function, default False user defined function Returns ------- None Raises ------ NumbaUtilError
python
pandas/core/groupby/numba_.py
27
[ "func" ]
None
true
4
6.24
pandas-dev/pandas
47,362
numpy
false
get_param_nodes
def get_param_nodes(graph: fx.Graph) -> list[fx.Node]: """Get all parameter nodes from a graph as a list. You can rely on this providing the correct order of parameters you need to feed into the joint graph (at the very beginning of the argument list, before buffers). Args: graph: The FX j...
Get all parameter nodes from a graph as a list. You can rely on this providing the correct order of parameters you need to feed into the joint graph (at the very beginning of the argument list, before buffers). Args: graph: The FX joint graph with descriptors Returns: A list of FX nodes representing all para...
python
torch/_functorch/_aot_autograd/fx_utils.py
279
[ "graph" ]
list[fx.Node]
true
1
6.72
pytorch/pytorch
96,034
google
false
nextDouble
@Deprecated public static double nextDouble(final double startInclusive, final double endExclusive) { return secure().randomDouble(startInclusive, endExclusive); }
Generates a random double within the specified range. @param startInclusive the smallest value that can be returned, must be non-negative. @param endExclusive the upper bound (not included). @throws IllegalArgumentException if {@code startInclusive > endExclusive} or if {@code startInclusive} is negative. @return the...
java
src/main/java/org/apache/commons/lang3/RandomUtils.java
153
[ "startInclusive", "endExclusive" ]
true
1
6.16
apache/commons-lang
2,896
javadoc
false
maybeBindThisJoinPoint
private boolean maybeBindThisJoinPoint() { if ((this.argumentTypes[0] == JoinPoint.class) || (this.argumentTypes[0] == ProceedingJoinPoint.class)) { bindParameterName(0, THIS_JOIN_POINT); return true; } else { return false; } }
If the first parameter is of type JoinPoint or ProceedingJoinPoint, bind "thisJoinPoint" as parameter name and return true, else return false.
java
spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java
309
[]
true
3
6.56
spring-projects/spring-framework
59,386
javadoc
false
emptyResults
public <T> Map<TopicPartition, T> emptyResults() { Map<TopicPartition, T> result = new HashMap<>(); timestampsToSearch.keySet().forEach(tp -> result.put(tp, null)); return result; }
Build result representing that no offsets were found as part of the current event. @return Map containing all the partitions the event was trying to get offsets for, and null {@link OffsetAndTimestamp} as value
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ListOffsetsEvent.java
53
[]
true
1
6.56
apache/kafka
31,560
javadoc
false
getBeanInfo
private static BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException { for (BeanInfoFactory beanInfoFactory : beanInfoFactories) { BeanInfo beanInfo = beanInfoFactory.getBeanInfo(beanClass); if (beanInfo != null) { return beanInfo; } } return simpleBeanInfoFactory.getBeanInfo(beanCla...
Retrieve a {@link BeanInfo} descriptor for the given target class. @param beanClass the target class to introspect @return the resulting {@code BeanInfo} descriptor (never {@code null}) @throws IntrospectionException from introspecting the given bean class
java
spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java
218
[ "beanClass" ]
BeanInfo
true
2
7.28
spring-projects/spring-framework
59,386
javadoc
false
write
<V> void write(@Nullable V value) { value = processValue(value); if (value == null) { append("null"); } else if (value instanceof WritableJson writableJson) { try { writableJson.to(this.out); } catch (IOException ex) { throw new UncheckedIOException(ex); } } else if (value instanceof ...
Write a value to the JSON output. The following value types are supported: <ul> <li>Any {@code null} value</li> <li>A {@link WritableJson} instance</li> <li>Any {@link Iterable} or Array (written as a JSON array)</li> <li>A {@link Map} (written as a JSON object)</li> <li>Any {@link Number}</li> <li>A {@link Boolean}</l...
java
core/spring-boot/src/main/java/org/springframework/boot/json/JsonValueWriter.java
122
[ "value" ]
void
true
10
6.72
spring-projects/spring-boot
79,428
javadoc
false
apply
protected void apply(@Nullable LogFile logFile, PropertyResolver resolver) { setSystemProperty(LoggingSystemProperty.APPLICATION_NAME, resolver); setSystemProperty(LoggingSystemProperty.APPLICATION_GROUP, resolver); setSystemProperty(LoggingSystemProperty.PID, new ApplicationPid().toString()); setSystemProperty...
Returns the {@link Console} to use. @return the {@link Console} to use @since 3.5.0
java
core/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystemProperties.java
127
[ "logFile", "resolver" ]
void
true
3
6.88
spring-projects/spring-boot
79,428
javadoc
false
lastIndexOf
public static int lastIndexOf(final long[] array, final long valueToFind) { return lastIndexOf(array, valueToFind, Integer.MAX_VALUE); }
Finds the last index of the given value within the array. <p> This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. </p> @param array the array to traverse backwards looking for the object, may be {@code null}. @param valueToFind the object to find. @return the last index of th...
java
src/main/java/org/apache/commons/lang3/ArrayUtils.java
4,081
[ "array", "valueToFind" ]
true
1
6.8
apache/commons-lang
2,896
javadoc
false
assign_fields_by_name
def assign_fields_by_name(dst, src, zero_unassigned=True): """ Assigns values from one structured array to another by field name. Normally in numpy >= 1.14, assignment of one structured array to another copies fields "by position", meaning that the first field from the src is copied to the first fi...
Assigns values from one structured array to another by field name. Normally in numpy >= 1.14, assignment of one structured array to another copies fields "by position", meaning that the first field from the src is copied to the first field of the dst, and so on, regardless of field name. This function instead copies ...
python
numpy/lib/recfunctions.py
1,233
[ "dst", "src", "zero_unassigned" ]
false
6
6.08
numpy/numpy
31,054
numpy
false
run
@Override public void run() { try { log.debug("Consumer network thread started"); // Wait until we're securely in the background network thread to initialize these objects... try { initializeResources(); } catch (Throwable t) { ...
Start the network thread and let it complete its initialization before proceeding. The {@link ClassicKafkaConsumer} constructor blocks during creation of its {@link NetworkClient}, providing precedent for waiting here. In certain cases (e.g. an invalid {@link LoginModule} in {@link SaslConfigs#SASL_JAAS_CONFIG}), an er...
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkThread.java
142
[]
void
true
5
6.56
apache/kafka
31,560
javadoc
false
_define_gemm_instance
def _define_gemm_instance( self, op: GemmOperation, evt_name: Optional[str] = None, ) -> tuple[str, str]: """Defines and renders the Cutlass / CUDA C++ code for a given GEMM operation instance. This function uses the Cutlass library to generate key parts of the codegen proce...
Defines and renders the Cutlass / CUDA C++ code for a given GEMM operation instance. This function uses the Cutlass library to generate key parts of the codegen process. General Matrix Multiply forms a core part of a number of scientific applications, so this efficient and adaptable implementation is crucial. Args: ...
python
torch/_inductor/codegen/cuda/gemm_template.py
1,539
[ "self", "op", "evt_name" ]
tuple[str, str]
true
5
7.92
pytorch/pytorch
96,034
google
false
toString
@Override public String toString() { StringBuilder sb = new StringBuilder("class=").append(getBeanClassName()); sb.append("; scope=").append(this.scope); sb.append("; abstract=").append(this.abstractFlag); sb.append("; lazyInit=").append(this.lazyInit); sb.append("; autowireMode=").append(this.autowireMode);...
Clone this bean definition. To be implemented by concrete subclasses. @return the cloned bean definition object
java
spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
1,355
[]
String
true
2
7.76
spring-projects/spring-framework
59,386
javadoc
false
apply
R apply(int input) throws E;
Applies this function. @param input the input for the function @return the result of the function @throws E Thrown when the function fails.
java
src/main/java/org/apache/commons/lang3/function/FailableIntFunction.java
55
[ "input" ]
R
true
1
6.8
apache/commons-lang
2,896
javadoc
false
connect
def connect(self, *args, **kwargs): """Connect receiver to sender for signal. Arguments: receiver (Callable): A function or an instance method which is to receive signals. Receivers must be hashable objects. if weak is :const:`True`, then receiver must be ...
Connect receiver to sender for signal. Arguments: receiver (Callable): A function or an instance method which is to receive signals. Receivers must be hashable objects. if weak is :const:`True`, then receiver must be weak-referenceable. Receivers must be able to accept keyword ar...
python
celery/utils/dispatch/signal.py
110
[ "self" ]
false
5
6
celery/celery
27,741
google
false
start_instances
def start_instances(self, instance_ids: list) -> dict: """ Start instances with given ids. :param instance_ids: List of instance ids to start :return: Dict with key `StartingInstances` and value as list of instances being started """ self.log.info("Starting instances: %s...
Start instances with given ids. :param instance_ids: List of instance ids to start :return: Dict with key `StartingInstances` and value as list of instances being started
python
providers/amazon/src/airflow/providers/amazon/aws/hooks/ec2.py
110
[ "self", "instance_ids" ]
dict
true
1
6.72
apache/airflow
43,597
sphinx
false
getCompatIPv4Address
public static Inet4Address getCompatIPv4Address(Inet6Address ip) { checkArgument( isCompatIPv4Address(ip), "Address '%s' is not IPv4-compatible.", toAddrString(ip)); return getInet4Address(Arrays.copyOfRange(ip.getAddress(), 12, 16)); }
Returns the IPv4 address embedded in an IPv4 compatible address. @param ip {@link Inet6Address} to be examined for an embedded IPv4 address @return {@link Inet4Address} of the embedded IPv4 address @throws IllegalArgumentException if the argument is not a valid IPv4 compatible address
java
android/guava/src/com/google/common/net/InetAddresses.java
702
[ "ip" ]
Inet4Address
true
1
6.4
google/guava
51,352
javadoc
false
forBeanTypes
static LazyInitializationExcludeFilter forBeanTypes(Class<?>... types) { return (beanName, beanDefinition, beanType) -> { for (Class<?> type : types) { if (type.isAssignableFrom(beanType)) { return true; } } return false; }; }
Factory method that creates a filter for the given bean types. @param types the filtered types @return a new filter instance
java
core/spring-boot/src/main/java/org/springframework/boot/LazyInitializationExcludeFilter.java
64
[]
LazyInitializationExcludeFilter
true
2
8.24
spring-projects/spring-boot
79,428
javadoc
false
_tile_description_to_json
def _tile_description_to_json(cls, tile_desc: "TileDescription") -> str: # type: ignore[name-defined] # noqa: F821 """ Convert TileDescription to JSON string. Args: tile_desc: TileDescription object Returns: str: JSON string representation """ ...
Convert TileDescription to JSON string. Args: tile_desc: TileDescription object Returns: str: JSON string representation
python
torch/_inductor/codegen/cuda/serialization.py
222
[ "cls", "tile_desc" ]
str
true
3
7.6
pytorch/pytorch
96,034
google
false
appendExportsOfDeclaration
function appendExportsOfDeclaration(statements: Statement[] | undefined, seen: IdentifierNameMap<boolean>, decl: Declaration, liveBinding?: boolean): Statement[] | undefined { const name = factory.getDeclarationName(decl); const exportSpecifiers = currentModuleInfo.exportSpecifiers.get(name); ...
Appends the exports of a declaration to a statement list, returning the statement list. @param statements A statement list to which the down-level export statements are to be appended. If `statements` is `undefined`, a new array is allocated if statements are appended. @param decl The declaration to export.
typescript
src/compiler/transformers/module/module.ts
2,108
[ "statements", "seen", "decl", "liveBinding?" ]
true
2
6.72
microsoft/TypeScript
107,154
jsdoc
false
_fit_transform
def _fit_transform(self, X, y=None, W=None, H=None, update_H=True): """Learn a NMF model for the data X and returns the transformed data. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) Data matrix to be decomposed y : Ignored ...
Learn a NMF model for the data X and returns the transformed data. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) Data matrix to be decomposed y : Ignored W : array-like of shape (n_samples, n_components), default=None If `init='custom'`, it is used as initial guess fo...
python
sklearn/decomposition/_nmf.py
1,630
[ "self", "X", "y", "W", "H", "update_H" ]
false
8
6
scikit-learn/scikit-learn
64,340
numpy
false
nextLong
@Deprecated public static long nextLong() { return secure().randomLong(); }
Generates a random long between 0 (inclusive) and Long.MAX_VALUE (exclusive). @return the random long. @see #nextLong(long, long) @since 3.5 @deprecated Use {@link #secure()}, {@link #secureStrong()}, or {@link #insecure()}.
java
src/main/java/org/apache/commons/lang3/RandomUtils.java
220
[]
true
1
6.32
apache/commons-lang
2,896
javadoc
false
_concat_same_type
def _concat_same_type(cls, to_concat: Sequence[Self]) -> Self: """ Concatenate multiple array of this dtype. Parameters ---------- to_concat : sequence of this type An array of the same dtype to concatenate. Returns ------- ExtensionArray ...
Concatenate multiple array of this dtype. Parameters ---------- to_concat : sequence of this type An array of the same dtype to concatenate. Returns ------- ExtensionArray See Also -------- api.extensions.ExtensionArray._explode : Transform each element of list-like to a row. api.extensions.ExtensionArray._f...
python
pandas/core/arrays/base.py
2,141
[ "cls", "to_concat" ]
Self
true
1
6.8
pandas-dev/pandas
47,362
numpy
false
findThreadGroups
public static Collection<ThreadGroup> findThreadGroups(final ThreadGroup threadGroup, final boolean recurse, final Predicate<ThreadGroup> predicate) { Objects.requireNonNull(threadGroup, "threadGroup"); Objects.requireNonNull(predicate, "predicate"); int count = threadGroup.activeGroupCount(); ...
Finds all active thread groups which match the given predicate and which is a subgroup of the given thread group (or one of its subgroups). @param threadGroup the thread group. @param recurse if {@code true} then evaluate the predicate recursively on all thread groups in all subgroups of the given group. @param pre...
java
src/main/java/org/apache/commons/lang3/ThreadUtils.java
258
[ "threadGroup", "recurse", "predicate" ]
true
1
7.04
apache/commons-lang
2,896
javadoc
false
getAllowedPaths
private List<Path> getAllowedPaths(String configValue) { if (configValue != null && !configValue.isEmpty()) { List<Path> allowedPaths = new ArrayList<>(); Arrays.stream(configValue.split(",")).forEach(b -> { Path normalisedPath = Paths.get(b).normalize(); ...
Constructs AllowedPaths with a list of Paths retrieved from {@code configValue}. @param configValue {@code allowed.paths} config value which is a string containing comma separated list of paths @throws ConfigException if any of the given paths is not absolute or does not exist.
java
clients/src/main/java/org/apache/kafka/common/config/internals/AllowedPaths.java
40
[ "configValue" ]
true
5
6.72
apache/kafka
31,560
javadoc
false
readNextToken
private int readNextToken(final char[] srcChars, int start, final int len, final StrBuilder workArea, final List<String> tokenList) { // skip all leading whitespace, unless it is the // field delimiter or the quote character while (start < len) { final int removeLen = Math.max( ...
Reads character by character through the String to get the next token. @param srcChars the character array being tokenized. @param start the first character of field. @param len the length of the character array being tokenized. @param workArea a temporary work area. @param tokenList the list of parsed tokens. @re...
java
src/main/java/org/apache/commons/lang3/text/StrTokenizer.java
708
[ "srcChars", "start", "len", "workArea", "tokenList" ]
true
8
8.24
apache/commons-lang
2,896
javadoc
false
calculateFirstNotNull
function calculateFirstNotNull(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs { const data = field.values; for (let idx = 0; idx < data.length; idx++) { const v = data[idx]; if (v != null && !Number.isNaN(v)) { return { firstNotNull: v }; } } return { firstNotNull: null }...
@returns an object with a key for each selected stat NOTE: This will also modify the 'field.state' object, leaving values in a cache until cleared.
typescript
packages/grafana-data/src/transformations/fieldReducer.ts
611
[ "field", "ignoreNulls", "nullAsZero" ]
true
4
8.24
grafana/grafana
71,362
jsdoc
false
whenNotNull
public Member<T> whenNotNull(Function<@Nullable T, ?> extractor) { Assert.notNull(extractor, "'extractor' must not be null"); return when((instance) -> Objects.nonNull(extractor.apply(instance))); }
Only include this member when an extracted value is not {@code null}. @param extractor an function used to extract the value to test @return a {@link Member} which may be configured further
java
core/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java
400
[ "extractor" ]
true
1
6.96
spring-projects/spring-boot
79,428
javadoc
false
isReady
@Override public boolean isReady(Node node, long now) { // if we need to update our metadata now declare all requests unready to make metadata requests first // priority return !metadataUpdater.isUpdateDue(now) && canSendRequest(node.idString(), now); }
Check if the node with the given id is ready to send more requests. @param node The node @param now The current time in ms @return true if the node is ready
java
clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
517
[ "node", "now" ]
true
2
8.08
apache/kafka
31,560
javadoc
false
sliceUnaligned
public UnalignedFileRecords sliceUnaligned(int position, int size) { int availableBytes = availableBytes(position, size); return new UnalignedFileRecords(channel, this.start + position, availableBytes); }
Return a slice of records from this instance, the difference with {@link FileRecords#slice(int, int)} is that the position is not necessarily on an offset boundary. This method is reserved for cases where offset alignment is not necessary, such as in the replication of raft snapshots. @param position The start position...
java
clients/src/main/java/org/apache/kafka/common/record/FileRecords.java
161
[ "position", "size" ]
UnalignedFileRecords
true
1
6.48
apache/kafka
31,560
javadoc
false
streamingIterator
@Override public CloseableIterator<Record> streamingIterator(BufferSupplier bufferSupplier) { if (isCompressed()) return compressedIterator(bufferSupplier, false); else return uncompressedIterator(); }
Gets the base timestamp of the batch which is used to calculate the record timestamps from the deltas. @return The base timestamp
java
clients/src/main/java/org/apache/kafka/common/record/DefaultRecordBatch.java
357
[ "bufferSupplier" ]
true
2
6.88
apache/kafka
31,560
javadoc
false
wrapAndThrowExecutionExceptionOrError
private static void wrapAndThrowExecutionExceptionOrError(Throwable cause) throws ExecutionException { if (cause instanceof Error) { throw new ExecutionError((Error) cause); } else if (cause instanceof RuntimeException) { throw new UncheckedExecutionException(cause); } else { throw n...
Creates a TimeLimiter instance using the given executor service to execute method calls. <p><b>Warning:</b> using a bounded executor may be counterproductive! If the thread pool fills up, any time callers spend waiting for a thread may count toward their time limit, and in this case the call may even time out before th...
java
android/guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java
261
[ "cause" ]
void
true
3
6.72
google/guava
51,352
javadoc
false
loss_gradient
def loss_gradient( self, coef, X, y, sample_weight=None, l2_reg_strength=0.0, n_threads=1, raw_prediction=None, ): """Computes the sum of loss and gradient w.r.t. coef. Parameters ---------- coef : ndarray of shape (n_d...
Computes the sum of loss and gradient w.r.t. coef. Parameters ---------- coef : ndarray of shape (n_dof,), (n_classes, n_dof) or (n_classes * n_dof,) Coefficients of a linear model. If shape (n_classes * n_dof,), the classes of one feature are contiguous, i.e. one reconstructs the 2d-array via coef.res...
python
sklearn/linear_model/_linear_loss.py
269
[ "self", "coef", "X", "y", "sample_weight", "l2_reg_strength", "n_threads", "raw_prediction" ]
false
9
6
scikit-learn/scikit-learn
64,340
numpy
false
forFile
public static Layout forFile(File file) { Assert.notNull(file, "'file' must not be null"); String lowerCaseFileName = file.getName().toLowerCase(Locale.ENGLISH); if (lowerCaseFileName.endsWith(".jar")) { return new Jar(); } if (lowerCaseFileName.endsWith(".war")) { return new War(); } if (file.isDir...
Return a layout for the given source file. @param file the source file @return a {@link Layout}
java
loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java
49
[ "file" ]
Layout
true
5
8.08
spring-projects/spring-boot
79,428
javadoc
false
_safe_print
def _safe_print(*args: Any, **kwargs: Any) -> None: """Safe print that avoids recursive torch function dispatches.""" import sys # Convert any torch objects to basic representations safe_args = [] for arg in args: if hasattr(arg, "__class__") and "torch" in str(type(arg)): safe_...
Safe print that avoids recursive torch function dispatches.
python
functorch/dim/__init__.py
413
[]
None
true
5
6.72
pytorch/pytorch
96,034
unknown
false
toObject
public static Character[] toObject(final char[] array) { if (array == null) { return null; } if (array.length == 0) { return EMPTY_CHARACTER_OBJECT_ARRAY; } return setAll(new Character[array.length], i -> Character.valueOf(array[i])); }
Converts an array of primitive chars to objects. <p>This method returns {@code null} for a {@code null} input array.</p> @param array a {@code char} array. @return a {@link Character} array, {@code null} if null array input.
java
src/main/java/org/apache/commons/lang3/ArrayUtils.java
8,708
[ "array" ]
true
3
8.24
apache/commons-lang
2,896
javadoc
false
find
static Zip64EndOfCentralDirectoryLocator find(DataBlock dataBlock, long endOfCentralDirectoryPos) throws IOException { debug.log("Finding Zip64EndOfCentralDirectoryLocator from EOCD at %s", endOfCentralDirectoryPos); long pos = endOfCentralDirectoryPos - SIZE; if (pos < 0) { debug.log("No Zip64EndOfCentralD...
Return the {@link Zip64EndOfCentralDirectoryLocator} or {@code null} if this is not a Zip64 file. @param dataBlock the source data block @param endOfCentralDirectoryPos the {@link ZipEndOfCentralDirectoryRecord} position @return a {@link Zip64EndOfCentralDirectoryLocator} instance or null @throws IOException on I/O err...
java
loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/Zip64EndOfCentralDirectoryLocator.java
59
[ "dataBlock", "endOfCentralDirectoryPos" ]
Zip64EndOfCentralDirectoryLocator
true
3
7.28
spring-projects/spring-boot
79,428
javadoc
false
is_interval_dtype
def is_interval_dtype(arr_or_dtype) -> bool: """ Check whether an array-like or dtype is of the Interval dtype. .. deprecated:: 2.2.0 Use isinstance(dtype, pd.IntervalDtype) instead. Parameters ---------- arr_or_dtype : array-like or dtype The array-like or dtype to check. ...
Check whether an array-like or dtype is of the Interval dtype. .. deprecated:: 2.2.0 Use isinstance(dtype, pd.IntervalDtype) instead. Parameters ---------- arr_or_dtype : array-like or dtype The array-like or dtype to check. Returns ------- boolean Whether or not the array-like or dtype is of the Interva...
python
pandas/core/dtypes/common.py
490
[ "arr_or_dtype" ]
bool
true
3
8
pandas-dev/pandas
47,362
numpy
false
removeAllOccurrences
public static long[] removeAllOccurrences(final long[] array, final long element) { return (long[]) removeAt(array, indexesOf(array, element)); }
Removes the occurrences of the specified element from the specified long array. <p> All subsequent elements are shifted to the left (subtracts one from their indices). If the array doesn't contain such an element, no elements are removed from the array. {@code null} will be returned if the input array is {@code null}. ...
java
src/main/java/org/apache/commons/lang3/ArrayUtils.java
5,538
[ "array", "element" ]
true
1
6.96
apache/commons-lang
2,896
javadoc
false
haversinMeters
public static double haversinMeters(double lat1, double lon1, double lat2, double lon2) { return haversinMeters(haversinSortKey(lat1, lon1, lat2, lon2)); }
Returns the Haversine distance in meters between two points specified in decimal degrees (latitude/longitude). This works correctly even if the dateline is between the two points. <p>Error is at most 4E-1 (40cm) from the actual haversine distance, but is typically much smaller for reasonable distances: around 1E-5 (0.0...
java
libs/geo/src/main/java/org/elasticsearch/geometry/simplify/SloppyMath.java
32
[ "lat1", "lon1", "lat2", "lon2" ]
true
1
6.96
elastic/elasticsearch
75,680
javadoc
false
missRate
public double missRate() { long requestCount = requestCount(); return (requestCount == 0) ? 0.0 : (double) missCount / requestCount; }
Returns the ratio of cache requests which were misses. This is defined as {@code missCount / requestCount}, or {@code 0.0} when {@code requestCount == 0}. Note that {@code hitRate + missRate =~ 1.0}. Cache misses include all requests which weren't cache hits, including requests which resulted in either successful or fa...
java
android/guava/src/com/google/common/cache/CacheStats.java
147
[]
true
2
6.64
google/guava
51,352
javadoc
false
withoutImports
ConfigDataProperties withoutImports() { return new ConfigDataProperties(null, this.activate); }
Return a new variant of these properties without any imports. @return a new {@link ConfigDataProperties} instance
java
core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataProperties.java
83
[]
ConfigDataProperties
true
1
6
spring-projects/spring-boot
79,428
javadoc
false
staged_predict
def staged_predict(self, X): """Predict classes at each iteration. This method allows monitoring (i.e. determine error on testing set) after each stage. .. versionadded:: 0.24 Parameters ---------- X : array-like of shape (n_samples, n_features) The...
Predict classes at each iteration. This method allows monitoring (i.e. determine error on testing set) after each stage. .. versionadded:: 0.24 Parameters ---------- X : array-like of shape (n_samples, n_features) The input samples. Yields ------ y : generator of ndarray of shape (n_samples,) The predicted ...
python
sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py
2,237
[ "self", "X" ]
false
4
6.08
scikit-learn/scikit-learn
64,340
numpy
false
from
public <T> Source<T> from(@Nullable T value) { return from(() -> value); }
Return a new {@link Source} from the specified value that can be used to perform the mapping. @param <T> the source type @param value the value @return a {@link Source} that can be used to complete the mapping
java
core/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java
96
[ "value" ]
true
1
6.96
spring-projects/spring-boot
79,428
javadoc
false
__contains__
def __contains__(self, key: Any) -> bool: """ return a boolean if this key is IN the index We *only* accept an Interval Parameters ---------- key : Interval Returns ------- bool """ hash(key) if not isinstance(key, Interva...
return a boolean if this key is IN the index We *only* accept an Interval Parameters ---------- key : Interval Returns ------- bool
python
pandas/core/indexes/interval.py
456
[ "self", "key" ]
bool
true
3
6.4
pandas-dev/pandas
47,362
numpy
false
whenHasText
public Source<T> whenHasText() { return when((value) -> StringUtils.hasText(value.toString())); }
Return a filtered version of the source that will only map values that have a {@code toString()} containing actual text. @return a new filtered source instance
java
core/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java
234
[]
true
1
6.64
spring-projects/spring-boot
79,428
javadoc
false
to_string
def to_string( self, buf: FilePath | WriteBuffer[str] | None = None, *, encoding: str | None = None, sparse_index: bool | None = None, sparse_columns: bool | None = None, max_rows: int | None = None, max_columns: int | None = None, delimiter: str =...
Write Styler to a file, buffer or string in text format. Parameters ---------- %(buf)s %(encoding)s sparse_index : bool, optional Whether to sparsify the display of a hierarchical index. Setting to False will display each explicit level element in a hierarchical key for each row. Defaults to ``pandas.optio...
python
pandas/io/formats/style.py
1,517
[ "self", "buf", "encoding", "sparse_index", "sparse_columns", "max_rows", "max_columns", "delimiter" ]
str | None
true
4
7.92
pandas-dev/pandas
47,362
numpy
false
calcTimeoutMsRemainingAsInt
static int calcTimeoutMsRemainingAsInt(long now, long deadlineMs) { long deltaMs = deadlineMs - now; if (deltaMs > Integer.MAX_VALUE) deltaMs = Integer.MAX_VALUE; else if (deltaMs < Integer.MIN_VALUE) deltaMs = Integer.MIN_VALUE; return (int) deltaMs; }
Get the current time remaining before a deadline as an integer. @param now The current time in milliseconds. @param deadlineMs The deadline time in milliseconds. @return The time delta in milliseconds.
java
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
461
[ "now", "deadlineMs" ]
true
3
7.92
apache/kafka
31,560
javadoc
false
isReusableParameter
function isReusableParameter(node: Node) { if (node.kind !== SyntaxKind.Parameter) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. const parameter = node as ParameterDeclaration; return parameter.initializer === undefi...
Reports a diagnostic error for the current token being an invalid name. @param blankDiagnostic Diagnostic to report for the case of the name being blank (matched tokenIfBlankName). @param nameDiagnostic Diagnostic to report for all other cases. @param tokenIfBlankName Current token if the name was invalid for being...
typescript
src/compiler/parser.ts
3,399
[ "node" ]
false
2
6.08
microsoft/TypeScript
107,154
jsdoc
false
positionOrNull
public synchronized FetchPosition positionOrNull(TopicPartition tp) { final TopicPartitionState state = assignedStateOrNull(tp); if (state == null) { return null; } return assignedState(tp).position; }
Attempt to complete validation with the end offset returned from the OffsetForLeaderEpoch request. @return Log truncation details if detected and no reset policy is defined.
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java
632
[ "tp" ]
FetchPosition
true
2
6.4
apache/kafka
31,560
javadoc
false
doConvertValue
private @Nullable Object doConvertValue(@Nullable Object oldValue, @Nullable Object newValue, @Nullable Class<?> requiredType, @Nullable PropertyEditor editor) { Object convertedValue = newValue; if (editor != null && !(convertedValue instanceof String)) { // Not a String -> use PropertyEditor's setValue. ...
Convert the value to the required type (if necessary from a String), using the given property editor. @param oldValue the previous value, if available (may be {@code null}) @param newValue the proposed new value @param requiredType the type we must convert to (or {@code null} if not known, for example in case of a coll...
java
spring-beans/src/main/java/org/springframework/beans/TypeConverterDelegate.java
361
[ "oldValue", "newValue", "requiredType", "editor" ]
Object
true
14
7.76
spring-projects/spring-framework
59,386
javadoc
false
toFinite
function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } return value === value ? value : 0; }
Converts `value` to a finite number. @static @memberOf _ @since 4.12.0 @category Lang @param {*} value The value to convert. @returns {number} Returns the converted number. @example _.toFinite(3.2); // => 3.2 _.toFinite(Number.MIN_VALUE); // => 5e-324 _.toFinite(Infinity); // => 1.7976931348623157e+308 _.toFinite('3.2'...
javascript
lodash.js
12,465
[ "value" ]
false
7
7.2
lodash/lodash
61,490
jsdoc
false
addTo
public void addTo(String to, String personal) throws MessagingException, UnsupportedEncodingException { Assert.notNull(to, "To address must not be null"); addTo(getEncoding() != null ? new InternetAddress(to, personal, getEncoding()) : new InternetAddress(to, personal)); }
Validate all given mail addresses. <p>The default implementation simply delegates to {@link #validateAddress} for each address. @param addresses the addresses to validate @throws AddressException if validation failed @see #validateAddress(InternetAddress)
java
spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessageHelper.java
633
[ "to", "personal" ]
void
true
2
6.08
spring-projects/spring-framework
59,386
javadoc
false
lag2poly
def lag2poly(c): """ Convert a Laguerre series to a polynomial. Convert an array representing the coefficients of a Laguerre series, ordered from lowest degree to highest, to an array of the coefficients of the equivalent polynomial (relative to the "standard" basis) ordered from lowest to high...
Convert a Laguerre series to a polynomial. Convert an array representing the coefficients of a Laguerre series, ordered from lowest degree to highest, to an array of the coefficients of the equivalent polynomial (relative to the "standard" basis) ordered from lowest to highest degree. Parameters ---------- c : array_...
python
numpy/polynomial/laguerre.py
140
[ "c" ]
false
4
7.52
numpy/numpy
31,054
numpy
false
setExpression
public void setExpression(@Nullable String expression) { this.expression = expression; try { onSetExpression(expression); } catch (IllegalArgumentException ex) { // Fill in location information if possible. if (this.location != null) { throw new IllegalArgumentException("Invalid expression at locat...
Return location information about the pointcut expression if available. This is useful in debugging. @return location information as a human-readable String, or {@code null} if none is available
java
spring-aop/src/main/java/org/springframework/aop/support/AbstractExpressionPointcut.java
58
[ "expression" ]
void
true
3
6.88
spring-projects/spring-framework
59,386
javadoc
false
equals
@Override public boolean equals(final Object obj) { if (obj == this) { return true; } if (!(obj instanceof Fraction)) { return false; } final Fraction other = (Fraction) obj; return getNumerator() == other.getNumerator() && getDenominator() == ...
Compares this fraction to another object to test if they are equal. <p> To be equal, both values must be equal. Thus 2/4 is not equal to 1/2. </p> @param obj the reference object with which to compare @return {@code true} if this object is equal
java
src/main/java/org/apache/commons/lang3/math/Fraction.java
641
[ "obj" ]
true
4
8.24
apache/commons-lang
2,896
javadoc
false
isLenient
function isLenient() { if (insecureHTTPParser && !warnedLenient) { warnedLenient = true; process.emitWarning('Using insecure HTTP parsing'); } return insecureHTTPParser; }
True if val contains an invalid field-vchar field-value = *( field-content / obs-fold ) field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] field-vchar = VCHAR / obs-text @param {string} val @returns {boolean}
javascript
lib/_http_common.js
293
[]
false
3
6.32
nodejs/node
114,839
jsdoc
false
parseJavaClassPath
@VisibleForTesting // TODO(b/65488446): Make this a public API. static ImmutableList<URL> parseJavaClassPath() { ImmutableList.Builder<URL> urls = ImmutableList.builder(); for (String entry : Splitter.on(PATH_SEPARATOR.value()).split(JAVA_CLASS_PATH.value())) { try { try { urls.add(new...
Returns the URLs in the class path specified by the {@code java.class.path} {@linkplain System#getProperty system property}.
java
android/guava/src/com/google/common/reflect/ClassPath.java
636
[]
true
3
6.4
google/guava
51,352
javadoc
false
match
public final boolean match(EndpointId endpointId) { return isIncluded(endpointId) && !isExcluded(endpointId); }
Return {@code true} if the filter matches. @param endpointId the endpoint ID to check @return {@code true} if the filter matches @since 2.6.0
java
module/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilter.java
125
[ "endpointId" ]
true
2
7.84
spring-projects/spring-boot
79,428
javadoc
false
resolve
private List<StandardConfigDataResource> resolve(StandardConfigDataReference reference) { if (!this.resourceLoader.isPattern(reference.getResourceLocation())) { return resolveNonPattern(reference); } return resolvePattern(reference); }
Create a new {@link StandardConfigDataLocationResolver} instance. @param logFactory the factory for loggers to use @param binder a binder backed by the initial {@link Environment} @param resourceLoader a {@link ResourceLoader} used to load resources
java
core/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataLocationResolver.java
311
[ "reference" ]
true
2
6.08
spring-projects/spring-boot
79,428
javadoc
false
describeTopics
DescribeTopicsResult describeTopics(TopicCollection topics, DescribeTopicsOptions options);
Describe some topics in the cluster. When using topic IDs, this operation is supported by brokers with version 3.1.0 or higher. @param topics The topics to describe. @param options The options to use when describing the topics. @return The DescribeTopicsResult.
java
clients/src/main/java/org/apache/kafka/clients/admin/Admin.java
332
[ "topics", "options" ]
DescribeTopicsResult
true
1
6.48
apache/kafka
31,560
javadoc
false
_default_custom_combo_kernel_horizontal_partition
def _default_custom_combo_kernel_horizontal_partition( nodes: list[BaseSchedulerNode], triton_scheduling: SIMDScheduling, kernel_map: dict[BaseSchedulerNode, TritonKernel], node_info_map: dict[BaseSchedulerNode, tuple[Any, Any, Any, Any]], ) -> list[list[BaseSchedulerNode]]: """Horizontally partitio...
Horizontally partition the given list of nodes into a list of list of nodes where each sublist represents a partition. Nodes in different partitions are implemented in different combo kernels. Nodes in the same partition are likely to be implemented in the same combo kernel, but subject to subsequent restrictions like ...
python
torch/_inductor/codegen/triton_combo_kernel.py
48
[ "nodes", "triton_scheduling", "kernel_map", "node_info_map" ]
list[list[BaseSchedulerNode]]
true
10
6.8
pytorch/pytorch
96,034
unknown
false
min
public static byte min(byte a, final byte b, final byte c) { if (b < a) { a = b; } if (c < a) { a = c; } return a; }
Gets the minimum of three {@code byte} values. @param a value 1. @param b value 2. @param c value 3. @return the smallest of the values.
java
src/main/java/org/apache/commons/lang3/math/NumberUtils.java
1,124
[ "a", "b", "c" ]
true
3
8.24
apache/commons-lang
2,896
javadoc
false
documentation
@Override public String documentation() { return "Represents a series of tagged fields."; }
Create a new TaggedFields object with the given tags and fields. @param fields This is an array containing Integer tags followed by associated Field objects. @return The new {@link TaggedFields}
java
clients/src/main/java/org/apache/kafka/common/protocol/types/TaggedFields.java
175
[]
String
true
1
6.64
apache/kafka
31,560
javadoc
false
generateCodeForFactoryMethod
private CodeBlock generateCodeForFactoryMethod( RegisteredBean registeredBean, Method factoryMethod, Class<?> targetClass) { if (!isVisible(factoryMethod, targetClass)) { return generateCodeForInaccessibleFactoryMethod(registeredBean.getBeanName(), factoryMethod, targetClass); } return generateCodeForAcces...
Generate the instance supplier code. @param registeredBean the bean to handle @param instantiationDescriptor the executable to use to create the bean @return the generated code @since 6.1.7
java
spring-beans/src/main/java/org/springframework/beans/factory/aot/InstanceSupplierCodeGenerator.java
262
[ "registeredBean", "factoryMethod", "targetClass" ]
CodeBlock
true
2
7.44
spring-projects/spring-framework
59,386
javadoc
false
build
@Override Map<String, List<TopicPartition>> build() { if (log.isDebugEnabled()) { log.debug("performing general assign. partitionsPerTopic: {}, subscriptions: {}, currentAssignment: {}, rackInfo: {}", partitionsPerTopic, subscriptions, currentAssignment, rackI...
Constructs a general assignment builder. @param partitionsPerTopic The partitions for each subscribed topic. @param subscriptions Map from the member id to their respective topic subscription @param currentAssignment Each consumer's previously owned and still-subscribed partitions @param r...
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.java
1,000
[]
true
3
6.24
apache/kafka
31,560
javadoc
false
parseForValidate
Map<String, Object> parseForValidate(Map<String, String> props, Map<String, ConfigValue> configValues) { Map<String, Object> parsed = new HashMap<>(); Set<String> configsWithNoParent = getConfigsWithNoParent(); for (String name: configsWithNoParent) { parseForValidate(name, props, pa...
Validate the current configuration values with the configuration definition. @param props the current configuration values @return List of Config, each Config contains the updated configuration information given the current configuration values.
java
clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
585
[ "props", "configValues" ]
true
1
6.24
apache/kafka
31,560
javadoc
false
toLabelFilter
function toLabelFilter(key: string, value: string | number, operator: string): QueryBuilderLabelFilter { // We need to make sure that we convert the value back to string because it may be a number const transformedValue = value === Infinity ? '+Inf' : value.toString(); return { label: key, op: operator, value: tr...
Parse the string and get all VectorSelector positions in the query together with parsed representation of the vector selector. @param query
typescript
packages/grafana-prometheus/src/add_label_to_query.ts
59
[ "key", "value", "operator" ]
true
2
6.56
grafana/grafana
71,362
jsdoc
false
resolveEmptyDirectories
private Collection<StandardConfigDataResource> resolveEmptyDirectories( Set<StandardConfigDataReference> references) { Set<StandardConfigDataResource> empty = new LinkedHashSet<>(); for (StandardConfigDataReference reference : references) { if (reference.getDirectory() != null) { empty.addAll(resolveEmpty...
Create a new {@link StandardConfigDataLocationResolver} instance. @param logFactory the factory for loggers to use @param binder a binder backed by the initial {@link Environment} @param resourceLoader a {@link ResourceLoader} used to load resources
java
core/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataLocationResolver.java
270
[ "references" ]
true
2
6.08
spring-projects/spring-boot
79,428
javadoc
false
assignOwnedPartitions
private List<TopicPartition> assignOwnedPartitions() { List<TopicPartition> assignedPartitions = new ArrayList<>(); for (Iterator<Entry<String, List<TopicPartition>>> it = currentAssignment.entrySet().iterator(); it.hasNext();) { Map.Entry<String, List<TopicPartition>> entry = it...
Constructs a general assignment builder. @param partitionsPerTopic The partitions for each subscribed topic. @param subscriptions Map from the member id to their respective topic subscription @param currentAssignment Each consumer's previously owned and still-subscribed partitions @param r...
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.java
1,033
[]
true
7
6.24
apache/kafka
31,560
javadoc
false
getT
public <T, E extends Throwable> T getT(final FailableSupplier<T, E> supplier) throws Throwable { startResume(); try { return supplier.get(); } finally { suspend(); } }
Delegates to {@link FailableSupplier#get()} while recording the duration of the call. @param <T> the type of results supplied by this supplier. @param <E> The kind of thrown exception or error. @param supplier The supplier to {@link Supplier#get()}. @return a result from the given Supplier. @throws Throwable ...
java
src/main/java/org/apache/commons/lang3/time/StopWatch.java
535
[ "supplier" ]
T
true
1
6.72
apache/commons-lang
2,896
javadoc
false
insert
def insert(self, loc: int, item: Hashable, value: ArrayLike, refs=None) -> None: """ Insert item at selected position. Parameters ---------- loc : int item : hashable value : np.ndarray or ExtensionArray refs : The reference tracking object of the value t...
Insert item at selected position. Parameters ---------- loc : int item : hashable value : np.ndarray or ExtensionArray refs : The reference tracking object of the value to set.
python
pandas/core/internals/managers.py
1,496
[ "self", "loc", "item", "value", "refs" ]
None
true
8
6.72
pandas-dev/pandas
47,362
numpy
false
getObject
@Override public Object getObject() { if (this.proxy == null) { throw new FactoryBeanNotInitializedException(); } return this.proxy; }
A hook for subclasses to post-process the {@link ProxyFactory} before creating the proxy instance with it. @param proxyFactory the AOP ProxyFactory about to be used @since 4.2
java
spring-aop/src/main/java/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.java
210
[]
Object
true
2
6.4
spring-projects/spring-framework
59,386
javadoc
false
import_executor_cls
def import_executor_cls(cls, executor_name: ExecutorName) -> tuple[type[BaseExecutor], ConnectorSource]: """ Import the executor class. Supports the same formats as ExecutorLoader.load_executor. :param executor_name: Name of core executor or module path to executor. :return: e...
Import the executor class. Supports the same formats as ExecutorLoader.load_executor. :param executor_name: Name of core executor or module path to executor. :return: executor class via executor_name and executor import source
python
airflow-core/src/airflow/executors/executor_loader.py
368
[ "cls", "executor_name" ]
tuple[type[BaseExecutor], ConnectorSource]
true
1
6.24
apache/airflow
43,597
sphinx
false
lexsort_indexer
def lexsort_indexer( keys: Sequence[ArrayLike | Index | Series], orders=None, na_position: str = "last", key: Callable | None = None, codes_given: bool = False, ) -> npt.NDArray[np.intp]: """ Performs lexical sorting on a set of keys Parameters ---------- keys : Sequence[ArrayLi...
Performs lexical sorting on a set of keys Parameters ---------- keys : Sequence[ArrayLike | Index | Series] Sequence of arrays to be sorted by the indexer Sequence[Series] is only if key is not None. orders : bool or list of booleans, optional Determines the sorting order for each element in keys. If a lis...
python
pandas/core/sorting.py
302
[ "keys", "orders", "na_position", "key", "codes_given" ]
npt.NDArray[np.intp]
true
12
6.8
pandas-dev/pandas
47,362
numpy
false
of
@SafeVarargs // Creating a stream from an array is safe public static IntStream of(final int... values) { return values == null ? IntStream.empty() : IntStream.of(values); }
Null-safe version of {@link IntStream#of(int[])}. @param values the elements of the new stream, may be {@code null}. @return the new stream on {@code values} or {@link IntStream#empty()}. @since 3.18.0
java
src/main/java/org/apache/commons/lang3/stream/IntStreams.java
38
[]
IntStream
true
2
7.84
apache/commons-lang
2,896
javadoc
false
omitBy
function omitBy(object, predicate) { return pickBy(object, negate(getIteratee(predicate))); }
The opposite of `_.pickBy`; this method creates an object composed of the own and inherited enumerable string keyed properties of `object` that `predicate` doesn't return truthy for. The predicate is invoked with two arguments: (value, key). @static @memberOf _ @since 4.0.0 @category Object @param {Object} object The s...
javascript
lodash.js
13,645
[ "object", "predicate" ]
false
1
6.24
lodash/lodash
61,490
jsdoc
false
reverse
@CheckReturnValue public Converter<B, A> reverse() { Converter<B, A> result = reverse; return (result == null) ? reverse = new ReverseConverter<>(this) : result; }
Returns the reversed view of this converter, which converts {@code this.convert(a)} back to a value roughly equivalent to {@code a}. <p>The returned converter is serializable if {@code this} converter is. <p><b>Note:</b> you should not override this method. It is non-final for legacy reasons.
java
android/guava/src/com/google/common/base/Converter.java
301
[]
true
2
7.04
google/guava
51,352
javadoc
false
scopeWithDelimiter
private static String scopeWithDelimiter(Inet6Address ip) { // getHostAddress on android sometimes maps the scope ID to an invalid interface name; if the // mapped interface isn't present, fallback to use the scope ID (which has no validation against // present interfaces) NetworkInterface scopedInterfa...
Returns the string representation of an {@link InetAddress}. <p>For IPv4 addresses, this is identical to {@link InetAddress#getHostAddress()}, but for IPv6 addresses, the output follows <a href="http://tools.ietf.org/html/rfc5952">RFC 5952</a> section 4. The main difference is that this method uses "::" for zero compre...
java
android/guava/src/com/google/common/net/InetAddresses.java
483
[ "ip" ]
String
true
3
8.08
google/guava
51,352
javadoc
false
readResolve
private Object readResolve() { return NULL; }
Ensures singleton after serialization. @return the singleton value.
java
src/main/java/org/apache/commons/lang3/ObjectUtils.java
96
[]
Object
true
1
6.16
apache/commons-lang
2,896
javadoc
false
incidentEdges
@Override public Set<E> incidentEdges() { return new AbstractSet<E>() { @Override public UnmodifiableIterator<E> iterator() { Iterable<E> incidentEdges = (selfLoopCount == 0) ? Iterables.concat(inEdgeMap.keySet(), outEdgeMap.keySet()) : Sets.union(in...
Keys are edges outgoing from the origin node, values are the target node.
java
android/guava/src/com/google/common/graph/AbstractDirectedNetworkConnections.java
64
[]
true
3
7.04
google/guava
51,352
javadoc
false
records
public List<ConsumerRecord<K, V>> records(TopicPartition partition) { List<ConsumerRecord<K, V>> recs = this.records.get(partition); if (recs == null) return Collections.emptyList(); else return Collections.unmodifiableList(recs); }
Get just the records for the given partition @param partition The partition to get records for
java
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRecords.java
58
[ "partition" ]
true
2
6.4
apache/kafka
31,560
javadoc
false
get_workflow_run_id
def get_workflow_run_id(workflow_name: str, repo: str) -> int: """ Get the latest workflow run ID for a given workflow name and repository. :param workflow_name: The name of the workflow to check. :param repo: The repository in the format 'owner/repo'. """ make_sure_gh_is_installed() comman...
Get the latest workflow run ID for a given workflow name and repository. :param workflow_name: The name of the workflow to check. :param repo: The repository in the format 'owner/repo'.
python
dev/breeze/src/airflow_breeze/utils/gh_workflow_utils.py
90
[ "workflow_name", "repo" ]
int
true
3
7.04
apache/airflow
43,597
sphinx
false
writeHeader
public static void writeHeader(ByteBuffer buffer, long baseOffset, int lastOffsetDelta, int sizeInBytes, byte magic, CompressionType compressionT...
Gets the base timestamp of the batch which is used to calculate the record timestamps from the deltas. @return The base timestamp
java
clients/src/main/java/org/apache/kafka/common/record/DefaultRecordBatch.java
459
[ "buffer", "baseOffset", "lastOffsetDelta", "sizeInBytes", "magic", "compressionType", "timestampType", "baseTimestamp", "maxTimestamp", "producerId", "epoch", "sequence", "isTransactional", "isControlBatch", "isDeleteHorizonSet", "partitionLeaderEpoch", "numRecords" ]
void
true
4
6.88
apache/kafka
31,560
javadoc
false
lowestPriorityChannel
public KafkaChannel lowestPriorityChannel() { KafkaChannel channel = null; if (!closingChannels.isEmpty()) { channel = closingChannels.values().iterator().next(); } else if (idleExpiryManager != null && !idleExpiryManager.lruConnections.isEmpty()) { String channelId = idl...
Returns the lowest priority channel chosen using the following sequence: 1) If one or more channels are in closing state, return any one of them 2) If idle expiry manager is enabled, return the least recently updated channel 3) Otherwise return any of the channels This method is used to close a channel to accommo...
java
clients/src/main/java/org/apache/kafka/common/network/Selector.java
1,026
[]
KafkaChannel
true
5
6.4
apache/kafka
31,560
javadoc
false
get_db_snapshot_state
def get_db_snapshot_state(self, snapshot_id: str) -> str: """ Get the current state of a DB instance snapshot. .. seealso:: - :external+boto3:py:meth:`RDS.Client.describe_db_snapshots` :param snapshot_id: The ID of the target DB instance snapshot :return: Returns th...
Get the current state of a DB instance snapshot. .. seealso:: - :external+boto3:py:meth:`RDS.Client.describe_db_snapshots` :param snapshot_id: The ID of the target DB instance snapshot :return: Returns the status of the DB snapshot as a string (eg. "available") :raises AirflowNotFoundException: If the DB instance...
python
providers/amazon/src/airflow/providers/amazon/aws/hooks/rds.py
53
[ "self", "snapshot_id" ]
str
true
1
6.4
apache/airflow
43,597
sphinx
false
getApplicationListeners
protected Collection<ApplicationListener<?>> getApplicationListeners() { synchronized (this.defaultRetriever) { return this.defaultRetriever.getApplicationListeners(); } }
Return a Collection containing all ApplicationListeners. @return a Collection of ApplicationListeners @see org.springframework.context.ApplicationListener
java
spring-context/src/main/java/org/springframework/context/event/AbstractApplicationEventMulticaster.java
173
[]
true
1
6.08
spring-projects/spring-framework
59,386
javadoc
false
fit_transform
def fit_transform(self, X, y=None, **params): """Fit the model from data in X and transform X. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) Training vector, where `n_samples` is the number of samples and `n_features` is t...
Fit the model from data in X and transform X. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) Training vector, where `n_samples` is the number of samples and `n_features` is the number of features. y : Ignored Not used, present for API consistency by convention. **p...
python
sklearn/decomposition/_kernel_pca.py
455
[ "self", "X", "y" ]
false
2
6.08
scikit-learn/scikit-learn
64,340
numpy
false
doSend
private void doSend(ClientRequest clientRequest, boolean isInternalRequest, long now, AbstractRequest request) { String destination = clientRequest.destination(); RequestHeader header = clientRequest.makeHeader(request.version()); if (log.isDebugEnabled()) { log.debug("Sending {} req...
Queue up the given request for sending. Requests can only be sent out to ready nodes. @param request The request @param now The current timestamp
java
clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
601
[ "clientRequest", "isInternalRequest", "now", "request" ]
void
true
2
7.04
apache/kafka
31,560
javadoc
false
unwrap
public static String unwrap(final String str, final char wrapChar) { if (isEmpty(str) || wrapChar == CharUtils.NUL || str.length() == 1) { return str; } if (str.charAt(0) == wrapChar && str.charAt(str.length() - 1) == wrapChar) { final int startIndex = 0; fina...
Unwraps a given string from a character. <pre> StringUtils.unwrap(null, null) = null StringUtils.unwrap(null, '\0') = null StringUtils.unwrap(null, '1') = null StringUtils.unwrap("a", 'a') = "a" StringUtils.unwrap("aa", 'a') = "" StringUtils.unwrap("\'abc\'", '\'') = "abc...
java
src/main/java/org/apache/commons/lang3/StringUtils.java
8,943
[ "str", "wrapChar" ]
String
true
6
7.76
apache/commons-lang
2,896
javadoc
false
isParenthesizedArrowFunctionExpression
function isParenthesizedArrowFunctionExpression(): Tristate { if (token() === SyntaxKind.OpenParenToken || token() === SyntaxKind.LessThanToken || token() === SyntaxKind.AsyncKeyword) { return lookAhead(isParenthesizedArrowFunctionExpressionWorker); } if (token() === SyntaxKind...
Reports a diagnostic error for the current token being an invalid name. @param blankDiagnostic Diagnostic to report for the case of the name being blank (matched tokenIfBlankName). @param nameDiagnostic Diagnostic to report for all other cases. @param tokenIfBlankName Current token if the name was invalid for being...
typescript
src/compiler/parser.ts
5,236
[]
true
5
6.88
microsoft/TypeScript
107,154
jsdoc
false
isStereotypeWithNameValue
protected boolean isStereotypeWithNameValue(String annotationType, Set<String> metaAnnotationTypes, Map<String, @Nullable Object> attributes) { boolean isStereotype = metaAnnotationTypes.contains(COMPONENT_ANNOTATION_CLASSNAME) || annotationType.equals("jakarta.inject.Named"); return (isStereotype && attri...
Check whether the given annotation is a stereotype that is allowed to suggest a component name through its {@code value()} attribute. @param annotationType the name of the annotation class to check @param metaAnnotationTypes the names of meta-annotations on the given annotation @param attributes the map of attributes f...
java
spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java
217
[ "annotationType", "metaAnnotationTypes", "attributes" ]
true
3
7.6
spring-projects/spring-framework
59,386
javadoc
false
tryAllocate
ByteBuffer tryAllocate(int sizeBytes);
Tries to acquire a ByteBuffer of the specified size @param sizeBytes size required @return a ByteBuffer (which later needs to be release()ed), or null if no memory available. the buffer will be of the exact size requested, even if backed by a larger chunk of memory
java
clients/src/main/java/org/apache/kafka/common/memory/MemoryPool.java
65
[ "sizeBytes" ]
ByteBuffer
true
1
6.32
apache/kafka
31,560
javadoc
false
trimToSize
public void trimToSize() { if (needsAllocArrays()) { return; } Set<E> delegate = delegateOrNull(); if (delegate != null) { Set<E> newDelegate = createHashFloodingResistantDelegate(size()); newDelegate.addAll(delegate); this.table = newDelegate; return; } int size = ...
Ensures that this {@code CompactHashSet} has the smallest representation in memory, given its current size.
java
android/guava/src/com/google/common/collect/CompactHashSet.java
626
[]
void
true
5
6.08
google/guava
51,352
javadoc
false
attributesFor
static @Nullable AnnotationAttributes attributesFor(AnnotatedTypeMetadata metadata, Class<?> annotationType) { return attributesFor(metadata, annotationType.getName()); }
Register all relevant annotation post processors in the given registry. @param registry the registry to operate on @param source the configuration source element (already extracted) that this registration was triggered from. May be {@code null}. @return a Set of BeanDefinitionHolders, containing all bean definitions th...
java
spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java
289
[ "metadata", "annotationType" ]
AnnotationAttributes
true
1
6.16
spring-projects/spring-framework
59,386
javadoc
false
render_template
def render_template(template: Any, context: MutableMapping[str, Any], *, native: bool) -> Any: """ Render a Jinja2 template with given Airflow context. The default implementation of ``jinja2.Template.render()`` converts the input context into dict eagerly many times, which triggers deprecation mess...
Render a Jinja2 template with given Airflow context. The default implementation of ``jinja2.Template.render()`` converts the input context into dict eagerly many times, which triggers deprecation messages in our custom context class. This takes the implementation apart and retain the context mapping without resolving ...
python
airflow-core/src/airflow/utils/helpers.py
235
[ "template", "context", "native" ]
Any
true
3
7.6
apache/airflow
43,597
sphinx
false
setAsText
@Override public void setAsText(@Nullable String text) { if (text == null) { setValue(null); } else { String value = text.trim(); if (this.charsToDelete != null) { value = StringUtils.deleteAny(value, this.charsToDelete); } if (this.emptyAsNull && value.isEmpty()) { setValue(null); } ...
Create a new StringTrimmerEditor. @param charsToDelete a set of characters to delete, in addition to trimming an input String. Useful for deleting unwanted line breaks: for example, "\r\n\f" will delete all new lines and line feeds in a String. @param emptyAsNull {@code true} if an empty String is to be transformed int...
java
spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringTrimmerEditor.java
65
[ "text" ]
void
true
5
6.88
spring-projects/spring-framework
59,386
javadoc
false