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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
notEmpty | public static <T extends CharSequence> T notEmpty(final T chars) {
return notEmpty(chars, DEFAULT_NOT_EMPTY_CHAR_SEQUENCE_EX_MESSAGE);
} | <p>Validates that the specified argument character sequence is
neither {@code null} nor a length of zero (no characters);
otherwise throwing an exception with the specified message.
<pre>Validate.notEmpty(myString);</pre>
<p>The message in the exception is "The validated
character sequence is empty".
@param <... | java | src/main/java/org/apache/commons/lang3/Validate.java | 868 | [
"chars"
] | T | true | 1 | 6.16 | apache/commons-lang | 2,896 | javadoc | false |
join | public static String join(final List<?> list, final char separator, final int startIndex, final int endIndex) {
if (list == null) {
return null;
}
final int noOfItems = endIndex - startIndex;
if (noOfItems <= 0) {
return EMPTY;
}
final List<?> subL... | Joins the elements of the provided {@link List} into a single String containing the provided list of elements.
<p>
No delimiter is added before or after the list. Null objects or empty strings within the array are represented by empty strings.
</p>
<pre>
StringUtils.join(null, *) = null
StringUtils.join([... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 4,363 | [
"list",
"separator",
"startIndex",
"endIndex"
] | String | true | 3 | 8.08 | apache/commons-lang | 2,896 | javadoc | false |
equals | public boolean equals(Object other) {
if (this == other)
return true;
if (other == null)
return false;
if (!other.getClass().equals(LegacyRecord.class))
return false;
LegacyRecord record = (LegacyRecord) other;
return this.buffer.equals(record.... | Get the underlying buffer backing this record instance.
@return the buffer | java | clients/src/main/java/org/apache/kafka/common/record/LegacyRecord.java | 295 | [
"other"
] | true | 4 | 6.88 | apache/kafka | 31,560 | javadoc | false | |
area | def area(
self,
x: Hashable | None = None,
y: Hashable | None = None,
stacked: bool = True,
**kwargs,
) -> PlotAccessor:
"""
Draw a stacked area plot.
An area plot displays quantitative data visually.
This function wraps the matplotlib area fu... | Draw a stacked area plot.
An area plot displays quantitative data visually.
This function wraps the matplotlib area function.
Parameters
----------
x : label or position, optional
Coordinates for the X axis. By default uses the index.
y : label or position, optional
Column to plot. By default uses all columns... | python | pandas/plotting/_core.py | 1,818 | [
"self",
"x",
"y",
"stacked"
] | PlotAccessor | true | 1 | 7.2 | pandas-dev/pandas | 47,362 | numpy | false |
_init_dict | def _init_dict(
self, data: Mapping, index: Index | None = None, dtype: DtypeObj | None = None
):
"""
Derive the "_mgr" and "index" attributes of a new Series from a
dictionary input.
Parameters
----------
data : dict or dict-like
Data used to pop... | Derive the "_mgr" and "index" attributes of a new Series from a
dictionary input.
Parameters
----------
data : dict or dict-like
Data used to populate the new Series.
index : Index or None, default None
Index for the new Series: if None, use dict keys.
dtype : np.dtype, ExtensionDtype, or None, default None
... | python | pandas/core/series.py | 525 | [
"self",
"data",
"index",
"dtype"
] | true | 9 | 7.04 | pandas-dev/pandas | 47,362 | numpy | false | |
get_previous_dagrun | def get_previous_dagrun(
self,
state: DagRunState | None = None,
session: Session | None = None,
) -> DagRun | None:
"""
Return the DagRun that ran before this task instance's DagRun.
:param state: If passed, it only take into account instances of a specific state.
... | Return the DagRun that ran before this task instance's DagRun.
:param state: If passed, it only take into account instances of a specific state.
:param session: SQLAlchemy ORM Session. | python | airflow-core/src/airflow/models/taskinstance.py | 826 | [
"self",
"state",
"session"
] | DagRun | None | true | 8 | 7.04 | apache/airflow | 43,597 | sphinx | false |
notna | def notna(self) -> npt.NDArray[np.bool_]:
"""
Detect existing (non-missing) values.
Return a boolean same-sized object indicating if the values are not NA.
Non-missing values get mapped to ``True``. Characters such as empty
strings ``''`` or :attr:`numpy.inf` are not considered ... | Detect existing (non-missing) values.
Return a boolean same-sized object indicating if the values are not NA.
Non-missing values get mapped to ``True``. Characters such as empty
strings ``''`` or :attr:`numpy.inf` are not considered NA values.
NA values, such as None or :attr:`numpy.NaN`, get mapped to ``False``
value... | python | pandas/core/indexes/base.py | 2,699 | [
"self"
] | npt.NDArray[np.bool_] | true | 1 | 7.28 | pandas-dev/pandas | 47,362 | unknown | false |
resolveResource | protected @Nullable Resource resolveResource(String filename) {
for (String fileExtension : this.fileExtensions) {
Resource resource = this.resourceLoader.getResource(filename + fileExtension);
if (resource.exists()) {
return resource;
}
}
return null;
} | Resolve the specified bundle {@code filename} into a concrete {@link Resource},
potentially checking multiple sources or file extensions.
<p>If no suitable concrete {@code Resource} can be resolved, this method
returns a {@code Resource} for which {@link Resource#exists()} returns
{@code false}, which gets subsequently... | java | spring-context/src/main/java/org/springframework/context/support/ReloadableResourceBundleMessageSource.java | 542 | [
"filename"
] | Resource | true | 2 | 7.44 | spring-projects/spring-framework | 59,386 | javadoc | false |
close | public void close() {
recordsBuilder.close();
if (!recordsBuilder.isControlBatch()) {
CompressionRatioEstimator.updateEstimation(topicPartition.topic(),
recordsBuilder.compression().type(),
... | Release resources required for record appends (e.g. compression buffers). Once this method is called, it's only
possible to update the RecordBatch header. | java | clients/src/main/java/org/apache/kafka/clients/producer/internals/ProducerBatch.java | 515 | [] | void | true | 2 | 6.4 | apache/kafka | 31,560 | javadoc | false |
connection | def connection(self, hostname=None, userid=None, password=None,
virtual_host=None, port=None, ssl=None,
connect_timeout=None, transport=None,
transport_options=None, heartbeat=None,
login_method=None, failover_strategy=None, **kwargs):
... | Establish a connection to the message broker.
Please use :meth:`connection_for_read` and
:meth:`connection_for_write` instead, to convey the intent
of use for this connection.
Arguments:
url: Either the URL or the hostname of the broker to use.
hostname (str): URL, Hostname/IP-address of the broker.
I... | python | celery/app/base.py | 977 | [
"self",
"hostname",
"userid",
"password",
"virtual_host",
"port",
"ssl",
"connect_timeout",
"transport",
"transport_options",
"heartbeat",
"login_method",
"failover_strategy"
] | false | 2 | 6.8 | celery/celery | 27,741 | google | false | |
nextClearBit | public int nextClearBit(final int fromIndex) {
return bitSet.nextClearBit(fromIndex);
} | Returns the index of the first bit that is set to {@code false} that occurs on or after the specified starting index.
@param fromIndex the index to start checking from (inclusive).
@return the index of the next clear bit.
@throws IndexOutOfBoundsException if the specified index is negative. | java | src/main/java/org/apache/commons/lang3/util/FluentBitSet.java | 314 | [
"fromIndex"
] | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false | |
compress | def compress(condition, a, axis=None, out=None):
"""
Return selected slices of an array along given axis.
When working along a given axis, a slice along that axis is returned in
`output` for each index where `condition` evaluates to True. When
working on a 1-D array, `compress` is equivalent to `ex... | Return selected slices of an array along given axis.
When working along a given axis, a slice along that axis is returned in
`output` for each index where `condition` evaluates to True. When
working on a 1-D array, `compress` is equivalent to `extract`.
Parameters
----------
condition : 1-D array of bools
Array t... | python | numpy/_core/fromnumeric.py | 2,138 | [
"condition",
"a",
"axis",
"out"
] | false | 1 | 6.24 | numpy/numpy | 31,054 | numpy | false | |
calculateDeadlineMs | static long calculateDeadlineMs(final Time time, final Duration duration) {
return calculateDeadlineMs(requireNonNull(time).milliseconds(), requireNonNull(duration).toMillis());
} | Calculate the deadline timestamp based on {@link Timer#currentTimeMs()} and {@link Duration#toMillis()}.
@param time Time
@param duration Duration
@return Absolute time by which event should be completed | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/CompletableEvent.java | 97 | [
"time",
"duration"
] | true | 1 | 6.16 | apache/kafka | 31,560 | javadoc | false | |
varHandleWithoutOffset | static VarHandle varHandleWithoutOffset(MemoryLayout layout, MemoryLayout.PathElement element) {
return layout.varHandle(element);
} | Return a {@link VarHandle} to access an element within the given memory segment.
Note: This is no-op in Java 21, see the Java 22 implementation.
@param layout The layout of a struct to access
@param element The element within the struct to access
@return A {@link VarHandle} that accesses the element with a fixed offset... | java | libs/native/src/main/java/org/elasticsearch/nativeaccess/jdk/MemorySegmentUtil.java | 43 | [
"layout",
"element"
] | VarHandle | true | 1 | 6.48 | elastic/elasticsearch | 75,680 | javadoc | false |
maybeLeaveGroup | public synchronized RequestFuture<Void> maybeLeaveGroup(CloseOptions.GroupMembershipOperation membershipOperation, String leaveReason) {
RequestFuture<Void> future = null;
if (shouldSendLeaveGroupRequest(membershipOperation)) {
log.info("Member {} sending LeaveGroup request to coordinator {... | Sends LeaveGroupRequest and logs the {@code leaveReason}, unless this member is using static membership
with the default consumer group membership operation, or is already not part of the group (i.e., does not have a
valid member ID, is in the UNJOINED state, or the coordinator is unknown).
@param membershipOperation t... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java | 1,170 | [
"membershipOperation",
"leaveReason"
] | true | 2 | 6.56 | apache/kafka | 31,560 | javadoc | false | |
splitByCharacterType | public static String[] splitByCharacterType(final String str) {
return splitByCharacterType(str, false);
} | Splits a String by Character type as returned by {@code java.lang.Character.getType(char)}. Groups of contiguous characters of the same type are returned
as complete tokens.
<pre>
StringUtils.splitByCharacterType(null) = null
StringUtils.splitByCharacterType("") = []
StringUtils.splitByCharacterType("... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 7,151 | [
"str"
] | true | 1 | 6.16 | apache/commons-lang | 2,896 | javadoc | false | |
getOrder | @Override
public int getOrder() {
if (this.aspectInstance instanceof Ordered ordered) {
return ordered.getOrder();
}
return getOrderForAspectClass(this.aspectInstance.getClass());
} | Determine the order for this factory's aspect instance,
either an instance-specific order expressed through implementing
the {@link org.springframework.core.Ordered} interface,
or a fallback order.
@see org.springframework.core.Ordered
@see #getOrderForAspectClass | java | spring-aop/src/main/java/org/springframework/aop/aspectj/SingletonAspectInstanceFactory.java | 70 | [] | true | 2 | 6.24 | spring-projects/spring-framework | 59,386 | javadoc | false | |
insert | public StrBuilder insert(final int index, final double value) {
return insert(index, String.valueOf(value));
} | Inserts the value into this builder.
@param index the index to add at, must be valid
@param value the value to insert
@return {@code this} instance.
@throws IndexOutOfBoundsException if the index is invalid | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 2,196 | [
"index",
"value"
] | StrBuilder | true | 1 | 6.48 | apache/commons-lang | 2,896 | javadoc | false |
fireFailure | private void fireFailure() {
RuntimeException exception = exception();
while (true) {
RequestFutureListener<T> listener = listeners.poll();
if (listener == null)
break;
listener.onFailure(exception);
}
} | Raise an error. The request will be marked as failed.
@param error corresponding error to be passed to caller | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/RequestFuture.java | 173 | [] | void | true | 3 | 6.88 | apache/kafka | 31,560 | javadoc | false |
contains | public boolean contains(final char ch) {
return (ch >= start && ch <= end) != negated;
} | Is the character specified contained in this range.
@param ch the character to check.
@return {@code true} if this range contains the input character. | java | src/main/java/org/apache/commons/lang3/CharRange.java | 247 | [
"ch"
] | true | 2 | 8.16 | apache/commons-lang | 2,896 | javadoc | false | |
_maybe_match_name | def _maybe_match_name(a, b):
"""
Try to find a name to attach to the result of an operation between
a and b. If only one of these has a `name` attribute, return that
name. Otherwise return a consensus name if they match or None if
they have different names.
Parameters
----------
a : o... | Try to find a name to attach to the result of an operation between
a and b. If only one of these has a `name` attribute, return that
name. Otherwise return a consensus name if they match or None if
they have different names.
Parameters
----------
a : object
b : object
Returns
-------
name : str or None
See Also
--... | python | pandas/core/ops/common.py | 114 | [
"a",
"b"
] | false | 9 | 6.4 | pandas-dev/pandas | 47,362 | numpy | false | |
tryAcquire | public synchronized boolean tryAcquire() {
prepareAcquire();
return acquirePermit();
} | Tries to acquire a permit from this semaphore. If the limit of this semaphore has not yet been reached, a permit is acquired, and this method returns
<strong>true</strong>. Otherwise, this method returns immediately with the result <strong>false</strong>.
@return <strong>true</strong> if a permit could be acquired; <st... | java | src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java | 478 | [] | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false | |
add | public void add(ConfigurationMetadataProperty property, ConfigurationMetadataSource source) {
if (source != null) {
source.getProperties().putIfAbsent(property.getId(), property);
}
getGroup(source).getProperties().putIfAbsent(property.getId(), property);
} | Add a {@link ConfigurationMetadataProperty} with the
{@link ConfigurationMetadataSource source} that defines it, if any.
@param property the property to add
@param source the source | java | configuration-metadata/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/SimpleConfigurationMetadataRepository.java | 72 | [
"property",
"source"
] | void | true | 2 | 6.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
maybeUpdateAssignment | void maybeUpdateAssignment(SubscriptionState subscription) {
int newAssignmentId = subscription.assignmentId();
if (this.assignmentId != newAssignmentId) {
Set<TopicPartition> newAssignedPartitions = subscription.assignedPartitions();
for (TopicPartition tp : this.assignedParti... | This method is called by the {@link Fetch fetch} logic before it requests fetches in order to update the
internal set of metrics that are tracked.
@param subscription {@link SubscriptionState} that contains the set of assigned partitions
@see SubscriptionState#assignmentId() | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchMetricsManager.java | 164 | [
"subscription"
] | void | true | 4 | 6.4 | apache/kafka | 31,560 | javadoc | false |
get_query_results | def get_query_results(
self, query_execution_id: str, next_token_id: str | None = None, max_results: int = 1000
) -> dict | None:
"""
Fetch submitted query results.
.. seealso::
- :external+boto3:py:meth:`Athena.Client.get_query_results`
:param query_execution_i... | Fetch submitted query results.
.. seealso::
- :external+boto3:py:meth:`Athena.Client.get_query_results`
:param query_execution_id: Id of submitted athena query
:param next_token_id: The token that specifies where to start pagination.
:param max_results: The maximum number of results (rows) to return in this requ... | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/athena.py | 196 | [
"self",
"query_execution_id",
"next_token_id",
"max_results"
] | dict | None | true | 5 | 7.44 | apache/airflow | 43,597 | sphinx | false |
addOrMergeGenericArgumentValue | private void addOrMergeGenericArgumentValue(ValueHolder newValue) {
if (newValue.getName() != null) {
for (Iterator<ValueHolder> it = this.genericArgumentValues.iterator(); it.hasNext();) {
ValueHolder currentValue = it.next();
if (newValue.getName().equals(currentValue.getName())) {
if (newValue.getV... | Add a generic argument value, merging the new value (typically a collection)
with the current value if demanded: see {@link org.springframework.beans.Mergeable}.
@param newValue the argument value in the form of a ValueHolder | java | spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java | 226 | [
"newValue"
] | void | true | 6 | 6.24 | spring-projects/spring-framework | 59,386 | javadoc | false |
toByteArray | default byte[] toByteArray(Charset charset) {
Assert.notNull(charset, "'charset' must not be null");
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
toWriter(new OutputStreamWriter(out, charset));
return out.toByteArray();
}
catch (IOException ex) {
throw new UncheckedIOException(ex);
... | Write the JSON to a byte array.
@param charset the charset
@return the JSON bytes | java | core/spring-boot/src/main/java/org/springframework/boot/json/WritableJson.java | 77 | [
"charset"
] | true | 2 | 7.92 | spring-projects/spring-boot | 79,428 | javadoc | false | |
aggregate | def aggregate(self, func=None, axis: Axis = 0, *args, **kwargs):
"""
Aggregate using one or more operations over the specified axis.
Parameters
----------
func : function, str, list or dict
Function to use for aggregating the data. If a function, must either
... | Aggregate using one or more operations over the specified axis.
Parameters
----------
func : function, str, list or dict
Function to use for aggregating the data. If a function, must either
work when passed a Series or when passed to Series.apply.
Accepted combinations are:
- function
- string fu... | python | pandas/core/series.py | 4,626 | [
"self",
"func",
"axis"
] | true | 2 | 8.4 | pandas-dev/pandas | 47,362 | numpy | false | |
equals | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ClientQuotaFilter that = (ClientQuotaFilter) o;
return Objects.equals(components, that.components) && Objects.equals(strict, that.strict);
} | @return whether the filter is strict, i.e. only includes specified components | java | clients/src/main/java/org/apache/kafka/common/quota/ClientQuotaFilter.java | 84 | [
"o"
] | true | 5 | 6.24 | apache/kafka | 31,560 | javadoc | false | |
getFileTypeMap | protected final FileTypeMap getFileTypeMap() {
if (this.fileTypeMap == null) {
try {
this.fileTypeMap = createFileTypeMap(this.mappingLocation, this.mappings);
}
catch (IOException ex) {
throw new IllegalStateException(
"Could not load specified MIME type mapping file: " + this.mappingLocation,... | Return the delegate FileTypeMap, compiled from the mappings in the mapping file
and the entries in the {@code mappings} property.
@see #setMappingLocation
@see #setMappings
@see #createFileTypeMap | java | spring-context-support/src/main/java/org/springframework/mail/javamail/ConfigurableMimeFileTypeMap.java | 119 | [] | FileTypeMap | true | 3 | 6.24 | spring-projects/spring-framework | 59,386 | javadoc | false |
rindex | def rindex(a, sub, start=0, end=None):
"""
Like `rfind`, but raises :exc:`ValueError` when the substring `sub` is
not found.
Parameters
----------
a : array-like, with `np.bytes_` or `np.str_` dtype
sub : array-like, with `np.bytes_` or `np.str_` dtype
start, end : array-like, with an... | Like `rfind`, but raises :exc:`ValueError` when the substring `sub` is
not found.
Parameters
----------
a : array-like, with `np.bytes_` or `np.str_` dtype
sub : array-like, with `np.bytes_` or `np.str_` dtype
start, end : array-like, with any integer dtype, optional
Returns
-------
out : ndarray
Output array o... | python | numpy/_core/strings.py | 371 | [
"a",
"sub",
"start",
"end"
] | false | 2 | 7.36 | numpy/numpy | 31,054 | numpy | false | |
register | function register(specifier, parentURL = undefined, options) {
if (parentURL != null && typeof parentURL === 'object' && !isURL(parentURL)) {
options = parentURL;
parentURL = options.parentURL;
}
getOrInitializeCascadedLoader().register(
specifier,
parentURL ?? 'data:',
options?.data,
opti... | Register a single loader programmatically.
@param {string|URL} specifier
@param {string|URL} [parentURL] Base to use when resolving `specifier`; optional if
`specifier` is absolute. Same as `options.parentUrl`, just inline
@param {object} [options] Additional options to apply, described below.
@param {string|URL} [op... | javascript | lib/internal/modules/esm/loader.js | 971 | [
"specifier",
"options"
] | false | 4 | 8.08 | nodejs/node | 114,839 | jsdoc | false | |
setAsText | @Override
public void setAsText(@Nullable String text) throws IllegalArgumentException {
if (this.allowEmpty && !StringUtils.hasLength(text)) {
// Treat empty String as null value.
setValue(null);
}
else if (text == null) {
throw new IllegalArgumentException("null String cannot be converted to char type... | Create a new CharacterEditor instance.
<p>The "allowEmpty" parameter controls whether an empty String is to be
allowed in parsing, i.e. be interpreted as the {@code null} value when
{@link #setAsText(String) text is being converted}. If {@code false},
an {@link IllegalArgumentException} will be thrown at that time.
@pa... | java | spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharacterEditor.java | 74 | [
"text"
] | void | true | 6 | 6.88 | spring-projects/spring-framework | 59,386 | javadoc | false |
addAll | public static boolean[] addAll(final boolean[] array1, final boolean... array2) {
if (array1 == null) {
return clone(array2);
}
if (array2 == null) {
return clone(array1);
}
final boolean[] joinedArray = new boolean[array1.length + array2.length];
... | Adds all the elements of the given arrays into a new array.
<p>
The new array contains all of the element of {@code array1} followed
by all of the elements {@code array2}. When an array is returned, it is always
a new array.
</p>
<pre>
ArrayUtils.addAll(array1, null) = cloned copy of array1
ArrayUtils.addAll(null, ar... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 855 | [
"array1"
] | true | 3 | 7.92 | apache/commons-lang | 2,896 | javadoc | false | |
shuffle | function shuffle(collection) {
var func = isArray(collection) ? arrayShuffle : baseShuffle;
return func(collection);
} | Creates an array of shuffled values, using a version of the
[Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
@static
@memberOf _
@since 0.1.0
@category Collection
@param {Array|Object} collection The collection to shuffle.
@returns {Array} Returns the new shuffled array.
@example
_.shuffle([1... | javascript | lodash.js | 9,923 | [
"collection"
] | false | 2 | 6.96 | lodash/lodash | 61,490 | jsdoc | false | |
memberEpoch | public int memberEpoch() {
return memberEpoch;
} | @return Current epoch of the member, maintained by the server. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java | 276 | [] | true | 1 | 6.96 | apache/kafka | 31,560 | javadoc | false | |
createCloudflareUrl | function createCloudflareUrl(path: string, config: ImageLoaderConfig) {
let params = `format=auto`;
if (config.width) {
params += `,width=${config.width}`;
}
// When requesting a placeholder image we ask for a low quality image to reduce the load time.
if (config.isPlaceholder) {
params += `,quality=... | Function that generates an ImageLoader for [Cloudflare Image
Resizing](https://developers.cloudflare.com/images/image-resizing/) and turns it into an Angular
provider. Note: Cloudflare has multiple image products - this provider is specifically for
Cloudflare Image Resizing; it will not work with Cloudflare Images or C... | typescript | packages/common/src/directives/ng_optimized_image/image_loaders/cloudflare_loader.ts | 29 | [
"path",
"config"
] | false | 3 | 6.8 | angular/angular | 99,544 | jsdoc | false | |
getParametersOfDecoratedDeclaration | function getParametersOfDecoratedDeclaration(node: SignatureDeclaration, container: ClassLikeDeclaration) {
if (container && node.kind === SyntaxKind.GetAccessor) {
const { setAccessor } = getAllAccessorDeclarations(container.members, node as AccessorDeclaration);
if (setAccessor) {
... | Serializes the type of a node for use with decorator type metadata.
@param node The node that should have its type serialized. | typescript | src/compiler/transformers/typeSerializer.ts | 228 | [
"node",
"container"
] | false | 4 | 6.24 | microsoft/TypeScript | 107,154 | jsdoc | false | |
indexOf | private static int indexOf(final Throwable throwable, final Class<? extends Throwable> type, int fromIndex, final boolean subclass) {
if (throwable == null || type == null) {
return NOT_FOUND;
}
if (fromIndex < 0) {
fromIndex = 0;
}
final Throwable[] throw... | Worker method for the {@code indexOfType} methods.
@param throwable the throwable to inspect, may be null.
@param type the type to search for, subclasses match, null returns -1.
@param fromIndex the (zero-based) index of the starting position, negative treated as zero, larger than chain size returns -1.
@param sub... | java | src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java | 575 | [
"throwable",
"type",
"fromIndex",
"subclass"
] | true | 10 | 7.6 | apache/commons-lang | 2,896 | javadoc | false | |
describeConsumerGroups | DescribeConsumerGroupsResult describeConsumerGroups(Collection<String> groupIds,
DescribeConsumerGroupsOptions options); | Describe some consumer groups in the cluster.
@param groupIds The IDs of the groups to describe.
@param options The options to use when describing the groups.
@return The DescribeConsumerGroupsResult. | java | clients/src/main/java/org/apache/kafka/clients/admin/Admin.java | 864 | [
"groupIds",
"options"
] | DescribeConsumerGroupsResult | true | 1 | 6.48 | apache/kafka | 31,560 | javadoc | false |
buildRootMap | function buildRootMap(roots: any[], nodes: any[]): Map<any, any[]> {
const rootMap = new Map<any, any[]>();
roots.forEach((root) => rootMap.set(root, []));
if (nodes.length == 0) return rootMap;
const NULL_NODE = 1;
const nodeSet = new Set(nodes);
const localRootMap = new Map<any, any>();
function getR... | @license
Copyright Google LLC All Rights Reserved.
Use of this source code is governed by an MIT-style license that can be
found in the LICENSE file at https://angular.dev/license | typescript | packages/animations/browser/src/render/transition_animation_engine.ts | 1,840 | [
"roots",
"nodes"
] | true | 9 | 6 | angular/angular | 99,544 | jsdoc | false | |
uncapitalize | public static String uncapitalize(final String str, final char... delimiters) {
final int delimLen = delimiters == null ? -1 : delimiters.length;
if (StringUtils.isEmpty(str) || delimLen == 0) {
return str;
}
final char[] buffer = str.toCharArray();
boolean uncapitali... | Uncapitalizes all the whitespace separated words in a String.
Only the first character of each word is changed.
<p>The delimiters represent a set of characters understood to separate words.
The first string character and the first non-delimiter character after a
delimiter will be uncapitalized.</p>
<p>Whitespace is def... | java | src/main/java/org/apache/commons/lang3/text/WordUtils.java | 391 | [
"str"
] | String | true | 7 | 7.44 | apache/commons-lang | 2,896 | javadoc | false |
opt | public Object opt(int index) {
if (index < 0 || index >= this.values.size()) {
return null;
}
return this.values.get(index);
} | Returns the value at {@code index}, or null if the array has no value at
{@code index}.
@param index the index to get the value from
@return the value at {@code index} or {@code null} | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONArray.java | 298 | [
"index"
] | Object | true | 3 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false |
is_ignored_output | def is_ignored_output(output: str) -> int:
"""
Check if the output matches any ignore pattern.
Args:
output: The combined stdout/stderr string.
Returns:
Index of the matched ignore pattern, or -1 if none matched.
"""
for idx, pattern in enumerate(IGNORE_PATTERNS):
if pa... | Check if the output matches any ignore pattern.
Args:
output: The combined stdout/stderr string.
Returns:
Index of the matched ignore pattern, or -1 if none matched. | python | tools/experimental/torchfuzz/multi_process_fuzzer.py | 67 | [
"output"
] | int | true | 3 | 8.08 | pytorch/pytorch | 96,034 | google | false |
negate | public static MethodMatcher negate(MethodMatcher methodMatcher) {
Assert.notNull(methodMatcher, "MethodMatcher must not be null");
return new NegateMethodMatcher(methodMatcher);
} | Return a method matcher that represents the logical negation of the specified
matcher instance.
@param methodMatcher the {@link MethodMatcher} to negate
@return a matcher that represents the logical negation of the specified matcher
@since 6.1 | java | spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java | 93 | [
"methodMatcher"
] | MethodMatcher | true | 1 | 6.32 | spring-projects/spring-framework | 59,386 | javadoc | false |
addListener | public void addListener(RequestFutureListener<T> listener) {
this.listeners.add(listener);
if (failed())
fireFailure();
else if (succeeded())
fireSuccess();
} | Add a listener which will be notified when the future completes
@param listener non-null listener to add | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/RequestFuture.java | 187 | [
"listener"
] | void | true | 3 | 6.4 | apache/kafka | 31,560 | javadoc | false |
getLastElementOnPage | public int getLastElementOnPage() {
int endIndex = getPageSize() * (getPage() + 1);
int size = getNrOfElements();
return (endIndex > size ? size : endIndex) - 1;
} | Return the element index of the last element on the current page.
Element numbering starts with 0. | java | spring-beans/src/main/java/org/springframework/beans/support/PagedListHolder.java | 273 | [] | true | 2 | 6.88 | spring-projects/spring-framework | 59,386 | javadoc | false | |
fftfreq | def fftfreq(n, d=1.0, device=None):
"""
Return the Discrete Fourier Transform sample frequencies.
The returned float array `f` contains the frequency bin centers in cycles
per unit of the sample spacing (with zero at the start). For instance, if
the sample spacing is in seconds, then the frequency... | Return the Discrete Fourier Transform sample frequencies.
The returned float array `f` contains the frequency bin centers in cycles
per unit of the sample spacing (with zero at the start). For instance, if
the sample spacing is in seconds, then the frequency unit is cycles/second.
Given a window length `n` and a sam... | python | numpy/fft/_helper.py | 126 | [
"n",
"d",
"device"
] | false | 2 | 7.68 | numpy/numpy | 31,054 | numpy | false | |
appendExportsOfImportDeclaration | function appendExportsOfImportDeclaration(statements: Statement[] | undefined, decl: ImportDeclaration): Statement[] | undefined {
if (currentModuleInfo.exportEquals) {
return statements;
}
const importClause = decl.importClause;
if (!importClause) {
retur... | Appends the exports of an ImportDeclaration 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 whose exp... | typescript | src/compiler/transformers/module/module.ts | 1,960 | [
"statements",
"decl"
] | true | 5 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
contributesPair | boolean contributesPair() {
return this.contributesPair;
} | Return if any of the members contributes a name/value pair to the JSON.
@return if a name/value pair is contributed | java | core/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java | 352 | [] | true | 1 | 6.96 | spring-projects/spring-boot | 79,428 | javadoc | false | |
getNextDataPath | function getNextDataPath(fluentPropName?: string, prevDataPath?: string[]) {
if (fluentPropName === undefined || prevDataPath === undefined) return []
return [...prevDataPath, 'select', fluentPropName]
} | The fluent API makes that nested relations can be retrieved at once. It's a
helper for writing `select` statements on relations with a chaining api.
Because of this, we automatically add `select` statements to the query, that
also means that we need to provide a `dataPath` for unpacking nested values.
@see {getNextUser... | typescript | packages/client/src/runtime/core/model/applyFluent.ts | 20 | [
"fluentPropName?",
"prevDataPath?"
] | false | 3 | 7.04 | prisma/prisma | 44,834 | jsdoc | false | |
functions | function functions(object) {
return object == null ? [] : baseFunctions(object, keys(object));
} | Creates an array of function property names from own enumerable properties
of `object`.
@static
@since 0.1.0
@memberOf _
@category Object
@param {Object} object The object to inspect.
@returns {Array} Returns the function names.
@see _.functionsIn
@example
function Foo() {
this.a = _.constant('a');
this.b = _.const... | javascript | lodash.js | 13,177 | [
"object"
] | false | 2 | 7.12 | lodash/lodash | 61,490 | jsdoc | false | |
parseTypeAnnotation | function parseTypeAnnotation(): TypeNode | undefined {
return parseOptional(SyntaxKind.ColonToken) ? parseType() : undefined;
} | 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 | 4,961 | [] | true | 2 | 6.64 | microsoft/TypeScript | 107,154 | jsdoc | false | |
_is_sort_key_with_default_timestamp | def _is_sort_key_with_default_timestamp(sort_key: int) -> bool:
"""
Check if the sort key was generated with the DEFAULT_SORT_TIMESTAMP.
This is used to identify log records that don't have timestamp.
:param sort_key: The sort key to check
:return: True if the sort key was generated with DEFAULT_S... | Check if the sort key was generated with the DEFAULT_SORT_TIMESTAMP.
This is used to identify log records that don't have timestamp.
:param sort_key: The sort key to check
:return: True if the sort key was generated with DEFAULT_SORT_TIMESTAMP, False otherwise | python | airflow-core/src/airflow/utils/log/file_task_handler.py | 289 | [
"sort_key"
] | bool | true | 1 | 7.04 | apache/airflow | 43,597 | sphinx | false |
factoryContainsBean | private boolean factoryContainsBean(ConfigurableBeanFactory beanFactory, String beanName) {
return (beanFactory.containsBean(beanName) && !beanFactory.isCurrentlyInCreation(beanName));
} | Check the BeanFactory to see whether the bean named <var>beanName</var> already
exists. Accounts for the fact that the requested bean may be "in creation", i.e.:
we're in the middle of servicing the initial request for this bean. From an enhanced
factory method's perspective, this means that the bean does not actually ... | java | spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java | 500 | [
"beanFactory",
"beanName"
] | true | 2 | 7.84 | spring-projects/spring-framework | 59,386 | javadoc | false | |
to_period | def to_period(self, freq=None) -> PeriodIndex:
"""
Cast to PeriodArray/PeriodIndex at a particular frequency.
Converts DatetimeArray/Index to PeriodArray/PeriodIndex.
Parameters
----------
freq : str or Period, optional
One of pandas' :ref:`period aliases <t... | Cast to PeriodArray/PeriodIndex at a particular frequency.
Converts DatetimeArray/Index to PeriodArray/PeriodIndex.
Parameters
----------
freq : str or Period, optional
One of pandas' :ref:`period aliases <timeseries.period_aliases>`
or a Period object. Will be inferred by default.
Returns
-------
PeriodArra... | python | pandas/core/indexes/datetimes.py | 546 | [
"self",
"freq"
] | PeriodIndex | true | 1 | 6.48 | pandas-dev/pandas | 47,362 | numpy | false |
get_valid_filename | def get_valid_filename(name):
"""
Return the given string converted to a string that can be used for a clean
filename. Remove leading and trailing spaces; convert other spaces to
underscores; and remove anything that is not an alphanumeric, dash,
underscore, or dot.
>>> get_valid_filename("john'... | Return the given string converted to a string that can be used for a clean
filename. Remove leading and trailing spaces; convert other spaces to
underscores; and remove anything that is not an alphanumeric, dash,
underscore, or dot.
>>> get_valid_filename("john's portrait in 2004.jpg")
'johns_portrait_in_2004.jpg' | python | django/utils/text.py | 270 | [
"name"
] | false | 2 | 6.32 | django/django | 86,204 | unknown | false | |
nextAnchor | function nextAnchor(camelCaseWord: string, start: number): number {
for (let i = start; i < camelCaseWord.length; i++) {
const c = camelCaseWord.charCodeAt(i);
if (isUpper(c) || isNumber(c) || (i > 0 && !isAlphanumeric(camelCaseWord.charCodeAt(i - 1)))) {
return i;
}
}
return camelCaseWord.length;
} | Gets alternative codes to the character code passed in. This comes in the
form of an array of character codes, all of which must match _in order_ to
successfully match.
@param code The character code to check. | typescript | src/vs/base/common/filters.ts | 204 | [
"camelCaseWord",
"start"
] | true | 6 | 7.04 | microsoft/vscode | 179,840 | jsdoc | false | |
run_ruff | def run_ruff(self, fix: bool) -> tuple[int, str]:
"""
Original Author: Josh Wilson (@person142)
Source:
https://github.com/scipy/scipy/blob/main/tools/lint_diff.py
Unlike pycodestyle, ruff by itself is not capable of limiting
its output to the given diff.
"""
... | Original Author: Josh Wilson (@person142)
Source:
https://github.com/scipy/scipy/blob/main/tools/lint_diff.py
Unlike pycodestyle, ruff by itself is not capable of limiting
its output to the given diff. | python | tools/linter.py | 13 | [
"self",
"fix"
] | tuple[int, str] | true | 2 | 6.24 | numpy/numpy | 31,054 | unknown | false |
add | public <V> Member<V> add(String name, Supplier<@Nullable V> supplier) {
Assert.notNull(supplier, "'supplier' must not be null");
return add(name, (instance) -> supplier.get());
} | Add a new member with a supplied value.
@param <V> the value type
@param name the member name
@param supplier a supplier of the value
@return the added {@link Member} which may be configured further | java | core/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java | 225 | [
"name",
"supplier"
] | true | 1 | 6.96 | spring-projects/spring-boot | 79,428 | javadoc | false | |
append | public StrBuilder append(final String str) {
if (str == null) {
return appendNull();
}
final int strLen = str.length();
if (strLen > 0) {
final int len = length();
ensureCapacity(len + strLen);
str.getChars(0, strLen, buffer, len);
... | Appends a string to this string builder.
Appending null will call {@link #appendNull()}.
@param str the string to append
@return {@code this} instance. | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 624 | [
"str"
] | StrBuilder | true | 3 | 7.92 | apache/commons-lang | 2,896 | javadoc | false |
joinReason | public static String joinReason(JoinGroupRequestData request) {
String joinReason = request.reason();
if (joinReason == null || joinReason.isEmpty()) {
joinReason = "not provided";
}
return joinReason;
} | Get the client's join reason.
@param request The JoinGroupRequest.
@return The join reason. | java | clients/src/main/java/org/apache/kafka/common/requests/JoinGroupRequest.java | 164 | [
"request"
] | String | true | 3 | 7.76 | apache/kafka | 31,560 | javadoc | false |
lastIndexOf | public static int lastIndexOf(final double[] array, final double valueToFind, final double tolerance) {
return lastIndexOf(array, valueToFind, Integer.MAX_VALUE, tolerance);
} | Finds the last index of the given value within a given tolerance in the array. This method will return the index of the last value which falls between
the region defined by valueToFind - tolerance and valueToFind + tolerance.
<p>
This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.
... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 3,919 | [
"array",
"valueToFind",
"tolerance"
] | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
toLocalDateTime | public static LocalDateTime toLocalDateTime(final Calendar calendar) {
return LocalDateTime.ofInstant(calendar.toInstant(), toZoneId(calendar));
} | Converts a Calendar to a LocalDateTime.
@param calendar the Calendar to convert.
@return a LocalDateTime.
@since 3.17.0 | java | src/main/java/org/apache/commons/lang3/time/CalendarUtils.java | 74 | [
"calendar"
] | LocalDateTime | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false |
getReturnOccurrences | function getReturnOccurrences(returnStatement: ReturnStatement, sourceFile: SourceFile): Node[] | undefined {
const func = getContainingFunction(returnStatement) as FunctionLikeDeclaration;
if (!func) {
return undefined;
}
const keywords: Node[] = [];
forEachR... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | typescript | src/services/documentHighlights.ts | 452 | [
"returnStatement",
"sourceFile"
] | true | 2 | 6 | microsoft/TypeScript | 107,154 | jsdoc | false | |
checkJarHell | @SuppressForbidden(reason = "needs JarFile for speed, just reading entries")
public static void checkJarHell(Set<URL> urls, Consumer<String> output) throws IOException {
// we don't try to be sneaky and use deprecated/internal/not portable stuff
// like sun.boot.class.path, and with jigsaw we don't ... | Checks the set of URLs for duplicate classes
@param urls A set of URLs from the system class loader to be checked for conflicting jars
@param output A {@link String} {@link Consumer} to which debug output will be sent
@throws IllegalStateException if jar hell was found | java | libs/core/src/main/java/org/elasticsearch/jdk/JarHell.java | 201 | [
"urls",
"output"
] | void | true | 9 | 6.16 | elastic/elasticsearch | 75,680 | javadoc | false |
onFailure | default @Nullable Object onFailure(ConfigurationPropertyName name, Bindable<?> target, BindContext context,
Exception error) throws Exception {
throw error;
} | Called when binding fails for any reason (including failures from
{@link #onSuccess} or {@link #onCreate} calls). Implementations may choose to
swallow exceptions and return an alternative result.
@param name the name of the element being bound
@param target the item being bound
@param context the bind context
@param e... | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindHandler.java | 92 | [
"name",
"target",
"context",
"error"
] | Object | true | 1 | 6.64 | spring-projects/spring-boot | 79,428 | javadoc | false |
_build_names_mapper | def _build_names_mapper(
rownames: list[str], colnames: list[str]
) -> tuple[dict[str, str], list[str], dict[str, str], list[str]]:
"""
Given the names of a DataFrame's rows and columns, returns a set of unique row
and column names and mappers that convert to original names.
A row or column name is... | Given the names of a DataFrame's rows and columns, returns a set of unique row
and column names and mappers that convert to original names.
A row or column name is replaced if it is duplicate among the rows of the inputs,
among the columns of the inputs or between the rows and the columns.
Parameters
----------
rowna... | python | pandas/core/reshape/pivot.py | 1,233 | [
"rownames",
"colnames"
] | tuple[dict[str, str], list[str], dict[str, str], list[str]] | true | 3 | 6.4 | pandas-dev/pandas | 47,362 | numpy | false |
filterJsxAttributes | function filterJsxAttributes(symbols: Symbol[], attributes: NodeArray<JsxAttribute | JsxSpreadAttribute>): Symbol[] {
const seenNames = new Set<__String>();
const membersDeclaredBySpreadAssignment = new Set<string>();
for (const attr of attributes) {
// If this is the current ite... | Filters out completion suggestions from 'symbols' according to existing JSX attributes.
@returns Symbols to be suggested in a JSX element, barring those whose attributes
do not occur at the current position and have not otherwise been typed. | typescript | src/services/completions.ts | 5,289 | [
"symbols",
"attributes"
] | true | 5 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
getLibrary | public <T extends NativeLibrary> T getLibrary(Class<T> cls) {
Supplier<?> libraryCtor = libraries.get(cls);
Object library = libraryCtor.get();
assert library != null;
assert cls.isAssignableFrom(library.getClass());
return cls.cast(library);
} | Construct an instance of the given library class.
@param cls The library class to create
@return An instance of the class | java | libs/native/src/main/java/org/elasticsearch/nativeaccess/lib/NativeLibraryProvider.java | 54 | [
"cls"
] | T | true | 1 | 7.04 | elastic/elasticsearch | 75,680 | javadoc | false |
createTask | private Callable<T> createTask(final ExecutorService execDestroy) {
return new InitializationTask(execDestroy);
} | Creates a task for the background initialization. The {@link Callable}
object returned by this method is passed to the {@link ExecutorService}.
This implementation returns a task that invokes the {@link #initialize()}
method. If a temporary {@link ExecutorService} is used, it is destroyed
at the end of the task.
@param... | java | src/main/java/org/apache/commons/lang3/concurrent/BackgroundInitializer.java | 238 | [
"execDestroy"
] | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false | |
addAll | @CanIgnoreReturnValue
@Override
public Builder<E> addAll(Iterable<? extends E> elements) {
if (elements instanceof Multiset) {
Multiset<? extends E> multiset = (Multiset<? extends E>) elements;
multiset.forEachEntry((e, n) -> contents.add(checkNotNull(e), n));
} else {
super.... | Adds each element of {@code elements} to the {@code ImmutableMultiset}.
@param elements the {@code Iterable} to add to the {@code ImmutableMultiset}
@return this {@code Builder} object
@throws NullPointerException if {@code elements} is null or contains a null element | java | guava/src/com/google/common/collect/ImmutableMultiset.java | 559 | [
"elements"
] | true | 2 | 7.44 | google/guava | 51,352 | javadoc | false | |
dot | def dot(self, other: AnyArrayLike | DataFrame) -> DataFrame | Series:
"""
Compute the matrix multiplication between the DataFrame and other.
This method computes the matrix product between the DataFrame and the
values of an other Series, DataFrame or a numpy array.
It can also ... | Compute the matrix multiplication between the DataFrame and other.
This method computes the matrix product between the DataFrame and the
values of an other Series, DataFrame or a numpy array.
It can also be called using ``self @ other``.
Parameters
----------
other : Series, DataFrame or array-like
The other obj... | python | pandas/core/frame.py | 1,692 | [
"self",
"other"
] | DataFrame | Series | true | 12 | 8.4 | pandas-dev/pandas | 47,362 | numpy | false |
findCacheOperations | protected abstract @Nullable Collection<CacheOperation> findCacheOperations(Class<?> clazz); | Subclasses need to implement this to return the cache operations for the
given class, if any.
@param clazz the class to retrieve the cache operations for
@return all cache operations associated with this class, or {@code null} if none | java | spring-context/src/main/java/org/springframework/cache/interceptor/AbstractFallbackCacheOperationSource.java | 184 | [
"clazz"
] | true | 1 | 6.48 | spring-projects/spring-framework | 59,386 | javadoc | false | |
toString | @Override
public String toString() {
PropertyValue[] pvs = getPropertyValues();
if (pvs.length > 0) {
return "PropertyValues: length=" + pvs.length + "; " + StringUtils.arrayToDelimitedString(pvs, "; ");
}
return "PropertyValues: length=0";
} | Return whether this holder contains converted values only ({@code true}),
or whether the values still need to be converted ({@code false}). | java | spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java | 379 | [] | String | true | 2 | 6.88 | spring-projects/spring-framework | 59,386 | javadoc | false |
replace | @Deprecated
public static String replace(final String text, final String searchString, final String replacement) {
return Strings.CS.replace(text, searchString, replacement);
} | Replaces all occurrences of a String within another String.
<p>
A {@code null} reference passed to this method is a no-op.
</p>
<pre>
StringUtils.replace(null, *, *) = null
StringUtils.replace("", *, *) = ""
StringUtils.replace("any", null, *) = "any"
StringUtils.replace("any", *, null) = "any"
St... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 6,153 | [
"text",
"searchString",
"replacement"
] | String | true | 1 | 6.48 | apache/commons-lang | 2,896 | javadoc | false |
registerBeanDefinitions | public int registerBeanDefinitions(Document doc, Resource resource) throws BeanDefinitionStoreException {
BeanDefinitionDocumentReader documentReader = createBeanDefinitionDocumentReader();
int countBefore = getRegistry().getBeanDefinitionCount();
documentReader.registerBeanDefinitions(doc, createReaderContext(re... | Register the bean definitions contained in the given DOM document.
Called by {@code loadBeanDefinitions}.
<p>Creates a new instance of the parser class and invokes
{@code registerBeanDefinitions} on it.
@param doc the DOM document
@param resource the resource descriptor (for context information)
@return the number of b... | java | spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java | 515 | [
"doc",
"resource"
] | true | 1 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false | |
_validate_integer | def _validate_integer(self, key: int | np.integer, axis: AxisInt) -> None:
"""
Check that 'key' is a valid position in the desired axis.
Parameters
----------
key : int
Requested position.
axis : int
Desired axis.
Raises
------
... | Check that 'key' is a valid position in the desired axis.
Parameters
----------
key : int
Requested position.
axis : int
Desired axis.
Raises
------
IndexError
If 'key' is not a valid position in axis 'axis'. | python | pandas/core/indexing.py | 1,688 | [
"self",
"key",
"axis"
] | None | true | 3 | 6.72 | pandas-dev/pandas | 47,362 | numpy | false |
fill | public static long[] fill(final long[] a, final long val) {
if (a != null) {
Arrays.fill(a, val);
}
return a;
} | Fills and returns the given array, assigning the given {@code long} value to each element of the array.
@param a the array to be filled (may be null).
@param val the value to be stored in all elements of the array.
@return the given array.
@see Arrays#fill(long[],long) | java | src/main/java/org/apache/commons/lang3/ArrayFill.java | 131 | [
"a",
"val"
] | true | 2 | 8.08 | apache/commons-lang | 2,896 | javadoc | false | |
previousIndex | @Override
public int previousIndex() {
return tokenPos - 1;
} | Gets the index of the previous token.
@return the previous token index. | java | src/main/java/org/apache/commons/lang3/text/StrTokenizer.java | 680 | [] | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
clear_db_references | def clear_db_references(self, session: Session):
"""
Clear db tables that have a reference to this instance.
:param session: ORM Session
:meta private:
"""
from airflow.models.renderedtifields import RenderedTaskInstanceFields
tables: list[type[TaskInstanceDepe... | Clear db tables that have a reference to this instance.
:param session: ORM Session
:meta private: | python | airflow-core/src/airflow/models/taskinstance.py | 2,083 | [
"self",
"session"
] | true | 3 | 7.04 | apache/airflow | 43,597 | sphinx | false | |
truePredicate | @SuppressWarnings("unchecked")
static <E extends Throwable> FailableDoublePredicate<E> truePredicate() {
return TRUE;
} | Gets the TRUE singleton.
@param <E> The kind of thrown exception or error.
@return The NOP singleton. | java | src/main/java/org/apache/commons/lang3/function/FailableDoublePredicate.java | 57 | [] | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false | |
createCurry | function createCurry(func, bitmask, arity) {
var Ctor = createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length,
placeholder = getHolder(wrapper);
while (index--) {
args[index] = arguments[inde... | Creates a function that wraps `func` to enable currying.
@private
@param {Function} func The function to wrap.
@param {number} bitmask The bitmask flags. See `createWrap` for more details.
@param {number} arity The arity of `func`.
@returns {Function} Returns the new wrapped function. | javascript | lodash.js | 5,117 | [
"func",
"bitmask",
"arity"
] | false | 9 | 6.08 | lodash/lodash | 61,490 | jsdoc | false | |
substituteNode | function substituteNode(hint: EmitHint, node: Node) {
Debug.assert(state < TransformationState.Disposed, "Cannot substitute a node after the result is disposed.");
return node && isSubstitutionEnabled(node) && onSubstituteNode(hint, node) || node;
} | Emits a node with possible substitution.
@param hint A hint as to the intended usage of the node.
@param node The node to emit.
@param emitCallback The callback used to emit the node or its substitute. | typescript | src/compiler/transformer.ts | 385 | [
"hint",
"node"
] | false | 4 | 6 | microsoft/TypeScript | 107,154 | jsdoc | false | |
extract | @Nullable R extract(@NonNull T value); | Extract from the given value.
@param value the source value (never {@code null})
@return an extracted value or {@code null} | java | core/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java | 1,078 | [
"value"
] | R | true | 1 | 6.8 | spring-projects/spring-boot | 79,428 | javadoc | false |
apply | public static <T, U, R, E extends Throwable> R apply(final FailableBiFunction<T, U, R, E> function, final T input1,
final U input2) {
return get(() -> function.apply(input1, input2));
} | Applies a function and rethrows any exception as a {@link RuntimeException}.
@param function the function to apply
@param input1 the first input to apply {@code function} on
@param input2 the second input to apply {@code function} on
@param <T> the type of the first argument the function accepts
@param <U> the type of ... | java | src/main/java/org/apache/commons/lang3/function/Failable.java | 146 | [
"function",
"input1",
"input2"
] | R | true | 1 | 6.48 | apache/commons-lang | 2,896 | javadoc | false |
log | private void log(LogLevel level, Object message, @Nullable Throwable t) {
synchronized (this.lines) {
if (this.destination != null) {
level.log(this.destination, message, t);
}
else {
this.lines.add(this.destinationSupplier, level, message, t);
}
}
} | Create a new {@link DeferredLog} instance managed by a {@link DeferredLogFactory}.
@param destination the switch-over destination
@param lines the lines backing all related deferred logs
@since 2.4.0 | java | core/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java | 167 | [
"level",
"message",
"t"
] | void | true | 2 | 6.4 | spring-projects/spring-boot | 79,428 | javadoc | false |
_generate_kernel_call_helper | def _generate_kernel_call_helper(
self,
kernel_name: str,
call_args,
*,
device=None,
triton=True,
arg_types=None,
raw_keys=None,
raw_args=None,
triton_meta=None,
graph_name="",
original_fxnode_name=None,
):
"""
... | Generates kernel call code.
triton: Defines whether the GPU backend uses Triton for codegen.
Otherwise it uses the CUDA language for codegen.
Only valid when cuda == True. | python | torch/_inductor/codegen/cpp_wrapper_cpu_array_ref.py | 106 | [
"self",
"kernel_name",
"call_args",
"device",
"triton",
"arg_types",
"raw_keys",
"raw_args",
"triton_meta",
"graph_name",
"original_fxnode_name"
] | true | 5 | 6.88 | pytorch/pytorch | 96,034 | unknown | false | |
dtypes | def dtypes(self) -> Series:
"""
Return the dtypes as a Series for the underlying MultiIndex.
See Also
--------
Index.dtype : Return the dtype object of the underlying data.
Series.dtypes : Return the data type of the underlying Series.
Examples
--------
... | Return the dtypes as a Series for the underlying MultiIndex.
See Also
--------
Index.dtype : Return the dtype object of the underlying data.
Series.dtypes : Return the data type of the underlying Series.
Examples
--------
>>> idx = pd.MultiIndex.from_product(
... [(0, 1, 2), ("green", "purple")], names=["number",... | python | pandas/core/indexes/multi.py | 773 | [
"self"
] | Series | true | 1 | 6.8 | pandas-dev/pandas | 47,362 | unknown | false |
matches | public boolean matches(String name, List<FilterPath> nextFilters, boolean matchFieldNamesWithDots) { // << here
if (nextFilters == null) {
return false;
}
// match dot first
if (matchFieldNamesWithDots) {
// contains dot and not the first or last char
... | check if the name matches filter nodes
if the name equals the filter node name, the node will add to nextFilters.
if the filter node is a final node, it means the name matches the pattern, and return true
if the name don't equal a final node, then return false, continue to check the inner filter node
if current node is... | java | libs/x-content/src/main/java/org/elasticsearch/xcontent/support/filtering/FilterPath.java | 78 | [
"name",
"nextFilters",
"matchFieldNamesWithDots"
] | true | 11 | 7.92 | elastic/elasticsearch | 75,680 | javadoc | false | |
nextFetchedRecord | private boolean nextFetchedRecord(final boolean checkCrcs) {
while (true) {
if (records == null || !records.hasNext()) {
maybeCloseRecordStream();
if (!batches.hasNext()) {
drain();
lastRecord = null;
break;... | Scans for the next record in the available batches, skipping control records
@param checkCrcs Whether to check the CRC of fetched records
@return true if the current batch has more records, else false | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareCompletedFetch.java | 358 | [
"checkCrcs"
] | true | 7 | 7.44 | apache/kafka | 31,560 | javadoc | false | |
createClassLoader | protected ClassLoader createClassLoader(Collection<URL> urls) throws Exception {
return createClassLoader(urls.toArray(new URL[0]));
} | Create a classloader for the specified archives.
@param urls the classpath URLs
@return the classloader
@throws Exception if the classloader cannot be created | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/Launcher.java | 81 | [
"urls"
] | ClassLoader | true | 1 | 6.8 | spring-projects/spring-boot | 79,428 | javadoc | false |
limit | public Splitter limit(int maxItems) {
checkArgument(maxItems > 0, "must be greater than zero: %s", maxItems);
return new Splitter(strategy, omitEmptyStrings, trimmer, maxItems);
} | Returns a splitter that behaves equivalently to {@code this} splitter but stops splitting after
it reaches the limit. The limit defines the maximum number of items returned by the iterator,
or the maximum size of the list returned by {@link #splitToList}.
<p>For example, {@code Splitter.on(',').limit(3).split("a,b,c,d"... | java | android/guava/src/com/google/common/base/Splitter.java | 326 | [
"maxItems"
] | Splitter | true | 1 | 6.32 | google/guava | 51,352 | javadoc | false |
always | @SuppressWarnings("unchecked")
public static <T> Predicate<T> always() {
return (Predicate<T>) ALWAYS;
} | @return a predicate that accepts all input values
@param <T> type of the predicate | java | libs/core/src/main/java/org/elasticsearch/core/Predicates.java | 82 | [] | true | 1 | 6.32 | elastic/elasticsearch | 75,680 | javadoc | false | |
_flush_logs_out_of_heap | def _flush_logs_out_of_heap(
heap: list[tuple[int, StructuredLogMessage]],
flush_size: int,
last_log_container: list[StructuredLogMessage | None],
) -> Generator[StructuredLogMessage, None, None]:
"""
Flush logs out of the heap, deduplicating them based on the last log.
:param heap: heap to flu... | Flush logs out of the heap, deduplicating them based on the last log.
:param heap: heap to flush logs from
:param flush_size: number of logs to flush
:param last_log_container: a container to store the last log, to avoid duplicate logs
:return: a generator that yields deduplicated logs | python | airflow-core/src/airflow/utils/log/file_task_handler.py | 332 | [
"heap",
"flush_size",
"last_log_container"
] | Generator[StructuredLogMessage, None, None] | true | 4 | 8.4 | apache/airflow | 43,597 | sphinx | false |
to_pytimedelta | def to_pytimedelta(self) -> npt.NDArray[np.object_]:
"""
Return an ndarray of datetime.timedelta objects.
Returns
-------
numpy.ndarray
A NumPy ``timedelta64`` object representing the same duration as the
original pandas ``Timedelta`` object. The precisio... | Return an ndarray of datetime.timedelta objects.
Returns
-------
numpy.ndarray
A NumPy ``timedelta64`` object representing the same duration as the
original pandas ``Timedelta`` object. The precision of the resulting
object is in nanoseconds, which is the default
time resolution used by pandas for ``Ti... | python | pandas/core/arrays/timedeltas.py | 827 | [
"self"
] | npt.NDArray[np.object_] | true | 1 | 6.64 | pandas-dev/pandas | 47,362 | unknown | false |
empty | public static ConditionMessage empty() {
return new ConditionMessage();
} | Factory method to return a new empty {@link ConditionMessage}.
@return a new empty {@link ConditionMessage} | java | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java | 139 | [] | ConditionMessage | true | 1 | 6 | spring-projects/spring-boot | 79,428 | javadoc | false |
addCopies | @CanIgnoreReturnValue
public Builder<E> addCopies(E element, int occurrences) {
contents.add(checkNotNull(element), occurrences);
return this;
} | Adds a number of occurrences of an element to this {@code ImmutableMultiset}.
@param element the element to add
@param occurrences the number of occurrences of the element to add. May be zero, in which
case no change will be made.
@return this {@code Builder} object
@throws NullPointerException if {@code element} i... | java | guava/src/com/google/common/collect/ImmutableMultiset.java | 530 | [
"element",
"occurrences"
] | true | 1 | 6.56 | google/guava | 51,352 | javadoc | false | |
once | function once<T>(event: Event<T>): Event<T> {
return (listener, thisArgs = null, disposables?) => {
// we need this, in case the event fires during the listener call
let didFire = false;
let result: Disposable | undefined = undefined;
result = event(e => {
if (didFire) {
return;
} else if (result) {
... | Given an event, returns another event which only fires once.
@param event The event source for the new event. | typescript | extensions/microsoft-authentication/src/common/async.ts | 83 | [
"event"
] | true | 6 | 7.2 | microsoft/vscode | 179,840 | jsdoc | false | |
capitalizeFully | public static String capitalizeFully(final String str, final char... delimiters) {
final int delimLen = delimiters == null ? -1 : delimiters.length;
if (StringUtils.isEmpty(str) || delimLen == 0) {
return str;
}
return capitalize(str.toLowerCase(), delimiters);
} | Converts all the delimiter separated words in a String into capitalized words,
that is each word is made up of a titlecase character and then a series of
lowercase characters.
<p>The delimiters represent a set of characters understood to separate words.
The first string character and the first non-delimiter character a... | java | src/main/java/org/apache/commons/lang3/text/WordUtils.java | 163 | [
"str"
] | String | true | 4 | 7.44 | apache/commons-lang | 2,896 | javadoc | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.