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
size
long size() { return MINIMUM_SIZE + fileNameLength() + extraFieldLength() + fileCommentLength(); }
Return the size of this record. @return the record size
java
loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/ZipCentralDirectoryFileHeaderRecord.java
74
[]
true
1
6.8
spring-projects/spring-boot
79,428
javadoc
false
ensureCoordinatorReady
protected synchronized boolean ensureCoordinatorReady(final Timer timer) { return ensureCoordinatorReady(timer, false); }
Ensure that the coordinator is ready to receive requests. @param timer Timer bounding how long this method can block @return true If coordinator discovery and initial connection succeeded, false otherwise
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
269
[ "timer" ]
true
1
6.64
apache/kafka
31,560
javadoc
false
equals
@Override public boolean equals(final Object obj) { if (obj == this) { return true; } if (obj instanceof Triple<?, ?, ?>) { final Triple<?, ?, ?> other = (Triple<?, ?, ?>) obj; return Objects.equals(getLeft(), other.getLeft()) && Objects.eq...
Compares this triple to another based on the three elements. @param obj the object to compare to, null returns false. @return true if the elements of the triple are equal.
java
src/main/java/org/apache/commons/lang3/tuple/Triple.java
128
[ "obj" ]
true
5
8.24
apache/commons-lang
2,896
javadoc
false
assert_allclose_dense_sparse
def assert_allclose_dense_sparse(x, y, rtol=1e-07, atol=1e-9, err_msg=""): """Assert allclose for sparse and dense data. Both x and y need to be either sparse or dense, they can't be mixed. Parameters ---------- x : {array-like, sparse matrix} First array to compare. y : {array-li...
Assert allclose for sparse and dense data. Both x and y need to be either sparse or dense, they can't be mixed. Parameters ---------- x : {array-like, sparse matrix} First array to compare. y : {array-like, sparse matrix} Second array to compare. rtol : float, default=1e-07 relative tolerance; see numpy...
python
sklearn/utils/_testing.py
244
[ "x", "y", "rtol", "atol", "err_msg" ]
false
6
6.24
scikit-learn/scikit-learn
64,340
numpy
false
isListOpener
function isListOpener(token: Node | undefined): token is Node { const kind = token && token.kind; return kind === SyntaxKind.OpenBraceToken || kind === SyntaxKind.OpenBracketToken || kind === SyntaxKind.OpenParenToken || kind === SyntaxKind.JsxOpeningElement; }
Splits sibling nodes into up to four partitions: 1) everything left of the first node matched by `pivotOn`, 2) the first node matched by `pivotOn`, 3) everything right of the first node matched by `pivotOn`, 4) a trailing semicolon, if `separateTrailingSemicolon` is enabled. The left and right groups, if not empty...
typescript
src/services/smartSelection.ts
344
[ "token" ]
false
5
6.08
microsoft/TypeScript
107,154
jsdoc
false
registerCustomEditor
public void registerCustomEditor(Class<?> requiredType, PropertyEditor propertyEditor) { TypeConverter converter = getTypeConverter(); if (!(converter instanceof PropertyEditorRegistry registry)) { throw new IllegalStateException( "TypeConverter does not implement PropertyEditorRegistry interface: " + conve...
Register the given custom property editor for all properties of the given type. <p>Typically used in conjunction with the default {@link org.springframework.beans.SimpleTypeConverter}; will work with any TypeConverter that implements the PropertyEditorRegistry interface as well. @param requiredType type of the property...
java
spring-beans/src/main/java/org/springframework/beans/support/ArgumentConvertingMethodInvoker.java
98
[ "requiredType", "propertyEditor" ]
void
true
2
6.08
spring-projects/spring-framework
59,386
javadoc
false
init_RISCV_64Bit
private static void init_RISCV_64Bit() { addProcessors(new Processor(Processor.Arch.BIT_64, Processor.Type.RISC_V), "riscv64"); }
Gets a {@link Processor} object the given value {@link String}. The {@link String} must be like a value returned by the {@code "os.arch"} system property. @param value A {@link String} like a value returned by the {@code os.arch} System Property. @return A {@link Processor} when it exists, else {@code null}.
java
src/main/java/org/apache/commons/lang3/ArchUtils.java
127
[]
void
true
1
6.96
apache/commons-lang
2,896
javadoc
false
getMessageInternal
protected @Nullable String getMessageInternal(@Nullable String code, Object @Nullable [] args, @Nullable Locale locale) { if (code == null) { return null; } if (locale == null) { locale = Locale.getDefault(); } Object[] argsToUse = args; if (!isAlwaysUseMessageFormat() && ObjectUtils.isEmpty(args)) {...
Resolve the given code and arguments as message in the given Locale, returning {@code null} if not found. Does <i>not</i> fall back to the code as default message. Invoked by {@code getMessage} methods. @param code the code to lookup up, such as 'calculator.noRateSet' @param args array of arguments that will be filled ...
java
spring-context/src/main/java/org/springframework/context/support/AbstractMessageSource.java
205
[ "code", "args", "locale" ]
String
true
9
8.08
spring-projects/spring-framework
59,386
javadoc
false
replaceIn
public boolean replaceIn(final StrBuilder source, final int offset, final int length) { if (source == null) { return false; } return substitute(source, offset, length); }
Replaces all the occurrences of variables within the given source builder with their matching values from the resolver. <p> Only the specified portion of the builder will be processed. The rest of the builder is not processed, but it is not deleted. </p> @param source the builder to replace in, null returns zero. @par...
java
src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java
749
[ "source", "offset", "length" ]
true
2
8.24
apache/commons-lang
2,896
javadoc
false
getCacheKey
protected Object getCacheKey(Class<?> beanClass, @Nullable String beanName) { if (StringUtils.hasLength(beanName)) { return new ComposedCacheKey(beanClass, beanName); } else { return beanClass; } }
Build a cache key for the given bean class and bean name. <p>Note: As of 7.0.2, this implementation returns a composed cache key for bean class plus bean name; or if no bean name specified, then the given bean {@code Class} as-is. @param beanClass the bean class @param beanName the bean name @return the cache key for t...
java
spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java
305
[ "beanClass", "beanName" ]
Object
true
2
7.92
spring-projects/spring-framework
59,386
javadoc
false
thumbprint
def thumbprint(jwk: dict[str, Any], hashalg=hashes.SHA256()) -> str: """ Return the key thumbprint as specified by RFC 7638. :param hashalg: A hash function (defaults to SHA256) :return: A base64url encoded digest of the key """ digest = hashes.Hash(hashalg, backend=default_backend()) json...
Return the key thumbprint as specified by RFC 7638. :param hashalg: A hash function (defaults to SHA256) :return: A base64url encoded digest of the key
python
airflow-core/src/airflow/api_fastapi/auth/tokens.py
495
[ "jwk", "hashalg" ]
str
true
1
7.04
apache/airflow
43,597
sphinx
false
supportsSkippingAssignment
public static boolean supportsSkippingAssignment(int apiVersion) { return apiVersion >= 9; }
Starting from version 9 of the JoinGroup API, static members are able to skip running the assignor based on the `SkipAssignment` field. We leverage this to tell the leader that it is the leader of the group but by skipping running the assignor while the group is in stable state. Notes: 1) This allows the leader to cont...
java
clients/src/main/java/org/apache/kafka/common/requests/JoinGroupRequest.java
153
[ "apiVersion" ]
true
1
6.64
apache/kafka
31,560
javadoc
false
send
public void send(NetworkSend send) { String connectionId = send.destinationId(); KafkaChannel channel = openOrClosingChannelOrFail(connectionId); if (closingChannels.containsKey(connectionId)) { // ensure notification via `disconnected`, leave channel in the state in which closing wa...
Queue the given request for sending in the subsequent {@link #poll(long)} calls @param send The request to send
java
clients/src/main/java/org/apache/kafka/common/network/Selector.java
391
[ "send" ]
void
true
4
6.72
apache/kafka
31,560
javadoc
false
_validate_queue_type
def _validate_queue_type(self, queue_type: Optional[str]) -> None: """Validate the queue type configuration. Args: queue_type: The configured queue type Raises: ValueError: If queue type is invalid """ if not queue_type: raise ValueError("bro...
Validate the queue type configuration. Args: queue_type: The configured queue type Raises: ValueError: If queue type is invalid
python
celery/worker/consumer/delayed_delivery.py
258
[ "self", "queue_type" ]
None
true
3
6.24
celery/celery
27,741
google
false
openBufferedStream
public Writer openBufferedStream() throws IOException { Writer writer = openStream(); return (writer instanceof BufferedWriter) ? (BufferedWriter) writer : new BufferedWriter(writer); }
Opens a new buffered {@link Writer} for writing to this sink. The returned stream is not required to be a {@link BufferedWriter} in order to allow implementations to simply delegate to {@link #openStream()} when the stream returned by that method does not benefit from additional buffering. This method returns a new, in...
java
android/guava/src/com/google/common/io/CharSink.java
82
[]
Writer
true
2
6.72
google/guava
51,352
javadoc
false
fire
public L fire() { return proxy; }
Returns a proxy object which can be used to call listener methods on all of the registered event listeners. All calls made to this proxy will be forwarded to all registered listeners. @return a proxy object which can be used to call listener methods on all of the registered event listeners
java
src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java
276
[]
L
true
1
6.8
apache/commons-lang
2,896
javadoc
false
handleCompletedReceives
private void handleCompletedReceives(List<ClientResponse> responses, long now) { for (NetworkReceive receive : this.selector.completedReceives()) { String source = receive.source(); InFlightRequest req = inFlightRequests.completeNext(source); AbstractResponse response = pars...
Handle any completed receives and update the response list with the responses received. @param responses The list of responses to update @param now The current time
java
clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
994
[ "responses", "now" ]
void
true
11
7.04
apache/kafka
31,560
javadoc
false
fromstring
def fromstring(datastring, dtype=None, shape=None, offset=0, formats=None, names=None, titles=None, aligned=False, byteorder=None): r"""Create a record array from binary data Note that despite the name of this function it does not accept `str` instances. Parameters ---------- da...
r"""Create a record array from binary data Note that despite the name of this function it does not accept `str` instances. Parameters ---------- datastring : bytes-like Buffer of binary data dtype : data-type, optional Valid dtype for all arrays shape : int or tuple of ints, optional Shape of each array. ...
python
numpy/_core/records.py
753
[ "datastring", "dtype", "shape", "offset", "formats", "names", "titles", "aligned", "byteorder" ]
false
6
7.44
numpy/numpy
31,054
numpy
false
forEach
function forEach(collection, iteratee) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, getIteratee(iteratee, 3)); }
Iterates over elements of `collection` and invokes `iteratee` for each element. The iteratee is invoked with three arguments: (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning `false`. **Note:** As with other "Collections" methods, objects with a "length" property are i...
javascript
lodash.js
9,447
[ "collection", "iteratee" ]
false
2
6.96
lodash/lodash
61,490
jsdoc
false
prepare_key
def prepare_key( gm: torch.fx.GraphModule, example_inputs: Sequence[InputType], fx_kwargs: _CompileFxKwargs, inputs_to_check: Sequence[int], remote: bool, ) -> tuple[tuple[str, list[str]] | None, dict[str, Any]]: """ Checks that the inductor input is cacheable...
Checks that the inductor input is cacheable, then computes and returns the cache key for the input. Returns (key_info, cache_info) where: - key_info is (hash_key, debug_lines), and - cache_info will contain debug info in the event of BypassFxGraphCache. NB: It is possible to have this function return a union instead. ...
python
torch/_inductor/codecache.py
1,498
[ "gm", "example_inputs", "fx_kwargs", "inputs_to_check", "remote" ]
tuple[tuple[str, list[str]] | None, dict[str, Any]]
true
2
6.88
pytorch/pytorch
96,034
unknown
false
getPointOfLeastRelativeError
public static double getPointOfLeastRelativeError(long bucketIndex, int scale) { checkIndexAndScaleBounds(bucketIndex, scale); double histogramBase = Math.pow(2, Math.scalb(1, -scale)); if (Double.isFinite(histogramBase)) { double upperBound = getUpperBucketBoundary(bucketIndex, scal...
For a bucket with the given index, computes the point {@code x} in the bucket such that {@code (x - l) / l} equals {@code (u - x) / u}, where {@code l} is the lower bucket boundary and {@code u} is the upper bucket boundary. <br> In other words, we select the point in the bucket that has the least relative error with r...
java
libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialScaleUtils.java
245
[ "bucketIndex", "scale" ]
true
3
8.08
elastic/elasticsearch
75,680
javadoc
false
registerBeanDefinitions
public int registerBeanDefinitions(Map<?, ?> map, @Nullable String prefix) throws BeansException { return registerBeanDefinitions(map, prefix, "Map " + map); }
Register bean definitions contained in a Map. Ignore ineligible properties. @param map a map of {@code name} to {@code property} (String or Object). Property values will be strings if coming from a Properties file etc. Property names (keys) <b>must</b> be Strings. Class keys must be Strings. @param prefix a filter with...
java
spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java
338
[ "map", "prefix" ]
true
1
6.8
spring-projects/spring-framework
59,386
javadoc
false
equals
@Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final Generation that = (Generation) o; return generationId == that.generationId && Objects.equals(memberId...
@return true if this generation has a valid member id, false otherwise. A member might have an id before it becomes part of a group generation.
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
1,610
[ "o" ]
true
6
7.04
apache/kafka
31,560
javadoc
false
asRunnable
public static Runnable asRunnable(final FailableRunnable<?> runnable) { return () -> run(runnable); }
Converts the given {@link FailableRunnable} into a standard {@link Runnable}. @param runnable a {@link FailableRunnable} @return a standard {@link Runnable} @since 3.10
java
src/main/java/org/apache/commons/lang3/Functions.java
439
[ "runnable" ]
Runnable
true
1
6.16
apache/commons-lang
2,896
javadoc
false
is_due
def is_due(self, last_run_at: datetime) -> tuple[bool, datetime]: """Return tuple of ``(is_due, next_time_to_run)``. Note: next time to run is in seconds. See Also: :meth:`celery.schedules.schedule.is_due` for more information. """ rem_delta = self.remai...
Return tuple of ``(is_due, next_time_to_run)``. Note: next time to run is in seconds. See Also: :meth:`celery.schedules.schedule.is_due` for more information.
python
celery/schedules.py
863
[ "self", "last_run_at" ]
tuple[bool, datetime]
true
2
6.4
celery/celery
27,741
unknown
false
get_window_bounds
def get_window_bounds( self, num_values: int = 0, min_periods: int | None = None, center: bool | None = None, closed: str | None = None, step: int | None = None, ) -> tuple[np.ndarray, np.ndarray]: """ Computes the bounds of a window. Paramete...
Computes the bounds of a window. Parameters ---------- num_values : int, default 0 number of values that will be aggregated over window_size : int, default 0 the number of rows in a window min_periods : int, default None min_periods passed from the top level rolling API center : bool, default None cent...
python
pandas/core/indexers/objects.py
111
[ "self", "num_values", "min_periods", "center", "closed", "step" ]
tuple[np.ndarray, np.ndarray]
true
6
6.4
pandas-dev/pandas
47,362
numpy
false
map
private static <T, R, E extends Throwable> R[] map(final T[] array, final Class<R> componentType, final FailableFunction<? super T, ? extends R, E> mapper) throws E { return ArrayFill.fill(newInstance(componentType, array.length), i -> mapper.apply(array[i])); }
Maps elements from an array into elements of a new array of a given type, while mapping old elements to new elements. @param <T> The input array type. @param <R> The output array type. @param <E> The type of exceptions thrown when the mapper function fails. @param array The input a...
java
src/main/java/org/apache/commons/lang3/ArrayUtils.java
4,220
[ "array", "componentType", "mapper" ]
true
1
6.8
apache/commons-lang
2,896
javadoc
false
take
def take( self, indices: TakeIndexer, **kwargs, ) -> Series: """ Return the elements in the given *positional* indices in each group. This means that we are not indexing according to actual values in the index attribute of the object. We are indexing accordin...
Return the elements in the given *positional* indices in each group. This means that we are not indexing according to actual values in the index attribute of the object. We are indexing according to the actual position of the element in the object. If a requested index does not exist for some group, this method will ...
python
pandas/core/groupby/generic.py
1,287
[ "self", "indices" ]
Series
true
1
7.2
pandas-dev/pandas
47,362
numpy
false
getLayer
std::string getLayer() const { std::size_t q=name.rfind('.'); if( q==name.npos ) { return ""; } return name.substr(0,q); }
< name used in headers: in singlepart mode, may contain viewname
cpp
3rdparty/openexr/IlmImf/ImfPartHelper.h
86
[]
true
2
6.56
opencv/opencv
85,374
doxygen
false
indexesOf
public static BitSet indexesOf(final boolean[] array, final boolean valueToFind) { return indexesOf(array, valueToFind, 0); }
Finds the indices of the given value in the array. <p> This method returns an empty BitSet for a {@code null} input array. </p> @param array the array to search for the object, may be {@code null}. @param valueToFind the value to find. @return a BitSet of all the indices of the value within the array, an empty BitSe...
java
src/main/java/org/apache/commons/lang3/ArrayUtils.java
1,895
[ "array", "valueToFind" ]
BitSet
true
1
6.8
apache/commons-lang
2,896
javadoc
false
rewriteExprFromNumberToTime
std::string rewriteExprFromNumberToTime( const ast_matchers::MatchFinder::MatchResult &Result, DurationScale Scale, const Expr *Node) { const Expr &RootNode = *Node->IgnoreParenImpCasts(); // First check to see if we can undo a complementary function call. if (std::optional<std::string> MaybeRewrite = ...
Returns `true` if `Node` is a value which evaluates to a literal `0`.
cpp
clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
240
[ "Scale" ]
true
3
6
llvm/llvm-project
36,021
doxygen
false
resolveConstructorArguments
private ConstructorArgumentValues resolveConstructorArguments( BeanDefinitionValueResolver valueResolver, ConstructorArgumentValues constructorArguments) { ConstructorArgumentValues resolvedConstructorArguments = new ConstructorArgumentValues(); for (Map.Entry<Integer, ConstructorArgumentValues.ValueHolder> ent...
Resolve arguments for the specified registered bean. @param registeredBean the registered bean @return the resolved constructor or factory method arguments
java
spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanInstanceSupplier.java
305
[ "valueResolver", "constructorArguments" ]
ConstructorArgumentValues
true
1
6.08
spring-projects/spring-framework
59,386
javadoc
false
resolveProfileSpecific
default List<R> resolveProfileSpecific(ConfigDataLocationResolverContext context, ConfigDataLocation location, Profiles profiles) throws ConfigDataLocationNotFoundException { return Collections.emptyList(); }
Resolve a {@link ConfigDataLocation} into one or more {@link ConfigDataResource} instances based on available profiles. This method is called once profiles have been deduced from the contributed values. By default this method returns an empty list. @param context the location resolver context @param location the locati...
java
core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLocationResolver.java
90
[ "context", "location", "profiles" ]
true
1
6.16
spring-projects/spring-boot
79,428
javadoc
false
combine
@CanIgnoreReturnValue Builder<E> combine(Builder<E> other) { addAll(other.contents, other.size); return this; }
Adds each element of {@code elements} to the {@code ImmutableList}. @param elements the {@code Iterator} to add to the {@code ImmutableList} @return this {@code Builder} object @throws NullPointerException if {@code elements} is null or contains a null element
java
android/guava/src/com/google/common/collect/ImmutableList.java
835
[ "other" ]
true
1
6.56
google/guava
51,352
javadoc
false
commitSyncExceptionForError
private Throwable commitSyncExceptionForError(Throwable error) { if (error instanceof StaleMemberEpochException) { return new CommitFailedException("OffsetCommit failed with stale member epoch. " + Errors.STALE_MEMBER_EPOCH.message()); } return error; }
Commit offsets, retrying on expected retriable errors while the retry timeout hasn't expired. @param offsets Offsets to commit @param deadlineMs Time until which the request will be retried if it fails with an expected retriable error. @return Future that will complete when a successful response
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java
488
[ "error" ]
Throwable
true
2
7.76
apache/kafka
31,560
javadoc
false
_select
def _select(readers=None, writers=None, err=None, timeout=0, poll=_select_imp): """Simple wrapper to :class:`~select.select`, using :`~select.poll`. Arguments: readers (Set[Fd]): Set of reader fds to test if readable. writers (Set[Fd]): Set of writer fds to test if writable. ...
Simple wrapper to :class:`~select.select`, using :`~select.poll`. Arguments: readers (Set[Fd]): Set of reader fds to test if readable. writers (Set[Fd]): Set of writer fds to test if writable. err (Set[Fd]): Set of fds to test for error condition. All fd sets passed must be mutable as this function will r...
python
celery/concurrency/asynpool.py
150
[ "readers", "writers", "err", "timeout", "poll" ]
false
9
7.28
celery/celery
27,741
google
false
suspend
public void suspend() { if (runningState != State.RUNNING) { throw new IllegalStateException("Stopwatch must be running to suspend."); } stopTimeNanos = System.nanoTime(); stopInstant = Instant.now(); runningState = State.SUSPENDED; }
Suspends this StopWatch for later resumption. <p> This method suspends the watch until it is resumed. The watch will not include time between the suspend and resume calls in the total time. </p> @throws IllegalStateException if this StopWatch is not currently running.
java
src/main/java/org/apache/commons/lang3/time/StopWatch.java
779
[]
void
true
2
6.88
apache/commons-lang
2,896
javadoc
false
visitor
function visitor(node: Node): VisitResult<Node | undefined> { return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ false) : node; }
Restores the `HierarchyFacts` for this node's ancestor after visiting this node's subtree, propagating specific facts from the subtree. @param ancestorFacts The `HierarchyFacts` of the ancestor to restore after visiting the subtree. @param excludeFacts The existing `HierarchyFacts` of the subtree that should not be ...
typescript
src/compiler/transformers/es2015.ts
601
[ "node" ]
true
2
6.16
microsoft/TypeScript
107,154
jsdoc
false
dump
def dump(obj, fp): '''Serialize an object representing the ARFF document to a given file-like object. :param obj: a dictionary. :param fp: a file-like object. ''' encoder = ArffEncoder() generator = encoder.iter_encode(obj) last_row = next(generator) for row in generator: f...
Serialize an object representing the ARFF document to a given file-like object. :param obj: a dictionary. :param fp: a file-like object.
python
sklearn/externals/_arff.py
1,081
[ "obj", "fp" ]
false
2
6.24
scikit-learn/scikit-learn
64,340
sphinx
false
awaitWakeup
void awaitWakeup(Timer timer) { try { lock.lock(); while (!wokenup.compareAndSet(true, false)) { // Update the timer before we head into the loop in case it took a while to get the lock. timer.update(); if (timer.isExpired()) { ...
Allows the caller to await a response from the broker for requested data. The method will block, returning only under one of the following conditions: <ol> <li>The buffer was already woken</li> <li>The buffer was woken during the wait</li> <li>The remaining time on the {@link Timer timer} elapsed</li> <...
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchBuffer.java
165
[ "timer" ]
void
true
6
6.24
apache/kafka
31,560
javadoc
false
mapKeys
function mapKeys(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, iteratee(value, key, object), value); }); return result; }
The opposite of `_.mapValues`; this method creates an object with the same values as `object` and keys generated by running each own enumerable string keyed property of `object` thru `iteratee`. The iteratee is invoked with three arguments: (value, key, object). @static @memberOf _ @since 3.8.0 @category Object @param ...
javascript
lodash.js
13,465
[ "object", "iteratee" ]
false
1
6.32
lodash/lodash
61,490
jsdoc
false
readCandidateConfigurations
private static List<String> readCandidateConfigurations(URL url) { try (BufferedReader reader = new BufferedReader( new InputStreamReader(new UrlResource(url).getInputStream(), StandardCharsets.UTF_8))) { List<String> candidates = new ArrayList<>(); String line; while ((line = reader.readLine()) != null)...
Loads the names of import candidates from the classpath. The names of the import candidates are stored in files named {@code META-INF/spring/full-qualified-annotation-name.imports} on the classpath. Every line contains the full qualified name of the candidate class. Comments are supported using the # character. @param ...
java
core/spring-boot/src/main/java/org/springframework/boot/context/annotation/ImportCandidates.java
110
[ "url" ]
true
4
7.6
spring-projects/spring-boot
79,428
javadoc
false
shutdown
public void shutdown() throws IOException { if (currentUsages.updateAndGet(u -> -1 - u) == -1) { doShutdown(); } }
Prepares the database for lookup by incrementing the usage count. If the usage count is already negative, it indicates that the database is being closed, and this method will return false to indicate that no lookup should be performed. @return true if the database is ready for lookup, false if it is being closed
java
modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/DatabaseReaderLazyLoader.java
149
[]
void
true
2
8.08
elastic/elasticsearch
75,680
javadoc
false
checkAborted
function checkAborted(signal, callback) { if (signal?.aborted) { callback(new AbortError(undefined, { cause: signal.reason })); return true; } return false; }
Synchronously tests whether or not the given path exists. @param {string | Buffer | URL} path @returns {boolean}
javascript
lib/fs.js
335
[ "signal", "callback" ]
false
2
6.24
nodejs/node
114,839
jsdoc
false
getProperty
@Override public @Nullable Object getProperty(String name) { Object value = super.getProperty(name); if (value instanceof OriginTrackedValue originTrackedValue) { return originTrackedValue.getValue(); } return value; }
Create a new {@link OriginTrackedMapPropertySource} instance. @param name the property source name @param source the underlying map source @param immutable if the underlying source is immutable and guaranteed not to change @since 2.2.0
java
core/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedMapPropertySource.java
65
[ "name" ]
Object
true
2
6.4
spring-projects/spring-boot
79,428
javadoc
false
postProcessBeforeInitialization
@Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof LoadTimeWeaverAware loadTimeWeaverAware) { LoadTimeWeaver ltw = this.loadTimeWeaver; if (ltw == null) { Assert.state(this.beanFactory != null, "BeanFactory required if no ...
Create a new {@code LoadTimeWeaverAwareProcessor}. <p>The {@code LoadTimeWeaver} will be auto-retrieved from the given {@link BeanFactory}, expecting a bean named {@link ConfigurableApplicationContext#LOAD_TIME_WEAVER_BEAN_NAME "loadTimeWeaver"}. @param beanFactory the BeanFactory to retrieve the LoadTimeWeaver from
java
spring-context/src/main/java/org/springframework/context/weaving/LoadTimeWeaverAwareProcessor.java
92
[ "bean", "beanName" ]
Object
true
3
6.08
spring-projects/spring-framework
59,386
javadoc
false
add
private void add(ExponentialHistogram toAdd, boolean allowUpscaling) { ExponentialHistogram a = result == null ? ExponentialHistogram.empty() : result; ExponentialHistogram b = toAdd; CopyableBucketIterator posBucketsA = a.positiveBuckets().iterator(); CopyableBucketIterator negBucketsA...
Merges the given histogram into the current result. The histogram might be upscaled if needed. @param toAdd the histogram to merge
java
libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialHistogramMerger.java
196
[ "toAdd", "allowUpscaling" ]
void
true
8
6.8
elastic/elasticsearch
75,680
javadoc
false
toString
@Override public String toString() { return (!isNested()) ? path().toString() : path() + "[" + nestedEntryName() + "]"; }
Return if this is the source of a nested zip. @return if this is for a nested zip
java
loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/ZipContent.java
435
[]
String
true
2
7.84
spring-projects/spring-boot
79,428
javadoc
false
indexOfDifference
public static int indexOfDifference(final CharSequence cs1, final CharSequence cs2) { if (cs1 == cs2) { return INDEX_NOT_FOUND; } if (cs1 == null || cs2 == null) { return 0; } int i; for (i = 0; i < cs1.length() && i < cs2.length(); ++i) { ...
Compares two CharSequences, and returns the index at which the CharSequences begin to differ. <p> For example, {@code indexOfDifference("i am a machine", "i am a robot") -> 7} </p> <pre> StringUtils.indexOfDifference(null, null) = -1 StringUtils.indexOfDifference("", "") = -1 StringUtils.indexOfDifferen...
java
src/main/java/org/apache/commons/lang3/StringUtils.java
3,022
[ "cs1", "cs2" ]
true
9
7.44
apache/commons-lang
2,896
javadoc
false
invokeExactMethod
public static Object invokeExactMethod(final Object object, final String methodName) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { return invokeExactMethod(object, methodName, ArrayUtils.EMPTY_OBJECT_ARRAY, null); }
Invokes a method whose parameter types match exactly the object type. <p> This uses reflection to invoke the method obtained from a call to {@link #getAccessibleMethod(Class, String, Class[])}. </p> @param object invoke method on this object. @param methodName get method with this name. @return The value returned b...
java
src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
559
[ "object", "methodName" ]
Object
true
1
6.16
apache/commons-lang
2,896
javadoc
false
newNestedPropertyAccessor
@Override protected BeanWrapperImpl newNestedPropertyAccessor(Object object, String nestedPath) { return new BeanWrapperImpl(object, nestedPath, this); }
Convert the given value for the specified property to the latter's type. <p>This method is only intended for optimizations in a BeanFactory. Use the {@code convertIfNecessary} methods for programmatic conversion. @param value the value to convert @param propertyName the target property (note that nested or indexed prop...
java
spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java
197
[ "object", "nestedPath" ]
BeanWrapperImpl
true
1
6.16
spring-projects/spring-framework
59,386
javadoc
false
set
private static Date set(final Date date, final int calendarField, final int amount) { validateDateNotNull(date); // getInstance() returns a new object, so this method is thread safe. final Calendar c = Calendar.getInstance(); c.setLenient(false); c.setTime(date); c.set(ca...
Sets the specified field to a date returning a new object. This does not use a lenient calendar. The original {@link Date} is unchanged. @param date the date, not null. @param calendarField the {@link Calendar} field to set the amount to. @param amount the amount to set. @return a new {@link Date} set with the specif...
java
src/main/java/org/apache/commons/lang3/time/DateUtils.java
1,484
[ "date", "calendarField", "amount" ]
Date
true
1
7.04
apache/commons-lang
2,896
javadoc
false
_make_validation_split
def _make_validation_split(self, y, sample_mask): """Split the dataset between training set and validation set. Parameters ---------- y : ndarray of shape (n_samples, ) Target values. sample_mask : ndarray of shape (n_samples, ) A boolean array indicatin...
Split the dataset between training set and validation set. Parameters ---------- y : ndarray of shape (n_samples, ) Target values. sample_mask : ndarray of shape (n_samples, ) A boolean array indicating whether each sample should be included for validation set. Returns ------- validation_mask : ndarray o...
python
sklearn/linear_model/_stochastic_gradient.py
280
[ "self", "y", "sample_mask" ]
false
7
6.08
scikit-learn/scikit-learn
64,340
numpy
false
repmat
def repmat(a, m, n): """ Repeat a 0-D to 2-D array or matrix MxN times. Parameters ---------- a : array_like The array or matrix to be repeated. m, n : int The number of times `a` is repeated along the first and second axes. Returns ------- out : ndarray The...
Repeat a 0-D to 2-D array or matrix MxN times. Parameters ---------- a : array_like The array or matrix to be repeated. m, n : int The number of times `a` is repeated along the first and second axes. Returns ------- out : ndarray The result of repeating `a`. Examples -------- >>> import numpy.matlib >>> ...
python
numpy/matlib.py
332
[ "a", "m", "n" ]
false
4
7.52
numpy/numpy
31,054
numpy
false
of
public static <T> Range<T> of(final T fromInclusive, final T toInclusive, final Comparator<T> comparator) { return new Range<>(fromInclusive, toInclusive, comparator); }
Creates a range with the specified minimum and maximum values (both inclusive). <p>The range uses the specified {@link Comparator} to determine where values lie in the range.</p> <p>The arguments may be passed in the order (min,max) or (max,min). The getMinimum and getMaximum methods will return the correct values.</p>...
java
src/main/java/org/apache/commons/lang3/Range.java
184
[ "fromInclusive", "toInclusive", "comparator" ]
true
1
6.64
apache/commons-lang
2,896
javadoc
false
format
def format(self, name: str, roffset=True) -> str: """ Codegen a call to tl.make_tensor_descriptor() Args: name: variable name for pointer roffset: unused, but kept for compatibility with BlockPtrOptions.format() Returns: "tl.make_tensor_descriptor(.....
Codegen a call to tl.make_tensor_descriptor() Args: name: variable name for pointer roffset: unused, but kept for compatibility with BlockPtrOptions.format() Returns: "tl.make_tensor_descriptor(...)"
python
torch/_inductor/codegen/triton.py
650
[ "self", "name", "roffset" ]
str
true
2
7.12
pytorch/pytorch
96,034
google
false
identity
static <E extends Throwable> FailableIntUnaryOperator<E> identity() { return t -> t; }
Returns a unary operator that always returns its input argument. @param <E> The kind of thrown exception or error. @return a unary operator that always returns its input argument
java
src/main/java/org/apache/commons/lang3/function/FailableIntUnaryOperator.java
41
[]
true
1
6.8
apache/commons-lang
2,896
javadoc
false
_should_be_skipped_or_marked
def _should_be_skipped_or_marked( estimator, check, expected_failed_checks: dict[str, str] | None = None ) -> tuple[bool, str]: """Check whether a check should be skipped or marked as xfail. Parameters ---------- estimator : estimator object Estimator instance for which to generate checks. ...
Check whether a check should be skipped or marked as xfail. Parameters ---------- estimator : estimator object Estimator instance for which to generate checks. check : partial or callable Check to be marked. expected_failed_checks : dict[str, str], default=None Dictionary of the form {check_name: reason} f...
python
sklearn/utils/estimator_checks.py
481
[ "estimator", "check", "expected_failed_checks" ]
tuple[bool, str]
true
3
6.88
scikit-learn/scikit-learn
64,340
numpy
false
applyTo
public static void applyTo(ConfigurableEnvironment environment, @Nullable ResourceLoader resourceLoader, @Nullable ConfigurableBootstrapContext bootstrapContext, Collection<String> additionalProfiles) { DeferredLogFactory logFactory = Supplier::get; bootstrapContext = (bootstrapContext != null) ? bootstrapContex...
Apply {@link ConfigData} post-processing to an existing {@link Environment}. This method can be useful when working with an {@link Environment} that has been created directly and not necessarily as part of a {@link SpringApplication}. @param environment the environment to apply {@link ConfigData} to @param resourceLoad...
java
core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessor.java
141
[ "environment", "resourceLoader", "bootstrapContext", "additionalProfiles" ]
void
true
2
6.08
spring-projects/spring-boot
79,428
javadoc
false
getAdvice
@Override public Advice getAdvice() { Advice advice = this.advice; if (advice != null) { return advice; } Assert.state(this.adviceBeanName != null, "'adviceBeanName' must be specified"); Assert.state(this.beanFactory != null, "BeanFactory must be set to resolve 'adviceBeanName'"); if (this.beanFactory...
Specify a particular instance of the target advice directly, avoiding lazy resolution in {@link #getAdvice()}. @since 3.1
java
spring-aop/src/main/java/org/springframework/aop/support/AbstractBeanFactoryPointcutAdvisor.java
89
[]
Advice
true
4
6.24
spring-projects/spring-framework
59,386
javadoc
false
argmin
def argmin(self, axis=None, fill_value=None, out=None, *, keepdims=np._NoValue): """ Return array of indices to the minimum values along the given axis. Parameters ---------- axis : {None, integer} If None, the index is into the flattened array, other...
Return array of indices to the minimum values along the given axis. Parameters ---------- axis : {None, integer} If None, the index is into the flattened array, otherwise along the specified axis fill_value : scalar or None, optional Value used to fill in the masked values. If None, the output of mini...
python
numpy/ma/core.py
5,685
[ "self", "axis", "fill_value", "out", "keepdims" ]
false
3
7.52
numpy/numpy
31,054
numpy
false
firstNonEmpty
@SafeVarargs public static <T extends CharSequence> T firstNonEmpty(final T... values) { if (values != null) { for (final T val : values) { if (isNotEmpty(val)) { return val; } } } return null; }
Returns the first value in the array which is not empty. <p> If all values are empty or the array is {@code null} or empty then {@code null} is returned. </p> <pre> StringUtils.firstNonEmpty(null, null, null) = null StringUtils.firstNonEmpty(null, null, "") = null StringUtils.firstNonEmpty(null, "", " ") = "...
java
src/main/java/org/apache/commons/lang3/StringUtils.java
1,930
[]
T
true
3
7.76
apache/commons-lang
2,896
javadoc
false
numResidentSends
int numResidentSends() { int count = 0; if (current != null) count += 1; count += sendQueue.size(); return count; }
Construct a MultiRecordsSend from a queue of Send objects. The queue will be consumed as the MultiRecordsSend progresses (on completion, it will be empty).
java
clients/src/main/java/org/apache/kafka/common/record/MultiRecordsSend.java
73
[]
true
2
6.72
apache/kafka
31,560
javadoc
false
bind
@Nullable Object bind(ConfigurationPropertyName name, Bindable<?> target, @Nullable ConfigurationPropertySource source);
Bind the given name to a target bindable using optionally limited to a single source. @param name the name to bind @param target the target bindable @param source the source of the elements or {@code null} to use all sources @return a bound object or {@code null}
java
core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AggregateElementBinder.java
52
[ "name", "target", "source" ]
Object
true
1
6.64
spring-projects/spring-boot
79,428
javadoc
false
get_autotune_deletion_call
def get_autotune_deletion_call() -> str: """After all the autotune kernel calls have been written (i.e. self.kernel_autotune_example_args is complete), returns a deletion call for all autotune example tensors that are unnecessary after kernel_name is calle...
After all the autotune kernel calls have been written (i.e. self.kernel_autotune_example_args is complete), returns a deletion call for all autotune example tensors that are unnecessary after kernel_name is called.
python
torch/_inductor/codegen/wrapper.py
2,956
[]
str
true
2
6.56
pytorch/pytorch
96,034
unknown
false
combine
@CanIgnoreReturnValue @Override Builder<E> combine(ImmutableSet.Builder<E> builder) { super.combine(builder); return this; }
Adds each element of {@code elements} to the {@code ImmutableSortedSet}, ignoring duplicate elements (only the first duplicate element is added). @param elements the elements to add to the {@code ImmutableSortedSet} @return this {@code Builder} object @throws NullPointerException if {@code elements} contains a null ele...
java
android/guava/src/com/google/common/collect/ImmutableSortedSet.java
519
[ "builder" ]
true
1
6.08
google/guava
51,352
javadoc
false
shouldAssertFunction
function shouldAssertFunction<K extends AssertionKeys>(level: AssertionLevel, name: K): boolean { if (!shouldAssert(level)) { assertionCache[name] = { level, assertion: Debug[name] }; (Debug as any)[name] = noop; return false; } return true; }
Tests whether an assertion function should be executed. If it shouldn't, it is cached and replaced with `ts.noop`. Replaced assertion functions are restored when `Debug.setAssertionLevel` is set to a high enough level. @param level The minimum assertion level required. @param name The name of the current assertion f...
typescript
src/compiler/debug.ts
187
[ "level", "name" ]
true
2
6.72
microsoft/TypeScript
107,154
jsdoc
false
findNonEmptyMapStart
@Nullable private static String findNonEmptyMapStart(XContentParser parser) throws IOException { Token token = parser.currentToken(); if (token == null) { token = parser.nextToken(); } if (token == XContentParser.Token.START_OBJECT) { return parser.nextFieldNa...
Checks if the next current token in the supplied parser is a map start for a non-empty map. Skips to the next token if the parser does not yet have a current token (i.e. {@link #currentToken()} returns {@code null}) and then checks it. @return the first key in the map if a non-empty map start is found
java
libs/x-content/src/main/java/org/elasticsearch/xcontent/support/AbstractXContentParser.java
368
[ "parser" ]
String
true
4
6.72
elastic/elasticsearch
75,680
javadoc
false
getEffectiveAnnotatedParameter
private static AnnotatedElement getEffectiveAnnotatedParameter(Parameter parameter, int index) { Executable executable = parameter.getDeclaringExecutable(); if (executable instanceof Constructor && ClassUtils.isInnerClass(executable.getDeclaringClass()) && executable.getParameterAnnotations().length == executab...
Due to a bug in {@code javac} on JDK versions prior to JDK 9, looking up annotations directly on a {@link Parameter} will fail for inner class constructors. <p>Note: Since Spring 6 may still encounter user code compiled with {@code javac 8}, this workaround is kept in place for the time being. <h4>Bug in javac in JDK &...
java
spring-beans/src/main/java/org/springframework/beans/factory/annotation/ParameterResolutionDelegate.java
163
[ "parameter", "index" ]
AnnotatedElement
true
5
6.88
spring-projects/spring-framework
59,386
javadoc
false
join
public static String join(String separator, byte... array) { checkNotNull(separator); if (array.length == 0) { return ""; } // For pre-sizing a builder, just get the right order of magnitude StringBuilder builder = new StringBuilder(array.length * (3 + separator.length())); builder.append...
Returns a string containing the supplied {@code byte} values separated by {@code separator}. For example, {@code join(":", (byte) 1, (byte) 2, (byte) 255)} returns the string {@code "1:2:255"}. @param separator the text that should appear between consecutive values in the resulting string (but not at the start or e...
java
android/guava/src/com/google/common/primitives/UnsignedBytes.java
248
[ "separator" ]
String
true
3
6.72
google/guava
51,352
javadoc
false
shouldProxyTargetClass
public static boolean shouldProxyTargetClass( ConfigurableListableBeanFactory beanFactory, @Nullable String beanName) { if (beanName != null && beanFactory.containsBeanDefinition(beanName)) { BeanDefinition bd = beanFactory.getBeanDefinition(beanName); return Boolean.TRUE.equals(bd.getAttribute(PRESERVE_TAR...
Determine whether the given bean should be proxied with its target class rather than its interfaces. Checks the {@link #PRESERVE_TARGET_CLASS_ATTRIBUTE "preserveTargetClass" attribute} of the corresponding bean definition. @param beanFactory the containing ConfigurableListableBeanFactory @param beanName the name of the...
java
spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AutoProxyUtils.java
141
[ "beanFactory", "beanName" ]
true
3
7.28
spring-projects/spring-framework
59,386
javadoc
false
where
def where(condition, x=_NoValue, y=_NoValue): """ Return a masked array with elements from `x` or `y`, depending on condition. .. note:: When only `condition` is provided, this function is identical to `nonzero`. The rest of this documentation covers only the case where all three ar...
Return a masked array with elements from `x` or `y`, depending on condition. .. note:: When only `condition` is provided, this function is identical to `nonzero`. The rest of this documentation covers only the case where all three arguments are provided. Parameters ---------- condition : array_like, bool ...
python
numpy/ma/core.py
7,913
[ "condition", "x", "y" ]
false
7
7.76
numpy/numpy
31,054
numpy
false
execute_async
def execute_async(self, key: TaskInstanceKey, command: CommandType, queue=None, executor_config=None): """ Save the task to be executed in the next sync by inserting the commands into a queue. :param key: A unique task key (typically a tuple identifying the task instance). :param comman...
Save the task to be executed in the next sync by inserting the commands into a queue. :param key: A unique task key (typically a tuple identifying the task instance). :param command: The shell command string to execute. :param executor_config: (Unused) to keep the same signature as the base. :param queue: (Unused) to...
python
providers/amazon/src/airflow/providers/amazon/aws/executors/aws_lambda/lambda_executor.py
225
[ "self", "key", "command", "queue", "executor_config" ]
true
6
7.04
apache/airflow
43,597
sphinx
false
timeout
public static CloseOptions timeout(final Duration timeout) { return new CloseOptions().withTimeout(timeout); }
Static method to create a {@code CloseOptions} with a custom timeout. @param timeout the maximum time to wait for the consumer to close. @return a new {@code CloseOptions} instance with the specified timeout.
java
clients/src/main/java/org/apache/kafka/clients/consumer/CloseOptions.java
68
[ "timeout" ]
CloseOptions
true
1
6.8
apache/kafka
31,560
javadoc
false
introspectPlainAccessors
private void introspectPlainAccessors(Class<?> beanClass, Set<String> readMethodNames) throws IntrospectionException { for (Method method : beanClass.getMethods()) { if (!this.propertyDescriptors.containsKey(method.getName()) && !readMethodNames.contains(method.getName()) && isPlainAccessor(method)) { ...
Create a new CachedIntrospectionResults instance for the given class. @param beanClass the bean class to analyze @throws BeansException in case of introspection failure
java
spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java
332
[ "beanClass", "readMethodNames" ]
void
true
4
6.24
spring-projects/spring-framework
59,386
javadoc
false
_min_max
def _min_max(self, kind: Literal["min", "max"], skipna: bool) -> Scalar: """ Min/max of non-NA/null values Parameters ---------- kind : {"min", "max"} skipna : bool Returns ------- scalar """ valid_vals = self._valid_sp_values ...
Min/max of non-NA/null values Parameters ---------- kind : {"min", "max"} skipna : bool Returns ------- scalar
python
pandas/core/arrays/sparse/array.py
1,636
[ "self", "kind", "skipna" ]
Scalar
true
10
6.4
pandas-dev/pandas
47,362
numpy
false
_replace_columnwise
def _replace_columnwise( self, mapping: dict[Hashable, tuple[Any, Any]], inplace: bool, regex ) -> Self: """ Dispatch to Series.replace column-wise. Parameters ---------- mapping : dict of the form {col: (target, value)} inplace : bool reg...
Dispatch to Series.replace column-wise. Parameters ---------- mapping : dict of the form {col: (target, value)} inplace : bool regex : bool or same types as `to_replace` in DataFrame.replace Returns ------- DataFrame
python
pandas/core/frame.py
6,342
[ "self", "mapping", "inplace", "regex" ]
Self
true
5
6.72
pandas-dev/pandas
47,362
numpy
false
bindValue
private void bindValue(Bindable<?> target, Collection<Object> collection, ResolvableType aggregateType, ResolvableType elementType, @Nullable Object value) { if (value == null || (value instanceof CharSequence charSequence && charSequence.isEmpty())) { return; } Object aggregate = convert(value, aggregateTy...
Bind indexed elements to the supplied collection. @param name the name of the property to bind @param target the target bindable @param elementBinder the binder to use for elements @param aggregateType the aggregate type, may be a collection or an array @param elementType the element type @param result the destination ...
java
core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/IndexedElementsBinder.java
96
[ "target", "collection", "aggregateType", "elementType", "value" ]
void
true
5
6.4
spring-projects/spring-boot
79,428
javadoc
false
validateNonPattern
private void validateNonPattern(String location) { Assert.state(!isPattern(location), () -> String.format("Location '%s' must not be a pattern", location)); }
Get a single resource from a non-pattern location. @param location the location @return the resource @see #isPattern(String)
java
core/spring-boot/src/main/java/org/springframework/boot/context/config/LocationResourceLoader.java
83
[ "location" ]
void
true
1
6
spring-projects/spring-boot
79,428
javadoc
false
between
@Deprecated public static <T extends Comparable<? super T>> Range<T> between(final T fromInclusive, final T toInclusive) { return of(fromInclusive, toInclusive, null); }
Creates a range with the specified minimum and maximum values (both inclusive). <p>The range uses the natural ordering of the elements to determine where values lie in the range.</p> <p>The arguments may be passed in the order (min,max) or (max,min). The getMinimum and getMaximum methods will return the correct values....
java
src/main/java/org/apache/commons/lang3/Range.java
80
[ "fromInclusive", "toInclusive" ]
true
1
6.64
apache/commons-lang
2,896
javadoc
false
create_default_config_parser
def create_default_config_parser(configuration_description: dict[str, dict[str, Any]]) -> ConfigParser: """ Create default config parser based on configuration description. It creates ConfigParser with all default values retrieved from the configuration description and expands all the variables from th...
Create default config parser based on configuration description. It creates ConfigParser with all default values retrieved from the configuration description and expands all the variables from the global and local variables defined in this module. :param configuration_description: configuration description - retrieve...
python
airflow-core/src/airflow/configuration.py
659
[ "configuration_description" ]
ConfigParser
true
7
7.44
apache/airflow
43,597
sphinx
false
child
public MemberPath child(int index) { return new MemberPath(this, null, index); }
Create a new child from this path with the specified index. @param index the index of the child @return a new {@link MemberPath} instance
java
core/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java
805
[ "index" ]
MemberPath
true
1
6.64
spring-projects/spring-boot
79,428
javadoc
false
iterator
@Override public Iterator<Character> iterator() { return new CharacterIterator(this); }
Returns an iterator which can be used to walk through the characters described by this range. <p>#NotThreadSafe# the iterator is not thread-safe</p> @return an iterator to the chars represented by this range @since 2.5
java
src/main/java/org/apache/commons/lang3/CharRange.java
341
[]
true
1
6.48
apache/commons-lang
2,896
javadoc
false
is_platform_arm
def is_platform_arm() -> bool: """ Checking if the running platform use ARM architecture. Returns ------- bool True if the running platform uses ARM architecture. """ return platform.machine() in ("arm64", "aarch64") or platform.machine().startswith( "armv" )
Checking if the running platform use ARM architecture. Returns ------- bool True if the running platform uses ARM architecture.
python
pandas/compat/__init__.py
103
[]
bool
true
2
6.56
pandas-dev/pandas
47,362
unknown
false
dropRightWhile
function dropRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; }
Creates a slice of `array` excluding elements dropped from the end. Elements are dropped until `predicate` returns falsey. The predicate is invoked with three arguments: (value, index, array). @static @memberOf _ @since 3.0.0 @category Array @param {Array} array The array to query. @param {Function} [predicate=_.identi...
javascript
lodash.js
7,229
[ "array", "predicate" ]
false
3
7.2
lodash/lodash
61,490
jsdoc
false
parseBinaryExpressionRest
function parseBinaryExpressionRest(precedence: OperatorPrecedence, leftOperand: Expression, pos: number): Expression { while (true) { // We either have a binary operator here, or we're finished. We call // reScanGreaterToken so that we merge token sequences like > and = into >= ...
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,608
[ "precedence", "leftOperand", "pos" ]
true
12
6.8
microsoft/TypeScript
107,154
jsdoc
false
dedup_names
def dedup_names( names: Sequence[Hashable], is_potential_multiindex: bool ) -> Sequence[Hashable]: """ Rename column names if duplicates exist. Currently the renaming is done by appending a period and an autonumeric, but a custom pattern may be supported in the future. Examples -------- ...
Rename column names if duplicates exist. Currently the renaming is done by appending a period and an autonumeric, but a custom pattern may be supported in the future. Examples -------- >>> dedup_names(["x", "y", "x", "x"], is_potential_multiindex=False) ['x', 'y', 'x.1', 'x.2']
python
pandas/io/common.py
1,248
[ "names", "is_potential_multiindex" ]
Sequence[Hashable]
true
5
7.44
pandas-dev/pandas
47,362
unknown
false
optString
public String optString(int index) { return optString(index, ""); }
Returns the value at {@code index} if it exists, coercing it if necessary. Returns the empty string if no such value exists. @param index the index to get the value from @return the {@code value} or an empty string
java
cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONArray.java
499
[ "index" ]
String
true
1
6.96
spring-projects/spring-boot
79,428
javadoc
false
acceptParams
function acceptParams (str) { var length = str.length; var colonIndex = str.indexOf(';'); var index = colonIndex === -1 ? length : colonIndex; var ret = { value: str.slice(0, index).trim(), quality: 1, params: {} }; while (index < length) { var splitIndex = str.indexOf('=', index); if (splitIndex ===...
Parse accept params `str` returning an object with `.value`, `.quality` and `.params`. @param {String} str @return {Object} @api private
javascript
lib/utils.js
89
[ "str" ]
false
8
6.08
expressjs/express
68,358
jsdoc
false
recordWritten
private void recordWritten(long offset, long timestamp, int size) { if (numRecords == Integer.MAX_VALUE) throw new IllegalArgumentException("Maximum number of records per batch exceeded, max records: " + Integer.MAX_VALUE); if (offset - baseOffset > Integer.MAX_VALUE) throw new I...
Append the record at the next consecutive offset. If no records have been appended yet, use the base offset of this builder. @param record The record to add
java
clients/src/main/java/org/apache/kafka/common/record/MemoryRecordsBuilder.java
787
[ "offset", "timestamp", "size" ]
void
true
5
7.04
apache/kafka
31,560
javadoc
false
createEntrySet
@Override ImmutableSet<Entry<K, V>> createEntrySet() { final class EntrySet extends ImmutableMapEntrySet<K, V> { @Override public UnmodifiableIterator<Entry<K, V>> iterator() { return asList().iterator(); } @Override public Spliterator<Entry<K, V>> spliterator() { re...
Returns an immutable set of the mappings in this map, sorted by the key ordering.
java
guava/src/com/google/common/collect/ImmutableSortedMap.java
806
[]
true
2
7.12
google/guava
51,352
javadoc
false
getMatchingAccessibleConstructor
public static <T> Constructor<T> getMatchingAccessibleConstructor(final Class<T> cls, final Class<?>... parameterTypes) { Objects.requireNonNull(cls, "cls"); // see if we can find the constructor directly // most of the time this works and it's much faster try { return Member...
Finds an accessible constructor with compatible parameters. <p> This checks all the constructor and finds one with compatible parameters This requires that every parameter is assignable from the given parameter types. This is a more flexible search than the normal exact matching algorithm. </p> <p> First it checks if t...
java
src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java
115
[ "cls" ]
true
6
8.08
apache/commons-lang
2,896
javadoc
false
stopAsync
@CanIgnoreReturnValue public ServiceManager stopAsync() { for (Service service : services) { service.stopAsync(); } return this; }
Initiates service {@linkplain Service#stopAsync shutdown} if necessary on all the services being managed. @return this
java
android/guava/src/com/google/common/util/concurrent/ServiceManager.java
341
[]
ServiceManager
true
1
6.08
google/guava
51,352
javadoc
false
getDescription
@Override protected String getDescription() { Assert.notNull(this.listener, "'listener' must not be null"); return "listener " + this.listener; }
Return the listener to be registered. @return the listener to be registered
java
core/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBean.java
111
[]
String
true
1
6.88
spring-projects/spring-boot
79,428
javadoc
false
is_bool_dtype
def is_bool_dtype(arr_or_dtype) -> bool: """ Check whether the provided array or dtype is of a boolean dtype. This function verifies whether a given object is a boolean data type. The input can be an array or a dtype object. Accepted array types include instances of ``np.array``, ``pd.Series``, ``p...
Check whether the provided array or dtype is of a boolean dtype. This function verifies whether a given object is a boolean data type. The input can be an array or a dtype object. Accepted array types include instances of ``np.array``, ``pd.Series``, ``pd.Index``, and similar array-like structures. Parameters -------...
python
pandas/core/dtypes/common.py
1,393
[ "arr_or_dtype" ]
bool
true
7
7.92
pandas-dev/pandas
47,362
numpy
false
parseDateStrictly
public static Date parseDateStrictly(final String str, final Locale locale, final String... parsePatterns) throws ParseException { return parseDateWithLeniency(str, locale, parsePatterns, false); }
Parses a string representing a date by trying a variety of different parsers, using the default date format symbols for the given locale. <p>The parse will try each parse pattern in turn. A parse is only deemed successful if it parses the whole of the input string. If no parse patterns match, a ParseException is thrown...
java
src/main/java/org/apache/commons/lang3/time/DateUtils.java
1,304
[ "str", "locale" ]
Date
true
1
6.8
apache/commons-lang
2,896
javadoc
false
filterPropertyDescriptorsForDependencyCheck
protected PropertyDescriptor[] filterPropertyDescriptorsForDependencyCheck(BeanWrapper bw, boolean cache) { PropertyDescriptor[] filtered = this.filteredPropertyDescriptorsCache.get(bw.getWrappedClass()); if (filtered == null) { filtered = filterPropertyDescriptorsForDependencyCheck(bw); if (cache) { Prop...
Extract a filtered set of PropertyDescriptors from the given BeanWrapper, excluding ignored dependency types or properties defined on ignored dependency interfaces. @param bw the BeanWrapper the bean was created with @param cache whether to cache filtered PropertyDescriptors for the given bean Class @return the filtere...
java
spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
1,580
[ "bw", "cache" ]
true
4
7.28
spring-projects/spring-framework
59,386
javadoc
false
findAutowireCandidates
protected Map<String, Object> findAutowireCandidates( @Nullable String beanName, Class<?> requiredType, DependencyDescriptor descriptor) { String[] candidateNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors( this, requiredType, true, descriptor.isEager()); Map<String, Object> result = CollectionUt...
Find bean instances that match the required type. Called during autowiring for the specified bean. @param beanName the name of the bean that is about to be wired @param requiredType the actual type of bean to look for (may be an array component type or collection element type) @param descriptor the descriptor of the de...
java
spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
1,952
[ "beanName", "requiredType", "descriptor" ]
true
17
6.72
spring-projects/spring-framework
59,386
javadoc
false
isSetterDefinedInInterface
public static boolean isSetterDefinedInInterface(PropertyDescriptor pd, Set<Class<?>> interfaces) { Method setter = pd.getWriteMethod(); if (setter != null) { Class<?> targetClass = setter.getDeclaringClass(); for (Class<?> ifc : interfaces) { if (ifc.isAssignableFrom(targetClass) && ClassUtils.hasMethod(...
Return whether the setter method of the given bean property is defined in any of the given interfaces. @param pd the PropertyDescriptor of the bean property @param interfaces the Set of interfaces (Class objects) @return whether the setter method is defined by an interface
java
spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java
114
[ "pd", "interfaces" ]
true
4
7.6
spring-projects/spring-framework
59,386
javadoc
false
toString
@Override public String toString() { return this.out.isEmpty() ? null : this.out.toString(); }
Returns the encoded JSON string. <p> If invoked with unterminated arrays or unclosed objects, this method's return value is undefined. <p> <strong>Warning:</strong> although it contradicts the general contract of {@link Object#toString}, this method returns null if the stringer contains no data. @return the encoded JSO...
java
cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONStringer.java
424
[]
String
true
2
7.52
spring-projects/spring-boot
79,428
javadoc
false