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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
device | def device(self) -> torch.device:
"""
Get the device of the first node.
Returns:
The device of the first node
"""
return self._input_nodes[0].get_device() | Get the device of the first node.
Returns:
The device of the first node | python | torch/_inductor/kernel_inputs.py | 85 | [
"self"
] | torch.device | true | 1 | 6.4 | pytorch/pytorch | 96,034 | unknown | false |
setStoreByValue | public void setStoreByValue(boolean storeByValue) {
if (storeByValue != this.storeByValue) {
this.storeByValue = storeByValue;
// Need to recreate all Cache instances with the new store-by-value configuration...
recreateCaches();
}
} | Specify whether this cache manager stores a copy of each entry ({@code true}
or the reference ({@code false} for all of its caches.
<p>Default is "false" so that the value itself is stored and no serializable
contract is required on cached values.
<p>Note: A change of the store-by-value setting will reset all existing ... | java | spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCacheManager.java | 140 | [
"storeByValue"
] | void | true | 2 | 6 | spring-projects/spring-framework | 59,386 | javadoc | false |
maybeRecordDeprecatedPreferredReadReplica | @Deprecated // To be removed in Kafka 5.0 release.
private void maybeRecordDeprecatedPreferredReadReplica(TopicPartition tp, SubscriptionState subscription) {
if (shouldReportDeprecatedMetric(tp.topic())) {
MetricName metricName = deprecatedPartitionPreferredReadReplicaMetricName(tp);
... | 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 | 249 | [
"tp",
"subscription"
] | void | true | 2 | 6.24 | apache/kafka | 31,560 | javadoc | false |
toPlainObject | function toPlainObject(value) {
return copyObject(value, keysIn(value));
} | Converts `value` to a plain object flattening inherited enumerable string
keyed properties of `value` to own properties of the plain object.
@static
@memberOf _
@since 3.0.0
@category Lang
@param {*} value The value to convert.
@returns {Object} Returns the converted plain object.
@example
function Foo() {
this.b = 2... | javascript | lodash.js | 12,609 | [
"value"
] | false | 1 | 6.4 | lodash/lodash | 61,490 | jsdoc | false | |
setUpEntry | private void setUpEntry(JarFile jarFile, JarArchiveEntry entry, UnpackHandler unpackHandler) throws IOException {
try (ZipHeaderPeekInputStream inputStream = new ZipHeaderPeekInputStream(jarFile.getInputStream(entry))) {
if (inputStream.hasZipHeader() && entry.getMethod() != ZipEntry.STORED) {
new StoredEntryP... | Write the specified manifest.
@param manifest the manifest to write
@throws IOException of the manifest cannot be written | java | loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/AbstractJarWriter.java | 112 | [
"jarFile",
"entry",
"unpackHandler"
] | void | true | 3 | 6.88 | spring-projects/spring-boot | 79,428 | javadoc | false |
serializeParameterTypesOfNode | function serializeParameterTypesOfNode(node: Node, container: ClassLikeDeclaration): ArrayLiteralExpression {
const valueDeclaration = isClassLike(node)
? getFirstConstructorWithBody(node)
: isFunctionLike(node) && nodeIsPresent((node as FunctionLikeDeclaration).body)
? n... | 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 | 200 | [
"node",
"container"
] | true | 11 | 7.04 | microsoft/TypeScript | 107,154 | jsdoc | false | |
serialize | public static byte[] serialize(final Serializable obj) {
final ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
serialize(obj, baos);
return baos.toByteArray();
} | Serializes an {@link Object} to a byte array for
storage/serialization.
@param obj the object to serialize to bytes.
@return a byte[] with the converted Serializable.
@throws SerializationException (runtime) if the serialization fails. | java | src/main/java/org/apache/commons/lang3/SerializationUtils.java | 235 | [
"obj"
] | true | 1 | 6.24 | apache/commons-lang | 2,896 | javadoc | false | |
constant | function constant(value) {
return function() {
return value;
};
} | Creates a function that returns `value`.
@static
@memberOf _
@since 2.4.0
@category Util
@param {*} value The value to return from the new function.
@returns {Function} Returns the new constant function.
@example
var objects = _.times(2, _.constant({ 'a': 1 }));
console.log(objects);
// => [{ 'a': 1 }, { 'a': 1 }]
cons... | javascript | lodash.js | 15,503 | [
"value"
] | false | 1 | 6.32 | lodash/lodash | 61,490 | jsdoc | false | |
classWrapperStatementVisitor | function classWrapperStatementVisitor(node: Node): VisitResult<Node | undefined> {
if (shouldVisitNode(node)) {
const original = getOriginalNode(node);
if (isPropertyDeclaration(original) && hasStaticModifier(original)) {
const ancestorFacts = enterSubtree(
... | 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 | 609 | [
"node"
] | true | 4 | 6.24 | microsoft/TypeScript | 107,154 | jsdoc | false | |
hashCode | @Override
public int hashCode() {
int result = 27;
for (String pattern : this.patterns) {
result = 13 * result + pattern.hashCode();
}
for (String excludedPattern : this.excludedPatterns) {
result = 13 * result + excludedPattern.hashCode();
}
return result;
} | Does the exclusion pattern at the given index match the given String?
@param pattern the {@code String} pattern to match
@param patternIndex index of pattern (starting from 0)
@return {@code true} if there is a match, {@code false} otherwise | java | spring-aop/src/main/java/org/springframework/aop/support/AbstractRegexpMethodPointcut.java | 205 | [] | true | 1 | 6.72 | spring-projects/spring-framework | 59,386 | javadoc | false | |
maybeBuildRequest | private Optional<UnsentRequest> maybeBuildRequest(AcknowledgeRequestState acknowledgeRequestState,
long currentTimeMs,
boolean onCommitAsync,
AtomicBoolean is... | @param acknowledgeRequestState Contains the acknowledgements to be sent.
@param currentTimeMs The current time in ms.
@param onCommitAsync Boolean to denote if the acknowledgements came from a commitAsync or not.
@param isAsyncSent Boolean to indicate if the async request has been sent.
@return Returns the request if i... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java | 429 | [
"acknowledgeRequestState",
"currentTimeMs",
"onCommitAsync",
"isAsyncSent"
] | true | 10 | 8.08 | apache/kafka | 31,560 | javadoc | false | |
matchesClassCastMessage | private boolean matchesClassCastMessage(String classCastMessage, Class<?> eventClass) {
// On Java 8, the message starts with the class name: "java.lang.String cannot be cast..."
if (classCastMessage.startsWith(eventClass.getName())) {
return true;
}
// On Java 11, the message starts with "class ..." a.k.a. ... | Invoke the given listener with the given event.
@param listener the ApplicationListener to invoke
@param event the current event to propagate
@since 4.1 | java | spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java | 204 | [
"classCastMessage",
"eventClass"
] | true | 5 | 6.56 | spring-projects/spring-framework | 59,386 | javadoc | false | |
getImports | Iterable<Group.Entry> getImports() {
for (DeferredImportSelectorHolder deferredImport : this.deferredImports) {
this.group.process(deferredImport.getConfigurationClass().getMetadata(),
deferredImport.getImportSelector());
}
return this.group.selectImports();
} | Return the imports defined by the group.
@return each import with its associated configuration class | java | spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java | 929 | [] | true | 1 | 6.88 | spring-projects/spring-framework | 59,386 | javadoc | false | |
update_flow_filter | def update_flow_filter(self, flow_name: str, filter_tasks, set_trigger_ondemand: bool = False) -> None:
"""
Update the flow task filter; all filters will be removed if an empty array is passed to filter_tasks.
:param flow_name: The flow name
:param filter_tasks: List flow tasks to be ad... | Update the flow task filter; all filters will be removed if an empty array is passed to filter_tasks.
:param flow_name: The flow name
:param filter_tasks: List flow tasks to be added
:param set_trigger_ondemand: If True, set the trigger to on-demand; otherwise, keep the trigger as is
:return: None | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/appflow.py | 89 | [
"self",
"flow_name",
"filter_tasks",
"set_trigger_ondemand"
] | None | true | 6 | 8.24 | apache/airflow | 43,597 | sphinx | false |
getResourcePatternResolver | private ResourcePatternResolver getResourcePatternResolver() {
if (this.resourcePatternResolver == null) {
this.resourcePatternResolver = new PathMatchingResourcePatternResolver();
}
return this.resourcePatternResolver;
} | Return the ResourceLoader that this component provider uses. | java | spring-context/src/main/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider.java | 278 | [] | ResourcePatternResolver | true | 2 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false |
find | public static @Nullable ConditionEvaluationReport find(BeanFactory beanFactory) {
if (beanFactory instanceof ConfigurableListableBeanFactory) {
return ConditionEvaluationReport.get((ConfigurableListableBeanFactory) beanFactory);
}
return null;
} | Attempt to find the {@link ConditionEvaluationReport} for the specified bean
factory.
@param beanFactory the bean factory (may be {@code null})
@return the {@link ConditionEvaluationReport} or {@code null} | java | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java | 169 | [
"beanFactory"
] | ConditionEvaluationReport | true | 2 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false |
instantiate | @SuppressWarnings("unchecked")
private T instantiate(Class<?> type) throws Exception {
Constructor<?>[] constructors = type.getDeclaredConstructors();
Arrays.sort(constructors, CONSTRUCTOR_COMPARATOR);
for (Constructor<?> constructor : constructors) {
Object[] args = getArgs(constructor.getParameterTypes());
... | Get an injectable argument instance for the given type. This method can be used
when manually instantiating an object without reflection.
@param <A> the argument type
@param type the argument type
@return the argument to inject or {@code null}
@since 3.4.0 | java | core/spring-boot/src/main/java/org/springframework/boot/util/Instantiator.java | 207 | [
"type"
] | T | true | 2 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false |
k | public abstract double k(double q, double compression, double n); | Converts a quantile to the k-scale. The total number of points is also provided so that a normalizing function
can be computed if necessary.
@param q The quantile
@param compression Also known as delta in literature on the t-digest
@param n The total number of samples
@return The corresponding value... | java | libs/tdigest/src/main/java/org/elasticsearch/tdigest/ScaleFunction.java | 497 | [
"q",
"compression",
"n"
] | true | 1 | 6.32 | elastic/elasticsearch | 75,680 | javadoc | false | |
min | def min(self, axis: AxisInt | None = None, skipna: bool = True, *args, **kwargs):
"""
Return the minimum value of the Index.
Parameters
----------
axis : {None}
Dummy argument for consistency with Series.
skipna : bool, default True
Exclude NA/nul... | Return the minimum value of the Index.
Parameters
----------
axis : {None}
Dummy argument for consistency with Series.
skipna : bool, default True
Exclude NA/null values when showing the result.
*args, **kwargs
Additional arguments and keywords for compatibility with NumPy.
Returns
-------
scalar
Mini... | python | pandas/core/indexes/base.py | 7,501 | [
"self",
"axis",
"skipna"
] | true | 11 | 8.48 | pandas-dev/pandas | 47,362 | numpy | false | |
removeDefaultRootHandler | private void removeDefaultRootHandler() {
try {
java.util.logging.Logger rootLogger = java.util.logging.LogManager.getLogManager().getLogger("");
Handler[] handlers = rootLogger.getHandlers();
if (handlers.length == 1 && handlers[0] instanceof ConsoleHandler) {
rootLogger.removeHandler(handlers[0]);
}... | Return the configuration location. The result may be:
<ul>
<li>{@code null}: if DefaultConfiguration is used (no explicit config loaded)</li>
<li>A file path: if provided explicitly by the user</li>
<li>A URI: if loaded from the classpath default or a custom location</li>
</ul>
@param configuration the source configura... | java | core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystem.java | 224 | [] | void | true | 4 | 7.44 | spring-projects/spring-boot | 79,428 | javadoc | false |
view_url_template | def view_url_template(self) -> str | None:
"""Return a URL for viewing the DAGs in S3. Currently, versioning is not supported."""
if self.version:
raise AirflowException("S3 url with version is not supported")
if hasattr(self, "_view_url_template") and self._view_url_template:
... | Return a URL for viewing the DAGs in S3. Currently, versioning is not supported. | python | providers/amazon/src/airflow/providers/amazon/aws/bundles/s3.py | 148 | [
"self"
] | str | None | true | 6 | 6 | apache/airflow | 43,597 | unknown | false |
isActive | boolean isActive(@Nullable ConfigDataActivationContext activationContext) {
if (this.kind == Kind.UNBOUND_IMPORT) {
return false;
}
return this.properties == null || this.properties.isActive(activationContext);
} | Return if this contributor is currently active.
@param activationContext the activation context
@return if the contributor is active | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributor.java | 136 | [
"activationContext"
] | true | 3 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false | |
replace | public String replace(final StringBuffer source) {
if (source == null) {
return null;
}
final StrBuilder buf = new StrBuilder(source.length()).append(source);
substitute(buf, 0, buf.length());
return buf.toString();
} | Replaces all the occurrences of variables with their matching values
from the resolver using the given source buffer as a template.
The buffer is not altered by this method.
@param source the buffer to use as a template, not changed, null returns null.
@return the result of the replace operation. | java | src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java | 690 | [
"source"
] | String | true | 2 | 8.24 | apache/commons-lang | 2,896 | javadoc | false |
onSuppressedException | protected void onSuppressedException(Exception ex) {
if (this.suppressedExceptions != null && this.suppressedExceptions.size() < SUPPRESSED_EXCEPTIONS_LIMIT) {
this.suppressedExceptions.add(ex);
}
} | Register an exception that happened to get suppressed during the creation of a
singleton bean instance, for example, a temporary circular reference resolution problem.
<p>The default implementation preserves any given exception in this registry's
collection of suppressed exceptions, up to a limit of 100 exceptions, add... | java | spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java | 471 | [
"ex"
] | void | true | 3 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false |
__init__ | def __init__(
self,
index_array: np.ndarray | None = None,
window_size: int | BaseIndexer = 0,
groupby_indices: dict | None = None,
window_indexer: type[BaseIndexer] = BaseIndexer,
indexer_kwargs: dict | None = None,
**kwargs,
) -> None:
"""
Pa... | Parameters
----------
index_array : np.ndarray or None
np.ndarray of the index of the original object that we are performing
a chained groupby operation over. This index has been pre-sorted relative to
the groups
window_size : int or BaseIndexer
window size during the windowing operation
groupby_indices... | python | pandas/core/indexers/objects.py | 533 | [
"self",
"index_array",
"window_size",
"groupby_indices",
"window_indexer",
"indexer_kwargs"
] | None | true | 3 | 6.24 | pandas-dev/pandas | 47,362 | numpy | false |
destroySingleton | public void destroySingleton(String beanName) {
// Destroy the corresponding DisposableBean instance.
// This also triggers the destruction of dependent beans.
DisposableBean disposableBean;
synchronized (this.disposableBeans) {
disposableBean = this.disposableBeans.remove(beanName);
}
destroyBean(beanNa... | Destroy the given bean. Delegates to {@code destroyBean}
if a corresponding disposable bean instance is found.
@param beanName the name of the bean
@see #destroyBean | java | spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java | 738 | [
"beanName"
] | void | true | 3 | 6.72 | spring-projects/spring-framework | 59,386 | javadoc | false |
useStateLike | function useStateLike<S>(
name: string,
initialState: (() => S) | S
): [S, (update: ((prevState: S) => S) | S) => void] {
const stateRef = useRefLike(
name,
// @ts-expect-error S type should never be function, but there's no way to tell that to TypeScript
typeof initialState === 'function' ? initialSt... | Returns a mutable ref object.
@example
```ts
const ref = useRef(0);
ref.current = 1;
```
@template T The type of the ref object.
@param {T} initialValue The initial value of the ref object.
@returns {{ current: T }} The mutable ref object. | typescript | code/core/src/preview-api/modules/addons/hooks.ts | 382 | [
"name",
"initialState"
] | true | 3 | 8.48 | storybookjs/storybook | 88,865 | jsdoc | false | |
findCandidateWriteMethods | private List<Method> findCandidateWriteMethods(MethodDescriptor[] methodDescriptors) {
List<Method> matches = new ArrayList<>();
for (MethodDescriptor methodDescriptor : methodDescriptors) {
Method method = methodDescriptor.getMethod();
if (isCandidateWriteMethod(method)) {
matches.add(method);
}
}
... | Wrap the given {@link BeanInfo} instance; copy all its existing property descriptors
locally, wrapping each in a custom {@link SimpleIndexedPropertyDescriptor indexed}
or {@link SimplePropertyDescriptor non-indexed} {@code PropertyDescriptor}
variant that bypasses default JDK weak/soft reference management; then search... | java | spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java | 132 | [
"methodDescriptors"
] | true | 2 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false | |
subarray | public static long[] subarray(final long[] array, int startIndexInclusive, int endIndexExclusive) {
if (array == null) {
return null;
}
startIndexInclusive = max0(startIndexInclusive);
endIndexExclusive = Math.min(endIndexExclusive, array.length);
final int newSize = ... | Produces a new {@code long} array containing the elements between the start and end indices.
<p>
The start index is inclusive, the end index exclusive. Null array input produces null output.
</p>
@param array the input array.
@param startIndexInclusive the starting index. Undervalue (<0) is promoted to... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 7,924 | [
"array",
"startIndexInclusive",
"endIndexExclusive"
] | true | 3 | 7.6 | apache/commons-lang | 2,896 | javadoc | false | |
as_sql | def as_sql(self, compiler, connection):
"""
Responsible for returning a (sql, [params]) tuple to be included
in the current query.
Different backends can provide their own implementation, by
providing an `as_{vendor}` method and patching the Expression:
```
def ... | Responsible for returning a (sql, [params]) tuple to be included
in the current query.
Different backends can provide their own implementation, by
providing an `as_{vendor}` method and patching the Expression:
```
def override_as_sql(self, compiler, connection):
# custom logic
return super().as_sql(compiler, ... | python | django/db/models/expressions.py | 225 | [
"self",
"compiler",
"connection"
] | false | 1 | 6 | django/django | 86,204 | google | false | |
get_root_path | def get_root_path(import_name: str) -> str:
"""Find the root path of a package, or the path that contains a
module. If it cannot be found, returns the current working
directory.
Not to be confused with the value returned by :func:`find_package`.
:meta private:
"""
# Module already imported... | Find the root path of a package, or the path that contains a
module. If it cannot be found, returns the current working
directory.
Not to be confused with the value returned by :func:`find_package`.
:meta private: | python | src/flask/helpers.py | 571 | [
"import_name"
] | str | true | 10 | 6 | pallets/flask | 70,946 | unknown | false |
filter | default ConfigurationPropertySource filter(Predicate<ConfigurationPropertyName> filter) {
return new FilteredConfigurationPropertiesSource(this, filter);
} | Return a filtered variant of this source, containing only names that match the
given {@link Predicate}.
@param filter the filter to match
@return a filtered {@link ConfigurationPropertySource} instance | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySource.java | 67 | [
"filter"
] | ConfigurationPropertySource | true | 1 | 6.16 | spring-projects/spring-boot | 79,428 | javadoc | false |
ErrorOrWarningView | function ErrorOrWarningView({
className,
badgeClassName,
count,
message,
}: ErrorOrWarningViewProps) {
return (
<div className={className}>
{count > 1 && <div className={badgeClassName}>{count}</div>}
<div className={styles.Message} title={message}>
{message}
</div>
</div>
... | 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/InspectedElementErrorsAndWarningsTree.js | 169 | [] | false | 2 | 6.24 | facebook/react | 241,750 | jsdoc | false | |
isListTerminator | function isListTerminator(kind: ParsingContext): boolean {
if (token() === SyntaxKind.EndOfFileToken) {
// Being at the end of the file ends all lists.
return true;
}
switch (kind) {
case ParsingContext.BlockStatements:
case ParsingContext... | Reports a diagnostic error for the current token being an invalid name.
@param blankDiagnostic Diagnostic to report for the case of the name being blank (matched tokenIfBlankName).
@param nameDiagnostic Diagnostic to report for all other cases.
@param tokenIfBlankName Current token if the name was invalid for being... | typescript | src/compiler/parser.ts | 3,000 | [
"kind"
] | true | 15 | 6.88 | microsoft/TypeScript | 107,154 | jsdoc | false | |
removeAll | public static long[] removeAll(final long[] array, final int... indices) {
return (long[]) removeAll((Object) array, indices);
} | Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.
<p>
This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned
array is always the same as that of the inpu... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 5,138 | [
"array"
] | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false | |
writeLayerIndex | private void writeLayerIndex(AbstractJarWriter writer) throws IOException {
Assert.state(this.layout != null, "'layout' must not be null");
String name = this.layout.getLayersIndexFileLocation();
if (StringUtils.hasLength(name)) {
Assert.state(this.layers != null, "'layers' must not be null");
Assert.state(... | Sets if jarmode jars relevant for the packaging should be automatically included.
@param includeRelevantJarModeJars if relevant jars are included | java | loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Packager.java | 253 | [
"writer"
] | void | true | 2 | 6.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
polymul | def polymul(c1, c2):
"""
Multiply one polynomial by another.
Returns the product of two polynomials `c1` * `c2`. The arguments are
sequences of coefficients, from lowest order term to highest, e.g.,
[1,2,3] represents the polynomial ``1 + 2*x + 3*x**2.``
Parameters
----------
c1, c2 :... | Multiply one polynomial by another.
Returns the product of two polynomials `c1` * `c2`. The arguments are
sequences of coefficients, from lowest order term to highest, e.g.,
[1,2,3] represents the polynomial ``1 + 2*x + 3*x**2.``
Parameters
----------
c1, c2 : array_like
1-D arrays of coefficients representing a... | python | numpy/polynomial/polynomial.py | 330 | [
"c1",
"c2"
] | false | 1 | 6.08 | numpy/numpy | 31,054 | numpy | false | |
writeBytesToImpl | abstract void writeBytesToImpl(byte[] dest, int offset, int maxLength); | Copies bytes from this hash code into {@code dest}.
@param dest the byte array into which the hash code will be written
@param offset the start offset in the data
@param maxLength the maximum number of bytes to write
@return the number of bytes written to {@code dest}
@throws IndexOutOfBoundsException if there is not e... | java | android/guava/src/com/google/common/hash/HashCode.java | 91 | [
"dest",
"offset",
"maxLength"
] | void | true | 1 | 6.48 | google/guava | 51,352 | javadoc | false |
make_biclusters | def make_biclusters(
shape,
n_clusters,
*,
noise=0.0,
minval=10,
maxval=100,
shuffle=True,
random_state=None,
):
"""Generate a constant block diagonal structure array for biclustering.
Read more in the :ref:`User Guide <sample_generators>`.
Parameters
----------
sha... | Generate a constant block diagonal structure array for biclustering.
Read more in the :ref:`User Guide <sample_generators>`.
Parameters
----------
shape : tuple of shape (n_rows, n_cols)
The shape of the result.
n_clusters : int
The number of biclusters.
noise : float, default=0.0
The standard deviation... | python | sklearn/datasets/_samples_generator.py | 2,134 | [
"shape",
"n_clusters",
"noise",
"minval",
"maxval",
"shuffle",
"random_state"
] | false | 4 | 7.28 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
leavingAfterReleasingActiveTasks | private void leavingAfterReleasingActiveTasks(Throwable callbackError) {
if (callbackError != null) {
log.error("Member {} callback to revoke task assignment failed. It will proceed " +
"to clear its assignment and send a leave group heartbeat",
memberId, callback... | Leaves the group.
<p>
This method does the following:
<ol>
<li>Transitions member state to {@link MemberState#PREPARE_LEAVING}.</li>
<li>Requests the invocation of the revocation callback or lost callback.</li>
<li>Once the callback completes, it clears the current and target assignment, unsubscribes from
... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java | 958 | [
"callbackError"
] | void | true | 2 | 6.4 | apache/kafka | 31,560 | javadoc | false |
identity | static <T, E extends Throwable> FailableFunction<T, T, E> identity() {
return t -> t;
} | Returns a function that always returns its input argument.
@param <T> the type of the input and output objects to the function
@param <E> The type of thrown exception or error.
@return a function that always returns its input argument | java | src/main/java/org/apache/commons/lang3/function/FailableFunction.java | 59 | [] | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false | |
append | def append(self, other: Index | Sequence[Index]) -> Index:
"""
Append a collection of Index options together.
Parameters
----------
other : Index or list/tuple of indices
Single Index or a collection of indices, which can be either a list or a
tuple.
... | Append a collection of Index options together.
Parameters
----------
other : Index or list/tuple of indices
Single Index or a collection of indices, which can be either a list or a
tuple.
Returns
-------
Index
Returns a new Index object resulting from appending the provided other
indices to the origin... | python | pandas/core/indexes/base.py | 5,373 | [
"self",
"other"
] | Index | true | 6 | 8.48 | pandas-dev/pandas | 47,362 | numpy | false |
getExports | function getExports(name: Identifier): ModuleExportName[] | undefined {
if (!isGeneratedIdentifier(name)) {
const importDeclaration = resolver.getReferencedImportDeclaration(name);
if (importDeclaration) {
return currentModuleInfo?.exportedBindings[getOriginalNodeId(i... | Gets the additional exports of a name.
@param name The name. | typescript | src/compiler/transformers/module/module.ts | 2,460 | [
"name"
] | true | 9 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
register | @Override
protected final void register(String description, ServletContext servletContext) {
D registration = addRegistration(description, servletContext);
if (registration == null) {
if (this.ignoreRegistrationFailure) {
logger.info(StringUtils.capitalize(description) + " was not registered (possibly alrea... | Add a single init-parameter, replacing any existing parameter with the same name.
@param name the init-parameter name
@param value the init-parameter value | java | core/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java | 113 | [
"description",
"servletContext"
] | void | true | 3 | 6.4 | spring-projects/spring-boot | 79,428 | javadoc | false |
weakCompareAndSet | public final boolean weakCompareAndSet(double expect, double update) {
return value.weakCompareAndSet(doubleToRawLongBits(expect), doubleToRawLongBits(update));
} | Atomically sets the value to the given updated value if the current value is <a
href="#bitEquals">bitwise equal</a> to the expected value.
<p>May <a
href="http://download.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/package-summary.html#Spurious">
fail spuriously</a> and does not provide ordering guarantees... | java | android/guava/src/com/google/common/util/concurrent/AtomicDouble.java | 141 | [
"expect",
"update"
] | true | 1 | 6.16 | google/guava | 51,352 | javadoc | false | |
eq | def eq(
self,
other,
level: Level | None = None,
fill_value: float | None = None,
axis: Axis = 0,
) -> Series:
"""
Return Equal to of series and other, element-wise (binary operator `eq`).
Equivalent to ``series == other``, but with support to substit... | Return Equal to of series and other, element-wise (binary operator `eq`).
Equivalent to ``series == other``, but with support to substitute a fill_value
for missing data in either one of the inputs.
Parameters
----------
other : object
When a Series is provided, will align on indexes. For all other types,
wil... | python | pandas/core/series.py | 6,811 | [
"self",
"other",
"level",
"fill_value",
"axis"
] | Series | true | 1 | 7.04 | pandas-dev/pandas | 47,362 | numpy | false |
maybeEnsureValid | private void maybeEnsureValid(RecordBatch batch, boolean checkCrcs) {
if (checkCrcs && batch.magic() >= RecordBatch.MAGIC_VALUE_V2) {
try {
batch.ensureValid();
} catch (CorruptRecordException e) {
throw new CorruptRecordException("Record batch for partiti... | 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 | 392 | [
"batch",
"checkCrcs"
] | void | true | 4 | 7.28 | apache/kafka | 31,560 | javadoc | false |
out_dtype | def out_dtype(self) -> torch.dtype:
"""
Get the output dtype, whether passed in or inferred from the nodes
Returns:
The output dtype
""" | Get the output dtype, whether passed in or inferred from the nodes
Returns:
The output dtype | python | torch/_inductor/kernel_inputs.py | 178 | [
"self"
] | torch.dtype | true | 1 | 6.24 | pytorch/pytorch | 96,034 | unknown | false |
apply | def apply(self, X):
"""Apply trees in the ensemble to X, return leaf indices.
.. versionadded:: 0.17
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input samples. Internally, its dtype will be converted to
``dt... | Apply trees in the ensemble to X, return leaf indices.
.. versionadded:: 0.17
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input samples. Internally, its dtype will be converted to
``dtype=np.float32``. If a sparse matrix is provided, it will
be converted to a... | python | sklearn/ensemble/_gb.py | 1,093 | [
"self",
"X"
] | false | 3 | 6.08 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
_slice | def _slice(
self, slicer: slice | npt.NDArray[np.bool_] | npt.NDArray[np.intp]
) -> ExtensionArray:
"""
Return a slice of my values.
Parameters
----------
slicer : slice, ndarray[int], or ndarray[bool]
Valid (non-reducing) indexer for self.values.
... | Return a slice of my values.
Parameters
----------
slicer : slice, ndarray[int], or ndarray[bool]
Valid (non-reducing) indexer for self.values.
Returns
-------
ExtensionArray | python | pandas/core/internals/blocks.py | 2,041 | [
"self",
"slicer"
] | ExtensionArray | true | 4 | 6.4 | pandas-dev/pandas | 47,362 | numpy | false |
hasAtLeastOneGeoipProcessor | private static boolean hasAtLeastOneGeoipProcessor(
List<Map<String, Object>> processors,
boolean downloadDatabaseOnPipelineCreation,
Map<String, PipelineConfiguration> pipelineConfigById,
Map<String, Boolean> pipelineHasGeoProcessorById
) {
if (processors != null) {
... | Check if a list of processor contains at least a geoip processor.
@param processors List of processors.
@param downloadDatabaseOnPipelineCreation Should the download_database_on_pipeline_creation of the geoip processor be true or false.
@param pipelineConfigById A Map of pipeline id to PipelineConfiguration
@param pipe... | java | modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderTaskExecutor.java | 340 | [
"processors",
"downloadDatabaseOnPipelineCreation",
"pipelineConfigById",
"pipelineHasGeoProcessorById"
] | true | 3 | 7.76 | elastic/elasticsearch | 75,680 | javadoc | false | |
convertForProperty | public @Nullable Object convertForProperty(@Nullable Object value, String propertyName) throws TypeMismatchException {
CachedIntrospectionResults cachedIntrospectionResults = getCachedIntrospectionResults();
PropertyDescriptor pd = cachedIntrospectionResults.getPropertyDescriptor(propertyName);
if (pd == null) {
... | 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 | 180 | [
"value",
"propertyName"
] | Object | true | 2 | 7.44 | spring-projects/spring-framework | 59,386 | javadoc | false |
compress | def compress(self, condition, axis=None, out=None):
"""
Return `a` where condition is ``True``.
If condition is a `~ma.MaskedArray`, missing values are considered
as ``False``.
Parameters
----------
condition : var
Boolean 1-d array selecting which e... | Return `a` where condition is ``True``.
If condition is a `~ma.MaskedArray`, missing values are considered
as ``False``.
Parameters
----------
condition : var
Boolean 1-d array selecting which entries to return. If len(condition)
is less than the size of a along the axis, then output is truncated
to lengt... | python | numpy/ma/core.py | 3,973 | [
"self",
"condition",
"axis",
"out"
] | false | 2 | 7.76 | numpy/numpy | 31,054 | numpy | false | |
add | public synchronized boolean add(final MetricName metricName, final MeasurableStat stat, final MetricConfig config) {
if (hasExpired()) {
return false;
} else if (metrics.containsKey(metricName)) {
return true;
} else {
final MetricConfig statConfig = config ==... | Register a metric with this sensor
@param metricName The name of the metric
@param stat The statistic to keep
@param config A special configuration for this metric. If null use the sensor default configuration.
@return true if metric is added to sensor, false if sensor is expired | java | clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java | 328 | [
"metricName",
"stat",
"config"
] | true | 5 | 7.76 | apache/kafka | 31,560 | javadoc | false | |
memdump | def memdump(samples=10, file=None): # pragma: no cover
"""Dump memory statistics.
Will print a sample of all RSS memory samples added by
calling :func:`sample_mem`, and in addition print
used RSS memory after :func:`gc.collect`.
"""
say = partial(print, file=file)
if ps() is None:
... | Dump memory statistics.
Will print a sample of all RSS memory samples added by
calling :func:`sample_mem`, and in addition print
used RSS memory after :func:`gc.collect`. | python | celery/utils/debug.py | 83 | [
"samples",
"file"
] | false | 4 | 6.24 | celery/celery | 27,741 | unknown | false | |
fillSet | private static <T> Set<T> fillSet(Set<T> baseSet, Set<T> fillSet, Predicate<T> predicate) {
Set<T> result = new HashSet<>(baseSet);
for (T element : fillSet) {
if (predicate.test(element)) {
result.add(element);
}
}
return result;
} | Copies {@code baseSet} and adds all non-existent elements in {@code fillSet} such that {@code predicate} is true.
In other words, all elements of {@code baseSet} will be contained in the result, with additional non-overlapping
elements in {@code fillSet} where the predicate is true.
@param baseSet the base elements for... | java | clients/src/main/java/org/apache/kafka/clients/MetadataSnapshot.java | 215 | [
"baseSet",
"fillSet",
"predicate"
] | true | 2 | 6.56 | apache/kafka | 31,560 | javadoc | false | |
validateIndex | protected void validateIndex(final int index) {
if (index < 0 || index > size) {
throw new StringIndexOutOfBoundsException(index);
}
} | Validates parameters defining a single index in the builder.
@param index the index, must be valid
@throws IndexOutOfBoundsException if the index is invalid | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 3,032 | [
"index"
] | void | true | 3 | 6.4 | apache/commons-lang | 2,896 | javadoc | false |
anyNull | public static boolean anyNull(final Object... values) {
return !allNotNull(values);
} | Tests if any value in the given array is {@code null}.
<p>
If any of the values are {@code null} or the array is {@code null}, then {@code true} is returned, otherwise {@code false} is returned.
</p>
<pre>
ObjectUtils.anyNull(*) = false
ObjectUtils.anyNull(*, *) = false
ObjectUtils.anyNull(null) ... | java | src/main/java/org/apache/commons/lang3/ObjectUtils.java | 219 | [] | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
builder | static ExponentialHistogramBuilder builder(int scale, ExponentialHistogramCircuitBreaker breaker) {
return new ExponentialHistogramBuilder(scale, breaker);
} | Create a builder for an exponential histogram with the given scale.
@param scale the scale of the histogram to build
@param breaker the circuit breaker to use
@return a new builder | java | libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialHistogram.java | 229 | [
"scale",
"breaker"
] | ExponentialHistogramBuilder | true | 1 | 6.96 | elastic/elasticsearch | 75,680 | javadoc | false |
_bind_queues | def _bind_queues(self, app: Celery, connection: Connection) -> None:
"""Bind all application queues to delayed delivery exchanges.
Args:
app: The Celery application instance
connection: The broker connection to use
Raises:
Exception: If queue binding fails
... | Bind all application queues to delayed delivery exchanges.
Args:
app: The Celery application instance
connection: The broker connection to use
Raises:
Exception: If queue binding fails | python | celery/worker/consumer/delayed_delivery.py | 149 | [
"self",
"app",
"connection"
] | None | true | 5 | 6.24 | celery/celery | 27,741 | google | false |
_compute_contiguous_strides | def _compute_contiguous_strides(size: tuple[int, ...]) -> list[int]:
"""
Helper function to compute standard contiguous strides for a given size.
Args:
size: Tensor shape/size as a tuple of integers
Returns:
list[int]: List of contiguous strides
"""
strides: list[int] = []
... | Helper function to compute standard contiguous strides for a given size.
Args:
size: Tensor shape/size as a tuple of integers
Returns:
list[int]: List of contiguous strides | python | tools/experimental/torchfuzz/tensor_fuzzer.py | 206 | [
"size"
] | list[int] | true | 3 | 7.92 | pytorch/pytorch | 96,034 | google | false |
createBeanFactoryBasedTargetSource | protected abstract @Nullable AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(
Class<?> beanClass, String beanName); | Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource
if they wish to create a custom TargetSource for this bean, or {@code null} if they are
not interested it in, in which case no special target source will be created.
Subclasses should not call {@code setTargetBeanName} or {@code se... | java | spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/AbstractBeanFactoryBasedTargetSourceCreator.java | 195 | [
"beanClass",
"beanName"
] | AbstractBeanFactoryBasedTargetSource | true | 1 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false |
addFirst | public static boolean[] addFirst(final boolean[] array, final boolean element) {
return array == null ? add(array, element) : insert(0, array, element);
} | Copies the given array and adds the given element at the beginning of the new array.
<p>
The new array contains the same elements of the input array plus the given element in the first position. The
component type of the new array is the same as that of the input array.
</p>
<p>
If the input array is {@code null}, a ne... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 1,166 | [
"array",
"element"
] | true | 2 | 8 | apache/commons-lang | 2,896 | javadoc | false | |
getFormatter | public DateTimeFormatter getFormatter(DateTimeFormatter formatter) {
if (this.chronology != null) {
formatter = formatter.withChronology(this.chronology);
}
if (this.timeZone != null) {
formatter = formatter.withZone(this.timeZone);
}
else {
LocaleContext localeContext = LocaleContextHolder.getLocale... | Get the DateTimeFormatter with this context's settings applied to the
base {@code formatter}.
@param formatter the base formatter that establishes default
formatting rules, generally context-independent
@return the contextual DateTimeFormatter | java | spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeContext.java | 87 | [
"formatter"
] | DateTimeFormatter | true | 5 | 7.28 | spring-projects/spring-framework | 59,386 | javadoc | false |
is_potential_multi_index | def is_potential_multi_index(
columns: Sequence[Hashable] | MultiIndex,
index_col: bool | Sequence[int] | None = None,
) -> bool:
"""
Check whether or not the `columns` parameter
could be converted into a MultiIndex.
Parameters
----------
columns : array-like
Object which may or... | Check whether or not the `columns` parameter
could be converted into a MultiIndex.
Parameters
----------
columns : array-like
Object which may or may not be convertible into a MultiIndex
index_col : None, bool or list, optional
Column or columns to use as the (possibly hierarchical) index
Returns
-------
bool... | python | pandas/io/common.py | 1,217 | [
"columns",
"index_col"
] | bool | true | 6 | 6.4 | pandas-dev/pandas | 47,362 | numpy | false |
add | @Override
public void add(double x, long w) {
checkValue(x);
if (tempUsed >= tempWeight.size() - lastUsedCell - 1) {
mergeNewValues();
}
int where = tempUsed++;
tempWeight.set(where, w);
tempMean.set(where, x);
unmergedWeight += w;
if (x < ... | Fully specified constructor. Normally only used for deserializing a buffer t-digest.
@param compression Compression factor
@param bufferSize Number of temporary centroids
@param size Size of main buffer | java | libs/tdigest/src/main/java/org/elasticsearch/tdigest/MergingDigest.java | 268 | [
"x",
"w"
] | void | true | 4 | 6.08 | elastic/elasticsearch | 75,680 | javadoc | false |
bindSourceFileIfExternalModule | function bindSourceFileIfExternalModule() {
setExportContextFlag(file);
if (isExternalModule(file)) {
bindSourceFileAsExternalModule();
}
else if (isJsonSourceFile(file)) {
bindSourceFileAsExternalModule();
// Create symbol equivalent for the mo... | 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 | 3,107 | [] | false | 4 | 6.08 | microsoft/TypeScript | 107,154 | jsdoc | false | |
_remove_nan_1d | def _remove_nan_1d(arr1d, second_arr1d=None, overwrite_input=False):
"""
Equivalent to arr1d[~arr1d.isnan()], but in a different order
Presumably faster as it incurs fewer copies
Parameters
----------
arr1d : ndarray
Array to remove nans from
second_arr1d : ndarray or None
... | Equivalent to arr1d[~arr1d.isnan()], but in a different order
Presumably faster as it incurs fewer copies
Parameters
----------
arr1d : ndarray
Array to remove nans from
second_arr1d : ndarray or None
A second array which will have the same positions removed as arr1d.
overwrite_input : bool
True if `arr1d... | python | numpy/lib/_nanfunctions_impl.py | 144 | [
"arr1d",
"second_arr1d",
"overwrite_input"
] | false | 12 | 6 | numpy/numpy | 31,054 | numpy | false | |
incrementThrottleTime | void incrementThrottleTime(String nodeId, long throttleTimeMs) {
requests.getOrDefault(nodeId, new ArrayDeque<>()).
forEach(request -> request.incrementThrottleTime(throttleTimeMs));
} | Returns a list of nodes with pending in-flight request, that need to be timed out
@param now current time in milliseconds
@return list of nodes | java | clients/src/main/java/org/apache/kafka/clients/InFlightRequests.java | 182 | [
"nodeId",
"throttleTimeMs"
] | void | true | 1 | 6.48 | apache/kafka | 31,560 | javadoc | false |
update_orm_from_pydantic | def update_orm_from_pydantic(
pool_name: str,
patch_body: PoolBody | PoolPatchBody,
update_mask: list[str] | None,
session: SessionDep,
) -> Pool:
"""
Update an existing pool.
:param pool_name: The name of the existing Pool to be updated.
:param patch_body: Pydantic model containing the... | Update an existing pool.
:param pool_name: The name of the existing Pool to be updated.
:param patch_body: Pydantic model containing the fields to update.
:param update_mask: Specific fields to update. If None, all provided fields will be considered.
:param session: The database session dependency.
:return: The update... | python | airflow-core/src/airflow/api_fastapi/core_api/services/public/pools.py | 45 | [
"pool_name",
"patch_body",
"update_mask",
"session"
] | Pool | true | 9 | 8 | apache/airflow | 43,597 | sphinx | false |
isEtagUsable | function isEtagUsable (etag) {
if (etag.length <= 2) {
// Shortest an etag can be is two chars (just ""). This is where we deviate
// from the spec requiring a min of 3 chars however
return false
}
if (etag[0] === '"' && etag[etag.length - 1] === '"') {
// ETag: ""asd123"" or ETag: "W/"asd123"",... | Note: this deviates from the spec a little. Empty etags ("", W/"") are valid,
however, including them in cached resposnes serves little to no purpose.
@see https://www.rfc-editor.org/rfc/rfc9110.html#name-etag
@param {string} etag
@returns {boolean} | javascript | deps/undici/src/lib/util/cache.js | 307 | [
"etag"
] | false | 7 | 6.08 | nodejs/node | 114,839 | jsdoc | false | |
containsAll | @Override
boolean containsAll(Collection<?> elements); | Returns {@code true} if this multiset contains at least one occurrence of each element in the
specified collection.
<p>This method refines {@link Collection#containsAll} to further specify that it <b>may not</b>
throw an exception in response to any of {@code elements} being null or of the wrong type.
<p><b>Note:</b> t... | java | android/guava/src/com/google/common/collect/Multiset.java | 408 | [
"elements"
] | true | 1 | 6.32 | google/guava | 51,352 | javadoc | false | |
canonicalPropertyNames | public static String @Nullable [] canonicalPropertyNames(String @Nullable [] propertyNames) {
if (propertyNames == null) {
return null;
}
String[] result = new String[propertyNames.length];
for (int i = 0; i < propertyNames.length; i++) {
result[i] = canonicalPropertyName(propertyNames[i]);
}
return r... | Determine the canonical names for the given property paths.
@param propertyNames the bean property paths (as array)
@return the canonical representation of the property paths
(as array of the same size)
@see #canonicalPropertyName(String) | java | spring-beans/src/main/java/org/springframework/beans/PropertyAccessorUtils.java | 176 | [
"propertyNames"
] | true | 3 | 7.28 | spring-projects/spring-framework | 59,386 | javadoc | false | |
merge | private void merge(
TDigestDoubleArray incomingMean,
TDigestDoubleArray incomingWeight,
int incomingCount,
TDigestIntArray incomingOrder,
double unmergedWeight,
boolean runBackwards,
double compression
) {
// when our incoming buffer fills up, we combi... | Fully specified constructor. Normally only used for deserializing a buffer t-digest.
@param compression Compression factor
@param bufferSize Number of temporary centroids
@param size Size of main buffer | java | libs/tdigest/src/main/java/org/elasticsearch/tdigest/MergingDigest.java | 304 | [
"incomingMean",
"incomingWeight",
"incomingCount",
"incomingOrder",
"unmergedWeight",
"runBackwards",
"compression"
] | void | true | 12 | 6.16 | elastic/elasticsearch | 75,680 | javadoc | false |
asInputStream | default InputStream asInputStream() throws IOException {
return new DataBlockInputStream(this);
} | Return this {@link DataBlock} as an {@link InputStream}.
@return an {@link InputStream} to read the data block content
@throws IOException on IO error | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/DataBlock.java | 78 | [] | InputStream | true | 1 | 6.64 | spring-projects/spring-boot | 79,428 | javadoc | false |
maybeCompleteReceive | public NetworkReceive maybeCompleteReceive() {
if (receive != null && receive.complete()) {
receive.payload().rewind();
NetworkReceive result = receive;
receive = null;
return result;
}
return null;
} | Returns the port to which this channel's socket is connected or 0 if the socket has never been connected.
If the socket was connected prior to being closed, then this method will continue to return the
connected port number after the socket is closed. | java | clients/src/main/java/org/apache/kafka/common/network/KafkaChannel.java | 425 | [] | NetworkReceive | true | 3 | 6.88 | apache/kafka | 31,560 | javadoc | false |
bitSet | public BitSet bitSet() {
return bitSet;
} | Gets the wrapped bit set.
@return the wrapped bit set. | java | src/main/java/org/apache/commons/lang3/util/FluentBitSet.java | 120 | [] | BitSet | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false |
drainAll | private void drainAll() {
lock.lock();
try {
completedFetches.forEach(ShareCompletedFetch::drain);
completedFetches.clear();
if (nextInLineFetch != null) {
nextInLineFetch.drain();
nextInLineFetch = null;
}
} finally... | Return the set of {@link TopicIdPartition partitions} for which we have data in the buffer.
@return {@link TopicIdPartition Partition} set | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareFetchBuffer.java | 192 | [] | void | true | 2 | 7.6 | apache/kafka | 31,560 | javadoc | false |
remove_unused_categories | def remove_unused_categories(self) -> Self:
"""
Remove categories which are not used.
This method is useful when working with datasets
that undergo dynamic changes where categories may no longer be
relevant, allowing to maintain a clean, efficient data structure.
Return... | Remove categories which are not used.
This method is useful when working with datasets
that undergo dynamic changes where categories may no longer be
relevant, allowing to maintain a clean, efficient data structure.
Returns
-------
Categorical
Categorical with unused categories dropped.
See Also
--------
rename_... | python | pandas/core/arrays/categorical.py | 1,472 | [
"self"
] | Self | true | 3 | 8.16 | pandas-dev/pandas | 47,362 | unknown | false |
are_dependencies_met | def are_dependencies_met(
self, dep_context: DepContext | None = None, session: Session = NEW_SESSION, verbose: bool = False
) -> bool:
"""
Are all conditions met for this task instance to be run given the context for the dependencies.
(e.g. a task instance being force run from the ... | Are all conditions met for this task instance to be run given the context for the dependencies.
(e.g. a task instance being force run from the UI will ignore some dependencies).
:param dep_context: The execution context that determines the dependencies that should be evaluated.
:param session: database session
:param... | python | airflow-core/src/airflow/models/taskinstance.py | 883 | [
"self",
"dep_context",
"session",
"verbose"
] | bool | true | 5 | 7.04 | apache/airflow | 43,597 | sphinx | false |
masked_equal | def masked_equal(x, value, copy=True):
"""
Mask an array where equal to a given value.
Return a MaskedArray, masked where the data in array `x` are
equal to `value`. The fill_value of the returned MaskedArray
is set to `value`.
For floating point arrays, consider using ``masked_values(x, value... | Mask an array where equal to a given value.
Return a MaskedArray, masked where the data in array `x` are
equal to `value`. The fill_value of the returned MaskedArray
is set to `value`.
For floating point arrays, consider using ``masked_values(x, value)``.
See Also
--------
masked_where : Mask where a condition is me... | python | numpy/ma/core.py | 2,132 | [
"x",
"value",
"copy"
] | false | 1 | 6.48 | numpy/numpy | 31,054 | unknown | false | |
get | static @Nullable Object get(
@Nullable Object hashTableObject,
@Nullable Object[] alternatingKeysAndValues,
int size,
int keyOffset,
@Nullable Object key) {
if (key == null) {
return null;
} else if (size == 1) {
// requireNonNull is safe because the first 2 elements ha... | Returns a hash table for the specified keys and values, and ensures that neither keys nor
values are null. This method may update {@code alternatingKeysAndValues} if there are duplicate
keys. If so, the return value will indicate how many entries are still valid, and will also
include a {@link Builder.DuplicateKey} in ... | java | android/guava/src/com/google/common/collect/RegularImmutableMap.java | 320 | [
"hashTableObject",
"alternatingKeysAndValues",
"size",
"keyOffset",
"key"
] | Object | true | 16 | 6.96 | google/guava | 51,352 | javadoc | false |
wildcardTypeToString | private static String wildcardTypeToString(final WildcardType wildcardType) {
final StringBuilder builder = new StringBuilder().append('?');
final Type[] lowerBounds = wildcardType.getLowerBounds();
final Type[] upperBounds = wildcardType.getUpperBounds();
if (lowerBounds.length > 1 || l... | Formats a {@link WildcardType} as a {@link String}.
@param wildcardType {@link WildcardType} to format.
@return String. | java | src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java | 1,711 | [
"wildcardType"
] | String | true | 7 | 7.76 | apache/commons-lang | 2,896 | javadoc | false |
resolveFieldValuesFor | private void resolveFieldValuesFor(Map<String, Object> values, TypeElement element) {
try {
this.fieldValuesParser.getFieldValues(element).forEach((name, value) -> {
if (!values.containsKey(name)) {
values.put(name, value);
}
});
}
catch (Exception ex) {
// continue
}
Element superType =... | Collect the annotations that are annotated or meta-annotated with the specified
{@link TypeElement annotation}.
@param element the element to inspect
@param annotationType the annotation to discover
@return the annotations that are annotated or meta-annotated with this annotation | java | configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/MetadataGenerationEnvironment.java | 393 | [
"values",
"element"
] | void | true | 5 | 7.44 | spring-projects/spring-boot | 79,428 | javadoc | false |
collectDependencyGroups | function collectDependencyGroups(externalImports: (ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration)[]) {
const groupIndices = new Map<string, number>();
const dependencyGroups: DependencyGroup[] = [];
for (const externalImport of externalImports) {
const externalM... | Collects the dependency groups for this files imports.
@param externalImports The imports for the file. | typescript | src/compiler/transformers/module/system.ts | 279 | [
"externalImports"
] | false | 4 | 6.08 | microsoft/TypeScript | 107,154 | jsdoc | false | |
getEnvVars | private Map<String, String> getEnvVars() {
try {
return System.getenv();
} catch (Exception e) {
log.error("Could not read environment variables", e);
throw new ConfigException("Could not read environment variables");
}
} | @param path path, not used for environment variables
@param keys the keys whose values will be retrieved.
@return the configuration data. | java | clients/src/main/java/org/apache/kafka/common/config/provider/EnvVarConfigProvider.java | 111 | [] | true | 2 | 7.76 | apache/kafka | 31,560 | javadoc | false | |
partitions | public Set<TopicPartition> partitions() {
return partitions;
} | returns all partitions for which no offsets are defined.
@return all partitions without offsets | java | clients/src/main/java/org/apache/kafka/clients/consumer/NoOffsetForPartitionException.java | 49 | [] | true | 1 | 6.8 | apache/kafka | 31,560 | javadoc | false | |
removeAll | public static String removeAll(final String text, final String regex) {
return replaceAll(text, regex, StringUtils.EMPTY);
} | Removes each substring of the text String that matches the given regular expression.
This method is a {@code null} safe equivalent to:
<ul>
<li>{@code text.replaceAll(regex, StringUtils.EMPTY)}</li>
<li>{@code Pattern.compile(regex).matcher(text).replaceAll(StringUtils.EMPTY)}</li>
</ul>
<p>A {@code null} reference p... | java | src/main/java/org/apache/commons/lang3/RegExUtils.java | 192 | [
"text",
"regex"
] | String | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false |
registerHints | public void registerHints(RuntimeHints hints) {
for (Bindable<?> bindable : this.bindables) {
try {
new Processor(bindable).process(hints.reflection());
}
catch (Exception ex) {
logger.debug("Skipping hints for " + bindable, ex);
}
}
} | Contribute hints to the given {@link RuntimeHints} instance.
@param hints the hints contributed so far for the deployment unit | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindableRuntimeHintsRegistrar.java | 95 | [
"hints"
] | void | true | 2 | 6.56 | spring-projects/spring-boot | 79,428 | javadoc | false |
reduce | public T reduce(final T identity, final BinaryOperator<T> accumulator) {
makeTerminated();
return stream().reduce(identity, accumulator);
} | Performs a reduction on the elements of this stream, using the provided identity value and an associative
accumulation function, and returns the reduced value. This is equivalent to:
<pre>
{@code
T result = identity;
for (T element : this stream)
result = accumulator.apply(result, element)
return re... | java | src/main/java/org/apache/commons/lang3/stream/Streams.java | 466 | [
"identity",
"accumulator"
] | T | true | 1 | 6.48 | apache/commons-lang | 2,896 | javadoc | false |
doLoadDocument | protected Document doLoadDocument(InputSource inputSource, Resource resource) throws Exception {
return this.documentLoader.loadDocument(inputSource, getEntityResolver(), this.errorHandler,
getValidationModeForResource(resource), isNamespaceAware());
} | Actually load the specified document using the configured DocumentLoader.
@param inputSource the SAX InputSource to read from
@param resource the resource descriptor for the XML file
@return the DOM Document
@throws Exception when thrown from the DocumentLoader
@see #setDocumentLoader
@see DocumentLoader#loadDocument | java | spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java | 438 | [
"inputSource",
"resource"
] | Document | true | 1 | 6 | spring-projects/spring-framework | 59,386 | javadoc | false |
abort | def abort(code: int | BaseResponse, *args: t.Any, **kwargs: t.Any) -> t.NoReturn:
"""Raise an :exc:`~werkzeug.exceptions.HTTPException` for the given
status code.
If :data:`~flask.current_app` is available, it will call its
:attr:`~flask.Flask.aborter` object, otherwise it will use
:func:`werkzeug.... | Raise an :exc:`~werkzeug.exceptions.HTTPException` for the given
status code.
If :data:`~flask.current_app` is available, it will call its
:attr:`~flask.Flask.aborter` object, otherwise it will use
:func:`werkzeug.exceptions.abort`.
:param code: The status code for the exception, which must be
registered in ``app... | python | src/flask/helpers.py | 265 | [
"code"
] | t.NoReturn | true | 2 | 6.4 | pallets/flask | 70,946 | sphinx | false |
printDebugInfo | static void printDebugInfo(raw_ostream &OS, const MCInst &Instruction,
const BinaryFunction *Function,
DWARFContext *DwCtx) {
const ClusteredRows *LineTableRows =
ClusteredRows::fromSMLoc(Instruction.getLoc());
if (LineTableRows == nullptr)
return;
... | Handles DWO sections that can either be in .o, .dwo or .dwp files. | cpp | bolt/lib/Core/BinaryContext.cpp | 2,081 | [] | true | 6 | 7.2 | llvm/llvm-project | 36,021 | doxygen | false | |
getTopicMetadata | private Map<String, List<PartitionInfo>> getTopicMetadata(MetadataRequest.Builder request, Timer timer) {
// Save the round trip if no topics are requested.
if (!request.isAllTopics() && request.emptyTopicList())
return Collections.emptyMap();
long attempts = 0L;
do {
... | Get metadata for all topics present in Kafka cluster.
@param request The MetadataRequest to send
@param timer Timer bounding how long this method can block
@return The map of topics with their partition information | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/TopicMetadataFetcher.java | 94 | [
"request",
"timer"
] | true | 12 | 7.92 | apache/kafka | 31,560 | javadoc | false | |
convertSingleImport | function convertSingleImport(
name: BindingName,
moduleSpecifier: StringLiteralLike,
checker: TypeChecker,
identifiers: Identifiers,
target: ScriptTarget,
quotePreference: QuotePreference,
): ConvertedImports {
switch (name.kind) {
case SyntaxKind.ObjectBindingPattern: {
... | Converts `const <<name>> = require("x");`.
Returns nodes that will replace the variable declaration for the commonjs import.
May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`. | typescript | src/services/codefixes/convertToEsModule.ts | 485 | [
"name",
"moduleSpecifier",
"checker",
"identifiers",
"target",
"quotePreference"
] | true | 8 | 6 | microsoft/TypeScript | 107,154 | jsdoc | false | |
deleteConsumerGroups | DeleteConsumerGroupsResult deleteConsumerGroups(Collection<String> groupIds, DeleteConsumerGroupsOptions options); | Delete consumer groups from the cluster.
@param options The options to use when deleting a consumer group.
@return The DeleteConsumerGroupsResult. | java | clients/src/main/java/org/apache/kafka/clients/admin/Admin.java | 984 | [
"groupIds",
"options"
] | DeleteConsumerGroupsResult | true | 1 | 6 | apache/kafka | 31,560 | javadoc | false |
getSplitNanoTime | public long getSplitNanoTime() {
if (splitState != SplitState.SPLIT) {
throw new IllegalStateException("Stopwatch must be split to get the split time.");
}
return splits.get(splits.size() - 1).getRight().toNanos();
} | Gets the split time in nanoseconds.
<p>
This is the time between start and latest split.
</p>
@return the split time in nanoseconds.
@throws IllegalStateException if this StopWatch has not yet been split.
@since 3.0 | java | src/main/java/org/apache/commons/lang3/time/StopWatch.java | 436 | [] | true | 2 | 8.08 | apache/commons-lang | 2,896 | javadoc | false | |
cloneIfNecessary | @Override
public AutowireCandidateResolver cloneIfNecessary() {
try {
return (AutowireCandidateResolver) clone();
}
catch (CloneNotSupportedException ex) {
throw new IllegalStateException(ex);
}
} | This implementation clones all instance fields through standard
{@link Cloneable} support, allowing for subsequent reconfiguration
of the cloned instance through a fresh {@link #setBeanFactory} call.
@see #clone() | java | spring-beans/src/main/java/org/springframework/beans/factory/support/GenericTypeAwareAutowireCandidateResolver.java | 205 | [] | AutowireCandidateResolver | true | 2 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false |
showError | function showError() {
vscode.window.showWarningMessage(vscode.l10n.t("Problem finding gulp tasks. See the output for more information."),
vscode.l10n.t("Go to output")).then((choice) => {
if (choice !== undefined) {
_channel.show(true);
}
});
} | Check if the given filename is a file.
If returns false in case the file does not exist or
the file stats cannot be accessed/queried or it
is no file at all.
@param filename
the filename to the checked
@returns
true in case the file exists, in any other case false. | typescript | extensions/gulp/src/main.ts | 80 | [] | false | 2 | 7.12 | microsoft/vscode | 179,840 | jsdoc | false | |
_find_option_with_arg | def _find_option_with_arg(argv, short_opts=None, long_opts=None):
"""Search argv for options specifying short and longopt alternatives.
Returns:
str: value for option found
Raises:
KeyError: if option not found.
"""
for i, arg in enumerate(argv):
if arg.startswith('-'):
... | Search argv for options specifying short and longopt alternatives.
Returns:
str: value for option found
Raises:
KeyError: if option not found. | python | celery/__init__.py | 81 | [
"argv",
"short_opts",
"long_opts"
] | false | 11 | 6.96 | celery/celery | 27,741 | unknown | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.