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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
get_git_log_command | def get_git_log_command(
verbose: bool, from_commit: str | None = None, to_commit: str | None = None
) -> list[str]:
"""
Get git command to run for the current repo from the current folder (which is the package folder).
:param verbose: whether to print verbose info while getting the command
:param f... | Get git command to run for the current repo from the current folder (which is the package folder).
:param verbose: whether to print verbose info while getting the command
:param from_commit: if present - base commit from which to start the log from
:param to_commit: if present - final commit which should be the start o... | python | dev/assign_cherry_picked_prs_with_milestone.py | 170 | [
"verbose",
"from_commit",
"to_commit"
] | list[str] | true | 5 | 8.08 | apache/airflow | 43,597 | sphinx | false |
wait_for_crawler_completion | def wait_for_crawler_completion(self, crawler_name: str, poll_interval: int = 5) -> str:
"""
Wait until Glue crawler completes; returns the status of the latest crawl or raises AirflowException.
:param crawler_name: unique crawler name per AWS account
:param poll_interval: Time (in seco... | Wait until Glue crawler completes; returns the status of the latest crawl or raises AirflowException.
:param crawler_name: unique crawler name per AWS account
:param poll_interval: Time (in seconds) to wait between two consecutive calls to check crawler status
:return: Crawler's status | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/glue_crawler.py | 173 | [
"self",
"crawler_name",
"poll_interval"
] | str | true | 1 | 6.4 | apache/airflow | 43,597 | sphinx | false |
newProxy | <T> T newProxy(T target, Class<T> interfaceType, long timeoutDuration, TimeUnit timeoutUnit); | Returns an instance of {@code interfaceType} that delegates all method calls to the {@code
target} object, enforcing the specified time limit on each call. This time-limited delegation
is also performed for calls to {@link Object#equals}, {@link Object#hashCode}, and {@link
Object#toString}.
<p>If the target method cal... | java | android/guava/src/com/google/common/util/concurrent/TimeLimiter.java | 81 | [
"target",
"interfaceType",
"timeoutDuration",
"timeoutUnit"
] | T | true | 1 | 6.32 | google/guava | 51,352 | javadoc | false |
argmax | def argmax(
self, axis: AxisInt | None = None, skipna: bool = True, *args, **kwargs
) -> int:
"""
Return int position of the {value} value in the Series.
If the {op}imum is achieved in multiple locations,
the first row position is returned.
Parameters
------... | Return int position of the {value} value in the Series.
If the {op}imum is achieved in multiple locations,
the first row position is returned.
Parameters
----------
axis : {{None}}
Unused. Parameter needed for compatibility with DataFrame.
skipna : bool, default True
Exclude NA/null values. If the entire Seri... | python | pandas/core/base.py | 754 | [
"self",
"axis",
"skipna"
] | int | true | 3 | 8.4 | pandas-dev/pandas | 47,362 | numpy | false |
unifyCollisionChars | public static String unifyCollisionChars(String topic) {
return topic.replace('.', '_');
} | Unify topic name with a period ('.') or underscore ('_'), this is only used to check collision and will not
be used to really change topic name.
@param topic A topic to unify
@return A unified topic name | java | clients/src/main/java/org/apache/kafka/common/internals/Topic.java | 95 | [
"topic"
] | String | true | 1 | 6.96 | apache/kafka | 31,560 | javadoc | false |
refreshCheckDelayElapsed | private boolean refreshCheckDelayElapsed() {
if (this.refreshCheckDelay < 0) {
return false;
}
long currentTimeMillis = System.currentTimeMillis();
if (this.lastRefreshCheck < 0 || currentTimeMillis - this.lastRefreshCheck > this.refreshCheckDelay) {
// Going to perform a refresh check - update the time... | Set the delay between refresh checks, in milliseconds.
Default is -1, indicating no refresh checks at all.
<p>Note that an actual refresh will only happen when
{@link #requiresRefresh()} returns {@code true}. | java | spring-aop/src/main/java/org/springframework/aop/target/dynamic/AbstractRefreshableTargetSource.java | 107 | [] | true | 4 | 6.88 | spring-projects/spring-framework | 59,386 | javadoc | false | |
findCause | @SuppressWarnings("unchecked")
protected final <E extends Throwable> @Nullable E findCause(@Nullable Throwable failure, Class<E> type) {
while (failure != null) {
if (type.isInstance(failure)) {
return (E) failure;
}
failure = failure.getCause();
}
return null;
} | Return the cause type being handled by the analyzer. By default the class generic
is used.
@return the cause type | java | core/spring-boot/src/main/java/org/springframework/boot/diagnostics/AbstractFailureAnalyzer.java | 63 | [
"failure",
"type"
] | E | true | 3 | 7.04 | spring-projects/spring-boot | 79,428 | javadoc | false |
callHasExpired | boolean callHasExpired(Call call) {
int remainingMs = calcTimeoutMsRemainingAsInt(now, call.deadlineMs);
if (remainingMs < 0)
return true;
nextTimeoutMs = Math.min(nextTimeoutMs, remainingMs);
return false;
} | Check whether a call should be timed out.
The remaining milliseconds until the next timeout will be updated.
@param call The call.
@return True if the call should be timed out. | java | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java | 1,068 | [
"call"
] | true | 2 | 8.24 | apache/kafka | 31,560 | javadoc | false | |
equals | @Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
KafkaChannel that = (KafkaChannel) o;
return id.equals(that.id);
} | @return true if underlying transport has bytes remaining to be read from any underlying intermediate buffers. | java | clients/src/main/java/org/apache/kafka/common/network/KafkaChannel.java | 479 | [
"o"
] | true | 4 | 6.72 | apache/kafka | 31,560 | javadoc | false | |
contains | public static boolean contains(int[] array, int target) {
for (int value : array) {
if (value == target) {
return true;
}
}
return false;
} | Returns {@code true} if {@code target} is present as an element anywhere in {@code array}.
@param array an array of {@code int} values, possibly empty
@param target a primitive {@code int} value
@return {@code true} if {@code array[i] == target} for some value of {@code i} | java | android/guava/src/com/google/common/primitives/Ints.java | 141 | [
"array",
"target"
] | true | 2 | 8.08 | google/guava | 51,352 | javadoc | false | |
contains | public static boolean contains(final short[] array, final short valueToFind) {
return indexOf(array, valueToFind) != INDEX_NOT_FOUND;
} | Checks if the value is in the given array.
<p>
The method returns {@code false} if a {@code null} array is passed in.
</p>
<p>
If the {@code array} elements you are searching implement {@link Comparator}, consider whether it is worth using
{@link Arrays#sort(short[])} and {@link Arrays#binarySearch(short[], short)}.
</... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 1,742 | [
"array",
"valueToFind"
] | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
trimEnd | function trimEnd(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.slice(0, trimmedEndIndex(string) + 1);
}
if (!string || !(chars = baseToString(chars))) {
return string;
}
var strSymbols = stringToArray(... | Removes trailing whitespace or specified characters from `string`.
@static
@memberOf _
@since 4.0.0
@category String
@param {string} [string=''] The string to trim.
@param {string} [chars=whitespace] The characters to trim.
@param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
@returns {string} ... | javascript | lodash.js | 15,101 | [
"string",
"chars",
"guard"
] | false | 6 | 7.36 | lodash/lodash | 61,490 | jsdoc | false | |
toUnescapedString | public String toUnescapedString() {
return toString(false);
} | Return a string representation of the path without any escaping.
@return the unescaped string representation | java | core/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java | 827 | [] | String | true | 1 | 6.32 | spring-projects/spring-boot | 79,428 | javadoc | false |
applyInvalidArgumentTypeError | function applyInvalidArgumentTypeError(error: InvalidArgumentTypeError, args: ArgumentsRenderingTree) {
const argName = error.argument.name
const selection = args.arguments.getDeepSubSelectionValue(error.selectionPath)?.asObject()
if (selection) {
selection.getDeepFieldValue(error.argumentPath)?.markAsError()... | Given the validation error and arguments rendering tree, applies corresponding
formatting to an error tree and adds all relevant messages.
@param error
@param args | typescript | packages/client/src/runtime/core/errorRendering/applyValidationError.ts | 418 | [
"error",
"args"
] | false | 2 | 6.08 | prisma/prisma | 44,834 | jsdoc | false | |
estimator_checks_generator | def estimator_checks_generator(
estimator,
*,
legacy: bool = True,
expected_failed_checks: dict[str, str] | None = None,
mark: Literal["xfail", "skip", None] = None,
xfail_strict: bool | None = None,
):
"""Iteratively yield all check callables for an estimator.
This function is used by
... | Iteratively yield all check callables for an estimator.
This function is used by
:func:`~sklearn.utils.estimator_checks.parametrize_with_checks` and
:func:`~sklearn.utils.estimator_checks.check_estimator` to yield all check callables
for an estimator. In most cases, these functions should be used instead. When
impleme... | python | sklearn/utils/estimator_checks.py | 513 | [
"estimator",
"legacy",
"expected_failed_checks",
"mark",
"xfail_strict"
] | true | 5 | 6.48 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
partial_fit | def partial_fit(self, X, y=None, W=None, H=None):
"""Update the model using the data in `X` as a mini-batch.
This method is expected to be called several times consecutively
on different chunks of a dataset so as to implement out-of-core
or online learning.
This is especially u... | Update the model using the data in `X` as a mini-batch.
This method is expected to be called several times consecutively
on different chunks of a dataset so as to implement out-of-core
or online learning.
This is especially useful when the whole dataset is too big to fit in
memory at once (see :ref:`scaling_strategie... | python | sklearn/decomposition/_nmf.py | 2,343 | [
"self",
"X",
"y",
"W",
"H"
] | false | 3 | 6.08 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
transformAndEmitBlock | function transformAndEmitBlock(node: Block): void {
if (containsYield(node)) {
transformAndEmitStatements(node.statements);
}
else {
emitStatement(visitNode(node, visitor, isStatement));
}
} | Visits an ElementAccessExpression that contains a YieldExpression.
@param node The node to visit. | typescript | src/compiler/transformers/generators.ts | 1,343 | [
"node"
] | true | 3 | 6.08 | microsoft/TypeScript | 107,154 | jsdoc | false | |
randomDouble | public double randomDouble(final double startInclusive, final double endExclusive) {
Validate.isTrue(endExclusive >= startInclusive, "Start value must be smaller or equal to end value.");
Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative.");
if (startInclusive == endEx... | Generates a random double within the specified range.
@param startInclusive the smallest value that can be returned, must be non-negative.
@param endExclusive the upper bound (not included).
@throws IllegalArgumentException if {@code startInclusive > endExclusive} or if {@code startInclusive} is negative.
@return the... | java | src/main/java/org/apache/commons/lang3/RandomUtils.java | 342 | [
"startInclusive",
"endExclusive"
] | true | 2 | 7.44 | apache/commons-lang | 2,896 | javadoc | false | |
supportsEventType | @Override
public boolean supportsEventType(ResolvableType eventType) {
return (this.delegate == null || this.delegate.supportsEventType(eventType));
} | Create a SourceFilteringListener for the given event source,
expecting subclasses to override the {@link #onApplicationEventInternal}
method (instead of specifying a delegate listener).
@param source the event source that this listener filters for,
only processing events from this source | java | spring-context/src/main/java/org/springframework/context/event/SourceFilteringListener.java | 77 | [
"eventType"
] | true | 2 | 6 | spring-projects/spring-framework | 59,386 | javadoc | false | |
doResolveBeanClass | private @Nullable Class<?> doResolveBeanClass(RootBeanDefinition mbd, Class<?>... typesToMatch)
throws ClassNotFoundException {
ClassLoader beanClassLoader = getBeanClassLoader();
ClassLoader dynamicLoader = beanClassLoader;
boolean freshResolve = false;
if (!ObjectUtils.isEmpty(typesToMatch)) {
// When... | Resolve the bean class for the specified bean definition,
resolving a bean class name into a Class reference (if necessary)
and storing the resolved Class in the bean definition for further use.
@param mbd the merged bean definition to determine the class for
@param beanName the name of the bean (for error handling pur... | java | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java | 1,582 | [
"mbd"
] | true | 12 | 7.68 | spring-projects/spring-framework | 59,386 | javadoc | false | |
is_lazy_array | def is_lazy_array(x: object) -> bool:
"""Return True if x is potentially a future or it may be otherwise impossible or
expensive to eagerly read its contents, regardless of their size, e.g. by
calling ``bool(x)`` or ``float(x)``.
Return False otherwise; e.g. ``bool(x)`` etc. is guaranteed to succeed an... | Return True if x is potentially a future or it may be otherwise impossible or
expensive to eagerly read its contents, regardless of their size, e.g. by
calling ``bool(x)`` or ``float(x)``.
Return False otherwise; e.g. ``bool(x)`` etc. is guaranteed to succeed and to be
cheap as long as the array has the right dtype an... | python | sklearn/externals/array_api_compat/common/_helpers.py | 973 | [
"x"
] | bool | true | 5 | 6 | scikit-learn/scikit-learn | 64,340 | unknown | false |
maybe_lift_tracked_freevar_to_input | def maybe_lift_tracked_freevar_to_input(self, arg: Any) -> Any:
"""
If arg is a free variable, then lift it to be an input.
Returns the new lifted arg (if arg was a freevar), else the
original arg.
"""
if not isinstance(arg, torch.fx.Proxy):
# Note: arg can be... | If arg is a free variable, then lift it to be an input.
Returns the new lifted arg (if arg was a freevar), else the
original arg. | python | torch/_dynamo/output_graph.py | 3,502 | [
"self",
"arg"
] | Any | true | 5 | 6 | pytorch/pytorch | 96,034 | unknown | false |
allequal | def allequal(a, b, fill_value=True):
"""
Return True if all entries of a and b are equal, using
fill_value as a truth value where either or both are masked.
Parameters
----------
a, b : array_like
Input arrays to compare.
fill_value : bool, optional
Whether masked values in ... | Return True if all entries of a and b are equal, using
fill_value as a truth value where either or both are masked.
Parameters
----------
a, b : array_like
Input arrays to compare.
fill_value : bool, optional
Whether masked values in a or b are considered equal (True) or not
(False).
Returns
-------
y : b... | python | numpy/ma/core.py | 8,387 | [
"a",
"b",
"fill_value"
] | false | 4 | 7.6 | numpy/numpy | 31,054 | numpy | false | |
skipTimeZone | static boolean skipTimeZone(final String tzId) {
return tzId.equalsIgnoreCase(TimeZones.GMT_ID);
} | Tests whether to skip the given time zone, true if TimeZone.getTimeZone().
<p>
On Java 25 and up, skips short IDs if {@code ignoreTimeZoneShortIDs} is true.
</p>
<p>
This method is package private only for testing.
</p>
@param tzId the ID to test.
@return Whether to skip the given time zone ID. | java | src/main/java/org/apache/commons/lang3/time/FastDateParser.java | 522 | [
"tzId"
] | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false | |
_reorder_for_extension_array_stack | def _reorder_for_extension_array_stack(
arr: ExtensionArray, n_rows: int, n_columns: int
) -> ExtensionArray:
"""
Re-orders the values when stacking multiple extension-arrays.
The indirect stacking method used for EAs requires a followup
take to get the order correct.
Parameters
----------... | Re-orders the values when stacking multiple extension-arrays.
The indirect stacking method used for EAs requires a followup
take to get the order correct.
Parameters
----------
arr : ExtensionArray
n_rows, n_columns : int
The number of rows and columns in the original DataFrame.
Returns
-------
taken : Extension... | python | pandas/core/reshape/reshape.py | 933 | [
"arr",
"n_rows",
"n_columns"
] | ExtensionArray | true | 1 | 6.8 | pandas-dev/pandas | 47,362 | numpy | false |
hasActiveExternalCalls | private boolean hasActiveExternalCalls(Collection<Call> calls) {
for (Call call : calls) {
if (!call.isInternal()) {
return true;
}
}
return false;
} | Unassign calls that have not yet been sent based on some predicate. For example, this
is used to reassign the calls that have been assigned to a disconnected node.
@param shouldUnassign Condition for reassignment. If the predicate is true, then the calls will
be put back in the pendingCalls collec... | java | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java | 1,418 | [
"calls"
] | true | 2 | 6.88 | apache/kafka | 31,560 | javadoc | false | |
shuffleSelf | function shuffleSelf(array, size) {
var index = -1,
length = array.length,
lastIndex = length - 1;
size = size === undefined ? length : size;
while (++index < size) {
var rand = baseRandom(index, lastIndex),
value = array[rand];
array[rand] = array[ind... | A specialized version of `_.shuffle` which mutates and sets the size of `array`.
@private
@param {Array} array The array to shuffle.
@param {number} [size=array.length] The size of `array`.
@returns {Array} Returns `array`. | javascript | lodash.js | 6,814 | [
"array",
"size"
] | false | 3 | 6.08 | lodash/lodash | 61,490 | jsdoc | false | |
excluding | public ErrorAttributeOptions excluding(Include... excludes) {
EnumSet<Include> updated = copyIncludes();
Arrays.stream(excludes).forEach(updated::remove);
return new ErrorAttributeOptions(Collections.unmodifiableSet(updated));
} | Return an {@code ErrorAttributeOptions} that excludes the specified attribute
{@link Include} options.
@param excludes error attributes to exclude
@return an {@code ErrorAttributeOptions} | java | core/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorAttributeOptions.java | 79 | [] | ErrorAttributeOptions | true | 1 | 6.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
get_api_items | def get_api_items(api_doc_fd):
"""
Yield information about all public API items.
Parse api.rst file from the documentation, and extract all the functions,
methods, classes, attributes... This should include all pandas public API.
Parameters
----------
api_doc_fd : file descriptor
A... | Yield information about all public API items.
Parse api.rst file from the documentation, and extract all the functions,
methods, classes, attributes... This should include all pandas public API.
Parameters
----------
api_doc_fd : file descriptor
A file descriptor of the API documentation page, containing the tabl... | python | scripts/validate_docstrings.py | 87 | [
"api_doc_fd"
] | false | 13 | 6 | pandas-dev/pandas | 47,362 | numpy | false | |
_parse_simple_yaml | def _parse_simple_yaml(yaml_str: str) -> dict:
"""Simple YAML parser for basic configs (without external dependencies).
Supports:
- key: value pairs
- booleans (true/false)
- null values
- integers and floats
- strings (quoted and unquoted)
- lists in JSON format [item1, item2, ...]
... | Simple YAML parser for basic configs (without external dependencies).
Supports:
- key: value pairs
- booleans (true/false)
- null values
- integers and floats
- strings (quoted and unquoted)
- lists in JSON format [item1, item2, ...]
- comments (lines starting with # or after #)
Args:
yaml_str: YAML content as st... | python | benchmarks/transformer/config_utils.py | 70 | [
"yaml_str"
] | dict | true | 15 | 8 | pytorch/pytorch | 96,034 | google | false |
median | def median(self, numeric_only: bool = False):
"""
Compute median of groups, excluding missing values.
For multiple groupings, the result index will be a MultiIndex
Parameters
----------
numeric_only : bool, default False
Include only float, int, boolean colu... | Compute median of groups, excluding missing values.
For multiple groupings, the result index will be a MultiIndex
Parameters
----------
numeric_only : bool, default False
Include only float, int, boolean columns.
.. versionchanged:: 2.0.0
numeric_only no longer accepts ``None`` and defaults to False... | python | pandas/core/resample.py | 1,429 | [
"self",
"numeric_only"
] | true | 1 | 7.12 | pandas-dev/pandas | 47,362 | numpy | false | |
getTypeForFactoryBean | protected @Nullable Class<?> getTypeForFactoryBean(FactoryBean<?> factoryBean) {
try {
return factoryBean.getObjectType();
}
catch (Throwable ex) {
// Thrown from the FactoryBean's getObjectType implementation.
logger.info("FactoryBean threw exception from getObjectType, despite the contract saying " +
... | Determine the type for the given FactoryBean.
@param factoryBean the FactoryBean instance to check
@return the FactoryBean's object type,
or {@code null} if the type cannot be determined yet | java | spring-beans/src/main/java/org/springframework/beans/factory/support/FactoryBeanRegistrySupport.java | 55 | [
"factoryBean"
] | true | 2 | 7.92 | spring-projects/spring-framework | 59,386 | javadoc | false | |
load | static @Nullable PemContent load(@Nullable String content, ResourceLoader resourceLoader) throws IOException {
if (!StringUtils.hasLength(content)) {
return null;
}
if (isPresentInText(content)) {
return new PemContent(content);
}
try (InputStream in = resourceLoader.getResource(content).getInputStream(... | Load {@link PemContent} from the given content (either the PEM content itself or a
reference to the resource to load).
@param content the content to load
@param resourceLoader the resource loader used to load content
@return a new {@link PemContent} instance or {@code null}
@throws IOException on IO error | java | core/spring-boot/src/main/java/org/springframework/boot/ssl/pem/PemContent.java | 119 | [
"content",
"resourceLoader"
] | PemContent | true | 4 | 7.76 | spring-projects/spring-boot | 79,428 | javadoc | false |
createWithExpectedSize | public static <E extends @Nullable Object> CompactLinkedHashSet<E> createWithExpectedSize(
int expectedSize) {
return new CompactLinkedHashSet<>(expectedSize);
} | Creates a {@code CompactLinkedHashSet} instance, with a high enough "initial capacity" that it
<i>should</i> hold {@code expectedSize} elements without rebuilding internal data structures.
@param expectedSize the number of elements you expect to add to the returned set
@return a new, empty {@code CompactLinkedHashSet} ... | java | android/guava/src/com/google/common/collect/CompactLinkedHashSet.java | 95 | [
"expectedSize"
] | true | 1 | 6 | google/guava | 51,352 | javadoc | false | |
ensureExclusiveFields | private static void ensureExclusiveFields(List<List<String>> exclusiveFields) {
StringBuilder message = null;
for (List<String> fieldset : exclusiveFields) {
if (fieldset.size() > 1) {
if (message == null) {
message = new StringBuilder();
}... | Parses a Value from the given {@link XContentParser}
@param parser the parser to build a value from
@param value the value to fill from the parser
@param context a context that is passed along to all declared field parsers
@return the parsed value
@throws IOException if an IOException occurs. | java | libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java | 345 | [
"exclusiveFields"
] | void | true | 5 | 7.6 | elastic/elasticsearch | 75,680 | javadoc | false |
fromInteger | public static Inet4Address fromInteger(int address) {
return getInet4Address(Ints.toByteArray(address));
} | Returns an Inet4Address having the integer value specified by the argument.
@param address {@code int}, the 32bit integer address to be converted
@return {@link Inet4Address} equivalent of the argument | java | android/guava/src/com/google/common/net/InetAddresses.java | 1,082 | [
"address"
] | Inet4Address | true | 1 | 6.64 | google/guava | 51,352 | javadoc | false |
checkStrictModePostfixUnaryExpression | function checkStrictModePostfixUnaryExpression(node: PostfixUnaryExpression) {
// Grammar checking
// The identifier eval or arguments may not appear as the LeftHandSideExpression of an
// Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression
// operate... | Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names.
@param symbolTable - The symbol table which node will be added to.
@param parent - node's parent declaration.
@param node - The declaration to be added to the symbol table
@param includes - The SymbolFlags that n... | typescript | src/compiler/binder.ts | 2,710 | [
"node"
] | false | 2 | 6.08 | microsoft/TypeScript | 107,154 | jsdoc | false | |
asWriter | public static Writer asWriter(Appendable target) {
if (target instanceof Writer) {
return (Writer) target;
}
return new AppendableWriter(target);
} | Returns a Writer that sends all output to the given {@link Appendable} target. Closing the
writer will close the target if it is {@link Closeable}, and flushing the writer will flush the
target if it is {@link java.io.Flushable}.
@param target the object to which output will be sent
@return a new Writer object, unless ... | java | android/guava/src/com/google/common/io/CharStreams.java | 359 | [
"target"
] | Writer | true | 2 | 8.24 | google/guava | 51,352 | javadoc | false |
adapt | @Nullable R adapt(T value); | Adapt the given value.
@param value the value to adapt
@return an adapted value or {@code null} | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java | 386 | [
"value"
] | R | true | 1 | 6.8 | spring-projects/spring-boot | 79,428 | javadoc | false |
toRootLowerCase | public static String toRootLowerCase(final String source) {
return source == null ? null : source.toLowerCase(Locale.ROOT);
} | Converts the given source String as a lower-case using the {@link Locale#ROOT} locale in a null-safe manner.
@param source A source String or null.
@return the given source String as a lower-case using the {@link Locale#ROOT} locale or null.
@since 3.10 | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 8,672 | [
"source"
] | String | true | 2 | 8.16 | apache/commons-lang | 2,896 | javadoc | false |
matchesProperty | public static boolean matchesProperty(String registeredPath, String propertyPath) {
if (!registeredPath.startsWith(propertyPath)) {
return false;
}
if (registeredPath.length() == propertyPath.length()) {
return true;
}
if (registeredPath.charAt(propertyPath.length()) != PropertyAccessor.PROPERTY_KEY_PRE... | Determine whether the given registered path matches the given property path,
either indicating the property itself or an indexed element of the property.
@param propertyPath the property path (typically without index)
@param registeredPath the registered path (potentially with index)
@return whether the paths match | java | spring-beans/src/main/java/org/springframework/beans/PropertyAccessorUtils.java | 120 | [
"registeredPath",
"propertyPath"
] | true | 4 | 7.28 | spring-projects/spring-framework | 59,386 | javadoc | false | |
registerCandidateTypeForIncludeFilter | private void registerCandidateTypeForIncludeFilter(String className, TypeFilter filter) {
if (this.componentsIndex != null) {
if (filter instanceof AnnotationTypeFilter annotationTypeFilter) {
Class<? extends Annotation> annotationType = annotationTypeFilter.getAnnotationType();
if (isStereotypeAnnotationF... | Register the given class as a candidate type with the runtime-populated index, if any.
@param className the fully-qualified class name of the candidate type
@param filter the include filter to introspect for the associated stereotype | java | spring-context/src/main/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider.java | 364 | [
"className",
"filter"
] | void | true | 6 | 6.4 | spring-projects/spring-framework | 59,386 | javadoc | false |
resolveAddresses | private void resolveAddresses() throws UnknownHostException {
// (Re-)initialize list
addresses = ClientUtils.resolve(host, hostResolver);
if (log.isDebugEnabled()) {
log.debug("Resolved host {} to addresses {}", host, addresses);
}
addressInde... | Jumps to the next available resolved address for this node. If no other addresses are available, marks the
list to be refreshed on the next {@link #currentAddress()} call. | java | clients/src/main/java/org/apache/kafka/clients/ClusterConnectionStates.java | 534 | [] | void | true | 4 | 6.88 | apache/kafka | 31,560 | javadoc | false |
patch_dynamo_config | def patch_dynamo_config(
arg1: Optional[Union[str, dict[str, Any], tuple[tuple[str, Any], ...]]] = None,
arg2: Any = None,
**kwargs: Any,
) -> DynamoConfigPatchProxy:
"""
A wrapper around torch._dynamo.config.patch that can be traced by Dynamo to
temporarily change config values DURING tracing.
... | A wrapper around torch._dynamo.config.patch that can be traced by Dynamo to
temporarily change config values DURING tracing.
See _allowed_config_patches for the list of allowed config patches.
Arguments are the same as with torch._dynamo.config.patch.
Can be used as a decorator or a context manager.
User code SHOUL... | python | torch/_dynamo/decorators.py | 936 | [
"arg1",
"arg2"
] | DynamoConfigPatchProxy | true | 2 | 6.72 | pytorch/pytorch | 96,034 | unknown | false |
fit | def fit(self, X, y=None):
"""Learn the idf vector (global term weights).
Parameters
----------
X : sparse matrix of shape (n_samples, n_features)
A matrix of term/token counts.
y : None
This parameter is not needed to compute tf-idf.
Returns
... | Learn the idf vector (global term weights).
Parameters
----------
X : sparse matrix of shape (n_samples, n_features)
A matrix of term/token counts.
y : None
This parameter is not needed to compute tf-idf.
Returns
-------
self : object
Fitted transformer. | python | sklearn/feature_extraction/text.py | 1,645 | [
"self",
"X",
"y"
] | false | 4 | 6.24 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
get_bin_seeds | def get_bin_seeds(X, bin_size, min_bin_freq=1):
"""Find seeds for mean_shift.
Finds seeds by first binning data onto a grid whose lines are
spaced bin_size apart, and then choosing those bins with at least
min_bin_freq points.
Parameters
----------
X : array-like of shape (n_samples, n_fe... | Find seeds for mean_shift.
Finds seeds by first binning data onto a grid whose lines are
spaced bin_size apart, and then choosing those bins with at least
min_bin_freq points.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Input points, the same points that will be used in mean_shift.
bin... | python | sklearn/cluster/_mean_shift.py | 247 | [
"X",
"bin_size",
"min_bin_freq"
] | false | 4 | 6.24 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
appendIfMissing | @Deprecated
public static String appendIfMissing(final String str, final CharSequence suffix, final CharSequence... suffixes) {
return Strings.CS.appendIfMissing(str, suffix, suffixes);
} | Appends the suffix to the end of the string if the string does not already end with any of the suffixes.
<pre>
StringUtils.appendIfMissing(null, null) = null
StringUtils.appendIfMissing("abc", null) = "abc"
StringUtils.appendIfMissing("", "xyz" = "xyz"
StringUtils.appendIfMissing("abc", "xyz") = "abc... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 464 | [
"str",
"suffix"
] | String | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false |
getPropertyDescriptor | @Override
public PropertyDescriptor getPropertyDescriptor(String propertyName) throws InvalidPropertyException {
BeanWrapperImpl nestedBw = (BeanWrapperImpl) getPropertyAccessorForPropertyPath(propertyName);
String finalPath = getFinalPath(nestedBw, propertyName);
PropertyDescriptor pd = nestedBw.getCachedIntros... | 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 | 214 | [
"propertyName"
] | PropertyDescriptor | true | 2 | 7.44 | spring-projects/spring-framework | 59,386 | javadoc | false |
toArray | public static boolean[] toArray(Collection<Boolean> collection) {
if (collection instanceof BooleanArrayAsList) {
return ((BooleanArrayAsList) collection).toBooleanArray();
}
Object[] boxedArray = collection.toArray();
int len = boxedArray.length;
boolean[] array = new boolean[len];
for (... | Copies a collection of {@code Boolean} instances into a new array of primitive {@code boolean}
values.
<p>Elements are copied from the argument collection as if by {@code collection.toArray()}.
Calling this method is as thread-safe as calling that method.
<p><b>Note:</b> consider representing the collection as a {@link... | java | android/guava/src/com/google/common/primitives/Booleans.java | 355 | [
"collection"
] | true | 3 | 7.6 | google/guava | 51,352 | javadoc | false | |
createExportExpression | function createExportExpression(name: ModuleExportName, value: Expression, location?: TextRange, liveBinding?: boolean) {
return setTextRange(
liveBinding ? factory.createCallExpression(
factory.createPropertyAccessExpression(
factory.createIdentifier("Object"... | Creates a call to the current file's export function to export a value.
@param name The bound name of the export.
@param value The exported value.
@param location The location to use for source maps and comments for the export. | typescript | src/compiler/transformers/module/module.ts | 2,185 | [
"name",
"value",
"location?",
"liveBinding?"
] | false | 3 | 6.24 | microsoft/TypeScript | 107,154 | jsdoc | false | |
_wrap_aggregated_output | def _wrap_aggregated_output(
self,
result: Series | DataFrame,
qs: npt.NDArray[np.float64] | None = None,
):
"""
Wraps the output of GroupBy aggregations into the expected result.
Parameters
----------
result : Series, DataFrame
Returns
... | Wraps the output of GroupBy aggregations into the expected result.
Parameters
----------
result : Series, DataFrame
Returns
-------
Series or DataFrame | python | pandas/core/groupby/groupby.py | 1,306 | [
"self",
"result",
"qs"
] | true | 4 | 6.24 | pandas-dev/pandas | 47,362 | numpy | false | |
flatten_descr | def flatten_descr(ndtype):
"""
Flatten a structured data-type description.
Examples
--------
>>> import numpy as np
>>> from numpy.lib import recfunctions as rfn
>>> ndtype = np.dtype([('a', '<i4'), ('b', [('ba', '<f8'), ('bb', '<i4')])])
>>> rfn.flatten_descr(ndtype)
(('a', dtype('... | Flatten a structured data-type description.
Examples
--------
>>> import numpy as np
>>> from numpy.lib import recfunctions as rfn
>>> ndtype = np.dtype([('a', '<i4'), ('b', [('ba', '<f8'), ('bb', '<i4')])])
>>> rfn.flatten_descr(ndtype)
(('a', dtype('int32')), ('ba', dtype('float64')), ('bb', dtype('int32'))) | python | numpy/lib/recfunctions.py | 169 | [
"ndtype"
] | false | 6 | 6.32 | numpy/numpy | 31,054 | unknown | false | |
extractTopicPartition | public static <K, V> TopicPartition extractTopicPartition(ProducerRecord<K, V> record) {
return new TopicPartition(record.topic(), record.partition() == null ? RecordMetadata.UNKNOWN_PARTITION : record.partition());
} | This method is called when sending the record fails in {@link ProducerInterceptor#onSend
(ProducerRecord)} method. This method calls {@link ProducerInterceptor#onAcknowledgement(RecordMetadata, Exception, Headers)}
method for each interceptor
@param record The record from client
@param interceptTopicPartition The topi... | java | clients/src/main/java/org/apache/kafka/clients/producer/internals/ProducerInterceptors.java | 140 | [
"record"
] | TopicPartition | true | 2 | 6.16 | apache/kafka | 31,560 | javadoc | false |
cluster_status | def cluster_status(self, cluster_identifier: str) -> str | None:
"""
Get status of a cluster.
.. seealso::
- :external+boto3:py:meth:`Redshift.Client.describe_clusters`
:param cluster_identifier: unique identifier of a cluster
"""
try:
response =... | Get status of a cluster.
.. seealso::
- :external+boto3:py:meth:`Redshift.Client.describe_clusters`
:param cluster_identifier: unique identifier of a cluster | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/redshift_cluster.py | 79 | [
"self",
"cluster_identifier"
] | str | None | true | 2 | 6.08 | apache/airflow | 43,597 | sphinx | false |
equals | @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
return this.name.equals(((Option) obj).name);
} | Return a description of the option.
@return the option description | java | loader/spring-boot-jarmode-tools/src/main/java/org/springframework/boot/jarmode/tools/Command.java | 331 | [
"obj"
] | true | 4 | 6.88 | spring-projects/spring-boot | 79,428 | javadoc | false | |
isReturnVoidStatementInConstructorWithCapturedSuper | function isReturnVoidStatementInConstructorWithCapturedSuper(node: Node): boolean {
return (hierarchyFacts & HierarchyFacts.ConstructorWithSuperCall) !== 0
&& node.kind === SyntaxKind.ReturnStatement
&& !(node as ReturnStatement).expression;
} | 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 | 571 | [
"node"
] | true | 3 | 6.24 | microsoft/TypeScript | 107,154 | jsdoc | false | |
removeFromChain | @GuardedBy("this")
@Nullable E removeFromChain(E first, E entry) {
int newCount = count;
E newFirst = entry.getNext();
for (E e = first; e != entry; e = e.getNext()) {
E next = copyEntry(e, newFirst);
if (next != null) {
newFirst = next;
} else {
newCoun... | Removes an entry from within a table. All entries following the removed node can stay, but
all preceding ones need to be cloned.
<p>This method does not decrement count for the removed entry, but does decrement count for
all partially collected entries which are skipped. As such callers which are modifying count
must r... | java | android/guava/src/com/google/common/collect/MapMakerInternalMap.java | 1,825 | [
"first",
"entry"
] | E | true | 3 | 8.08 | google/guava | 51,352 | javadoc | false |
tryWithResources | @SafeVarargs
public static void tryWithResources(final FailableRunnable<? extends Throwable> action,
final FailableConsumer<Throwable, ? extends Throwable> errorHandler,
final FailableRunnable<? extends Throwable>... resources) {
final org.apache.commons.lang3.function.FailableRunnable<?>[] ... | A simple try-with-resources implementation, that can be used, if your objects do not implement the
{@link AutoCloseable} interface. The method executes the {@code action}. The method guarantees, that <em>all</em>
the {@code resources} are being executed, in the given order, afterwards, and regardless of success, or fai... | java | src/main/java/org/apache/commons/lang3/Functions.java | 626 | [
"action",
"errorHandler"
] | void | true | 2 | 6.4 | apache/commons-lang | 2,896 | javadoc | false |
trySend | long trySend(long now) {
long pollDelayMs = maxPollTimeoutMs;
// send any requests that can be sent now
for (Node node : unsent.nodes()) {
Iterator<ClientRequest> iterator = unsent.requestIterator(node);
if (iterator.hasNext())
pollDelayMs = Math.min(poll... | Check whether there is pending request. This includes both requests that
have been transmitted (i.e. in-flight requests) and those which are awaiting transmission.
@return A boolean indicating whether there is pending request | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.java | 504 | [
"now"
] | true | 4 | 6.88 | apache/kafka | 31,560 | javadoc | false | |
getRegistrations | @SuppressWarnings("unchecked")
<S> List<Registration<S, ?>> getRegistrations(S source, boolean required) {
Class<S> sourceType = (Class<S>) source.getClass();
List<Registration<S, ?>> result = new ArrayList<>();
for (Registration<?, ?> candidate : this.registrations) {
if (candidate.sourceType().isAssignableF... | Return a {@link Map} of {@link ConnectionDetails} interface type to
{@link ConnectionDetails} instance created from the factories associated with the
given source.
@param <S> the source type
@param source the source
@param required if a connection details result is required
@return a map of {@link ConnectionDetails} in... | java | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/service/connection/ConnectionDetailsFactories.java | 101 | [
"source",
"required"
] | true | 4 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false | |
set_alignment | def set_alignment(torch_layout, op_element) -> bool:
"""
Helper method to update the alignment of a given CUTLASS GEMM op operand's element.
This method modifies the alignment of the given Cutlass GEMM op operand's element to match the
layout of the corresponding ir.Buffer node.
... | Helper method to update the alignment of a given CUTLASS GEMM op operand's element.
This method modifies the alignment of the given Cutlass GEMM op operand's element to match the
layout of the corresponding ir.Buffer node.
Args:
torch_layout: The layout of the corresponding ir.Buffer node.
op_element: The Cut... | python | torch/_inductor/codegen/cuda/gemm_template.py | 700 | [
"torch_layout",
"op_element"
] | bool | true | 5 | 7.92 | pytorch/pytorch | 96,034 | google | false |
score | def score(self, X, y=None, sample_weight=None, **params):
"""Transform the data, and apply `score` with the final estimator.
Call `transform` of each transformer in the pipeline. The transformed
data are finally passed to the final estimator that calls
`score` method. Only valid if the ... | Transform the data, and apply `score` with the final estimator.
Call `transform` of each transformer in the pipeline. The transformed
data are finally passed to the final estimator that calls
`score` method. Only valid if the final estimator implements `score`.
Parameters
----------
X : iterable
Data to predict o... | python | sklearn/pipeline.py | 1,092 | [
"self",
"X",
"y",
"sample_weight"
] | false | 5 | 6.08 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
tz_convert | def tz_convert(self, tz) -> Self:
"""
Convert tz-aware Datetime Array/Index from one time zone to another.
Parameters
----------
tz : str, zoneinfo.ZoneInfo, pytz.timezone, dateutil.tz.tzfile, datetime.tzinfo or None
Time zone for time. Corresponding timestamps would... | Convert tz-aware Datetime Array/Index from one time zone to another.
Parameters
----------
tz : str, zoneinfo.ZoneInfo, pytz.timezone, dateutil.tz.tzfile, datetime.tzinfo or None
Time zone for time. Corresponding timestamps would be converted
to this time zone of the Datetime Array/Index. A `tz` of None will
... | python | pandas/core/arrays/datetimes.py | 860 | [
"self",
"tz"
] | Self | true | 3 | 8.08 | pandas-dev/pandas | 47,362 | numpy | false |
trimmed | public ImmutableIntArray trimmed() {
return isPartialView() ? new ImmutableIntArray(toArray()) : this;
} | Returns an immutable array containing the same values as {@code this} array. This is logically
a no-op, and in some circumstances {@code this} itself is returned. However, if this instance
is a {@link #subArray} view of a larger array, this method will copy only the appropriate range
of values, resulting in an equivale... | java | android/guava/src/com/google/common/primitives/ImmutableIntArray.java | 632 | [] | ImmutableIntArray | true | 2 | 6.64 | google/guava | 51,352 | javadoc | false |
saturatedCast | public static int saturatedCast(long value) {
if (value > Integer.MAX_VALUE) {
return Integer.MAX_VALUE;
}
if (value < Integer.MIN_VALUE) {
return Integer.MIN_VALUE;
}
return (int) value;
} | Returns the {@code int} nearest in value to {@code value}.
@param value any {@code long} value
@return the same value cast to {@code int} if it is in the range of the {@code int} type,
{@link Integer#MAX_VALUE} if it is too large, or {@link Integer#MIN_VALUE} if it is too
small | java | android/guava/src/com/google/common/primitives/Ints.java | 107 | [
"value"
] | true | 3 | 7.92 | google/guava | 51,352 | javadoc | false | |
synchronizedMultimap | @J2ktIncompatible // Synchronized
public static <K extends @Nullable Object, V extends @Nullable Object>
Multimap<K, V> synchronizedMultimap(Multimap<K, V> multimap) {
return Synchronized.multimap(multimap, null);
} | Returns a synchronized (thread-safe) multimap backed by the specified multimap. In order to
guarantee serial access, it is critical that <b>all</b> access to the backing multimap is
accomplished through the returned multimap.
<p>It is imperative that the user manually synchronize on the returned multimap when accessing... | java | android/guava/src/com/google/common/collect/Multimaps.java | 637 | [
"multimap"
] | true | 1 | 6.24 | google/guava | 51,352 | javadoc | false | |
_boost | def _boost(self, iboost, X, y, sample_weight, random_state):
"""Implement a single boost for regression
Perform a single boost according to the AdaBoost.R2 algorithm and
return the updated sample weights.
Parameters
----------
iboost : int
The index of the c... | Implement a single boost for regression
Perform a single boost according to the AdaBoost.R2 algorithm and
return the updated sample weights.
Parameters
----------
iboost : int
The index of the current boost iteration.
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The training input samples... | python | sklearn/ensemble/_weight_boosting.py | 969 | [
"self",
"iboost",
"X",
"y",
"sample_weight",
"random_state"
] | false | 8 | 6 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
apply | public static <T, R, E extends Throwable> R apply(final FailableFunction<T, R, E> function, final T input) {
return get(() -> function.apply(input));
} | Applies a function and rethrows any exception as a {@link RuntimeException}.
@param function the function to apply
@param input the input to apply {@code function} on
@param <T> the type of the argument the function accepts
@param <R> the return type of the function
@param <E> the type of checked exception the function... | java | src/main/java/org/apache/commons/lang3/function/Failable.java | 161 | [
"function",
"input"
] | R | true | 1 | 6.48 | apache/commons-lang | 2,896 | javadoc | false |
all | public KafkaFuture<Map<String, ClassicGroupDescription>> all() {
return KafkaFuture.allOf(futures.values().toArray(new KafkaFuture<?>[0])).thenApply(
nil -> {
Map<String, ClassicGroupDescription> descriptions = new HashMap<>(futures.size());
futures.forEach((key, futu... | Return a future which yields all ClassicGroupDescription objects, if all the describes succeed. | java | clients/src/main/java/org/apache/kafka/clients/admin/DescribeClassicGroupsResult.java | 48 | [] | true | 2 | 6.4 | apache/kafka | 31,560 | javadoc | false | |
poll | public boolean poll(RequestFuture<?> future, Timer timer, boolean disableWakeup) {
do {
poll(timer, future, disableWakeup);
} while (!future.isDone() && timer.notExpired());
return future.isDone();
} | Block until the provided request future request has finished or the timeout has expired.
@param future The request future to wait for
@param timer Timer bounding how long this method can block
@param disableWakeup true if we should not check for wakeups, false otherwise
@return true if the future is done, false otherwi... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.java | 230 | [
"future",
"timer",
"disableWakeup"
] | true | 2 | 7.6 | apache/kafka | 31,560 | javadoc | false | |
asBiFunction | @SuppressWarnings("unchecked")
public static <T, U, R> BiFunction<T, U, R> asBiFunction(final Method method) {
return asInterfaceInstance(BiFunction.class, method);
} | Produces a {@link BiFunction} for a given a <em>function</em> Method. You call the BiFunction with two arguments: (1)
the object receiving the method call, and (2) the method argument. The BiFunction return type must match the method's
return type.
<p>
For example to invoke {@link String#charAt(int)}:
</p>
<pre>{@code
... | java | src/main/java/org/apache/commons/lang3/function/MethodInvokers.java | 108 | [
"method"
] | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false | |
weighted_mode | def weighted_mode(a, w, *, axis=0):
"""Return an array of the weighted modal (most common) value in the passed array.
If there is more than one such value, only the first is returned.
The bin-count for the modal bins is also returned.
This is an extension of the algorithm in scipy.stats.mode.
Par... | Return an array of the weighted modal (most common) value in the passed array.
If there is more than one such value, only the first is returned.
The bin-count for the modal bins is also returned.
This is an extension of the algorithm in scipy.stats.mode.
Parameters
----------
a : array-like of shape (n_samples,)
... | python | sklearn/utils/extmath.py | 787 | [
"a",
"w",
"axis"
] | false | 5 | 7.6 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
reset | public StrTokenizer reset(final char[] input) {
reset();
this.chars = ArrayUtils.clone(input);
return this;
} | Reset this tokenizer, giving it a new input string to parse.
In this manner you can re-use a tokenizer with the same settings
on multiple input lines.
@param input the new character array to tokenize, not cloned, null sets no text to parse.
@return {@code this} instance. | java | src/main/java/org/apache/commons/lang3/text/StrTokenizer.java | 870 | [
"input"
] | StrTokenizer | true | 1 | 7.04 | apache/commons-lang | 2,896 | javadoc | false |
hasPath | function hasPath(object, path, hasFunc) {
path = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
... | Checks if `path` exists on `object`.
@private
@param {Object} object The object to query.
@param {Array|string} path The path to check.
@param {Function} hasFunc The function to check properties.
@returns {boolean} Returns `true` if `path` exists, else `false`. | javascript | lodash.js | 6,222 | [
"object",
"path",
"hasFunc"
] | false | 11 | 6.08 | lodash/lodash | 61,490 | jsdoc | false | |
stop | def stop(self) -> int:
"""
The value of the `stop` parameter.
This property returns the `stop` value of the RangeIndex, which defines the
upper (or lower, in case of negative steps) bound of the index range. The
`stop` value is exclusive, meaning the RangeIndex includes values u... | The value of the `stop` parameter.
This property returns the `stop` value of the RangeIndex, which defines the
upper (or lower, in case of negative steps) bound of the index range. The
`stop` value is exclusive, meaning the RangeIndex includes values up to but
not including this value.
See Also
--------
RangeIndex : ... | python | pandas/core/indexes/range.py | 344 | [
"self"
] | int | true | 1 | 7.28 | pandas-dev/pandas | 47,362 | unknown | false |
apply | R apply(T t, U u, V v); | Applies this function to the given arguments.
@param t the first function argument
@param u the second function argument
@param v the third function argument
@return the function result | java | src/main/java/org/apache/commons/lang3/function/TriFunction.java | 64 | [
"t",
"u",
"v"
] | R | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false |
check_axis_name | def check_axis_name(name: str) -> bool:
"""Check if the name is a valid axis name.
Args:
name (str): the axis name to check
Returns:
bool: whether the axis name is valid
"""
is_valid, _ = ParsedExpression.check_axis_name_return_reason(name)
retur... | Check if the name is a valid axis name.
Args:
name (str): the axis name to check
Returns:
bool: whether the axis name is valid | python | functorch/einops/_parsing.py | 199 | [
"name"
] | bool | true | 1 | 6.56 | pytorch/pytorch | 96,034 | google | false |
getGenericArgumentValue | public @Nullable ValueHolder getGenericArgumentValue(@Nullable Class<?> requiredType, @Nullable String requiredName,
@Nullable Set<ValueHolder> usedValueHolders) {
for (ValueHolder valueHolder : this.genericArgumentValues) {
if (usedValueHolders != null && usedValueHolders.contains(valueHolder)) {
continue... | Look for the next generic argument value that matches the given type,
ignoring argument values that have already been used in the current
resolution process.
@param requiredType the type to match (can be {@code null} to find
an arbitrary next generic argument value)
@param requiredName the name to match (can be {@code ... | java | spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java | 274 | [
"requiredType",
"requiredName",
"usedValueHolders"
] | ValueHolder | true | 14 | 7.6 | spring-projects/spring-framework | 59,386 | javadoc | false |
getDatabase | @Nullable
static Database getDatabase(final String databaseType) {
Database database = null;
if (Strings.hasText(databaseType)) {
final String databaseTypeLowerCase = databaseType.toLowerCase(Locale.ROOT);
if (databaseTypeLowerCase.startsWith(IPINFO_PREFIX)) {
... | Parses the passed-in databaseType and return the Database instance that is
associated with that databaseType.
@param databaseType the database type String from the metadata of the database file
@return the Database instance that is associated with the databaseType (or null) | java | modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IpDataLookupFactories.java | 43 | [
"databaseType"
] | Database | true | 3 | 7.92 | elastic/elasticsearch | 75,680 | javadoc | false |
createScopedProxy | public static BeanDefinitionHolder createScopedProxy(BeanDefinitionHolder definition,
BeanDefinitionRegistry registry, boolean proxyTargetClass) {
String originalBeanName = definition.getBeanName();
BeanDefinition targetDefinition = definition.getBeanDefinition();
String targetBeanName = getTargetBeanName(ori... | Generate a scoped proxy for the supplied target bean, registering the target
bean with an internal name and setting 'targetBeanName' on the scoped proxy.
@param definition the original bean definition
@param registry the bean definition registry
@param proxyTargetClass whether to create a target class proxy
@return the... | java | spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java | 58 | [
"definition",
"registry",
"proxyTargetClass"
] | BeanDefinitionHolder | true | 4 | 7.44 | spring-projects/spring-framework | 59,386 | javadoc | false |
h3ToFaceIjk | public static FaceIJK h3ToFaceIjk(long h3) {
int baseCell = H3Index.H3_get_base_cell(h3);
if (baseCell < 0 || baseCell >= Constants.NUM_BASE_CELLS) { // LCOV_EXCL_BR_LINE
// Base cells less than zero can not be represented in an index
// To prevent reading uninitialized memory, ... | Convert an H3Index to a FaceIJK address.
@param h3 The H3Index. | java | libs/h3/src/main/java/org/elasticsearch/h3/H3Index.java | 189 | [
"h3"
] | FaceIJK | true | 12 | 6.88 | elastic/elasticsearch | 75,680 | javadoc | false |
Future | Future(Future&& other) noexcept
: cs_(std::move(other.cs_)),
state_(std::exchange(other.state_, nullptr)),
ct_(std::move(other.ct_)),
hasCancelTokenOverride_(
std::exchange(other.hasCancelTokenOverride_, false)) {} | Construct an empty Future.
This object is not valid use until you initialize it with move assignment. | cpp | folly/coro/Promise.h | 225 | [] | true | 2 | 6.88 | facebook/folly | 30,157 | doxygen | false | |
SuspendedByGroup | function SuspendedByGroup({
bridge,
element,
inspectedElement,
store,
name,
environment,
suspendedBy,
minTime,
maxTime,
}: GroupProps) {
const [isOpen, setIsOpen] = useState(false);
let start = Infinity;
let end = -Infinity;
let isRejected = false;
for (let i = 0; i < suspendedBy.length; i++... | Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
@flow | javascript | packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSuspendedBy.js | 360 | [] | false | 13 | 6.32 | facebook/react | 241,750 | jsdoc | false | |
maybeFailWithError | private void maybeFailWithError() {
if (!hasError()) {
return;
}
// for ProducerFencedException, do not wrap it as a KafkaException
// but create a new instance without the call trace since it was not thrown because of the current call
if (lastError instanceof Produce... | Check if the transaction is in the prepared state.
@return true if the current state is PREPARED_TRANSACTION | java | clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java | 1,154 | [] | void | true | 5 | 8.4 | apache/kafka | 31,560 | javadoc | false |
sensor | public synchronized Sensor sensor(String name, MetricConfig config, Sensor... parents) {
return this.sensor(name, config, Sensor.RecordingLevel.INFO, parents);
} | Get or create a sensor with the given unique name and zero or more parent sensors. All parent sensors will
receive every value recorded with this sensor. This uses a default recording level of INFO.
@param name The name of the sensor
@param config A default configuration to use for this sensor for metrics that don't ha... | java | clients/src/main/java/org/apache/kafka/common/metrics/Metrics.java | 372 | [
"name",
"config"
] | Sensor | true | 1 | 6.96 | apache/kafka | 31,560 | javadoc | false |
parse | public Value parse(XContentParser parser, Value value, Context context) throws IOException {
XContentParser.Token token;
if (parser.currentToken() != XContentParser.Token.START_OBJECT) {
token = parser.nextToken();
if (token != XContentParser.Token.START_OBJECT) {
... | Parses a Value from the given {@link XContentParser}
@param parser the parser to build a value from
@param value the value to fill from the parser
@param context a context that is passed along to all declared field parsers
@return the parsed value
@throws IOException if an IOException occurs. | java | libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java | 271 | [
"parser",
"value",
"context"
] | Value | true | 13 | 7.68 | elastic/elasticsearch | 75,680 | javadoc | false |
normalizeUpperBounds | public static Type[] normalizeUpperBounds(final Type[] bounds) {
Objects.requireNonNull(bounds, "bounds");
// don't bother if there's only one (or none) type
if (bounds.length < 2) {
return bounds;
}
final Set<Type> types = new HashSet<>(bounds.length);
for (f... | Strips out the redundant upper bound types in type variable types and wildcard types (or it would with wildcard types if multiple upper bounds were
allowed).
<p>
Example, with the variable type declaration:
</p>
<pre>{@code
<K extends java.util.Collection<String> & java.util.List<String>>
}</pre>
<p>
since {@link List}... | java | src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java | 1,346 | [
"bounds"
] | true | 5 | 7.76 | apache/commons-lang | 2,896 | javadoc | false | |
lazyModule | function lazyModule() {
return $Module ??= require('internal/modules/cjs/loader').Module;
} | Import the Module class on first use.
@returns {object} | javascript | lib/internal/modules/helpers.js | 135 | [] | false | 1 | 6.16 | nodejs/node | 114,839 | jsdoc | false | |
checkAndGetCoordinator | protected synchronized Node checkAndGetCoordinator() {
if (coordinator != null && client.isUnavailable(coordinator)) {
markCoordinatorUnknown(true, "coordinator unavailable");
return null;
}
return this.coordinator;
} | Get the coordinator if its connection is still active. Otherwise mark it unknown and
return null.
@return the current coordinator or null if it is unknown | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java | 983 | [] | Node | true | 3 | 8.08 | apache/kafka | 31,560 | javadoc | false |
mapToIndexScaleZero | private static long mapToIndexScaleZero(double value) {
long rawBits = Double.doubleToLongBits(value);
long rawExponent = (rawBits & EXPONENT_BIT_MASK) >> SIGNIFICAND_WIDTH;
long rawSignificand = rawBits & SIGNIFICAND_BIT_MASK;
if (rawExponent == 0) {
rawExponent -= Long.numb... | Compute the exact bucket index for scale zero by extracting the exponent.
@see <a
href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#scale-zero-extract-the-exponent">Scale
Zero: Extract the Exponent</a> | java | libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/Base2ExponentialHistogramIndexer.java | 93 | [
"value"
] | true | 3 | 6.4 | elastic/elasticsearch | 75,680 | javadoc | false | |
updatePartitionLeadership | public synchronized Set<TopicPartition> updatePartitionLeadership(Map<TopicPartition, LeaderIdAndEpoch> partitionLeaders, List<Node> leaderNodes) {
Map<Integer, Node> newNodes = leaderNodes.stream().collect(Collectors.toMap(Node::id, node -> node));
// Insert non-overlapping nodes from existing-nodes in... | Updates the partition-leadership info in the metadata. Update is done by merging existing metadata with the input leader information and nodes.
This is called whenever partition-leadership updates are returned in a response from broker(ex - ProduceResponse & FetchResponse).
Note that the updates via Metadata RPC are ha... | java | clients/src/main/java/org/apache/kafka/clients/Metadata.java | 381 | [
"partitionLeaders",
"leaderNodes"
] | true | 9 | 7.84 | apache/kafka | 31,560 | javadoc | false | |
process | private void process(final StreamsOnTasksRevokedCallbackCompletedEvent event) {
if (requestManagers.streamsMembershipManager.isEmpty()) {
log.warn("An internal error occurred; the Streams membership manager was not present, so the notification " +
"of the onTasksRevoked callback exec... | Process event indicating whether the AcknowledgeCommitCallbackHandler is configured by the user.
@param event Event containing a boolean to indicate if the callback handler is configured or not. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java | 687 | [
"event"
] | void | true | 2 | 6.08 | apache/kafka | 31,560 | javadoc | false |
delete_any_fargate_profiles | def delete_any_fargate_profiles(self) -> None:
"""
Delete all EKS Fargate profiles for a provided Amazon EKS Cluster.
EKS Fargate profiles must be deleted one at a time, so we must wait
for one to be deleted before sending the next delete command.
"""
fargate_profiles = ... | Delete all EKS Fargate profiles for a provided Amazon EKS Cluster.
EKS Fargate profiles must be deleted one at a time, so we must wait
for one to be deleted before sending the next delete command. | python | providers/amazon/src/airflow/providers/amazon/aws/operators/eks.py | 781 | [
"self"
] | None | true | 3 | 6 | apache/airflow | 43,597 | unknown | false |
empty | static ExponentialHistogram empty() {
return EmptyExponentialHistogram.INSTANCE;
} | Default hash code implementation to be used with {@link #equals(ExponentialHistogram, ExponentialHistogram)}.
@param histogram the histogram to hash
@return the hash code | java | libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialHistogram.java | 219 | [] | ExponentialHistogram | true | 1 | 6 | elastic/elasticsearch | 75,680 | javadoc | false |
md5 | def md5(string: ReadableBuffer = b"", /) -> hashlib._Hash:
"""
Safely allows calling the ``hashlib.md5`` function when ``usedforsecurity`` is disabled in configuration.
:param string: The data to hash. Default to empty str byte.
:return: The hashed value.
"""
return hashlib.md5(string, usedfors... | Safely allows calling the ``hashlib.md5`` function when ``usedforsecurity`` is disabled in configuration.
:param string: The data to hash. Default to empty str byte.
:return: The hashed value. | python | airflow-core/src/airflow/utils/hashlib_wrapper.py | 27 | [
"string"
] | hashlib._Hash | true | 1 | 6.72 | apache/airflow | 43,597 | sphinx | false |
patternKeyCompare | function patternKeyCompare(a, b) {
const aPatternIndex = StringPrototypeIndexOf(a, '*');
const bPatternIndex = StringPrototypeIndexOf(b, '*');
const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
if (baseLenA > baseLenB) { ... | Compares two strings that may contain a wildcard character ('*') and returns a value indicating their order.
@param {string} a - The first string to compare.
@param {string} b - The second string to compare.
@returns {number} - A negative number if `a` should come before `b`, a positive number if `a` should come after ... | javascript | lib/internal/modules/esm/resolve.js | 671 | [
"a",
"b"
] | false | 9 | 6.08 | nodejs/node | 114,839 | jsdoc | false | |
compression | @Override
public double compression() {
return compression;
} | @param q The quantile desired. Can be in the range [0,1].
@return The minimum value x such that we think that the proportion of samples is ≤ x is q. | java | libs/tdigest/src/main/java/org/elasticsearch/tdigest/AVLTreeDigest.java | 367 | [] | true | 1 | 6.96 | elastic/elasticsearch | 75,680 | javadoc | false | |
quantile | def quantile(
self,
q: float | Sequence[float] | AnyArrayLike = 0.5,
interpolation: QuantileInterpolation = "linear",
) -> float | Series:
"""
Return value at the given quantile.
Parameters
----------
q : float or array-like, default 0.5 (50% quantile... | Return value at the given quantile.
Parameters
----------
q : float or array-like, default 0.5 (50% quantile)
The quantile(s) to compute, which can lie in range: 0 <= q <= 1.
interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'}
This optional parameter specifies the interpolation method to use,
... | python | pandas/core/series.py | 2,608 | [
"self",
"q",
"interpolation"
] | float | Series | true | 4 | 8.56 | pandas-dev/pandas | 47,362 | numpy | false |
removeDebugFlags | private String[] removeDebugFlags(String[] args) {
List<String> rtn = new ArrayList<>(args.length);
boolean appArgsDetected = false;
for (String arg : args) {
// Allow apps to have a --debug argument
appArgsDetected |= "--".equals(arg);
if ("--debug".equals(arg) && !appArgsDetected) {
continue;
}
... | Run the appropriate and handle and errors.
@param args the input arguments
@return a return status code (non boot is used to indicate an error) | java | cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java | 189 | [
"args"
] | true | 3 | 8.4 | spring-projects/spring-boot | 79,428 | javadoc | false | |
equals | @Override
public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
FileAccessTree that = (FileAccessTree) o;
return Objects.deepEquals(readPaths, that.readPaths) && Objects.deepEquals(writePaths, that.writePaths);
} | @return the "canonical" form of the given {@code path}, to be used for entitlement checks. | java | libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/FileAccessTree.java | 393 | [
"o"
] | true | 4 | 7.04 | elastic/elasticsearch | 75,680 | javadoc | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.